summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_interface.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-05-18 19:28:32 +0000
committerhasso <hasso>2004-05-18 19:28:32 +0000
commit3b4cd3a9e89a5aace04a6a756bd0d23b7108fd83 (patch)
treea15fe3959155a6ca5bd5a2f8e967f9fd39736975 /ospf6d/ospf6_interface.c
parent4845437528f395c75c1945dd80b140b7162e4667 (diff)
Update to latest (really :) ospf6d from Zebra repository and some tiny
fixes.
Diffstat (limited to 'ospf6d/ospf6_interface.c')
-rw-r--r--ospf6d/ospf6_interface.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 8f01e7dd..9a029205 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -113,6 +113,7 @@ struct ospf6_interface *
ospf6_interface_create (struct interface *ifp)
{
struct ospf6_interface *oi;
+ int iobuflen;
oi = (struct ospf6_interface *)
XMALLOC (MTYPE_OSPF6_IF, sizeof (struct ospf6_interface));
@@ -137,10 +138,20 @@ ospf6_interface_create (struct interface *ifp)
oi->dead_interval = 40;
oi->rxmt_interval = 5;
oi->cost = 1;
- oi->ifmtu = ifp->mtu;
oi->state = OSPF6_INTERFACE_DOWN;
oi->flag = 0;
+ /* Try to adust I/O buffer size with IfMtu */
+ iobuflen = ospf6_iobuf_size (ifp->mtu);
+ if (iobuflen < ifp->mtu)
+ {
+ zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
+ ifp->name, iobuflen);
+ oi->ifmtu = iobuflen;
+ }
+ else
+ oi->ifmtu = ifp->mtu;
+
oi->lsupdate_list = ospf6_lsdb_create ();
oi->lsack_list = ospf6_lsdb_create ();
oi->lsdb = ospf6_lsdb_create ();
@@ -253,12 +264,22 @@ void
ospf6_interface_if_add (struct interface *ifp)
{
struct ospf6_interface *oi;
+ int iobuflen;
oi = (struct ospf6_interface *) ifp->info;
if (oi == NULL)
return;
- oi->ifmtu = ifp->mtu;
+ /* Try to adust I/O buffer size with IfMtu */
+ iobuflen = ospf6_iobuf_size (ifp->mtu);
+ if (iobuflen < ifp->mtu)
+ {
+ zlog_info ("Interface %s: IfMtu is adjusted to I/O buffer size: %d.",
+ ifp->name, iobuflen);
+ oi->ifmtu = iobuflen;
+ }
+ else
+ oi->ifmtu = ifp->mtu;
/* interface start */
if (oi->area)