public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH TRIVIAL 2.6.8.1] X.25 : Stop /proc/net/x25/route infinitely reading
@ 2004-10-25  0:10 Andrew Hendry
  0 siblings, 0 replies; only message in thread
From: Andrew Hendry @ 2004-10-25  0:10 UTC (permalink / raw)
  To: linux-x25, eis; +Cc: trivial, linux-kernel


The problem:
route add --x25 0/0 eth0
cat /proc/net/x25/route
reads the single routing entry forever.

This patch makes x25_get_route_idx behave the same as x25_get_socket_idx
which works correctly.

Signed-off-by: Andrew Hendry <ahendry@tusc.com.au>

Andrew.

diff -up linux-2.6.8.1/net/x25/x25_proc.c.orig
linux-2.6.8.1/net/x25/x25_proc.c
--- linux-2.6.8.1/net/x25/x25_proc.c.orig       2004-10-25
09:27:58.600069976 +1000
+++ linux-2.6.8.1/net/x25/x25_proc.c    2004-10-25 09:29:30.079163040
+1000
@@ -32,10 +32,11 @@ static __inline__ struct x25_route *x25_
  
        list_for_each(route_entry, &x25_route_list) {
                rt = list_entry(route_entry, struct x25_route, node);
-               if (--pos)
-                       break;
+               if (!pos--)
+                       goto found;
        }
-
+       rt = NULL;
+found:
        return rt;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-25  0:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-25  0:10 [PATCH TRIVIAL 2.6.8.1] X.25 : Stop /proc/net/x25/route infinitely reading Andrew Hendry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox