From eef1fe11b89c5ec3c035ff6e4a9acfbc5780b539 Mon Sep 17 00:00:00 2001 From: hasso Date: Sun, 3 Oct 2004 18:46:08 +0000 Subject: New way to handle secondary addresses from Gilad Arnold. --- zebra/connected.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'zebra/connected.c') diff --git a/zebra/connected.c b/zebra/connected.c index 21af3e9c..df0b56a0 100644 --- a/zebra/connected.c +++ b/zebra/connected.c @@ -32,6 +32,7 @@ #include "zebra/zserv.h" #include "zebra/redistribute.h" +#include "zebra/interface.h" /* If same interface address is already exist... */ struct connected * @@ -136,6 +137,8 @@ connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr, /* Update interface address information to protocol daemon. */ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)) { + if_subnet_add (ifp, ifc); + SET_FLAG (ifc->conf, ZEBRA_IFC_REAL); zebra_interface_address_add_update (ifp, ifc); @@ -203,16 +206,15 @@ connected_delete_ipv4 (struct interface *ifp, int flags, struct in_addr *addr, { zebra_interface_address_delete_update (ifp, ifc); + if_subnet_delete (ifp, ifc); + connected_down_ipv4 (ifp, ifc); UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL); } - if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - { - listnode_delete (ifp->connected, ifc); - connected_free (ifc); - } + listnode_delete (ifp->connected, ifc); + connected_free (ifc); } #ifdef HAVE_IPV6 @@ -389,10 +391,7 @@ connected_delete_ipv6 (struct interface *ifp, struct in6_addr *address, UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL); } - if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - { - listnode_delete (ifp->connected, ifc); - connected_free (ifc); - } + listnode_delete (ifp->connected, ifc); + connected_free (ifc); } #endif /* HAVE_IPV6 */ -- cgit v1.2.1