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:
@@ -746,35 +746,34 @@ rip_if_notify(struct proto *P, unsigned flags, struct iface *iface)
|
||||
{
|
||||
struct rip_proto *p = (void *) P;
|
||||
struct rip_config *cf = (void *) P->cf;
|
||||
struct rip_iface *ifa = rip_find_iface(p, iface);
|
||||
|
||||
if (iface->flags & IF_IGNORE)
|
||||
return;
|
||||
|
||||
if (flags & IF_CHANGE_UP)
|
||||
/* Add, remove or restart interface */
|
||||
if (flags & (IF_CHANGE_UPDOWN | (rip_is_v2(p) ? IF_CHANGE_ADDR4 : IF_CHANGE_LLV6)))
|
||||
{
|
||||
struct rip_iface_config *ic = (void *) iface_patt_find(&cf->patt_list, iface, NULL);
|
||||
if (ifa)
|
||||
rip_remove_iface(p, ifa);
|
||||
|
||||
if (!(iface->flags & IF_UP))
|
||||
return;
|
||||
|
||||
/* Ignore ifaces without appropriate address */
|
||||
if (rip_is_v2(p) ? !iface->addr4 : !iface->llv6)
|
||||
return;
|
||||
|
||||
struct rip_iface_config *ic = (void *) iface_patt_find(&cf->patt_list, iface, NULL);
|
||||
if (ic)
|
||||
rip_add_iface(p, iface, ic);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
struct rip_iface *ifa = rip_find_iface(p, iface);
|
||||
|
||||
if (!ifa)
|
||||
return;
|
||||
|
||||
if (flags & IF_CHANGE_DOWN)
|
||||
{
|
||||
rip_remove_iface(p, ifa);
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags & IF_CHANGE_MTU)
|
||||
rip_iface_update_buffers(ifa);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user