diff options
author | Alexey Kodanev <alexey.kodanev@oracle.com> | 2019-08-23 20:51:43 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-25 14:34:08 -0700 |
commit | 803f3e22ae10003a83c781498c0ac34cfe3463ff (patch) | |
tree | 724d97a07ccd049bbbab364d16fef737a5f17e83 /net/mpls | |
parent | 9b5f684182403f2b338f797c44eca0061c797dc8 (diff) | |
download | linux-stable-803f3e22ae10003a83c781498c0ac34cfe3463ff.tar.gz linux-stable-803f3e22ae10003a83c781498c0ac34cfe3463ff.tar.bz2 linux-stable-803f3e22ae10003a83c781498c0ac34cfe3463ff.zip |
ipv4: mpls: fix mpls_xmit for iptunnel
When using mpls over gre/gre6 setup, rt->rt_gw4 address is not set, the
same for rt->rt_gw_family. Therefore, when rt->rt_gw_family is checked
in mpls_xmit(), neigh_xmit() call is skipped. As a result, such setup
doesn't work anymore.
This issue was found with LTP mpls03 tests.
Fixes: 1550c171935d ("ipv4: Prepare rtable for IPv6 gateway")
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls')
-rw-r--r-- | net/mpls/mpls_iptunnel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/mpls/mpls_iptunnel.c b/net/mpls/mpls_iptunnel.c index d25e91d7bdc1..44b675016393 100644 --- a/net/mpls/mpls_iptunnel.c +++ b/net/mpls/mpls_iptunnel.c @@ -133,12 +133,12 @@ static int mpls_xmit(struct sk_buff *skb) mpls_stats_inc_outucastpkts(out_dev, skb); if (rt) { - if (rt->rt_gw_family == AF_INET) - err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4, - skb); - else if (rt->rt_gw_family == AF_INET6) + if (rt->rt_gw_family == AF_INET6) err = neigh_xmit(NEIGH_ND_TABLE, out_dev, &rt->rt_gw6, skb); + else + err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4, + skb); } else if (rt6) { if (ipv6_addr_v4mapped(&rt6->rt6i_gateway)) { /* 6PE (RFC 4798) */ |