[BusyBox 0000980]: patch to avoid "broadcast +" syntax
bugs at busybox.net
bugs at busybox.net
Thu Nov 30 01:51:50 PST 2006
A NOTE has been added to this issue.
======================================================================
http://busybox.net/bugs/view.php?id=980
======================================================================
Reported By: robang74
Assigned To: BusyBox
======================================================================
Project: BusyBox
Issue ID: 980
Category: Standards Compliance
Reproducibility: always
Severity: minor
Priority: normal
Status: feedback
======================================================================
Date Submitted: 08-03-2006 00:44 PDT
Last Modified: 11-30-2006 01:51 PST
======================================================================
Summary: 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.
======================================================================
----------------------------------------------------------------------
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...
----------------------------------------------------------------------
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.
----------------------------------------------------------------------
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
----------------------------------------------------------------------
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
----------------------------------------------------------------------
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
----------------------------------------------------------------------
robang74 - 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
----------------------------------------------------------------------
robang74 - 11-30-06 01:51
----------------------------------------------------------------------
busybox-20061130-ifconfig_3.patch: sorry I have no SVN access so I made the
today snapshot patch. I hope this would be applaied.
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
======================================================================
More information about the busybox-cvs
mailing list