diff options
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 7ad681f5e712..5130d2efdbbe 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <net/neighbour.h> | 29 | #include <net/neighbour.h> |
30 | #include <net/dst.h> | 30 | #include <net/dst.h> |
31 | #include <net/sock.h> | 31 | #include <net/sock.h> |
32 | #include <net/netevent.h> | ||
32 | #include <linux/rtnetlink.h> | 33 | #include <linux/rtnetlink.h> |
33 | #include <linux/random.h> | 34 | #include <linux/random.h> |
34 | #include <linux/string.h> | 35 | #include <linux/string.h> |
@@ -754,6 +755,7 @@ static void neigh_timer_handler(unsigned long arg) | |||
754 | neigh->nud_state = NUD_STALE; | 755 | neigh->nud_state = NUD_STALE; |
755 | neigh->updated = jiffies; | 756 | neigh->updated = jiffies; |
756 | neigh_suspect(neigh); | 757 | neigh_suspect(neigh); |
758 | notify = 1; | ||
757 | } | 759 | } |
758 | } else if (state & NUD_DELAY) { | 760 | } else if (state & NUD_DELAY) { |
759 | if (time_before_eq(now, | 761 | if (time_before_eq(now, |
@@ -762,6 +764,7 @@ static void neigh_timer_handler(unsigned long arg) | |||
762 | neigh->nud_state = NUD_REACHABLE; | 764 | neigh->nud_state = NUD_REACHABLE; |
763 | neigh->updated = jiffies; | 765 | neigh->updated = jiffies; |
764 | neigh_connect(neigh); | 766 | neigh_connect(neigh); |
767 | notify = 1; | ||
765 | next = neigh->confirmed + neigh->parms->reachable_time; | 768 | next = neigh->confirmed + neigh->parms->reachable_time; |
766 | } else { | 769 | } else { |
767 | NEIGH_PRINTK2("neigh %p is probed.\n", neigh); | 770 | NEIGH_PRINTK2("neigh %p is probed.\n", neigh); |
@@ -819,6 +822,8 @@ static void neigh_timer_handler(unsigned long arg) | |||
819 | out: | 822 | out: |
820 | write_unlock(&neigh->lock); | 823 | write_unlock(&neigh->lock); |
821 | } | 824 | } |
825 | if (notify) | ||
826 | call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh); | ||
822 | 827 | ||
823 | #ifdef CONFIG_ARPD | 828 | #ifdef CONFIG_ARPD |
824 | if (notify && neigh->parms->app_probes) | 829 | if (notify && neigh->parms->app_probes) |
@@ -926,9 +931,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
926 | { | 931 | { |
927 | u8 old; | 932 | u8 old; |
928 | int err; | 933 | int err; |
929 | #ifdef CONFIG_ARPD | ||
930 | int notify = 0; | 934 | int notify = 0; |
931 | #endif | ||
932 | struct net_device *dev; | 935 | struct net_device *dev; |
933 | int update_isrouter = 0; | 936 | int update_isrouter = 0; |
934 | 937 | ||
@@ -948,9 +951,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
948 | neigh_suspect(neigh); | 951 | neigh_suspect(neigh); |
949 | neigh->nud_state = new; | 952 | neigh->nud_state = new; |
950 | err = 0; | 953 | err = 0; |
951 | #ifdef CONFIG_ARPD | ||
952 | notify = old & NUD_VALID; | 954 | notify = old & NUD_VALID; |
953 | #endif | ||
954 | goto out; | 955 | goto out; |
955 | } | 956 | } |
956 | 957 | ||
@@ -1022,9 +1023,7 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, | |||
1022 | if (!(new & NUD_CONNECTED)) | 1023 | if (!(new & NUD_CONNECTED)) |
1023 | neigh->confirmed = jiffies - | 1024 | neigh->confirmed = jiffies - |
1024 | (neigh->parms->base_reachable_time << 1); | 1025 | (neigh->parms->base_reachable_time << 1); |
1025 | #ifdef CONFIG_ARPD | ||
1026 | notify = 1; | 1026 | notify = 1; |
1027 | #endif | ||
1028 | } | 1027 | } |
1029 | if (new == old) | 1028 | if (new == old) |
1030 | goto out; | 1029 | goto out; |
@@ -1056,6 +1055,9 @@ out: | |||
1056 | (neigh->flags & ~NTF_ROUTER); | 1055 | (neigh->flags & ~NTF_ROUTER); |
1057 | } | 1056 | } |
1058 | write_unlock_bh(&neigh->lock); | 1057 | write_unlock_bh(&neigh->lock); |
1058 | |||
1059 | if (notify) | ||
1060 | call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, neigh); | ||
1059 | #ifdef CONFIG_ARPD | 1061 | #ifdef CONFIG_ARPD |
1060 | if (notify && neigh->parms->app_probes) | 1062 | if (notify && neigh->parms->app_probes) |
1061 | neigh_app_notify(neigh); | 1063 | neigh_app_notify(neigh); |