Skip to content

Commit

Permalink
ip6_tunnel: allow routing IPv4 traffic in NBMA mode
Browse files Browse the repository at this point in the history
Since IPv4 routes support IPv6 gateways now, we can route IPv4 traffic in
NBMA tunnels.

Signed-off-by: Qing Deng <i@moy.cat>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Qing Deng authored and David S. Miller committed Jan 25, 2022
1 parent 53243d4 commit c1f55c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions net/ipv6/ip6_tunnel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down

0 comments on commit c1f55c5

Please sign in to comment.