[BusyBox 0001032]: udhcp does not support ethernet aliases

bugs at busybox.net bugs at busybox.net
Mon Oct 27 12:55:54 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1032 
====================================================================== 
Reported By:                teg
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1032
Category:                   
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     feedback
====================================================================== 
Date Submitted:             09-19-2006 01:01 PDT
Last Modified:              10-27-2008 05:55 PDT
====================================================================== 
Summary:                    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.
====================================================================== 

---------------------------------------------------------------------- 
 teg - 09-19-06 01:38  
---------------------------------------------------------------------- 
When it dies, It reports:

debug, Sending renew...
error, FATAL: couldn't listen on socket, No such device 

---------------------------------------------------------------------- 
 bernhardf - 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.

HTH 

---------------------------------------------------------------------- 
 teg - 10-01-06 03:15  
---------------------------------------------------------------------- 
I AM using busybox version. 

---------------------------------------------------------------------- 
 bernhardf - 10-01-06 05:47  
---------------------------------------------------------------------- 
Reported against wrong project; Assigning to busybox. 

---------------------------------------------------------------------- 
 vda - 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);
                        else
                                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);
                close(fd);
                return -1;
        } 

---------------------------------------------------------------------- 
 teg - 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. 

---------------------------------------------------------------------- 
 vda - 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. 

---------------------------------------------------------------------- 
 teg - 11-28-06 23:54  
---------------------------------------------------------------------- 
Here you are:
root at 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 

---------------------------------------------------------------------- 
 vda - 10-27-08 05:55  
---------------------------------------------------------------------- 
Current svn has these routines renamed to:

udhcp_raw_socket
udhcp_listen_socket

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                          
======================================================================




More information about the busybox-cvs mailing list