summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2020-09-25 16:16:39 +0300
committerDavid S. Miller <davem@davemloft.net>2020-09-26 02:58:07 +0300
commit546c044c9651e81a16833806feff6b369bb5de33 (patch)
treef17d162bb18c097e7c24fba33caa93b9a2347fb2 /drivers/net
parent0189399cbb5eba6e98f02b61574b507062c476b7 (diff)
downloadlinux-546c044c9651e81a16833806feff6b369bb5de33.tar.xz
vxlan: move encapsulation warning
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 <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/vxlan.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index cc904f003f15..14f903d09c01 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