BusyBox Bug and Patch Tracking

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001032 [BusyBox] major always 09-19-06 01:01 10-27-08 05:55
Reporter teg View Status public  
Assigned To BusyBox
Priority normal Resolution open  
Status feedback   Product Version
Summary 0001032: udhcp does not support ethernet aliases
Description I have multiple aliases for eth0 (eth0:1, eth0:2, etc.) and I run invidual udhcpc for each interface. Every interface will get IP address, but after a while (lease time?) when renew(?) comes, every udhcpc dies.
Additional Information
Attached Files

- Relationships

- Notes
09-19-06 01:38

When it dies, It reports:

debug, Sending renew...
error, FATAL: couldn't listen on socket, No such device
09-30-06 13:51

I recommend you to use the version of udhcp that is in busybox. AFAIK the stand-alone udhcpd currently isn't actively maintained as opposed to the version in busybox.
If you do not need any other applets from busybox, then just turn them off.

10-01-06 03:15

I AM using busybox version.
10-01-06 05:47

Reported against wrong project; Assigning to busybox.
11-27-06 12:10

Need a bit of help debugging it. It happens here:

                if (listen_mode != LISTEN_NONE && fd < 0) {
                        if (listen_mode == LISTEN_KERNEL)
                                fd = listen_socket(INADDR_ANY, CLIENT_PORT, client_config.interface);
                                fd = raw_socket(client_config.ifindex);
                        if (fd < 0) {
                                bb_perror_msg("FATAL: cannot listen on socket");
                                return 0;

Can you check that it happens in listen_socket? (Just add a printf before it).
Next, listen_socket() itself is in socket.c. Please add this line with '+'. What does this printf prints for you?

        strncpy(interface.ifr_name, inf, IFNAMSIZ);
        if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, (char *)&interface, sizeof(interface)) < 0) {
+printf("BINDTODEVICE '%s' failed\n", inf);
                return -1;
11-27-06 12:13

I'm using it on a Linksys router, but I don't have development environment currently installed. I'll try to set up that first for debugging.
11-28-06 16:16

Most likely fixed in svn. Bug is to be closed after a few weeks unless svn is reported to not work.
11-28-06 23:54

Here you are:
root@linksys2:~# ./busybox udhcpc -f -c x.x.x.x -i vlan1:7 -p /tmp/dhcp.test.pid
info, udhcpc (v0.9.9-pre) started
SIOCSIFFLAGS: Cannot assign requested address
debug, Sending discover...
debug, Sending select for x.x.x.x...
info, Lease of x.x.x.x obtained, lease time 3600
deleting routers
adding router x.x.x.x
adding dns x.x.x.x
adding dns x.x.x.x
debug, Sending renew...
Listen socket
BINDTODEVICE 'vlan1:7' failed
error, FATAL: couldn't listen on socket, No such device
10-27-08 05:55

Current svn has these routines renamed to:


I suspect on ethN:M aliases udhcp_raw_socket works, but udhcp_listen_socket does not. Can you verify it? Add "entered" / "exited ok" printouts to both functions:

int FAST_FUNC udhcp_raw_socket(int ifindex)
        int fd;
        struct sockaddr_ll sock;
bb_error_msg("raw_socket %d entered", ifindex);
bb_error_msg("raw_socket %d succeeded", ifindex);

        return fd;

(do the same for udhcp_listen_socket)

Does it indeed fail on the _first_ call to udhcp_listen_socket()?

- Issue History
Date Modified Username Field Change
09-19-06 01:01 teg New Issue
09-19-06 01:01 teg Issue Monitored: teg
09-19-06 01:38 teg Note Added: 0001636
09-30-06 13:51 bernhardf Note Added: 0001669
10-01-06 03:15 teg Note Added: 0001679
10-01-06 05:47 bernhardf Note Added: 0001681
10-01-06 05:47 bernhardf Assigned To  => BusyBox
10-01-06 05:47 bernhardf Status new => assigned
10-01-06 05:48 bernhardf Project udhcp => BusyBox
11-27-06 12:10 vda Note Added: 0001814
11-27-06 12:10 vda Status assigned => feedback
11-27-06 12:13 teg Note Added: 0001816
11-28-06 16:16 vda Note Added: 0001829
11-28-06 23:54 teg Note Added: 0001831
10-27-08 05:55 vda Note Added: 0014334

Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker