Kleine Änderung beim erstellen der Auswahlzeile im Setup.

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@611 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
casemaster
2007-06-05 21:24:58 +00:00
parent 8e58bd3706
commit d10e55d104
2 changed files with 17 additions and 2 deletions

View File

@@ -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);

View File

@@ -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], "...");
}