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

ba9f1f
From 0a6bfc42945419eba5ed92c10ae722625a2ccb05 Mon Sep 17 00:00:00 2001
b56ae6
From: Mohammed Gamal <mgamal@redhat.com>
b56ae6
Date: Tue, 8 Nov 2022 16:20:17 +0100
ba9f1f
Subject: [PATCH 1/3] redhat: hv_set_if_config: Workaround for gateway
ba9f1f
 numbering in NetworkManager
b56ae6
b56ae6
RH-Author: Mohamed Gamal Morsy <mmorsy@redhat.com>
ba9f1f
RH-MergeRequest: 4: redhat: hv_set_if_config: Workaround for gateway numbering in NetworkManager
ba9f1f
RH-Bugzilla: 2142028
b56ae6
RH-Acked-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
ba9f1f
RH-Acked-by: Cathy Avery <cavery@redhat.com>
ba9f1f
RH-Commit: [1/1] 85b28bc13239a64b7a200ca4edb83ac5d0fe5ebd
b56ae6
ba9f1f
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2142028
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