Bug 2044189 - network-scripts-10.13 is broken in Fedora 35
Summary: network-scripts-10.13 is broken in Fedora 35
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: 35
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Jan Macku
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-24 07:55 UTC by thomas.bartschies
Modified: 2022-02-04 01:19 UTC (History)
16 users (show)

Fixed In Version: initscripts-10.14-1.fc35
Clone Of:
Environment:
Last Closed: 2022-02-04 01:19:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-sysv initscripts pull 412 0 None open ifup-routes: Revert quotes 2022-01-24 11:24:01 UTC

Description thomas.bartschies 2022-01-24 07:55:39 UTC
Description of problem:
network-scripts 10.13 Update changed the handling of routes from a route-<interface> file. Now any route coming from such a file triggers the ip route add
Error: any valid prefix is expected rather than "..."

Reason is, that the ip route add command in ifup-routes handle_file function
now encloses the $line variable in double quotes. In v10.11 the route was
added without them. The ip command now interpretes the complete route as
it's first command line parameter, which is incorrect

Here are the problematic changes:
--- ifup-routes.R       2021-08-27 09:55:06.000000000 +0200
+++ ifup-routes 2022-01-13 09:08:43.000000000 +0100
@@ -2,6 +2,8 @@
 #
 # adds static routes which go through device $1

+. /etc/sysconfig/network-scripts/network-functions
+
 if [ -z "$1" ]; then
     echo $"usage: ifup-routes <net-device> [<nickname>]"
     exit 1
@@ -19,7 +21,12 @@
             line="$line via $(eval echo '$'GATEWAY$routenum)"
         fi
         line="$line dev $2"
-        /sbin/ip route add $line
+
+        /sbin/ip route add "$line" || {
+            net_log $"Failed to add route ${line}, using ip route replace instead." warning
+            /sbin/ip route replace "$line"
+        }
+
         routenum=$(($routenum+1))
     done
 }
@@ -34,7 +41,10 @@
     fi
     { cat "$file" ; echo ; } | while read line; do
         if [[ ! "$line" =~ $MATCH ]]; then
-            /sbin/ip $proto $type add $line
+            /sbin/ip $proto "$type" add "$line" || {
+                net_log $"Failed to add ${type} ${line}, using ip ${type} replace instead." warning
+                /sbin/ip $proto "$type" replace "$line"
+            }
         fi
     done
 }

Version-Release number of selected component (if applicable):
network-scripts 10.13

How reproducible:
ifup-routes <interface>

Steps to Reproduce:
1. add routes via ifup-routes
2. or restart system
3.

Actual results:
No static routes are added at all.

Expected results:
Static routes are added.

Additional info:

Comment 1 Jan Macku 2022-01-24 08:17:57 UTC
Hi, I'm aware of this issue and I'm working on solution.

Comment 2 thomas.bartschies 2022-01-24 08:38:04 UTC
The fix is simple. Just remove the double quotes around the $line variable. This restores the previous behaviour from v10.11.
I've already done this in my installation and tested it successfully.

Comment 3 Fedora Update System 2022-01-24 12:15:23 UTC
FEDORA-2022-850adec1a6 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-850adec1a6

Comment 4 Fedora Update System 2022-01-25 02:10:19 UTC
FEDORA-2022-850adec1a6 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-850adec1a6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-850adec1a6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 thomas.bartschies 2022-01-27 06:16:01 UTC
version 10.14 works again.

Comment 6 Fedora Update System 2022-02-04 01:19:51 UTC
FEDORA-2022-850adec1a6 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.