lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230510-dcb-rewr-v1-4-83adc1f93356@microchip.com>
Date: Mon, 22 May 2023 20:41:07 +0200
From: Daniel Machon <daniel.machon@...rochip.com>
To: <netdev@...r.kernel.org>
CC: <dsahern@...nel.org>, <stephen@...workplumber.org>, <petrm@...dia.com>,
	<UNGLinuxDriver@...rochip.com>, <daniel.machon@...rochip.com>
Subject: [PATCH iproute2-next 4/9] dcb: app: modify
 dcb_app_table_remove_replaced() for dcb-rewr reuse

When doing a replace command, entries are checked against selector and
protocol. Rewrite requires the check to be against selector and
priority.

Modify the existing dcb_app_table_remove_replace function for dcb-rewr
reuse, by using the newly introduced dcbnl attribute in the
dcb_app_table struct.

Signed-off-by: Daniel Machon <daniel.machon@...rochip.com>
---
 dcb/dcb_app.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/dcb/dcb_app.c b/dcb/dcb_app.c
index 9bb64f32e12e..23d6bb2a0013 100644
--- a/dcb/dcb_app.c
+++ b/dcb/dcb_app.c
@@ -160,15 +160,27 @@ void dcb_app_table_remove_replaced(struct dcb_app_table *a,
 		for (ib = 0; ib < b->n_apps; ib++) {
 			const struct dcb_app *ab = &b->apps[ib];
 
-			if (aa->selector == ab->selector &&
-			    aa->protocol == ab->protocol)
-				present = true;
-			else
+			if (aa->selector != ab->selector)
 				continue;
 
-			if (aa->priority == ab->priority) {
-				found = true;
-				break;
+			if (a->attr == DCB_ATTR_IEEE_APP_TABLE) {
+				if (aa->protocol == ab->protocol)
+					present = true;
+				else
+					continue;
+				if (aa->priority == ab->priority) {
+					found = true;
+					break;
+				}
+			} else {
+				if (aa->priority == ab->priority)
+					present = true;
+				else
+					continue;
+				if (aa->protocol == ab->protocol) {
+					found = true;
+					break;
+				}
 			}
 		}
 

-- 
2.34.1


Powered by blists - more mailing lists