ifconfig problem of busybox 1.4.1?
Denis Vlasenko
vda.linux at googlemail.com
Thu Mar 22 18:20:45 UTC 2007
On Thursday 22 March 2007 01:09, Reeve Yang wrote:
> If I run ifconfig command with "inet" parameter, I got following message:
>
> fconfig eth0 inet 10.1.0.2
> ifconfig: inet: Resolver Error 0 (no error)
>
> And the ip address is not added onto the interface. Does anyone has
> clue what's going on here?
No.
> On busybox 1.2.1 there is no problem.
1.2.1 was way too permissive. It simply skipped any keywords
it didn't understand:
# ./busybox ifconfig lo die bitch die 127.0.0.2
# ./busybox ifconfig -a
lo Link encap:Local Loopback
inet addr:127.0.0.2 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1902 errors:0 dropped:0 overruns:0 frame:0
TX packets:1902 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:120952 (118.1 KiB) TX bytes:120952 (118.1 KiB)
"inet" and "inet6" will be likewise ignored.
Code below. Note how it doesn't die if gethostbyname returned error?
} else if (inet_aton(host, &sai.sin_addr) == 0) {
/* It's not a dotted quad. */
struct hostent *hp;
if ((hp = gethostbyname(host)) == (struct hostent *)NULL) {
++goterr;
continue;
}
memcpy((char *) &sai.sin_addr, (char *) hp->h_addr_list[0],
sizeof(struct in_addr));
}
I can reinstate old behavior if this is considered 'better'.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/x-gzip
Size: 3475 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070322/dbc80945/attachment-0002.bin
More information about the busybox
mailing list