Changes order of iface/addr/neigh event hooks.
Now the order is: Up -> iface, addr, neigh Down -> neigh, addr, iface It fixes the case when an iface appears, related static routes are activated and exported to OSPF before the iface notification and therefore forwarding addresses are not encoded in generated external LSAs.
This commit is contained in:
parent
ac9dc669d8
commit
f92e6ab364
1 changed files with 18 additions and 13 deletions
23
nest/iface.c
23
nest/iface.c
|
@ -150,7 +150,7 @@ ifa_send_notify(struct proto *p, unsigned c, struct ifa *a)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ifa_notify_change_dep(unsigned c, struct ifa *a)
|
ifa_notify_change_(unsigned c, struct ifa *a)
|
||||||
{
|
{
|
||||||
struct proto *p;
|
struct proto *p;
|
||||||
|
|
||||||
|
@ -163,8 +163,13 @@ ifa_notify_change_dep(unsigned c, struct ifa *a)
|
||||||
static inline void
|
static inline void
|
||||||
ifa_notify_change(unsigned c, struct ifa *a)
|
ifa_notify_change(unsigned c, struct ifa *a)
|
||||||
{
|
{
|
||||||
|
if (c & IF_CHANGE_DOWN)
|
||||||
|
neigh_ifa_update(a);
|
||||||
|
|
||||||
|
ifa_notify_change_(c, a);
|
||||||
|
|
||||||
|
if (c & IF_CHANGE_UP)
|
||||||
neigh_ifa_update(a);
|
neigh_ifa_update(a);
|
||||||
ifa_notify_change_dep(c, a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -201,14 +206,14 @@ if_notify_change(unsigned c, struct iface *i)
|
||||||
if_dump(i);
|
if_dump(i);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (c & IF_CHANGE_UP)
|
if (c & IF_CHANGE_DOWN)
|
||||||
neigh_if_up(i);
|
neigh_if_down(i);
|
||||||
|
|
||||||
if (c & IF_CHANGE_DOWN)
|
if (c & IF_CHANGE_DOWN)
|
||||||
WALK_LIST(a, i->addrs)
|
WALK_LIST(a, i->addrs)
|
||||||
{
|
{
|
||||||
a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS);
|
a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS);
|
||||||
ifa_notify_change_dep(IF_CHANGE_DOWN, a);
|
ifa_notify_change_(IF_CHANGE_DOWN, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
WALK_LIST(p, active_proto_list)
|
WALK_LIST(p, active_proto_list)
|
||||||
|
@ -218,14 +223,14 @@ if_notify_change(unsigned c, struct iface *i)
|
||||||
WALK_LIST(a, i->addrs)
|
WALK_LIST(a, i->addrs)
|
||||||
{
|
{
|
||||||
a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS);
|
a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS);
|
||||||
ifa_notify_change_dep(IF_CHANGE_UP, a);
|
ifa_notify_change_(IF_CHANGE_UP, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (c & IF_CHANGE_UP)
|
||||||
|
neigh_if_up(i);
|
||||||
|
|
||||||
if ((c & (IF_CHANGE_UP | IF_CHANGE_DOWN | IF_CHANGE_LINK)) == IF_CHANGE_LINK)
|
if ((c & (IF_CHANGE_UP | IF_CHANGE_DOWN | IF_CHANGE_LINK)) == IF_CHANGE_LINK)
|
||||||
neigh_if_link(i);
|
neigh_if_link(i);
|
||||||
|
|
||||||
if (c & IF_CHANGE_DOWN)
|
|
||||||
neigh_if_down(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned
|
static unsigned
|
||||||
|
|
Loading…
Reference in a new issue