summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_network.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2016-12-07 16:21:45 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2016-12-08 12:50:25 +0100
commitde587d745e3b8b75cf92b2bff78af370adddb39f (patch)
tree4677ff51ed2c85ad085af409ba06da6067b68cc3 /ospfd/ospf_network.c
parentquagga: Remove description of deprecated interfaces (diff)
downloadfrr-de587d745e3b8b75cf92b2bff78af370adddb39f.tar.xz
frr-de587d745e3b8b75cf92b2bff78af370adddb39f.zip
ospfd: set the OSPF socket's send buffer size only once
This reverts commit b7fe4141, which introduced a logic where the OSPF send buffer size was dynamically updated to reflect the maximum MTU of the OSPF enabled interfaces (this was done to make ospfd work with interfaces configured for jumbo frames). Since commit a78d75b0, this is not necessary anymore because ospf_sock_init() now sets the OSPF send buffer size to a very high value (8MB). Also, the previous logic was broken because it didn't account for run-time interface MTU changes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_network.c')
-rw-r--r--ospfd/ospf_network.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/ospfd/ospf_network.c b/ospfd/ospf_network.c
index 088123ea2..f02fcd14a 100644
--- a/ospfd/ospf_network.c
+++ b/ospfd/ospf_network.c
@@ -41,7 +41,6 @@ extern struct zebra_privs_t ospfd_privs;
#include "ospfd/ospf_lsdb.h"
#include "ospfd/ospf_neighbor.h"
#include "ospfd/ospf_packet.h"
-#include "ospfd/ospf_dump.h"
@@ -258,37 +257,3 @@ ospf_sock_init (void)
return ospf_sock;
}
-
-void
-ospf_adjust_sndbuflen (struct ospf * ospf, unsigned int buflen)
-{
- int ret, newbuflen;
- /* Check if any work has to be done at all. */
- if (ospf->maxsndbuflen >= buflen)
- return;
- if (IS_DEBUG_OSPF (zebra, ZEBRA_INTERFACE))
- zlog_debug ("%s: adjusting OSPF send buffer size to %d",
- __func__, buflen);
- if (ospfd_privs.change (ZPRIVS_RAISE))
- zlog_err ("%s: could not raise privs, %s", __func__,
- safe_strerror (errno));
- /* Now we try to set SO_SNDBUF to what our caller has requested
- * (the MTU of a newly added interface). However, if the OS has
- * truncated the actual buffer size to somewhat less size, try
- * to detect it and update our records appropriately. The OS
- * may allocate more buffer space, than requested, this isn't
- * a error.
- */
- ret = setsockopt_so_sendbuf (ospf->fd, buflen);
- newbuflen = getsockopt_so_sendbuf (ospf->fd);
- if (ret < 0 || newbuflen < 0 || newbuflen < (int) buflen)
- zlog_warn ("%s: tried to set SO_SNDBUF to %u, but got %d",
- __func__, buflen, newbuflen);
- if (newbuflen >= 0)
- ospf->maxsndbuflen = (unsigned int)newbuflen;
- else
- zlog_warn ("%s: failed to get SO_SNDBUF", __func__);
- if (ospfd_privs.change (ZPRIVS_LOWER))
- zlog_err ("%s: could not lower privs, %s", __func__,
- safe_strerror (errno));
-}