]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net sched actions: avoid bitwise operation on signed value in pedit
authorRoman Mashak <mrv@mojatatu.com>
Wed, 27 Jun 2018 17:33:35 +0000 (13:33 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Jun 2018 13:12:03 +0000 (22:12 +0900)
Since char can be unsigned or signed, and bitwise operators may have
implementation-dependent results when performed on signed operands,
declare 'u8 *' operand instead.

Suggested-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_pedit.c

index caa6927a992c19fcb4c7cae2c6eec0aac7c1f5c4..ab151346d3d45a754046f239642e1fa6b3e16808 100644 (file)
@@ -311,7 +311,7 @@ static int tcf_pedit(struct sk_buff *skb, const struct tc_action *a,
                        }
 
                        if (tkey->offmask) {
-                               char *d, _d;
+                               u8 *d, _d;
 
                                if (!offset_valid(skb, hoffset + tkey->at)) {
                                        pr_info("tc action pedit 'at' offset %d out of bounds\n",