Blame SOURCES/hpvd-redhat-hv_set_if_config-Workaround-for-gateway-numbe.patch

b56ae6
From 8acc8ecc93352bfb3d78e8d37c5ed03a4948a39d Mon Sep 17 00:00:00 2001
b56ae6
From: Mohammed Gamal <mgamal@redhat.com>
b56ae6
Date: Tue, 8 Nov 2022 16:20:17 +0100
b56ae6
Subject: [PATCH] redhat: hv_set_if_config: Workaround for gateway numbering in
b56ae6
 NetworkManager
b56ae6
b56ae6
RH-Author: Mohamed Gamal Morsy <mmorsy@redhat.com>
b56ae6
RH-MergeRequest: 10: redhat: hv_set_if_config: Workaround for gateway numbering in NetworkManager
b56ae6
RH-Bugzilla: 2150255
b56ae6
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
b56ae6
RH-Acked-by: Jon Maloy <jmaloy@redhat.com>
b56ae6
RH-Commit: [1/1] a52af3c2a8c4365cbe6777fe1afe4ebcf81954d6
b56ae6
b56ae6
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2150255
b56ae6
b56ae6
Unlike older sysconfig scripts, NetworkManager expects GATEWAYx=ipaddr for all values of x.
b56ae6
So the first gateway is GATEWAY0 instead of GATEWAY. Other values should remain unchanged.
b56ae6
Workaround this by replacing GATEWAY= with GATEWAY0=.
b56ae6
b56ae6
A proper fix however, would be to generate NetworkManager keyfiles instead of ifcfg files.
b56ae6
That can be done eitter by changing hypervkvpd code to do that or to let the script parse
b56ae6
ifcfg files and generate corresponding NetworkManager keyfiles
b56ae6
b56ae6
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
b56ae6
---
b56ae6
 hv_set_ifconfig.sh | 4 ++++
b56ae6
 1 file changed, 4 insertions(+)
b56ae6
b56ae6
diff --git a/hv_set_ifconfig.sh b/hv_set_ifconfig.sh
b56ae6
index 146829b..fe7fccf 100644
b56ae6
--- a/hv_set_ifconfig.sh
b56ae6
+++ b/hv_set_ifconfig.sh
b56ae6
@@ -54,6 +54,10 @@ echo "IPV6INIT=yes" >> $1
b56ae6
 echo "PEERDNS=yes" >> $1
b56ae6
 echo "ONBOOT=yes" >> $1
b56ae6
 
b56ae6
+#Unlike older sysconfig scripts, NetworkManager expects GATEWAYx=ipaddr for all values of x.
b56ae6
+#So the first gateway is GATEWAY0 instead of GATEWAY. Other values should remain unchanged.
b56ae6
+#Workaround this by replacing GATEWAY= with GATEWAY0=.
b56ae6
+sed -i "s/GATEWAY=/GATEWAY0=/" $1
b56ae6
 
b56ae6
 cp $1 /etc/sysconfig/network-scripts/
b56ae6
 
b56ae6
-- 
b56ae6
2.37.3
b56ae6