diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2014-02-28 18:46:49 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2014-03-08 03:14:49 -0500 |
commit | bd9d55929df54b67708460d7eda84a7d7924009d (patch) | |
tree | b82267ecca20a4103c6a376f922f875492cff0e6 | |
parent | 96dee024ca4799d6d21588951240035c21ba1c67 (diff) |
ixgbevf: fix skb->pkt_type checks
skb->pkt_type is not a bitmask, but contains only value at a time from
the range defined in include/uapi/linux/if_packet.h.
Checking it like if it was a bitmask of values would also cause
PACKET_OTHERHOST, PACKET_LOOPBACK and PACKET_FASTROUTE to be matched by
this check since their lower 2 bits are also set, although that does not
fix a real bug, it is still potentially confusing.
This bogus check was introduced in commit 815cccbf ("ixgbe: add setlink,
getlink support to ixgbe and ixgbevf").
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 57e0cd89b3dc..6ac5da219150 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -516,7 +516,8 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector, | |||
516 | /* Workaround hardware that can't do proper VEPA multicast | 516 | /* Workaround hardware that can't do proper VEPA multicast |
517 | * source pruning. | 517 | * source pruning. |
518 | */ | 518 | */ |
519 | if ((skb->pkt_type & (PACKET_BROADCAST | PACKET_MULTICAST)) && | 519 | if ((skb->pkt_type == PACKET_BROADCAST || |
520 | skb->pkt_type == PACKET_MULTICAST) && | ||
520 | ether_addr_equal(rx_ring->netdev->dev_addr, | 521 | ether_addr_equal(rx_ring->netdev->dev_addr, |
521 | eth_hdr(skb)->h_source)) { | 522 | eth_hdr(skb)->h_source)) { |
522 | dev_kfree_skb_irq(skb); | 523 | dev_kfree_skb_irq(skb); |