Commit 6ff7586e authored by Roman Mashak's avatar Roman Mashak Committed by David S. Miller

net sched actions: use sizeof operator for buffer length

Replace constant integer with sizeof() to clearly indicate
the destination buffer length in skb_header_pointer() calls.
Reviewed-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarRoman Mashak <mrv@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 544377cd
...@@ -319,7 +319,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, ...@@ -319,7 +319,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
goto bad; goto bad;
} }
d = skb_header_pointer(skb, hoffset + tkey->at, d = skb_header_pointer(skb, hoffset + tkey->at,
1, &_d); sizeof(_d), &_d);
if (!d) if (!d)
goto bad; goto bad;
offset += (*d & tkey->offmask) >> tkey->shift; offset += (*d & tkey->offmask) >> tkey->shift;
...@@ -337,7 +337,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a, ...@@ -337,7 +337,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
} }
ptr = skb_header_pointer(skb, hoffset + offset, ptr = skb_header_pointer(skb, hoffset + offset,
4, &hdata); sizeof(hdata), &hdata);
if (!ptr) if (!ptr)
goto bad; goto bad;
/* just do it, baby */ /* just do it, baby */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment