summaryrefslogtreecommitdiff
path: root/zebra/connected.c
diff options
context:
space:
mode:
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 */