On input packet processing, rt->rt_iif will be zero if we should
use skb->dev->ifindex.
Since we access rt->rt_iif consistently via inet_iif(), that is
the only spot whose interpretation have to adjust.
Signed-off-by: David S. Miller <davem@davemloft.net>
static inline int inet_iif(const struct sk_buff *skb)
{
- return skb_rtable(skb)->rt_iif;
+ int iif = skb_rtable(skb)->rt_iif;
+
+ if (iif)
+ return iif;
+ return skb->skb_iif;
}
extern int sysctl_ip_default_ttl;
rth->rt_flags = RTCF_MULTICAST;
rth->rt_type = RTN_MULTICAST;
rth->rt_is_input= 1;
- rth->rt_iif = dev->ifindex;
+ rth->rt_iif = 0;
rth->rt_pmtu = 0;
rth->rt_gateway = 0;
if (our) {
rth->rt_flags = flags;
rth->rt_type = res->type;
rth->rt_is_input = 1;
- rth->rt_iif = in_dev->dev->ifindex;
+ rth->rt_iif = 0;
rth->rt_pmtu = 0;
rth->rt_gateway = 0;
rth->rt_flags = flags|RTCF_LOCAL;
rth->rt_type = res.type;
rth->rt_is_input = 1;
- rth->rt_iif = dev->ifindex;
+ rth->rt_iif = 0;
rth->rt_pmtu = 0;
rth->rt_gateway = 0;
if (res.type == RTN_UNREACHABLE) {
rth->rt_flags = flags;
rth->rt_type = type;
rth->rt_is_input = 0;
- rth->rt_iif = orig_oif ? : dev_out->ifindex;
+ rth->rt_iif = orig_oif ? : 0;
rth->rt_pmtu = 0;
rth->rt_gateway = 0;