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