[3/9] red: Fixes bug12763

Message ID 20240411150108.21573-3-adolf.belka@ipfire.org
State Staged
Commit 9c28cd59c1b4f535382e5e4e7952d921af8cc03b
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 if an empty table is accessed.

Fixes: Bug#12763
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
---
 src/initscripts/networking/red | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
index beb665e5f..51bf95a43 100644
--- a/src/initscripts/networking/red
+++ b/src/initscripts/networking/red
@@ -129,10 +129,10 @@  case "${1}" in
 			touch /var/ipfire/red/active
 
 			# Create route to default gateway
-			ip route add ${GATEWAY} dev ${DEVICE}
+			ip route add ${GATEWAY} dev ${DEVICE} >/dev/null 2>&1
 
 			boot_mesg "Setting up default gateway ${GATEWAY}..."
-			ip route add default via ${GATEWAY} dev ${DEVICE}
+			ip route add default via ${GATEWAY} dev ${DEVICE} >/dev/null 2>&1
 			evaluate_retval
 
 			if [ -d "/sys/class/net/${DEVICE}" ]; then