diff options
author | Chunhe Li <lichunhe@huawei.com> | 2014-09-08 22:17:21 +0200 |
---|---|---|
committer | Pravin B Shelar <pshelar@nicira.com> | 2014-11-06 08:52:35 +0100 |
commit | e1f9c356d2946ec717d035ccac5532b1c5709c52 (patch) | |
tree | a006b187186abc7a7d0ebf3c56ff6b1e6d64febd /net/openvswitch/vport-internal_dev.c | |
parent | openvswitch: Refactor get_dp() function into multiple access APIs. (diff) | |
download | linux-e1f9c356d2946ec717d035ccac5532b1c5709c52.tar.xz linux-e1f9c356d2946ec717d035ccac5532b1c5709c52.zip |
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.c | 5 |
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) struct net_device *netdev = netdev_vport_priv(vport)->dev; int len; + if (unlikely(!(netdev->flags & IFF_UP))) { + kfree_skb(skb); + return 0; + } + len = skb->len; skb_dst_drop(skb); |