diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2011-04-07 17:04:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-07 17:04:08 -0400 |
commit | 1b86a58f9d7ce4fe2377687f378fbfb53bdc9b6c (patch) | |
tree | e931b86166c2a644470e3754e2d3139f97834951 /include/net/route.h | |
parent | 9b57e1a79e2142df8412ab223c90ba6f47c6b3a3 (diff) |
ipv4: Fix "Set rt->rt_iif more sanely on output routes."
Commit 1018b5c01636c7c6bda31a719bda34fc631db29a ("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>
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/route.h b/include/net/route.h index f88429cad52a..8fce0621cad1 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -64,6 +64,7 @@ struct rtable { | |||
64 | 64 | ||
65 | __be32 rt_dst; /* Path destination */ | 65 | __be32 rt_dst; /* Path destination */ |
66 | __be32 rt_src; /* Path source */ | 66 | __be32 rt_src; /* Path source */ |
67 | int rt_route_iif; | ||
67 | int rt_iif; | 68 | int rt_iif; |
68 | int rt_oif; | 69 | int rt_oif; |
69 | __u32 rt_mark; | 70 | __u32 rt_mark; |
@@ -80,12 +81,12 @@ struct rtable { | |||
80 | 81 | ||
81 | static inline bool rt_is_input_route(struct rtable *rt) | 82 | static inline bool rt_is_input_route(struct rtable *rt) |
82 | { | 83 | { |
83 | return rt->rt_iif != 0; | 84 | return rt->rt_route_iif != 0; |
84 | } | 85 | } |
85 | 86 | ||
86 | static inline bool rt_is_output_route(struct rtable *rt) | 87 | static inline bool rt_is_output_route(struct rtable *rt) |
87 | { | 88 | { |
88 | return rt->rt_iif == 0; | 89 | return rt->rt_route_iif == 0; |
89 | } | 90 | } |
90 | 91 | ||
91 | struct ip_rt_acct { | 92 | struct ip_rt_acct { |