net/sched: cls_flower: Use a proper mask value for enc key id parameter
authorHadar Hen Zion <hadarh@mellanox.com>
Tue, 27 Sep 2016 08:21:18 +0000 (11:21 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Sep 2016 07:11:22 +0000 (03:11 -0400)
The current code use the encapsulation key id value as the mask of that
parameter which is wrong. Fix that by using a full mask.

Fixes: bc3103f1ed40 ('net/sched: cls_flower: Classify packet in ip tunnels')
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Acked-by: Amir Vadai <amir@vadai.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_flower.c

index 2af09c872a1a2bce264ab2ef3b401332aec0aaca..f6f40fba599bad3d1db4bb14fcc4f7d663d128bc 100644 (file)
@@ -481,7 +481,7 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
        }
 
        fl_set_key_val(tb, &key->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID,
-                      &mask->enc_key_id.keyid, TCA_FLOWER_KEY_ENC_KEY_ID,
+                      &mask->enc_key_id.keyid, TCA_FLOWER_UNSPEC,
                       sizeof(key->enc_key_id.keyid));
 
        return 0;
@@ -919,7 +919,7 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
                goto nla_put_failure;
 
        if (fl_dump_key_val(skb, &key->enc_key_id, TCA_FLOWER_KEY_ENC_KEY_ID,
-                           &mask->enc_key_id, TCA_FLOWER_KEY_ENC_KEY_ID,
+                           &mask->enc_key_id, TCA_FLOWER_UNSPEC,
                            sizeof(key->enc_key_id)))
                goto nla_put_failure;