patch 'fib: fix adding default route overwriting entire table' has been queued to stable release 20.11.10

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Oct 19 01:59:27 CEST 2023


Hi,

FYI, your patch has been queued to stable release 20.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/21/23. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/a4698a6616f1f78d7d817c331f7d0239d04c9224

Thanks.

Luca Boccassi

---
>From a4698a6616f1f78d7d817c331f7d0239d04c9224 Mon Sep 17 00:00:00 2001
From: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
Date: Mon, 2 Oct 2023 15:11:48 +0000
Subject: [PATCH] fib: fix adding default route overwriting entire table

[ upstream commit ab1b927cd73e96643cfe93dc2493d03c737b59ae ]

When FIB contains any route covering last IP address
(255.255.255.255), upon adding a new default route
the entire FIB table will be overwritten with corresponding
default route next hop.

Previous fix added check for ledge against 0 for case
if default route is added as a first route, however
this check was also erroneously triggered in case when
ledge was wrapped around the address space
(this would happen if FIB contains any route covering
last possible address - 255.255.255.255).

This fix prevents wrap around from happening.

Fixes: 880bc2b5f3bd ("fib: fix adding default route")

Signed-off-by: Vladimir Medvedkin <vladimir.medvedkin at intel.com>
---
 lib/librte_fib/dir24_8.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_fib/dir24_8.c b/lib/librte_fib/dir24_8.c
index 181ed03dee..49407ba638 100644
--- a/lib/librte_fib/dir24_8.c
+++ b/lib/librte_fib/dir24_8.c
@@ -392,6 +392,12 @@ modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip,
 				return ret;
 			ledge = redge +
 				(uint32_t)(1ULL << (32 - tmp_depth));
+			/*
+			 * we got to the end of address space
+			 * and wrapped around
+			 */
+			if (ledge == 0)
+				break;
 		} else {
 			redge = ip + (uint32_t)(1ULL << (32 - depth));
 			if (ledge == redge && ledge != 0)
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-10-19 00:28:58.154503944 +0100
+++ 0038-fib-fix-adding-default-route-overwriting-entire-tabl.patch	2023-10-19 00:28:56.305806847 +0100
@@ -1 +1 @@
-From ab1b927cd73e96643cfe93dc2493d03c737b59ae Mon Sep 17 00:00:00 2001
+From a4698a6616f1f78d7d817c331f7d0239d04c9224 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ab1b927cd73e96643cfe93dc2493d03c737b59ae ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
- lib/fib/dir24_8.c | 6 ++++++
+ lib/librte_fib/dir24_8.c | 6 ++++++
@@ -28,5 +29,5 @@
-diff --git a/lib/fib/dir24_8.c b/lib/fib/dir24_8.c
-index a61897667b..c739e92304 100644
---- a/lib/fib/dir24_8.c
-+++ b/lib/fib/dir24_8.c
-@@ -388,6 +388,12 @@ modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip,
+diff --git a/lib/librte_fib/dir24_8.c b/lib/librte_fib/dir24_8.c
+index 181ed03dee..49407ba638 100644
+--- a/lib/librte_fib/dir24_8.c
++++ b/lib/librte_fib/dir24_8.c
+@@ -392,6 +392,12 @@ modify_fib(struct dir24_8_tbl *dp, struct rte_rib *rib, uint32_t ip,


More information about the stable mailing list