BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000980 [BusyBox] Standards Compliance minor always 08-03-06 00:44 11-30-06 02:03
Reporter robang74 View Status public  
Assigned To BusyBox
Priority normal Resolution open  
Status feedback   Product Version 1.1.x
Summary 0000980: patch to avoid "broadcast +" syntax
Description Automatic calculation of broadcast could be done if IP and netmask is defined.
Busybox's ifconfig made it only if "broadcast +" is specified which is not a common use of ifconfig. This patch fix this behaviure and mantain "broadcast +" syntax for back compatibilty which those scripts still using it.
Additional Information
Attached Files  busybox-1.1.3-ifconfig.patch [^] (3,722 bytes) 08-03-06 00:44
 busybox-1.2.2.1-ifconfig_2.patch [^] (3,752 bytes) 11-27-06 10:27
 busybox-1.2.2.1-vda_coding.patch [^] (578 bytes) 11-27-06 10:27
 busybox-1.2.2.1-ifconfig_3.patch [^] (3,807 bytes) 11-27-06 12:31
 busybox-20061130-ifconfig_3.patch [^] (2,618 bytes) 11-30-06 01:50
 busybox-network-config.patch [^] (492 bytes) 11-30-06 02:03

- Relationships

- Notes
(0001755)
vda
11-21-06 05:17

Do I understand you correctly that "standard" ifconfig automatically deduces bcast addr while bbox's requires "broadcast +" on the command line.

And BTW, why ifconfig insists on continuing on errors, sometimes even without error message? It's more natural and probably better to bail out with error message on stderr...
 
(0001764)
vda
11-21-06 12:27

/bin/ifconfig is busybox'ed,
/usr/bin/ifconfig is "standard"

Both work without "broadcast +" syntax.

bash-3.2# ip a l dev if
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:17:6d:77:db brd ff:ff:ff:ff:ff:ff
bash-3.2# ip a f dev if
bash-3.2# /usr/bin/ifconfig if 192.168.1.111 netmask 255.255.255.0 up
bash-3.2# ip a l dev if
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:17:6d:77:db brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global if


bash-3.2# ip a f dev if
bash-3.2# /bin/ifconfig if 192.168.1.111 netmask 255.255.255.0 up
bash-3.2# ip a l dev if
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:16:17:6d:77:db brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global if

Please provide an example where your patch helps.
 
(0001765)
robang74
11-22-06 01:24

Try with something different from 192.168... or other standard class ip.

See this belowe how "broadcast +" works in re-setting broadcast in order to make it fits the netmask/ip while it supposed has to be done without "broadcast +" either.

BusyBox v1.1.2 (2006.11.21-14:23+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:00
          inet addr:172.16.241.217 Bcast:172.16.255.255 Mask:255.255.0.0

# ifconfig eth0 172.16.241.216
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:00
          inet addr:172.16.241.216 Bcast:172.16.255.255 Mask:255.255.0.0

# ifconfig eth0 172.16.241.216 netmask 255.255.255.0
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:00
          inet addr:172.16.241.216 Bcast:172.16.255.255 Mask:255.255.255.0

# ifconfig eth0 172.16.241.216 netmask 255.255.255.0 broadcast +
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:00
          inet addr:172.16.241.216 Bcast:172.16.241.255 Mask:255.255.255.0

# ifconfig eth0 192.168.0.1
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0A:35:00:22:00
          inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
 
(0001767)
vda
11-22-06 12:55

Current svn is ok:

bash-3.2# ifconfig if 172.16.241.216
bash-3.2# ip a l dev if
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    inet 172.16.241.216/16 brd 172.16.255.255 scope global if

bash-3.2# ifconfig if 172.16.241.216 netmask 255.255.255.0
bash-3.2# ip a l dev if
2: if: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    inet 172.16.241.216/24 brd 172.16.241.255 scope global if
                                      ^^^ ok
 
(0001811)
robang74
11-27-06 10:31

busybox-1.2.2.1-ifconfig_2.patch is the same as 1.1.3 version but ported on last available stable busybox version + an aesthetic correction about argv vector usage.

busybox-1.2.2.1-vda_coding.patch is a syntax modification VDA suggests
 
(0001817)
robang74
11-27-06 12:32
edited on: 11-29-06 01:43

busybox-1.2.2.1-ifconfig_3.patch: this is the last patch and the only one I think it is enought correct to be included in busybox.

Problems fixed since the version 1.1.3 patch:

 1) double *++argv check to avoid to check argv[argc+1] ?= NULL
 2) added an #ifdef in the 3-cases-if to reduce the size with no broadcast cfg opt

 
(0001842)
robang74
11-30-06 01:51
edited on: 01-06-07 15:15

These two goes togheter

busybox-20061130-ifconfig_3.patch
busybox-network-config.patch

sorry I have no SVN access so I made the today snapshot patch.
I hope these would be applied.

 

- Issue History
Date Modified Username Field Change
08-03-06 00:44 robang74 New Issue
08-03-06 00:44 robang74 Status new => assigned
08-03-06 00:44 robang74 Assigned To  => BusyBox
08-03-06 00:44 robang74 File Added: busybox-1.1.3-ifconfig.patch
11-21-06 05:17 vda Note Added: 0001755
11-21-06 05:17 vda Status assigned => feedback
11-21-06 12:27 vda Note Added: 0001764
11-22-06 01:24 robang74 Note Added: 0001765
11-22-06 12:55 vda Note Added: 0001767
11-27-06 10:27 robang74 File Added: busybox-1.2.2.1-ifconfig_2.patch
11-27-06 10:27 robang74 Issue Monitored: robang74
11-27-06 10:27 robang74 File Added: busybox-1.2.2.1-vda_coding.patch
11-27-06 10:31 robang74 Note Added: 0001811
11-27-06 12:31 robang74 File Added: busybox-1.2.2.1-ifconfig_3.patch
11-27-06 12:32 robang74 Note Added: 0001817
11-29-06 01:43 robang74 Note Edited: 0001817
11-30-06 01:50 robang74 File Added: busybox-20061130-ifconfig_3.patch
11-30-06 01:51 robang74 Note Added: 0001842
11-30-06 02:03 robang74 File Added: busybox-network-config.patch
11-30-06 02:03 robang74 Note Edited: 0001842
01-06-07 15:14 robang74 Note Edited: 0001842
01-06-07 15:15 robang74 Note Edited: 0001842


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker