[BusyBox 0001601]: No (or wrong) support for virtual interfaces in ifup, ifdown, /etc/network/interfaces.

bugs at busybox.net bugs at busybox.net
Fri Nov 23 08:35:25 UTC 2007


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=1601 
====================================================================== 
Reported By:                iggarpe
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1601
Category:                   Networking Support
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             11-21-2007 08:10 PST
Last Modified:              11-23-2007 00:35 PST
====================================================================== 
Summary:                    No (or wrong) support for virtual interfaces in
ifup, ifdown, /etc/network/interfaces.
Description: 
If you define, for example, interface eth0:0 as follows in
/etc/network/interfaces:

iface eth0 inet static

iface eth0:0 inet static
    address 192.168.100.10
    netmask 255.255.255.0

And then you try to activate it with "ifup eth0:0", ifup will NOT complain
about anything but will actually configure eth0 instead of eth0:0.

(it will configure eth0 using the configuration specified for eth0:0)
====================================================================== 

---------------------------------------------------------------------- 
 iggarpe - 11-21-07 10:10  
---------------------------------------------------------------------- 
The following code snippet is from file networking/ifupdown.c, function
get_var:

    if (strncmpz(id, "iface", idlen) == 0) {
        char *result;
        static char label_buf[20];
        safe_strncpy(label_buf, ifd->iface, sizeof(label_buf));
        result = strchr(label_buf, ':');
        if (result) {
            *result = '\0';
        }
        return label_buf;
    }

Clearly it is intentionally ripping off the virtual interface suffic ":n",
and that's the reason "ifup eth0:0" will wrongly issue commands for eth0
instead of eth0:0.

Any ideas about why the code is removing the ":n" ???

(I just checked and the ifup that comes with my ubuntu development machine
works as espected, properly issuing commands and configuring virtual
interfaces) 

---------------------------------------------------------------------- 
 vda - 11-22-07 18:54  
---------------------------------------------------------------------- 
Nice bug report.

Please try removing this:

        result = strchr(label_buf, ':');
        if (result) {
            *result = '\0';
        }

Does it work now? 

---------------------------------------------------------------------- 
 iggarpe - 11-23-07 00:21  
---------------------------------------------------------------------- 
Indeed I tried to remove that code even before attaching the note and it
works fine, as expected.

In the note I just point out where I think the problem is because it is so
obviously not a bug, but that the programmer INTENTIONALLY removed the
colon and number for virtual interfaces, so I though there might be a good
reason to it.

I´ve been using the modified code since yesterday and no problem. 

---------------------------------------------------------------------- 
 vda - 11-23-07 00:35  
---------------------------------------------------------------------- 
Did that in svn, thanks. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-21-07 08:10  iggarpe        New Issue                                    
11-21-07 08:10  iggarpe        Status                   new => assigned     
11-21-07 08:10  iggarpe        Assigned To               => BusyBox         
11-21-07 10:10  iggarpe        Note Added: 0002945                          
11-22-07 18:54  vda            Note Added: 0002949                          
11-22-07 18:54  vda            Status                   assigned => feedback
11-23-07 00:21  iggarpe        Note Added: 0002950                          
11-23-07 00:35  vda            Status                   feedback => closed  
11-23-07 00:35  vda            Note Added: 0002951                          
======================================================================




More information about the busybox-cvs mailing list