diff options
author | Wolfgang Bumiller <w.bumiller@proxmox.com> | 2018-01-18 05:32:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-24 14:52:40 -0500 |
commit | 560a66075d694e6ec24c60967b4d93d97cbb33d1 (patch) | |
tree | 40797c0285b08660a2189da110ec2a18f897adb0 | |
parent | 1ecdaea02ca6bfacf2ecda500dc1af51e9780c42 (diff) |
net: sched: em_nbyte: don't add the data offset twice
'ptr' is shifted by the offset and then validated,
the memcmp should not add it a second time.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/em_nbyte.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/em_nbyte.c b/net/sched/em_nbyte.c index df3110d69585..07c10bac06a0 100644 --- a/net/sched/em_nbyte.c +++ b/net/sched/em_nbyte.c | |||
@@ -51,7 +51,7 @@ static int em_nbyte_match(struct sk_buff *skb, struct tcf_ematch *em, | |||
51 | if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len)) | 51 | if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len)) |
52 | return 0; | 52 | return 0; |
53 | 53 | ||
54 | return !memcmp(ptr + nbyte->hdr.off, nbyte->pattern, nbyte->hdr.len); | 54 | return !memcmp(ptr, nbyte->pattern, nbyte->hdr.len); |
55 | } | 55 | } |
56 | 56 | ||
57 | static struct tcf_ematch_ops em_nbyte_ops = { | 57 | static struct tcf_ematch_ops em_nbyte_ops = { |