Skip to content

Commit 803f3e2

Browse files
akodanevdavem330
authored andcommitted
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: 1550c17 ("ipv4: Prepare rtable for IPv6 gateway") Signed-off-by: Alexey Kodanev <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9b5f684 commit 803f3e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/mpls/mpls_iptunnel.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ static int mpls_xmit(struct sk_buff *skb)
133133
mpls_stats_inc_outucastpkts(out_dev, skb);
134134

135135
if (rt) {
136-
if (rt->rt_gw_family == AF_INET)
137-
err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4,
138-
skb);
139-
else if (rt->rt_gw_family == AF_INET6)
136+
if (rt->rt_gw_family == AF_INET6)
140137
err = neigh_xmit(NEIGH_ND_TABLE, out_dev, &rt->rt_gw6,
141138
skb);
139+
else
140+
err = neigh_xmit(NEIGH_ARP_TABLE, out_dev, &rt->rt_gw4,
141+
skb);
142142
} else if (rt6) {
143143
if (ipv6_addr_v4mapped(&rt6->rt6i_gateway)) {
144144
/* 6PE (RFC 4798) */

0 commit comments

Comments
 (0)