Skip to content

Commit 546c044

Browse files
Fabian Frederickdavem330
authored andcommitted
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>
1 parent 0189399 commit 546c044

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/vxlan.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,11 +2650,6 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
26502650
udp_sum = !(flags & VXLAN_F_UDP_ZERO_CSUM6_TX);
26512651
label = vxlan->cfg.label;
26522652
} else {
2653-
if (!info) {
2654-
WARN_ONCE(1, "%s: Missing encapsulation instructions\n",
2655-
dev->name);
2656-
goto drop;
2657-
}
26582653
remote_ip.sa.sa_family = ip_tunnel_info_af(info);
26592654
if (remote_ip.sa.sa_family == AF_INET) {
26602655
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)
28892884
info->mode & IP_TUNNEL_INFO_TX) {
28902885
vni = tunnel_id_to_key32(info->key.tun_id);
28912886
} else {
2887+
if (!info)
2888+
WARN_ONCE(1, "%s: Missing encapsulation instructions\n",
2889+
dev->name);
2890+
28922891
if (info && info->mode & IP_TUNNEL_INFO_TX)
28932892
vxlan_xmit_one(skb, dev, vni, NULL, false);
28942893
else

0 commit comments

Comments
 (0)