0016-net-sched-fix-TCF_LAYER_LINK-case-in-tcf_get_base_pt.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Wolfgang Bumiller <[email protected]>
  3. Date: Fri, 19 Jan 2018 11:12:38 +0100
  4. Subject: [PATCH] net: sched: fix TCF_LAYER_LINK case in tcf_get_base_ptr
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. TCF_LAYER_LINK and TCF_LAYER_NETWORK returned the same pointer as
  9. skb->data points to the network header.
  10. Use skb_mac_header instead.
  11. Signed-off-by: Wolfgang Bumiller <[email protected]>
  12. Signed-off-by: Fabian Grünbichler <[email protected]>
  13. ---
  14. include/net/pkt_cls.h | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
  17. index 537d0a0ad4c4..4450961b1554 100644
  18. --- a/include/net/pkt_cls.h
  19. +++ b/include/net/pkt_cls.h
  20. @@ -395,7 +395,7 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer)
  21. {
  22. switch (layer) {
  23. case TCF_LAYER_LINK:
  24. - return skb->data;
  25. + return skb_mac_header(skb);
  26. case TCF_LAYER_NETWORK:
  27. return skb_network_header(skb);
  28. case TCF_LAYER_TRANSPORT:
  29. --
  30. 2.14.2