[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH rhel6-branch] ipoib support - write TYPE to ifcfg also for disabled devices (#660686)



Related: rhbz#660686
---
 loader/net.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index 0b0d16d..b4add2b 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -161,10 +161,10 @@ static void ipCallback(newtComponent co, void * dptr) {
  *
  * This can directly be written into the ifcfg script's TYPE= field.
  */
-static char *netArpTypeStr(iface_t *iface)
+static char *netArpTypeStr(const char *ifname)
 {
     char *ret = NULL;
-    int arptype = iface_get_arptype(iface->device);
+    int arptype = iface_get_arptype(ifname);
     switch (arptype) {
     case ARPHRD_ETHER:
         ret = strdup("Ethernet");
@@ -1236,6 +1236,9 @@ int writeDisabledIfcfgFile(char *device) {
 
     fprintf(fp, "DEVICE=%s\n", device);
     fprintf(fp, "HWADDR=%s\n", iface_mac2str(device));
+    char *str_type = netArpTypeStr(device);
+    if (str_type) fprintf(fp, "TYPE=%s\n", str_type);
+    free(str_type);
     uuid = nm_utils_uuid_generate();
     fprintf(fp, "UUID=%s\n", uuid);
     g_free(uuid);
@@ -1346,7 +1349,7 @@ int writeEnabledNetInfo(iface_t *iface) {
     fprintf(fp, "UUID=%s\n", uuid);
     g_free(uuid);
     fprintf(fp, "ONBOOT=yes\n");
-    char *str_type = netArpTypeStr(iface);
+    char *str_type = netArpTypeStr(iface->device);
     if (str_type) fprintf(fp, "TYPE=%s\n", str_type);
     free(str_type);
 
-- 
1.7.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]