Merge branch 'lwtunnel-encap-local'
Robert Shearman says: ==================== lwtunnel: encap locally-generated ipv4 packets Locally-generated IPv4 packets, such as from applications running on the host or traceroute/ping currently don't have lwtunnel output redirected encap applied. However, they should do in the same way as for forwarded packets and this patch series addresses that. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
c961b1ccd0
2 changed files with 12 additions and 2 deletions
|
@ -215,8 +215,12 @@ int lwtunnel_output6(struct sock *sk, struct sk_buff *skb)
|
||||||
struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
|
struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
|
||||||
struct lwtunnel_state *lwtstate = NULL;
|
struct lwtunnel_state *lwtstate = NULL;
|
||||||
|
|
||||||
if (rt)
|
if (rt) {
|
||||||
lwtstate = rt->rt6i_lwtstate;
|
lwtstate = rt->rt6i_lwtstate;
|
||||||
|
skb->dev = rt->dst.dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
skb->protocol = htons(ETH_P_IPV6);
|
||||||
|
|
||||||
return __lwtunnel_output(sk, skb, lwtstate);
|
return __lwtunnel_output(sk, skb, lwtstate);
|
||||||
}
|
}
|
||||||
|
@ -227,8 +231,12 @@ int lwtunnel_output(struct sock *sk, struct sk_buff *skb)
|
||||||
struct rtable *rt = (struct rtable *)skb_dst(skb);
|
struct rtable *rt = (struct rtable *)skb_dst(skb);
|
||||||
struct lwtunnel_state *lwtstate = NULL;
|
struct lwtunnel_state *lwtstate = NULL;
|
||||||
|
|
||||||
if (rt)
|
if (rt) {
|
||||||
lwtstate = rt->rt_lwtstate;
|
lwtstate = rt->rt_lwtstate;
|
||||||
|
skb->dev = rt->dst.dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
skb->protocol = htons(ETH_P_IP);
|
||||||
|
|
||||||
return __lwtunnel_output(sk, skb, lwtstate);
|
return __lwtunnel_output(sk, skb, lwtstate);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2022,6 +2022,8 @@ add:
|
||||||
}
|
}
|
||||||
|
|
||||||
rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0);
|
rt_set_nexthop(rth, fl4->daddr, res, fnhe, fi, type, 0);
|
||||||
|
if (lwtunnel_output_redirect(rth->rt_lwtstate))
|
||||||
|
rth->dst.output = lwtunnel_output;
|
||||||
|
|
||||||
return rth;
|
return rth;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue