Thread (19 messages) 19 messages, 2 authors, 2014-03-09

[net-next 13/15] ixgbevf: fix skb->pkt_type checks

flat view
STALE4607d SUPERSEDED: 1 (0M)

From: Jeff Kirsher <hidden>
Date: 2014-03-08 09:26:00
Subsystem: intel ethernet drivers, networking drivers, the rest · Maintainers: Tony Nguyen, Przemek Kitszel, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 72 in this series; 1 review trailer.

Revisions (72)
  1. v1
  2. v2 [diff vs current]
  3. v1
  4. v1
  5. v1
  6. v1
  7. v1
  8. v1
  9. v1
  10. v1
  11. v1
  12. v1
  13. v1
  14. v1
  15. v1
  16. v1
  17. v1
  18. v2 [diff vs current]
  19. v1
  20. v1
  21. v1
  22. v1
  23. v1
  24. v1
  25. v1
  26. v2 [diff vs current]
  27. v1
  28. v2 [diff vs current]
  29. v1
  30. v2 [diff vs current]
  31. v1
  32. v1
  33. v2 [diff vs current]
  34. v1
  35. v1
  36. v1
  37. v1
  38. v1
  39. v2 [diff vs current]
  40. v3 [diff vs current]
  41. v4 [diff vs current]
  42. v5 [diff vs current]
  43. v1
  44. v1
  45. v1
  46. v2 [diff vs current]
  47. v1
  48. v1
  49. v2 [diff vs current]
  50. v3 [diff vs current]
  51. v1
  52. v1 current
  53. v1
  54. v1
  55. v2 [diff vs current]
  56. v1
  57. v2 [diff vs current]
  58. v3 [diff vs current]
  59. v1
  60. v1
  61. v1
  62. v2 [diff vs current]
  63. v1
  64. v1
  65. v1
  66. v1
  67. v1
  68. v2 [diff vs current]
  69. v1
  70. v1
  71. v1
  72. v1
From: Florian Fainelli <f.fainelli@gmail.com>

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 <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 57e0cd8..6ac5da2 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,
 		/* Workaround hardware that can't do proper VEPA multicast
 		 * source pruning.
 		 */
-		if ((skb->pkt_type & (PACKET_BROADCAST | PACKET_MULTICAST)) &&
+		if ((skb->pkt_type == PACKET_BROADCAST ||
+		    skb->pkt_type == PACKET_MULTICAST) &&
 		    ether_addr_equal(rx_ring->netdev->dev_addr,
 				     eth_hdr(skb)->h_source)) {
 			dev_kfree_skb_irq(skb);
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help