aboutsummaryrefslogtreecommitdiffstats
path: root/net/openvswitch/vport-internal_dev.c
diff options
context:
space:
mode:
authorChunhe Li <lichunhe@huawei.com>2014-09-08 16:17:21 -0400
committerPravin B Shelar <pshelar@nicira.com>2014-11-06 02:52:35 -0500
commite1f9c356d2946ec717d035ccac5532b1c5709c52 (patch)
treea006b187186abc7a7d0ebf3c56ff6b1e6d64febd /net/openvswitch/vport-internal_dev.c
parentcc3a5ae6f23336ddc1d136a66c0a6a60276e99a3 (diff)
openvswitch: Drop packets when interdev is not up
If the internal device is not up, it should drop received packets. Sometimes it receive the broadcast or multicast packets, and the ip protocol stack will casue more cpu usage wasted. Signed-off-by: Chunhe Li <lichunhe@huawei.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Diffstat (limited to 'net/openvswitch/vport-internal_dev.c')
-rw-r--r--net/openvswitch/vport-internal_dev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 10dc07e1678b..6a55f7105505 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -224,6 +224,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
224 struct net_device *netdev = netdev_vport_priv(vport)->dev; 224 struct net_device *netdev = netdev_vport_priv(vport)->dev;
225 int len; 225 int len;
226 226
227 if (unlikely(!(netdev->flags & IFF_UP))) {
228 kfree_skb(skb);
229 return 0;
230 }
231
227 len = skb->len; 232 len = skb->len;
228 233
229 skb_dst_drop(skb); 234 skb_dst_drop(skb);