Commit c7c1a0f60b90955855ba8cd9cfc480167bf6c3da
Committed by
David S. Miller
1 parent
e8d1937073
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
net/ax25/ax25_uid.c
... | ... | @@ -148,9 +148,13 @@ |
148 | 148 | { |
149 | 149 | struct ax25_uid_assoc *pt; |
150 | 150 | struct hlist_node *node; |
151 | - int i = 0; | |
151 | + int i = 1; | |
152 | 152 | |
153 | 153 | read_lock(&ax25_uid_lock); |
154 | + | |
155 | + if (*pos == 0) | |
156 | + return SEQ_START_TOKEN; | |
157 | + | |
154 | 158 | ax25_uid_for_each(pt, node, &ax25_uid_list) { |
155 | 159 | if (i == *pos) |
156 | 160 | return pt; |
... | ... | @@ -162,8 +166,10 @@ |
162 | 166 | static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
163 | 167 | { |
164 | 168 | ++*pos; |
165 | - | |
166 | - return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | |
169 | + if (v == SEQ_START_TOKEN) | |
170 | + return ax25_uid_list.first; | |
171 | + else | |
172 | + return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, | |
167 | 173 | ax25_uid_assoc, uid_node); |
168 | 174 | } |
169 | 175 |