diff --git a/src/install+setup/libsmooth/libsmooth.h b/src/install+setup/libsmooth/libsmooth.h index f32915cec..c19f5bdac 100644 --- a/src/install+setup/libsmooth/libsmooth.h +++ b/src/install+setup/libsmooth/libsmooth.h @@ -100,7 +100,7 @@ int clear_card_entry(int cards); int ask_clear_card_entry(int cards); int manualdriver(char *driver, char *driveroptions); -/* data.c */ +/* varval.c */ struct keyvalue *initkeyvalues(void); void freekeyvalues(struct keyvalue *head); int readkeyvalues(struct keyvalue *head, char *filename); diff --git a/src/install+setup/libsmooth/netstuff.c b/src/install+setup/libsmooth/netstuff.c index ad0141a37..b124cd9c0 100644 --- a/src/install+setup/libsmooth/netstuff.c +++ b/src/install+setup/libsmooth/netstuff.c @@ -354,6 +354,17 @@ void strupper(unsigned char *string) } */ +int ismacaddr(unsigned int *ismac) +{ + unsigned int *a; + + for (a = ismac; *a; a++) + if (*a != ':' && !isxdigit(*a)) return 0; // is int != ':' or not hexdigit then exit + + return 1; +} + + int write_configs_netudev(int card , int colour) { #define UDEV_NET_CONF "/etc/udev/rules.d/30-persistent-network.rules" @@ -433,7 +444,9 @@ int scan_network_cards(void) strcpy(driver, strtok(temp_line,";")); strcpy(description, strtok(NULL,";")); strcpy(macaddr, strtok(NULL,";")); + fprintf(flog,"Check 4 MacAddr.\n"); // #### Debug #### if ( strlen(macaddr) ) { +// if ( ismacaddr(&macaddr) ) { strcpy(nics[count].driver , driver ); strcpy(nics[count].description , description ); strcpy(nics[count].macaddr , macaddr ); @@ -486,8 +499,10 @@ int nicmenu(int colour) if ( strlen(nics[i].description) < 55 ) sprintf(MenuInhalt[mcount], "%.*s", strlen(nics[i].description)-2, nics[i].description+1); else { + fprintf(flog,"Modify string 4 display.\n"); // #### Debug #### sprintf(cMenuInhalt, "%.50s", nics[i].description + 1); - strncpy(MenuInhalt[mcount], cMenuInhalt,(strrchr(cMenuInhalt,' ') - cMenuInhalt)); +// strncpy(MenuInhalt[mcount], cMenuInhalt,(strrchr(cMenuInhalt,' ') - cMenuInhalt)); + sprintf(MenuInhalt[mcount], "%.*s", strlen(strrchr(cMenuInhalt,' ')), cMenuInhalt); strcat (MenuInhalt[mcount], "..."); }