[Bug 5786] New: ifconfig oddly won't respect CIDR notation

bugzilla at busybox.net bugzilla at busybox.net
Thu Dec 13 18:27:07 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=5786

           Summary: ifconfig oddly won't respect CIDR notation
           Product: Busybox
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: jovan at janevski.net
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Hello,

I am using TinyCoreLinux, kernel 3.0.21-tinycore with BusyBox v1.20.1 installed
on it.

If i try to assign interface IP and subnet within the 192.168.0.0/16 subnet
using for example:
----
ifconfig eth4 up 192.168.1.1/24
----
My specified CIDR notation is respected and i get 192.168.1.1/24:
----
ifconfig eth4
eth4      Link encap:Ethernet  HWaddr 00:00:E8:XX:XX:XX 
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: XXXX::XXX:XXXX:XX:XX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:266 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22874 (22.3 KiB)  TX bytes:4338 (4.2 KiB)
          Interrupt:18 Base address:0xba00
----

But if i try to assign interface IP and subnet within 172.16.0.0/12, 10.0.0.0/8
or other subnets using for example:
----
ifconfig eth4 up 172.16.2.1/24
====and====
ifconfig eth4 up 10.0.0.1/24
----
Then my specified CIRD notation is not respected and i get 172.16.2.1/12 and
10.0.0.1/8 instead:
----
ifconfig eth4
eth4      Link encap:Ethernet  HWaddr 00:00:E8:XX:XX:XX
          inet addr:172.16.2.1  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: XXXX::XXX:XXXX:XX:XX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:296 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24674 (24.0 KiB)  TX bytes:4338 (4.2 KiB)
          Interrupt:18 Base address:0xba00 
====and====
eth4      Link encap:Ethernet  HWaddr 00:00:E8:XX:XX:XX 
          inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          inet6 addr: XXXX::XXX:XXXX:XX:XX/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:296 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24674 (24.0 KiB)  TX bytes:4338 (4.2 KiB)
          Interrupt:18 Base address:0xba00
----

The same problem happens if i try to assign 1.1.1.1/24 instead i get 1.1.1.1/8.

I've tested the commands on Debian 6.0.5 both 32 and 64 bit with the standard
ifconfig tool (non-busybox) it works without any problems.

The only way to get the proper IP and subnet assignment per interface while
using busybox is - instead of using:
----
ifconfig eth4 up 172.16.2.1/24
----
i could use:
----
ifconfig eth4 172.16.2.1 netmask 255.255.255.0 broadcast 172.16.2.255
----
And then i get the propper IP and subnet assignment.

Any help regarding this problem is appreciated.

Best Regards,
Jovan

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list