1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Nest: Do not hard-reset interface when preferred address is changed

Modify protocols to use preferred address change notification instead on
depending on hard-reset of interfaces in that case, and remove hard-reset
in that case. This avoids issue when e.g. IPv6 protocol restarts
interface when IPv4 preferred address changed (as hard-reset is
unavoidable and common for whole iface).

The patch also fixes a bug when removing last address does not send
preferred address change notification.
This commit is contained in:
Ondrej Zajicek (work)
2018-11-28 16:43:17 +01:00
parent 66934aceff
commit e2ae08694e
5 changed files with 65 additions and 50 deletions

View File

@@ -330,13 +330,19 @@ radv_if_notify(struct proto *P, unsigned flags, struct iface *iface)
{
struct radv_proto *p = (struct radv_proto *) P;
struct radv_config *cf = (struct radv_config *) (P->cf);
struct radv_iface *ifa = radv_iface_find(p, iface);
if (iface->flags & IF_IGNORE)
return;
if (flags & IF_CHANGE_UP)
/* Add, remove or restart interface */
if (flags & (IF_CHANGE_UPDOWN | IF_CHANGE_LLV6))
{
struct radv_iface_config *ic = (void *) iface_patt_find(&cf->patt_list, iface, NULL);
if (ifa)
radv_iface_remove(ifa);
if (!(iface->flags & IF_UP))
return;
/* Ignore non-multicast ifaces */
if (!(iface->flags & IF_MULTICAST))
@@ -346,22 +352,16 @@ radv_if_notify(struct proto *P, unsigned flags, struct iface *iface)
if (!iface->llv6)
return;
struct radv_iface_config *ic = (void *) iface_patt_find(&cf->patt_list, iface, NULL);
if (ic)
radv_iface_new(p, iface, ic);
return;
}
struct radv_iface *ifa = radv_iface_find(p, iface);
if (!ifa)
return;
if (flags & IF_CHANGE_DOWN)
{
radv_iface_remove(ifa);
return;
}
if ((flags & IF_CHANGE_LINK) && (iface->flags & IF_LINK_UP))
radv_iface_notify(ifa, RA_EV_INIT);
}