From: Roman Mashak <mrv@mojatatu.com>
Date: Wed, 27 Jun 2018 13:33:33 -0400
Subject: net sched actions: use sizeof operator for buffer length
Patch-mainline: v4.19-rc1
Git-commit: 6ff7586e382cb4274adefd56501d428ea39a5af3
References: bsc#1109837
Replace constant integer with sizeof() to clearly indicate
the destination buffer length in skb_header_pointer() calls.
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
net/sched/act_pedit.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -319,7 +319,7 @@ static int tcf_pedit(struct sk_buff *skb
goto bad;
}
d = skb_header_pointer(skb, hoffset + tkey->at,
- 1, &_d);
+ sizeof(_d), &_d);
if (!d)
goto bad;
offset += (*d & tkey->offmask) >> tkey->shift;
@@ -337,7 +337,7 @@ static int tcf_pedit(struct sk_buff *skb
}
ptr = skb_header_pointer(skb, hoffset + offset,
- 4, &hdata);
+ sizeof(hdata), &hdata);
if (!ptr)
goto bad;
/* just do it, baby */