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

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