Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1020822ybe; Wed, 4 Sep 2019 11:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGw+5LRi6HmmVf/W6g3Sce7kWyGodPA/XHluY/yN9dR6FO5iV3EvbOE80O6nDX/P+YQuwB X-Received: by 2002:a17:90a:1b0a:: with SMTP id q10mr6318719pjq.91.1567620917828; Wed, 04 Sep 2019 11:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567620917; cv=none; d=google.com; s=arc-20160816; b=YC0UiLusVWgYBk7R2VqsfV4XYpYaRriZjU0AovqIqIe89uf6acDTe9fwJXgFFkA18e WxeOJJrFAxs/4cIRyc8AcK0YXEQUuf+bY8LyFId2pDQHhf9EJfZymuWwjUpCvjX3zXeq lIk+ZmZ23cGYxwgGZYezvaydHu3bZ2aVq+Lszf0lYb7hpRhKaIraJe7BzN1dN6mN5Vo/ fAMphvTX64cNSS6XqI1RC2KpDuXpgC8zHjRx1T7m/4yOWw7G+MBTrXzj3MRHEih6zYTb nCS6gffbomm7eZCvkN7aIHHhxPoQlqLNul3BmHtyjWbJSvZS3ABeh9ZoI3pVo/Y4D5BA gZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hHE1LF7xftHaL3iAdbkCf9uF7iFS9svmHB41nR+wlEE=; b=oLNiPar9VF1iSdhQwGaTipOIKIVjD4i0ff23spurSBUzLD9XU/GGtZ4XULk9TmGQAR m1cu/pr+ltvy2mEjMj+xdDRExBf4yR58dykGEJ9ujZPy5rHQIG5/ncCSjBTvwGA/kjf7 KDhAtz1FG28tSe+GOgiUU0Dwql9R7K58nuKw6e3BMq/xTE6irONXqz0Hzy0KU21eJNFi J3frbFQv7jV9ZcC0mDNvKUixgL1lZ0Z+ytAvEw3z3h99c99/JsQbAXnHN6kLAt1mjAPR BUpymDgY3JHgo6t+vvZngS2pM3vQRdyc6nbz804o3u0LRo/+mJ/d6zi5Aa1Gl7mDjZxE Levw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQDWHfjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t189si1633078pgt.428.2019.09.04.11.15.02; Wed, 04 Sep 2019 11:15:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vQDWHfjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390308AbfIDSNk (ORCPT + 99 others); Wed, 4 Sep 2019 14:13:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:58534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388984AbfIDSNh (ORCPT ); Wed, 4 Sep 2019 14:13:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7884E208E4; Wed, 4 Sep 2019 18:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567620817; bh=ynBtC09Evgr3eVUFBLyZhJcRTnkYVtUlu6SMzMg/fKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQDWHfjwGTCiIfRkVQW+AGVIyr4Na0rzeTneufJKX6LQfa+YJW64imj/2AU9+F3Fx VOWpx9SItVEeI1MSuIMMhtZdYXWpEkiSCoqAz7O3grLo01VrxzESUguZbstgekMR9/ 0leoVJoHV9PY5ErwXSGNJ3+qBlRZNA/4YqpT1IdQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kodanev , David Ahern , "David S. Miller" Subject: [PATCH 5.2 055/143] ipv4: mpls: fix mpls_xmit for iptunnel Date: Wed, 4 Sep 2019 19:53:18 +0200 Message-Id: <20190904175316.228828422@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904175314.206239922@linuxfoundation.org> References: <20190904175314.206239922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexey Kodanev [ Upstream commit 803f3e22ae10003a83c781498c0ac34cfe3463ff ] 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 Reviewed-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/mpls/mpls_iptunnel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- 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) */