commit:     ba522492a3f9e057867f4d7f1d2491cd3a7dbfc3
Author:     Alexander Zubkov <green <AT> qrator <DOT> net>
AuthorDate: Sat Sep 28 19:54:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 00:28:25 2024 +0000
URL:        https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=ba522492

net: iproute2: fix missing quotes in test

Missing quotes cause incorrect evaluation of an empty string, causing
the expression to be always true. Thus every route is considered "nodev"
route, causing problems in cases where specific dev is required.

Original "nodev" patch 7c6a8de0 contained bashism that forgave missing
quoutes. But later it was fixed by 97a79cfd, and the missing quotes
became critical.

Signed-off-by: Alexander Zubkov <green <AT> qrator.net>
Closes: https://bugs.gentoo.org/940443
X-Gentoo-Bug: 940443
X-Gentoo-Bug-URL: https://bugs.gentoo.org/940443
Closes: https://github.com/gentoo/netifrc/pull/58
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net/iproute2.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/iproute2.sh b/net/iproute2.sh
index ca43496..4abc47c 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -290,7 +290,7 @@ _add_route()
 
        # Process dev vs nodev routes
        # Positional parameters are used for correct array handling
-       if [ -n ${rtype} ]; then
+       if [ -n "${rtype}" ]; then
                local nodev_routes="$(service_get_value "nodev_routes")"
                service_set_value "nodev_routes" "${nodev_routes}
 ${family} route del ${rtype} ${cmd}"

Reply via email to