summaryrefslogtreecommitdiffstats
path: root/ospf6d
diff options
context:
space:
mode:
authorDon Slice <dslice@cumulusnetworks.com>2017-06-28 14:37:32 +0200
committerDon Slice <dslice@cumulusnetworks.com>2017-06-28 14:37:32 +0200
commitc4efd33d3692245463e0b73e36908ca066d87013 (patch)
tree9ed4658bfc6e06c3c18faf7f407315d09e01524c /ospf6d
parentospf6d: fix ifmtu settings when kernel changes values (diff)
downloadfrr-c4efd33d3692245463e0b73e36908ca066d87013.tar.xz
frr-c4efd33d3692245463e0b73e36908ca066d87013.zip
ospf6d: add buffer length check to ifmtu changes
Previous fix was missing the possibility of having to modify the io buffer size if the kernel reports an new mtu value. This fix adds that check. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_interface.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 4d07e24b8..991eb318d 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -380,6 +380,7 @@ void
ospf6_interface_state_update (struct interface *ifp)
{
struct ospf6_interface *oi;
+ unsigned int iobuflen;
oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL)
@@ -392,9 +393,19 @@ ospf6_interface_state_update (struct interface *ifp)
/* Adjust the mtu values if the kernel told us something new */
if (ifp->mtu6 != oi->ifmtu)
{
- /* If nothing configured, just accept it */
+ /* If nothing configured, accept it and check for buffer size */
if (!oi->c_ifmtu)
- oi->ifmtu = ifp->mtu6;
+ {
+ oi->ifmtu = ifp->mtu6;
+ iobuflen = ospf6_iobuf_size (ifp->mtu6);
+ if (oi->ifmtu > iobuflen)
+ {
+ if (IS_OSPF6_DEBUG_INTERFACE)
+ zlog_debug ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
+ ifp->name, iobuflen);
+ oi->ifmtu = iobuflen;
+ }
+ }
else if (oi->c_ifmtu > ifp->mtu6)
{
oi->ifmtu = ifp->mtu6;