summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-04-08 18:08:00 +0200
committerRenato Westphal <renato@opensourcerouting.org>2019-04-08 18:11:28 +0200
commit338b8e914ab1dc30f56f5bcbabd525d547bbc1ea (patch)
tree472af15e5b3fbdf331da8b18ff653cfa24fe2784 /ripd
parentMerge pull request #4101 from pacovn/doc_typo1 (diff)
downloadfrr-338b8e914ab1dc30f56f5bcbabd525d547bbc1ea.tar.xz
frr-338b8e914ab1dc30f56f5bcbabd525d547bbc1ea.zip
*: setting the socket send/recv buffer sizes doesn't need elevated privs
The less code running under elevated privileges the better. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/ripd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 9683e26b5..201de9a46 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -1377,9 +1377,9 @@ int rip_create_socket(struct vrf *vrf)
#ifdef IPTOS_PREC_INTERNETCONTROL
setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL);
#endif
+ setsockopt_so_recvbuf(sock, RIP_UDP_RCV_BUF);
frr_elevate_privs(&ripd_privs) {
- setsockopt_so_recvbuf(sock, RIP_UDP_RCV_BUF);
if ((ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr)))
< 0) {
zlog_err("%s: Can't bind socket %d to %s port %d: %s",