summaryrefslogtreecommitdiffstats
path: root/zebra/connected.c
diff options
context:
space:
mode:
authorajs <ajs>2006-05-21 04:04:49 +0000
committerajs <ajs>2006-05-21 04:04:49 +0000
commitf40f4d76117374802508120bd1782856738fa54e (patch)
tree53e1d4f60382f51b93dca59a2da5aed416f6943a /zebra/connected.c
parentd87f595b6730fe6d6472dd700e6f8744f60fde33 (diff)
downloadquagga-f40f4d76117374802508120bd1782856738fa54e.tar.bz2
quagga-f40f4d76117374802508120bd1782856738fa54e.tar.xz
[interface configuration] Try to avoid losing address info after shutdown.
2006-05-21 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * if.h: (struct connected) Document the meaning of the ZEBRA_IFC_REAL and ZEBRA_IFC_CONFIGURED flags. * connected.c: (connected_withdraw) Do not delete the connected address if the ZEBRA_IFC_CONFIGURED flag is set. (connected_add_ipv4,connected_add_ipv6) Before calling connected_withdraw, unset the ZEBRA_IFC_CONFIGURED flag on the superseded connected structure.
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/zebra/connected.c b/zebra/connected.c
index 39f47805..37aa456a 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -60,8 +60,11 @@ connected_withdraw (struct connected *ifc)
UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
}
- listnode_delete (ifc->ifp->connected, ifc);
- connected_free (ifc);
+ if (!CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
+ {
+ listnode_delete (ifc->ifp->connected, ifc);
+ connected_free (ifc);
+ }
}
static void
@@ -227,7 +230,10 @@ connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr,
if ((current = connected_check (ifp, (struct prefix *) ifc->address)))
{
if (CHECK_FLAG(current->conf, ZEBRA_IFC_CONFIGURED))
- SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
+ {
+ SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
+ UNSET_FLAG(current->conf, ZEBRA_IFC_CONFIGURED);
+ }
connected_withdraw (current); /* implicit withdraw - freebsd does this */
}
@@ -370,7 +376,10 @@ connected_add_ipv6 (struct interface *ifp, struct in6_addr *addr,
if ((current = connected_check (ifp, (struct prefix *) ifc->address)))
{
if (CHECK_FLAG(current->conf, ZEBRA_IFC_CONFIGURED))
- SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
+ {
+ SET_FLAG(ifc->conf, ZEBRA_IFC_CONFIGURED);
+ UNSET_FLAG(current->conf, ZEBRA_IFC_CONFIGURED);
+ }
connected_withdraw (current); /* implicit update of existing address */
}