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);
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 ();
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 ();
p = ifc->address;
if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)
- && ! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL))
+ && ! CHECK_FLAG (ifc->conf, ZEBRA_IFC_QUEUED))
{
/* Address check. */
if (p->family == AF_INET)
/* Add to subnet chain list. */
if_subnet_add (ifp, ifc);
+ SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
SET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
zebra_interface_address_add_update (ifp, ifc);
safe_strerror(errno));
continue;
}
+ SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
SET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
zebra_interface_address_add_update (ifp, ifc);
zebra_interface_address_delete_update (ifp, ifc);
UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
+ UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
/* Remove from subnet chain. */
list_delete_node (addr_list, anode);
zebra_interface_address_delete_update (ifp, ifc);
UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
+ UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
if (CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED))
last = node;
SET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED);
/* In case of this route need to install kernel. */
- if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)
+ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_QUEUED)
&& CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
/* Some system need to up the interface to set IP address. */
if_subnet_add (ifp, ifc);
/* IP address propery set. */
+ SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
SET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
/* Update interface address information to protocol daemon. */
UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED);
/* This is not real address or interface is not active. */
- if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)
+ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_QUEUED)
|| ! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
listnode_delete (ifp->connected, ifc);
* through the route socket, and we don't want to touch that behaviour
* for now. It should work without the #ifdef, but why take the risk...
* -- equinox 2012-07-13 */
+ UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
#ifdef HAVE_NETLINK
/* Remove connected route. */
SET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED);
/* In case of this route need to install kernel. */
- if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)
+ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_QUEUED)
&& CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
/* Some system need to up the interface to set IP address. */
}
/* IP address propery set. */
+ SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
SET_FLAG (ifc->conf, ZEBRA_IFC_REAL);
/* Update interface address information to protocol daemon. */
UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED);
/* This is not real address or interface is not active. */
- if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL)
+ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_QUEUED)
|| ! CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
{
listnode_delete (ifp->connected, ifc);
return CMD_WARNING;
}
+ UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED);
+
/* Redistribute this information. */
zebra_interface_address_delete_update (ifp, ifc);