]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Fix "Set rt->rt_iif more sanely on output routes."
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Thu, 7 Apr 2011 21:04:08 +0000 (14:04 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Apr 2011 21:04:08 +0000 (14:04 -0700)
commitc8291fc5260de8d4b53ce41faa86ec0653d2f1ea
treee931b86166c2a644470e3754e2d3139f97834951
parent14fa24d89672a9ec56accc02336f16bc844d82fc
ipv4: Fix "Set rt->rt_iif more sanely on output routes."

Commit 718382487c68346a54b4a7c26532d7665a6903f5 ("Set rt->rt_iif more
sanely on output routes.")  breaks rt_is_{output,input}_route.

This became the cause to return "IP_PKTINFO's ->ipi_ifindex == 0".

To fix it, this does:

1) Add "int rt_route_iif;" to struct rtable

2) For input routes, always set rt_route_iif to same value as rt_iif

3) For output routes, always set rt_route_iif to zero.  Set rt_iif
   as it is done currently.

4) Change rt_is_{output,input}_route() to test rt_route_iif

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/route.h
net/ipv4/route.c
net/ipv4/xfrm4_policy.c