|
|
36cfb7 |
From 0bc6d74ce3291b669bc05524b404bc6914dab5ba Mon Sep 17 00:00:00 2001
|
|
|
36cfb7 |
From: Kamal Heib <kheib@redhat.com>
|
|
|
36cfb7 |
Date: Thu, 9 Nov 2017 04:44:32 -0500
|
|
|
36cfb7 |
Subject: [PATCH] pedit: Check for extended capability in protocol parser
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1456539
|
|
|
36cfb7 |
|
|
|
36cfb7 |
commit a13426fe1a2b0fdebacc33820105523934eb355f
|
|
|
36cfb7 |
Author: Amir Vadai <amir@vadai.me>
|
|
|
36cfb7 |
Date: Sun May 14 11:17:45 2017 +0300
|
|
|
36cfb7 |
|
|
|
36cfb7 |
pedit: Check for extended capability in protocol parser
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Do not allow using eth and udp header types if non-extended pedit kABI
|
|
|
36cfb7 |
is being used. Other protocol parsers already have this check.
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Amir Vadai <amir@vadai.me>
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Kamal Heib <kheib@redhat.com>
|
|
|
36cfb7 |
---
|
|
|
36cfb7 |
tc/p_eth.c | 3 +++
|
|
|
36cfb7 |
tc/p_udp.c | 3 +++
|
|
|
36cfb7 |
2 files changed, 6 insertions(+)
|
|
|
36cfb7 |
|
|
|
36cfb7 |
diff --git a/tc/p_eth.c b/tc/p_eth.c
|
|
|
e138d9 |
index ad3e28f80eb64..2d2f96ca2f0fb 100644
|
|
|
36cfb7 |
--- a/tc/p_eth.c
|
|
|
36cfb7 |
+++ b/tc/p_eth.c
|
|
|
36cfb7 |
@@ -34,6 +34,9 @@ parse_eth(int *argc_p, char ***argv_p,
|
|
|
36cfb7 |
if (argc < 2)
|
|
|
36cfb7 |
return -1;
|
|
|
36cfb7 |
|
|
|
36cfb7 |
+ if (!sel->extended)
|
|
|
36cfb7 |
+ return -1;
|
|
|
36cfb7 |
+
|
|
|
36cfb7 |
tkey->htype = TCA_PEDIT_KEY_EX_HDR_TYPE_ETH;
|
|
|
36cfb7 |
|
|
|
36cfb7 |
if (strcmp(*argv, "type") == 0) {
|
|
|
36cfb7 |
diff --git a/tc/p_udp.c b/tc/p_udp.c
|
|
|
e138d9 |
index a56a1b5192542..3916d95860408 100644
|
|
|
36cfb7 |
--- a/tc/p_udp.c
|
|
|
36cfb7 |
+++ b/tc/p_udp.c
|
|
|
36cfb7 |
@@ -34,6 +34,9 @@ parse_udp(int *argc_p, char ***argv_p,
|
|
|
36cfb7 |
if (argc < 2)
|
|
|
36cfb7 |
return -1;
|
|
|
36cfb7 |
|
|
|
36cfb7 |
+ if (!sel->extended)
|
|
|
36cfb7 |
+ return -1;
|
|
|
36cfb7 |
+
|
|
|
36cfb7 |
tkey->htype = TCA_PEDIT_KEY_EX_HDR_TYPE_UDP;
|
|
|
36cfb7 |
|
|
|
36cfb7 |
if (strcmp(*argv, "sport") == 0) {
|
|
|
36cfb7 |
--
|
|
|
e138d9 |
2.21.0
|
|
|
36cfb7 |
|