From patchwork Fri Sep 25 13:16:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 260214 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26817C4363D for ; Fri, 25 Sep 2020 13:17:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E484823888 for ; Fri, 25 Sep 2020 13:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728905AbgIYNRD (ORCPT ); Fri, 25 Sep 2020 09:17:03 -0400 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:53047 "EHLO mailrelay112.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728121AbgIYNRC (ORCPT ); Fri, 25 Sep 2020 09:17:02 -0400 IronPort-SDR: j4hNMfuq5CSYQYaEIQJGu8KqlMc6/hszWlwqCeEnxZpNZabx7BYo8QbWscV3RqovnGRNBvv4cg I1DZfH82ClABXFIK4zVS+PYMZ0NMjgVUY64y+vKsC6dHC/jafwqpM/nSWmNsZ/eor68neDOIQO GEejyvcAjWoxhOl6aKDCKwJ+/CvBXJAKNbgkl3pHyM+WkParmsPRlWgAm2BqySkd7MPT3ZL/RM 8Biw5RjZPktdFjLjamGZxVpJlCO6sP6UJB6wv9do0kKHa/RrGXvILbVGU9S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(HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 25 Sep 2020 15:16:59 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org Cc: mkubecek@suse.cz, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabian Frederick Subject: [PATCH V2 3/5 net-next] vxlan: move encapsulation warning Date: Fri, 25 Sep 2020 15:16:39 +0200 Message-Id: <20200925131639.56564-1-fabf@skynet.be> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org vxlan_xmit_one() was only called from vxlan_xmit() without rdst and info was already tested. Emit warning in that function instead Signed-off-by: Fabian Frederick --- drivers/net/vxlan.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index cc904f003f158..14f903d09c010 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2650,11 +2650,6 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, udp_sum = !(flags & VXLAN_F_UDP_ZERO_CSUM6_TX); label = vxlan->cfg.label; } else { - if (!info) { - WARN_ONCE(1, "%s: Missing encapsulation instructions\n", - dev->name); - goto drop; - } remote_ip.sa.sa_family = ip_tunnel_info_af(info); if (remote_ip.sa.sa_family == AF_INET) { remote_ip.sin.sin_addr.s_addr = info->key.u.ipv4.dst; @@ -2889,6 +2884,10 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) info->mode & IP_TUNNEL_INFO_TX) { vni = tunnel_id_to_key32(info->key.tun_id); } else { + if (!info) + WARN_ONCE(1, "%s: Missing encapsulation instructions\n", + dev->name); + if (info && info->mode & IP_TUNNEL_INFO_TX) vxlan_xmit_one(skb, dev, vni, NULL, false); else