[2/9] static-routes: Fixes bug12763

Message ID 20240411150108.21573-2-adolf.belka@ipfire.org
State Staged
Commit e33ee46e621eb6967c954a9d3b4683880e372579
Headers
Series [1/9] ipsec-interfaces: Fixes bug12763 |

Commit Message

Adolf Belka April 11, 2024, 3:01 p.m. UTC
  - This ensures that all ip route and ip rule commands are redirected to null if the output
   is not used to feed into a variable.
- This will prevent any error messages related to empty iproute tables being displayed
   during boot.
- Tested on my vm system and confirmed that the fix in ipsec-interfaces stops the "FIB
   table does not exist" and "RTNETLINK answers: no such file or directory" messages during
   boot.

Fixes: Bug#12763
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 src/initscripts/system/static-routes | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/src/initscripts/system/static-routes b/src/initscripts/system/static-routes
index 85785e9af..9aacc8db5 100644
--- a/src/initscripts/system/static-routes
+++ b/src/initscripts/system/static-routes
@@ -29,14 +29,14 @@  function init_table() {
 		return
 	fi
 
-	ip rule add table static
+	ip rule add table static >/dev/null 2>&1
 }
 
 function create_all_routes() {
 	local file=${1}
 	shift
 
-	# Remote all routes.
+	# Remove all routes.
 	ip route flush table static >/dev/null 2>&1
 
 	local status
@@ -54,7 +54,7 @@  function create_all_routes() {
 			continue
 		fi
 
-		ip route add ${network} via ${gateway} table static proto static
+		ip route add ${network} via ${gateway} table static proto static >/dev/null 2>&1
 	done < ${file}
 }