rpms/kernel/devel linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch, NONE, 1.1 config-generic, 1.287, 1.288 kernel.spec, 1.1566, 1.1567

John W. Linville linville at fedoraproject.org
Fri Jun 12 15:05:03 UTC 2009


Author: linville

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27819

Modified Files:
	config-generic kernel.spec 
Added Files:
	linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch 
Log Message:
neigh: fix state transition INCOMPLETE->FAILED via Netlink request ; enable CONFIG_ARPD (used by OpenNHRP)

linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch:

--- NEW FILE linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch ---
commit 5ef12d98a19254ee5dc851bd83e214b43ec1f725
Author: Timo Teras <timo.teras at iki.fi>
Date:   Thu Jun 11 04:16:28 2009 -0700

    neigh: fix state transition INCOMPLETE->FAILED via Netlink request
    
    The current code errors out the INCOMPLETE neigh entry skb queue only from
    the timer if maximum probes have been attempted and there has been no reply.
    This also causes the transtion to FAILED state.
    
    However, the neigh entry can be also updated via Netlink to inform that the
    address is unavailable.  Currently, neigh_update() just stops the timers and
    leaves the pending skb's unreleased. This results that the clean up code in
    the timer callback is never called, preventing also proper garbage collection.
    
    This fixes neigh_update() to process the pending skb queue immediately if
    INCOMPLETE -> FAILED state transtion occurs due to a Netlink request.
    
    Signed-off-by: Timo Teras <timo.teras at iki.fi>
    Signed-off-by: David S. Miller <davem at davemloft.net>

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index c54229b..163b4f5 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -771,6 +771,28 @@ static __inline__ int neigh_max_probes(struct neighbour *n)
 		p->ucast_probes + p->app_probes + p->mcast_probes);
 }
 
+static void neigh_invalidate(struct neighbour *neigh)
+{
+	struct sk_buff *skb;
+
+	NEIGH_CACHE_STAT_INC(neigh->tbl, res_failed);
+	NEIGH_PRINTK2("neigh %p is failed.\n", neigh);
+	neigh->updated = jiffies;
+
+	/* It is very thin place. report_unreachable is very complicated
+	   routine. Particularly, it can hit the same neighbour entry!
+
+	   So that, we try to be accurate and avoid dead loop. --ANK
+	 */
+	while (neigh->nud_state == NUD_FAILED &&
+	       (skb = __skb_dequeue(&neigh->arp_queue)) != NULL) {
+		write_unlock(&neigh->lock);
+		neigh->ops->error_report(neigh, skb);
+		write_lock(&neigh->lock);
+	}
+	skb_queue_purge(&neigh->arp_queue);
+}
+
 /* Called when a timer expires for a neighbour entry. */
 
 static void neigh_timer_handler(unsigned long arg)
@@ -835,26 +857,9 @@ static void neigh_timer_handler(unsigned long arg)
 
 	if ((neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) &&
 	    atomic_read(&neigh->probes) >= neigh_max_probes(neigh)) {
-		struct sk_buff *skb;
-
 		neigh->nud_state = NUD_FAILED;
-		neigh->updated = jiffies;
 		notify = 1;
-		NEIGH_CACHE_STAT_INC(neigh->tbl, res_failed);
-		NEIGH_PRINTK2("neigh %p is failed.\n", neigh);
-
-		/* It is very thin place. report_unreachable is very complicated
-		   routine. Particularly, it can hit the same neighbour entry!
-
-		   So that, we try to be accurate and avoid dead loop. --ANK
-		 */
-		while (neigh->nud_state == NUD_FAILED &&
-		       (skb = __skb_dequeue(&neigh->arp_queue)) != NULL) {
-			write_unlock(&neigh->lock);
-			neigh->ops->error_report(neigh, skb);
-			write_lock(&neigh->lock);
-		}
-		skb_queue_purge(&neigh->arp_queue);
+		neigh_invalidate(neigh);
 	}
 
 	if (neigh->nud_state & NUD_IN_TIMER) {
@@ -1001,6 +1006,11 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
 		neigh->nud_state = new;
 		err = 0;
 		notify = old & NUD_VALID;
+		if ((old & (NUD_INCOMPLETE | NUD_PROBE)) &&
+		    (new & NUD_FAILED)) {
+			neigh_invalidate(neigh);
+			notify = 1;
+		}
 		goto out;
 	}
 


Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/config-generic,v
retrieving revision 1.287
retrieving revision 1.288
diff -u -p -r1.287 -r1.288
--- config-generic	10 Jun 2009 19:00:54 -0000	1.287
+++ config-generic	12 Jun 2009 15:04:32 -0000	1.288
@@ -750,7 +750,7 @@ CONFIG_NET_IPGRE_BROADCAST=y
 CONFIG_IP_MROUTE=y
 CONFIG_IP_PIMSM_V1=y
 CONFIG_IP_PIMSM_V2=y
-# CONFIG_ARPD is not set
+CONFIG_ARPD=y
 CONFIG_SYN_COOKIES=y
 CONFIG_INET_AH=m
 CONFIG_INET_ESP=m


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1566
retrieving revision 1.1567
diff -u -p -r1.1566 -r1.1567
--- kernel.spec	12 Jun 2009 12:06:05 -0000	1.1566
+++ kernel.spec	12 Jun 2009 15:04:32 -0000	1.1567
@@ -634,6 +634,8 @@ Patch681: linux-2.6-mac80211-age-scan-re
 
 Patch800: linux-2.6-crash-driver.patch
 
+Patch1000: linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch
+
 Patch1515: linux-2.6.29-lirc.patch
 
 Patch1700: agp-set_memory_ucwb.patch
@@ -1208,6 +1210,9 @@ ApplyPatch linux-2.6-ata-quirk.patch
 # /dev/crash driver.
 ApplyPatch linux-2.6-crash-driver.patch
 
+# neigh: fix state transition INCOMPLETE->FAILED via Netlink request
+ApplyPatch linux-2.6-neigh_-fix-state-transition-INCOMPLETE-_FAILED-via-Netlink-request.patch
+
 # http://www.lirc.org/
 ApplyPatch linux-2.6.29-lirc.patch
 
@@ -1822,6 +1827,10 @@ fi
 # and build.
 
 %changelog
+* Fri Jun 12 2009 John W. Linville <linville at redhat.com>
+- neigh: fix state transition INCOMPLETE->FAILED via Netlink request
+- enable CONFIG_ARPD (used by OpenNHRP)
+
 * Wed Jun 10 2009 Chuck Ebbert <cebbert at redhat.com>
 - VIA Nano updates:
   Enable Padlock AES encryption and random number generator on x86-64




More information about the fedora-extras-commits mailing list