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

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