Commit 32d6aa79 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[X25]: Stop /proc/net/x25/route infinitely reading

From: Andrew Hendry <ahendry@tusc.com.au>

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: default avatarAndrew Hendry <ahendry@tusc.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 02592cc3
......@@ -32,10 +32,11 @@ static __inline__ struct x25_route *x25_get_route_idx(loff_t pos)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment