[Bug 9106] ip neigh flush dev eth0 is hanging

bugzilla-daemon at bugzilla.ubuntu.com bugzilla-daemon at bugzilla.ubuntu.com
Wed Aug 17 21:12:09 UTC 2005


Please do not reply to this email.  You can add comments at
http://bugzilla.ubuntu.com/show_bug.cgi?id=9106
Ubuntu | linux





------- Additional Comments From herbert at linuxhacker.at  2005-08-17 22:12 UTC -------
I'm writing to the maintainer Stephen Hemminger at odsl.org of the iproute2
package and descripe the error situation. His answer:

+++
Thanks, this usually shows up when someone tries to run flush
as non-root.  Some vendors added a check for getuid() != 0, but that
fails in secure environments with capabilities and no root user.

I'll probably just change it to try 10 times and give up.
+++

And iproute2-050816 containig the following ChangeLog entry:

    2005-08-16  Stephen Hemminger  <shemminger at osdl.org>

        * Limit ip route flush to 10 rounds.
        * Cleanup ip rule flush error message

Ok, i backported his changes to the Ubuntu Hoary iproute package and the output of:

localhost:~ # ip neigh flush dev eth1
*** Flush not complete bailing out after 10 rounds

Looks good. The isolated patch:
--- ip/ipneigh.c.ORIG	2005-08-17 22:11:06.000000000 +0200
+++ ip/ipneigh.c	2005-08-17 22:13:02.000000000 +0200
@@ -31,6 +31,7 @@
 #include "ip_common.h"
 
 #define NUD_VALID
(NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY)
+#define MAX_ROUNDS	10
 
 static struct
 {
@@ -411,7 +412,7 @@
 		filter.rth = &rth;
 		filter.state &= ~NUD_FAILED;
 
-		for (;;) {
+		while (round < MAX_ROUNDS) {
 			if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) {
 				perror("Cannot send dump request");
 				exit(1);
@@ -437,6 +438,9 @@
 				fflush(stdout);
 			}
 		}
+		printf("*** Flush not complete bailing out after %d rounds\n",
+			MAX_ROUNDS);
+		return 1;
 	}
 
 	if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) {

A prebuild iproute package for Ubuntu Hoary is available on my site
http://apt-get.linuxhacker.at/ubuntu/dists/hoary/main/pool/ and the patch:
https://info.linuxhacker.at/Patches/iproute-flush2.patch and the full errorlog
https://info.linuxhacker.at/wiki/FwbuilderFirewallScrptHanging

Piotr Roszatyck tested the new iproute2 version today with Debian and document
this in the Debian Bug Entry #282492
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=282492).

The testoutput with my iproute-20041019-1hs1 package. With the original Ubuntu
Hoary package on my Notebook:
~# ip neigh
10.165.167.1 dev ath0 lladdr 00:09:5b:ee:72:54 nud stale
~# ip neigh flush dev ath0
----> hanging

Now installing the new package:
~# apt-cache policy iproute
iproute:
  Installed: 20041019-1
  Candidate: 20041019-1hs1
  Version table:
     20041019-1hs1 0
        500 http://apt-get.linuxhacker.at hoary/main Packages
 *** 20041019-1 0
        500 http://at.archive.ubuntu.com hoary/main Packages
        100 /var/lib/dpkg/status

apt-get install iproute
~# ip neigh
10.165.167.1 dev ath0 lladdr 00:09:5b:ee:72:54 nud stale
root at faultier:~# ip neigh flush dev ath0
*** Flush not complete bailing out after 10 rounds

Will this patch integrated in the new Breezy?

-- 
Configure bugmail: http://bugzilla.ubuntu.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




More information about the kernel-bugs mailing list