diff options
| author | Russ White <russ@riw.us> | 2021-05-11 22:04:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-11 22:04:07 -0400 |
| commit | 6158f832257b4acae2dcb179207530e455522945 (patch) | |
| tree | 9169fadb171a98d9b4cf5a1a67d488dc109aae02 /ospf6d/ospf6_interface.c | |
| parent | 449e54fd12372273dcac68781eb77c1297aeb2ba (diff) | |
| parent | 9160389122d425a83fe2a6cf30d72f993b1d1b47 (diff) | |
Merge pull request #8622 from volta-networks/fix_ospf6_max_if_addr
ospf6d: Limit the number of interface addresses being supported in ospfv3
Diffstat (limited to 'ospf6d/ospf6_interface.c')
| -rw-r--r-- | ospf6d/ospf6_interface.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 11bdd1e355..c2f9c3362e 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -405,6 +405,7 @@ void ospf6_interface_connected_route_update(struct interface *ifp) struct connected *c; struct listnode *node, *nnode; struct in6_addr nh_addr; + int count = 0, max_addr_count; oi = (struct ospf6_interface *)ifp->info; if (oi == NULL) @@ -423,10 +424,22 @@ void ospf6_interface_connected_route_update(struct interface *ifp) /* update "route to advertise" interface route table */ ospf6_route_remove_all(oi->route_connected); + if (oi->ifmtu >= OSPF6_JUMBO_MTU) + max_addr_count = OSPF6_MAX_IF_ADDRS_JUMBO; + else + max_addr_count = OSPF6_MAX_IF_ADDRS; + for (ALL_LIST_ELEMENTS(oi->interface->connected, node, nnode, c)) { if (c->address->family != AF_INET6) continue; + /* number of interface addresses supported is based on MTU + * size of OSPFv3 packet + */ + count++; + if (count >= max_addr_count) + break; + CONTINUE_IF_ADDRESS_LINKLOCAL(IS_OSPF6_DEBUG_INTERFACE, c->address); CONTINUE_IF_ADDRESS_UNSPECIFIED(IS_OSPF6_DEBUG_INTERFACE, |
