]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
pedit: Check for extended capability in protocol parser
authorAmir Vadai <amir@vadai.me>
Sun, 14 May 2017 08:17:45 +0000 (11:17 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 15 May 2017 22:05:20 +0000 (15:05 -0700)
Do not allow using eth and udp header types if non-extended pedit kABI
is being used. Other protocol parsers already have this check.

Signed-off-by: Amir Vadai <amir@vadai.me>
tc/p_eth.c
tc/p_udp.c

index ad3e28f80eb64128b11e65d2050dc0c43e73fcb0..2d2f96ca2f0fb1efb61cfffe71c84db4b42eb0c0 100644 (file)
@@ -34,6 +34,9 @@ parse_eth(int *argc_p, char ***argv_p,
        if (argc < 2)
                return -1;
 
+       if (!sel->extended)
+               return -1;
+
        tkey->htype = TCA_PEDIT_KEY_EX_HDR_TYPE_ETH;
 
        if (strcmp(*argv, "type") == 0) {
index a56a1b51925422f0e11f2b1d5f8f45470ca392af..3916d958604087539bb0fb86f3235409872db22c 100644 (file)
@@ -34,6 +34,9 @@ parse_udp(int *argc_p, char ***argv_p,
        if (argc < 2)
                return -1;
 
+       if (!sel->extended)
+               return -1;
+
        tkey->htype = TCA_PEDIT_KEY_EX_HDR_TYPE_UDP;
 
        if (strcmp(*argv, "sport") == 0) {