summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishakha Narvekar <Vishakha.Narvekar@dell.com>2017-10-03 16:13:29 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-04 18:16:48 -0700
commite769fcec6bc4bdd1b0e2cf817680148f9c40b1c4 (patch)
tree11deb5a063028440de108c8779cf371469e23c37
parent90caccdd8cc0215705f18b92771b449b01e2474a (diff)
downloadop-kernel-dev-e769fcec6bc4bdd1b0e2cf817680148f9c40b1c4.zip
op-kernel-dev-e769fcec6bc4bdd1b0e2cf817680148f9c40b1c4.tar.gz
net: 8021q: skip packets if the vlan is down
If the vlan is down, free the packet instead of proceeding with other processing, or counting it as received. If vlan interfaces are used as slaves for bonding, with arp monitoring for connectivity, if the rx counter is seen to be incrementing, then the bond device will not observe that the interface is down. CC: David S. Miller <davem@davemloft.net> Signed-off-by: Vishakha Narvekar <Vishakha.Narvekar@dell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/8021q/vlan_core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index e2ed698..0bc31de 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -21,6 +21,12 @@ bool vlan_do_receive(struct sk_buff **skbp)
if (unlikely(!skb))
return false;
+ if (unlikely(!(vlan_dev->flags & IFF_UP))) {
+ kfree_skb(skb);
+ *skbp = NULL;
+ return false;
+ }
+
skb->dev = vlan_dev;
if (unlikely(skb->pkt_type == PACKET_OTHERHOST)) {
/* Our lower layer thinks this is not local, let's make sure.
OpenPOWER on IntegriCloud