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