ip6_tunnel: allow routing IPv4 traffic in NBMA mode
Subsystems (3)
PATCH 1/1 ip6_tunnel: allow routing IPv4 traffic in NBMA mode
Since IPv4 routes support IPv6 gateways now, we can route IPv4 traffic in NBMA tunnels.
Signed-off-by Qing Deng <[email protected]>
--- net/ipv6/ip6_tunnel.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ipv6/ip6_tunnel.c +5 -0
@@ -1121,6 +1121,11 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield,memcpy (&fl6->daddr, addr6,sizeof (fl6->daddr));neigh_release (neigh); + }else if (skb->protocol ==htons (ETH_P_IP )) { +struct rtable *rt =skb_rtable (skb); + +if (rt->rt_gw_family ==AF_INET6 ) +memcpy (&fl6->daddr, &rt->rt_gw6,sizeof (fl6->daddr)); } } else if (t->parms.proto != 0 && !(t->parms.flags & (IP6_TNL_F_USE_ORIG_TCLASS |
base-commit: 1f40caa080474d0420e0b0e6c896e455acb6e236
Signature · 1 line
2.32.0 (Apple Git-132)
Quoted 4 lines · On Sun, 23 Jan 2022 14:00:00 +0800 Qing Deng wrote:
Since IPv4 routes support IPv6 gateways now, we can route IPv4 traffic in NBMA tunnels.
Signed-off-by Qing Deng <[email protected]>
Applied, thanks, c1f55c5e0482 ("ip6_tunnel: allow routing IPv4 traffic in NBMA mode") in net-next.