diff options
Diffstat (limited to 'drivers/net/macvlan.c')
-rw-r--r-- | drivers/net/macvlan.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 60e4ca01ccbb..726edabff26b 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/netpoll.h> | 36 | #include <linux/netpoll.h> |
37 | 37 | ||
38 | #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) | 38 | #define MACVLAN_HASH_SIZE (1 << BITS_PER_BYTE) |
39 | #define MACVLAN_BC_QUEUE_LEN 1000 | ||
39 | 40 | ||
40 | struct macvlan_port { | 41 | struct macvlan_port { |
41 | struct net_device *dev; | 42 | struct net_device *dev; |
@@ -248,7 +249,7 @@ static void macvlan_broadcast_enqueue(struct macvlan_port *port, | |||
248 | goto err; | 249 | goto err; |
249 | 250 | ||
250 | spin_lock(&port->bc_queue.lock); | 251 | spin_lock(&port->bc_queue.lock); |
251 | if (skb_queue_len(&port->bc_queue) < skb->dev->tx_queue_len) { | 252 | if (skb_queue_len(&port->bc_queue) < MACVLAN_BC_QUEUE_LEN) { |
252 | __skb_queue_tail(&port->bc_queue, nskb); | 253 | __skb_queue_tail(&port->bc_queue, nskb); |
253 | err = 0; | 254 | err = 0; |
254 | } | 255 | } |
@@ -739,7 +740,10 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
739 | struct macvlan_dev *vlan = netdev_priv(dev); | 740 | struct macvlan_dev *vlan = netdev_priv(dev); |
740 | int err = -EINVAL; | 741 | int err = -EINVAL; |
741 | 742 | ||
742 | if (!vlan->port->passthru) | 743 | /* Support unicast filter only on passthru devices. |
744 | * Multicast filter should be allowed on all devices. | ||
745 | */ | ||
746 | if (!vlan->port->passthru && is_unicast_ether_addr(addr)) | ||
743 | return -EOPNOTSUPP; | 747 | return -EOPNOTSUPP; |
744 | 748 | ||
745 | if (flags & NLM_F_REPLACE) | 749 | if (flags & NLM_F_REPLACE) |
@@ -760,7 +764,10 @@ static int macvlan_fdb_del(struct ndmsg *ndm, struct nlattr *tb[], | |||
760 | struct macvlan_dev *vlan = netdev_priv(dev); | 764 | struct macvlan_dev *vlan = netdev_priv(dev); |
761 | int err = -EINVAL; | 765 | int err = -EINVAL; |
762 | 766 | ||
763 | if (!vlan->port->passthru) | 767 | /* Support unicast filter only on passthru devices. |
768 | * Multicast filter should be allowed on all devices. | ||
769 | */ | ||
770 | if (!vlan->port->passthru && is_unicast_ether_addr(addr)) | ||
764 | return -EOPNOTSUPP; | 771 | return -EOPNOTSUPP; |
765 | 772 | ||
766 | if (is_unicast_ether_addr(addr)) | 773 | if (is_unicast_ether_addr(addr)) |
@@ -800,6 +807,7 @@ static netdev_features_t macvlan_fix_features(struct net_device *dev, | |||
800 | features, | 807 | features, |
801 | mask); | 808 | mask); |
802 | features |= ALWAYS_ON_FEATURES; | 809 | features |= ALWAYS_ON_FEATURES; |
810 | features &= ~NETIF_F_NETNS_LOCAL; | ||
803 | 811 | ||
804 | return features; | 812 | return features; |
805 | } | 813 | } |