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

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