diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2011-12-12 00:24:15 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2011-12-12 00:24:15 +0100 |
commit | cf7f0645316f5df0984467cf7001f5466254eaf3 (patch) | |
tree | 660ed7a04d393a172be0138051d93991ba11196d /nest/iface.c | |
parent | 2779d50a24dc1b7c6b4cf83a17af817c02462855 (diff) |
Fixes problem with sticky neighbors and iface address changes.
Thanks Matthias Schiffer for the bugreport and the original patch.
Diffstat (limited to 'nest/iface.c')
-rw-r--r-- | nest/iface.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/nest/iface.c b/nest/iface.c index 2ff2611a..bf57a9b1 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -152,16 +152,24 @@ ifa_send_notify(struct proto *p, unsigned c, struct ifa *a) } static void -ifa_notify_change(unsigned c, struct ifa *a) +ifa_notify_change_dep(unsigned c, struct ifa *a) { struct proto *p; DBG("IFA change notification (%x) for %s:%I\n", c, a->iface->name, a->ip); + WALK_LIST(p, active_proto_list) ifa_send_notify(p, c, a); } static inline void +ifa_notify_change(unsigned c, struct ifa *a) +{ + neigh_ifa_update(a); + ifa_notify_change_dep(c, a); +} + +static inline void if_send_notify(struct proto *p, unsigned c, struct iface *i) { if (p->if_notify) @@ -197,11 +205,12 @@ if_notify_change(unsigned c, struct iface *i) if (c & IF_CHANGE_UP) neigh_if_up(i); + if (c & IF_CHANGE_DOWN) WALK_LIST(a, i->addrs) { a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS); - ifa_notify_change(IF_CHANGE_DOWN, a); + ifa_notify_change_dep(IF_CHANGE_DOWN, a); } WALK_LIST(p, active_proto_list) @@ -211,7 +220,7 @@ if_notify_change(unsigned c, struct iface *i) WALK_LIST(a, i->addrs) { a->flags = (i->flags & ~IA_FLAGS) | (a->flags & IA_FLAGS); - ifa_notify_change(IF_CHANGE_UP, a); + ifa_notify_change_dep(IF_CHANGE_UP, a); } if ((c & (IF_CHANGE_UP | IF_CHANGE_DOWN | IF_CHANGE_LINK)) == IF_CHANGE_LINK) |