]> git.baikalelectronics.ru Git - kernel.git/commit
neigh: remove duplicate check for same neigh
authorZhang Shengju <zhangshengju@cmss.chinamobile.com>
Wed, 30 Nov 2016 03:24:42 +0000 (11:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 18:46:16 +0000 (13:46 -0500)
commitb2736eb4410d214d908f0f437168ba43074a523b
tree19db7b0c31561a74e8dde9d87fdc28981d8b6ad6
parent3b45289d7d25a6d5da5ca74dda8b9f0ca10f5f9a
neigh: remove duplicate check for same neigh

Currently loop index 'idx' is used as the index in the neigh list of interest.
It's increased only when the neigh is dumped. It's not the absolute index in
the list. Because there is no info to record which neigh has already be scanned
by previous loop. This will cause the filtered out neighs to be scanned mulitple
times.

This patch make idx as the absolute index in the list, it will increase no matter
whether the neigh is filtered. This will prevent the above problem.

And this is in line with other dump functions.

v2:
 - take David Ahern's advice to do simple change

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/neighbour.c