aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-03-20 19:52:52 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-20 19:52:52 -0500
commit955aaa2fe39e21e49521449c09548ce1ba501010 (patch)
treee067beca9678350ad0f209d7406f3dcfa43394fd
parent74a3a0ed9096ba9feffc7e44f2a2c37d968bc6d1 (diff)
[NET]: NEIGHBOUR: Ensure to record time to neigh->updated when neighbour's state changed.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/neighbour.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e68700f950a5..6ba1cdea18e8 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -750,11 +750,13 @@ static void neigh_timer_handler(unsigned long arg)
750 neigh->used + neigh->parms->delay_probe_time)) { 750 neigh->used + neigh->parms->delay_probe_time)) {
751 NEIGH_PRINTK2("neigh %p is delayed.\n", neigh); 751 NEIGH_PRINTK2("neigh %p is delayed.\n", neigh);
752 neigh->nud_state = NUD_DELAY; 752 neigh->nud_state = NUD_DELAY;
753 neigh->updated = jiffies;
753 neigh_suspect(neigh); 754 neigh_suspect(neigh);
754 next = now + neigh->parms->delay_probe_time; 755 next = now + neigh->parms->delay_probe_time;
755 } else { 756 } else {
756 NEIGH_PRINTK2("neigh %p is suspected.\n", neigh); 757 NEIGH_PRINTK2("neigh %p is suspected.\n", neigh);
757 neigh->nud_state = NUD_STALE; 758 neigh->nud_state = NUD_STALE;
759 neigh->updated = jiffies;
758 neigh_suspect(neigh); 760 neigh_suspect(neigh);
759 } 761 }
760 } else if (state & NUD_DELAY) { 762 } else if (state & NUD_DELAY) {
@@ -762,11 +764,13 @@ static void neigh_timer_handler(unsigned long arg)
762 neigh->confirmed + neigh->parms->delay_probe_time)) { 764 neigh->confirmed + neigh->parms->delay_probe_time)) {
763 NEIGH_PRINTK2("neigh %p is now reachable.\n", neigh); 765 NEIGH_PRINTK2("neigh %p is now reachable.\n", neigh);
764 neigh->nud_state = NUD_REACHABLE; 766 neigh->nud_state = NUD_REACHABLE;
767 neigh->updated = jiffies;
765 neigh_connect(neigh); 768 neigh_connect(neigh);
766 next = neigh->confirmed + neigh->parms->reachable_time; 769 next = neigh->confirmed + neigh->parms->reachable_time;
767 } else { 770 } else {
768 NEIGH_PRINTK2("neigh %p is probed.\n", neigh); 771 NEIGH_PRINTK2("neigh %p is probed.\n", neigh);
769 neigh->nud_state = NUD_PROBE; 772 neigh->nud_state = NUD_PROBE;
773 neigh->updated = jiffies;
770 atomic_set(&neigh->probes, 0); 774 atomic_set(&neigh->probes, 0);
771 next = now + neigh->parms->retrans_time; 775 next = now + neigh->parms->retrans_time;
772 } 776 }
@@ -780,6 +784,7 @@ static void neigh_timer_handler(unsigned long arg)
780 struct sk_buff *skb; 784 struct sk_buff *skb;
781 785
782 neigh->nud_state = NUD_FAILED; 786 neigh->nud_state = NUD_FAILED;
787 neigh->updated = jiffies;
783 notify = 1; 788 notify = 1;
784 NEIGH_CACHE_STAT_INC(neigh->tbl, res_failed); 789 NEIGH_CACHE_STAT_INC(neigh->tbl, res_failed);
785 NEIGH_PRINTK2("neigh %p is failed.\n", neigh); 790 NEIGH_PRINTK2("neigh %p is failed.\n", neigh);
@@ -843,10 +848,12 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
843 if (neigh->parms->mcast_probes + neigh->parms->app_probes) { 848 if (neigh->parms->mcast_probes + neigh->parms->app_probes) {
844 atomic_set(&neigh->probes, neigh->parms->ucast_probes); 849 atomic_set(&neigh->probes, neigh->parms->ucast_probes);
845 neigh->nud_state = NUD_INCOMPLETE; 850 neigh->nud_state = NUD_INCOMPLETE;
851 neigh->updated = jiffies;
846 neigh_hold(neigh); 852 neigh_hold(neigh);
847 neigh_add_timer(neigh, now + 1); 853 neigh_add_timer(neigh, now + 1);
848 } else { 854 } else {
849 neigh->nud_state = NUD_FAILED; 855 neigh->nud_state = NUD_FAILED;
856 neigh->updated = jiffies;
850 write_unlock_bh(&neigh->lock); 857 write_unlock_bh(&neigh->lock);
851 858
852 if (skb) 859 if (skb)
@@ -857,6 +864,7 @@ int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
857 NEIGH_PRINTK2("neigh %p is delayed.\n", neigh); 864 NEIGH_PRINTK2("neigh %p is delayed.\n", neigh);
858 neigh_hold(neigh); 865 neigh_hold(neigh);
859 neigh->nud_state = NUD_DELAY; 866 neigh->nud_state = NUD_DELAY;
867 neigh->updated = jiffies;
860 neigh_add_timer(neigh, 868 neigh_add_timer(neigh,
861 jiffies + neigh->parms->delay_probe_time); 869 jiffies + neigh->parms->delay_probe_time);
862 } 870 }