Skip to content
Commit 4c84edc1 authored by JianJhen Chen's avatar JianJhen Chen Committed by David S. Miller
Browse files

net: bridge: fix a bug on using a neighbour cache entry without checking its state

When handling DNAT'ed packets on a bridge device, the neighbour cache entry
from lookup was used without checking its state. It means that a cache entry
in the NUD_STALE state will be used directly instead of entering the NUD_DELAY
state to confirm the reachability of the neighbor.

This problem becomes worse after commit 2724680b

 ("neigh: Keep neighbour
cache entries if number of them is small enough."), since all neighbour cache
entries in the NUD_STALE state will be kept in the neighbour table as long as
the number of cache entries does not exceed the value specified in gc_thresh1.

This commit validates the state of a neighbour cache entry before using
the entry.

Signed-off-by: default avatarJianJhen Chen <kchen@synology.com>
Reviewed-by: default avatarJinLin Chen <jlchen@synology.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f87d8ad9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment