Blame SOURCES/0030-pedit-Check-for-extended-capability-in-protocol-pars.patch

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