0015-net-sched-em_nbyte-don-t-add-the-data-offset-twice.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Wolfgang Bumiller <[email protected]>
  3. Date: Fri, 19 Jan 2018 11:12:37 +0100
  4. Subject: [PATCH] net: sched: em_nbyte: don't add the data offset twice
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. 'ptr' is shifted by the offset and then validated,
  9. the memcmp should not add it a second time.
  10. Signed-off-by: Wolfgang Bumiller <[email protected]>
  11. Signed-off-by: Fabian Grünbichler <[email protected]>
  12. ---
  13. net/sched/em_nbyte.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c
  16. index df3110d69585..07c10bac06a0 100644
  17. --- a/net/sched/em_nbyte.c
  18. +++ b/net/sched/em_nbyte.c
  19. @@ -51,7 +51,7 @@ static int em_nbyte_match(struct sk_buff *skb, struct tcf_ematch *em,
  20. if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len))
  21. return 0;
  22. - return !memcmp(ptr + nbyte->hdr.off, nbyte->pattern, nbyte->hdr.len);
  23. + return !memcmp(ptr, nbyte->pattern, nbyte->hdr.len);
  24. }
  25. static struct tcf_ematch_ops em_nbyte_ops = {
  26. --
  27. 2.14.2