summaryrefslogtreecommitdiff
path: root/zebra/connected.c
diff options
context:
space:
mode:
authorhasso <hasso>2004-10-03 18:46:08 +0000
committerhasso <hasso>2004-10-03 18:46:08 +0000
commiteef1fe11b89c5ec3c035ff6e4a9acfbc5780b539 (patch)
tree82f80b9b898ede1b5293fc52adb2bee9b138e46c /zebra/connected.c
parent18a6dce6f83dd20caf1f36c8e840868ff0bf6dbd (diff)
New way to handle secondary addresses from Gilad Arnold.
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c19
1 files changed, 9 insertions, 10 deletions
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 */