[BusyBox 0000980]: patch to avoid "broadcast +" syntax
bugs at busybox.net
bugs at busybox.net
Wed Nov 22 09:24:57 UTC 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-22-2006 01:24 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
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
======================================================================
More information about the busybox-cvs
mailing list