ipv4: fix the reusing of routing cache entries
authorJulian Anastasov <ja@ssi.bg>
Mon, 8 Aug 2011 05:20:20 +0000 (22:20 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Aug 2011 05:20:20 +0000 (22:20 -0700)
commitd547f727df86059104af2234804fdd538e112015
treebe54058b51ae121709242553e4aefde5662f734c
parent025890b4ed433b9c9e0f221bb806d42d049c87fe
ipv4: fix the reusing of routing cache entries

compare_keys and ip_route_input_common rely on
rt_oif for distinguishing of input and output routes
with same keys values. But sometimes the input route has
also same hash chain (keyed by iif != 0) with the output
routes (keyed by orig_oif=0). Problem visible if running
with small number of rhash_entries.

Fix them to use rt_route_iif instead. By this way
input route can not be returned to users that request
output route.

The patch fixes the ip_rt_bug errors that were
reported in ip_local_out context, mostly for 255.255.255.255
destinations.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/route.c