summaryrefslogtreecommitdiff
path: root/net/ax25
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2009-04-17 04:19:36 +0000
committerDavid S. Miller <davem@davemloft.net>2009-04-20 02:14:59 -0700
commitc7c1a0f60b90955855ba8cd9cfc480167bf6c3da (patch)
tree6d22a9da8f86ad86ab78ea41b620e6424cb2a180 /net/ax25
parente8d19370734f11e5880bb9ae2125f586e9e5d15c (diff)
downloadlinux-exynos-c7c1a0f60b90955855ba8cd9cfc480167bf6c3da.tar.gz
linux-exynos-c7c1a0f60b90955855ba8cd9cfc480167bf6c3da.tar.bz2
linux-exynos-c7c1a0f60b90955855ba8cd9cfc480167bf6c3da.zip
ax25: proc uid file misses header
This has been broken for a while. I happened to catch it testing because one app "knew" that the top line of the calls data was the policy line and got confused. Put the header back. Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25')
-rw-r--r--net/ax25/ax25_uid.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/net/ax25/ax25_uid.c b/net/ax25/ax25_uid.c
index 57aeba729bae..832bcf092a01 100644
--- a/net/ax25/ax25_uid.c
+++ b/net/ax25/ax25_uid.c
@@ -148,9 +148,13 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
{
struct ax25_uid_assoc *pt;
struct hlist_node *node;
- int i = 0;
+ int i = 1;
read_lock(&ax25_uid_lock);
+
+ if (*pos == 0)
+ return SEQ_START_TOKEN;
+
ax25_uid_for_each(pt, node, &ax25_uid_list) {
if (i == *pos)
return pt;
@@ -162,8 +166,10 @@ static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos)
static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
-
- return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,
+ if (v == SEQ_START_TOKEN)
+ return ax25_uid_list.first;
+ else
+ return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next,
ax25_uid_assoc, uid_node);
}