]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/install+setup/libsmooth/netstuff.c
Rootfile update.
[ipfire-2.x.git] / src / install+setup / libsmooth / netstuff.c
index 46e49c01b368afcce164dc93a2cef934e0db20c9..8c6f3fa90f7158a946912d9fa483b1dbf7015085 100644 (file)
@@ -221,7 +221,14 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag,
                                setnetaddress(kv, colour);
                                result = 1;
                        }
-               }                       
+               }
+               /* Workaround for a bug that dhcp radiobutton also end the dialog at arm
+               */
+               else {
+                       if (es.u.co != cancel) {
+                               error = 1;
+                       }
+               }
        }
        while (error);
 
@@ -322,7 +329,7 @@ void networkdialogcallbacktype(newtComponent cm, void *data)
                newtEntrySetFlags(dhcpforcemtuentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);               
        }
        newtRefresh();
-       newtDrawForm(networkform);      
+       newtDrawForm(networkform);
 }
 
 int interfacecheck(struct keyvalue *kv, char *colour)
@@ -525,7 +532,7 @@ int create_udev(void)
        for (i = 0 ; i < 4 ; i++)
        {
                if (strcmp(knics[i].macaddr, "")) {
-                       fprintf(fp,"ACTION==\"add\", SUBSYSTEM==\"net\", SYSFS{type}==\"1\", SYSFS{address}==\"%s\", NAME=\"%s0\" # %s\n", knics[i].macaddr, lcolourcard[i], knics[i].description);
+                       fprintf(fp,"\n# %s\nACTION==\"add\", SUBSYSTEM==\"net\", ATTR{type}==\"1\", ATTR{address}==\"%s\", NAME=\"%s0\"\n", knics[i].description, knics[i].macaddr, lcolourcard[i]);
                }
        }
        fclose(fp);
@@ -608,6 +615,7 @@ int nicmenu(int colour)
        int rc, choise = 0, count = 0, kcount = 0, mcount = 0, i, j, nic_in_use;
        int found_NIC_as_Card[4];
        char message[STRING_SIZE];
+       char temp[STRING_SIZE];
 
        char cMenuInhalt[STRING_SIZE];
        char MenuInhalt[20][180];
@@ -650,8 +658,20 @@ int nicmenu(int colour)
                pMenuInhalt[mcount] = NULL;
 
                sprintf(message, ctr[TR_CHOOSE_NETCARD], ucolourcard[colour]);
-               rc = newtWinMenu( ctr[TR_NETCARDMENU2], message, 50, 5, 5, 6, pMenuInhalt, &choise, ctr[TR_OK], ctr[TR_SELECT], ctr[TR_CANCEL], NULL);
-                               
+               rc=2;
+               while ( rc == 2 ) {
+                       rc = newtWinMenu( ctr[TR_NETCARDMENU2], message, 50, 5, 5, 6, pMenuInhalt, &choise, ctr[TR_SELECT], ctr[TR_IDENTIFY], ctr[TR_CANCEL], NULL);
+                       if ( rc == 2 ) {
+                               sprintf(temp, "/sbin/ip link set %s up", nics[found_NIC_as_Card[choise]].nic);
+                               mysystem(temp);
+                               sprintf(temp, "/usr/sbin/ethtool -p %s 10", nics[found_NIC_as_Card[choise]].nic);
+                               if (runcommandwithstatus(temp,ctr[TR_IDENTIFY_SHOULD_BLINK]) != 0) {      
+                                       errorbox(ctr[TR_IDENTIFY_NOT_SUPPORTED]);
+                               sprintf(temp, "/sbin/ip link set %s down", nics[found_NIC_as_Card[choise]].nic);
+                               mysystem(temp);
+                               }
+                       }
+               }
                if ( rc == 0 || rc == 1) {
                        write_configs_netudev(found_NIC_as_Card[choise], colour);
                }