summaryrefslogtreecommitdiff
path: root/zebra/connected.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2013-01-24 14:04:48 +0000
committerDavid Lamparter <equinox@opensourcerouting.org>2013-09-19 17:51:16 +0200
commitf7f740fe58fb838fc87e82dc7e1e2d4e5ccf085c (patch)
tree5f3d9c866aaf7f8f23aaa5956eb7323d49ef472f /zebra/connected.c
parentc7df92de2dc91d0a934cf892e543728cb1a10849 (diff)
zebra: add ZEBRA_IFC_QUEUED to keep track of kernel state
As there are timeframes when we don't get a notification from the kernel about new addresses. (e.g. while Linux performs IPv6 DAD), we need to have some information whether an address has been sent to the kernel or not. One case where this is relevant would be a user adding an IPv6 address, but deleting it before DAD has been complete. With the next patch which removes some (ill assuming) synchronous parts in address setup, ipv6_address_uninstall would not know whether or not it has to actually delete the prefix from the kernel. Resolving these windows where we lack information is what the flag ZEBRA_IFC_QUEUED is intended for. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/connected.c')
-rw-r--r--zebra/connected.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/zebra/connected.c b/zebra/connected.c
index 38ab37d5..d474560c 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -62,6 +62,9 @@ connected_withdraw (struct connected *ifc)
UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
}
+ /* The address is not in the kernel anymore, so clear the flag */
+ UNSET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
+
if (!CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
{
listnode_delete (ifc->ifp->connected, ifc);
@@ -211,6 +214,9 @@ connected_add_ipv4 (struct interface *ifp, int flags, struct in_addr *addr,
ifc = connected_new ();
ifc->ifp = ifp;
ifc->flags = flags;
+ /* If we get a notification from the kernel,
+ * we can safely assume the address is known to the kernel */
+ SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
/* Allocate new connected address. */
p = prefix_ipv4_new ();
@@ -363,6 +369,9 @@ connected_add_ipv6 (struct interface *ifp, int flags, struct in6_addr *addr,
ifc = connected_new ();
ifc->ifp = ifp;
ifc->flags = flags;
+ /* If we get a notification from the kernel,
+ * we can safely assume the address is known to the kernel */
+ SET_FLAG(ifc->conf, ZEBRA_IFC_QUEUED);
/* Allocate new connected address. */
p = prefix_ipv6_new ();