浏览代码

net: in the first call to neigh_seq_next, call neigh_get_first, not neigh_get_idx.

neigh_seq_next won't be called both with *pos > 0 && v ==
SEQ_START_TOKEN, so there's no point calling neigh_get_idx when we're
on the start token, just call neigh_get_first directly.

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Chris Larson 16 年之前
父节点
当前提交
bff69732c9
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/core/neighbour.c

+ 1 - 1
net/core/neighbour.c

@@ -2385,7 +2385,7 @@ void *neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 	void *rc;
 
 	if (v == SEQ_START_TOKEN) {
-		rc = neigh_get_idx(seq, pos);
+		rc = neigh_get_first(seq);
 		goto out;
 	}