diff options
| -rw-r--r-- | include/net/route.h | 6 | ||||
| -rw-r--r-- | net/ipv4/route.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/include/net/route.h b/include/net/route.h index 60d611dc5cee..c29ef2733f2d 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
| @@ -277,7 +277,11 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable | |||
| 277 | 277 | ||
| 278 | static inline int inet_iif(const struct sk_buff *skb) | 278 | static inline int inet_iif(const struct sk_buff *skb) |
| 279 | { | 279 | { |
| 280 | return skb_rtable(skb)->rt_iif; | 280 | int iif = skb_rtable(skb)->rt_iif; |
| 281 | |||
| 282 | if (iif) | ||
| 283 | return iif; | ||
| 284 | return skb->skb_iif; | ||
| 281 | } | 285 | } |
| 282 | 286 | ||
| 283 | extern int sysctl_ip_default_ttl; | 287 | extern int sysctl_ip_default_ttl; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index f6be78119396..6bcb8fc71cbc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -1309,7 +1309,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
| 1309 | rth->rt_flags = RTCF_MULTICAST; | 1309 | rth->rt_flags = RTCF_MULTICAST; |
| 1310 | rth->rt_type = RTN_MULTICAST; | 1310 | rth->rt_type = RTN_MULTICAST; |
| 1311 | rth->rt_is_input= 1; | 1311 | rth->rt_is_input= 1; |
| 1312 | rth->rt_iif = dev->ifindex; | 1312 | rth->rt_iif = 0; |
| 1313 | rth->rt_pmtu = 0; | 1313 | rth->rt_pmtu = 0; |
| 1314 | rth->rt_gateway = 0; | 1314 | rth->rt_gateway = 0; |
| 1315 | if (our) { | 1315 | if (our) { |
| @@ -1435,7 +1435,7 @@ static int __mkroute_input(struct sk_buff *skb, | |||
| 1435 | rth->rt_flags = flags; | 1435 | rth->rt_flags = flags; |
| 1436 | rth->rt_type = res->type; | 1436 | rth->rt_type = res->type; |
| 1437 | rth->rt_is_input = 1; | 1437 | rth->rt_is_input = 1; |
| 1438 | rth->rt_iif = in_dev->dev->ifindex; | 1438 | rth->rt_iif = 0; |
| 1439 | rth->rt_pmtu = 0; | 1439 | rth->rt_pmtu = 0; |
| 1440 | rth->rt_gateway = 0; | 1440 | rth->rt_gateway = 0; |
| 1441 | 1441 | ||
| @@ -1608,7 +1608,7 @@ local_input: | |||
| 1608 | rth->rt_flags = flags|RTCF_LOCAL; | 1608 | rth->rt_flags = flags|RTCF_LOCAL; |
| 1609 | rth->rt_type = res.type; | 1609 | rth->rt_type = res.type; |
| 1610 | rth->rt_is_input = 1; | 1610 | rth->rt_is_input = 1; |
| 1611 | rth->rt_iif = dev->ifindex; | 1611 | rth->rt_iif = 0; |
| 1612 | rth->rt_pmtu = 0; | 1612 | rth->rt_pmtu = 0; |
| 1613 | rth->rt_gateway = 0; | 1613 | rth->rt_gateway = 0; |
| 1614 | if (res.type == RTN_UNREACHABLE) { | 1614 | if (res.type == RTN_UNREACHABLE) { |
| @@ -1772,7 +1772,7 @@ static struct rtable *__mkroute_output(const struct fib_result *res, | |||
| 1772 | rth->rt_flags = flags; | 1772 | rth->rt_flags = flags; |
| 1773 | rth->rt_type = type; | 1773 | rth->rt_type = type; |
| 1774 | rth->rt_is_input = 0; | 1774 | rth->rt_is_input = 0; |
| 1775 | rth->rt_iif = orig_oif ? : dev_out->ifindex; | 1775 | rth->rt_iif = orig_oif ? : 0; |
| 1776 | rth->rt_pmtu = 0; | 1776 | rth->rt_pmtu = 0; |
| 1777 | rth->rt_gateway = 0; | 1777 | rth->rt_gateway = 0; |
| 1778 | 1778 | ||
