Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
David S. Miller
c7c1a0f6 e8d19370

+9 -3
+9 -3
net/ax25/ax25_uid.c
··· 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; ··· 166 162 static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) 167 163 { 168 164 ++*pos; 169 - 170 - return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, 165 + if (v == SEQ_START_TOKEN) 166 + return ax25_uid_list.first; 167 + else 168 + return hlist_entry(((ax25_uid_assoc *)v)->uid_node.next, 171 169 ax25_uid_assoc, uid_node); 172 170 } 173 171