fixed compilation error

This commit is contained in:
Joakim Eriksson 2012-02-29 16:45:05 -08:00
parent 07f6e10c1c
commit 1637a807e2

View file

@ -607,17 +607,23 @@ ifconf(const char *tundev, const char *ipaddr)
char lladdr[40];
char c, *ptr=(char *)ipaddr;
uint16_t digit,ai,a[8],cc,scc,i;
for(ai=0;ai<8;ai++) a[ai]=0;
ai=0;cc=scc=0;
for(ai=0; ai<8; ai++) {
a[ai]=0;
}
ai=0;
cc=scc=0;
while(c=*ptr++) {
if(c=='/') break;
if(c==':') {
if(cc) scc = ai;
if(cc)
scc = ai;
cc = 1;
if(++ai>7) break;
} else {
cc=0;
digit = c-'0'; if (digit > 9) digit = 10 + (c & 0xdf) - 'A';
digit = c-'0';
if (digit > 9)
digit = 10 + (c & 0xdf) - 'A';
a[ai] = (a[ai] << 4) + digit;
}
}
@ -632,10 +638,9 @@ uint16_t digit,ai,a[8],cc,scc,i;
}
}
sprintf(lladdr,"fe80::%x:%x:%x:%x",a[1]&0xfefd,a[2],a[3],a[7]);
if (timestamp) stamptime();
ssystem("ifconfig %s add %s/64", tundev, lladdr);
}
#endif /* link local */
#else