[arch-projects] [RFC2] [PATCH] [initscripts] network: Add missing broadcast address
Without this broadcast address is not set. broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+). Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- network | 2 +- rc.conf | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/network b/network index b8c900d..c2ad9ba 100755 --- a/network +++ b/network @@ -32,7 +32,7 @@ network_up() { return 1 fi done - ip addr add $address/$netmask dev $interface || return 1 + ip addr add $address/$netmask broadcast ${broadcast:-+} dev $interface || return 1 ip route add default via $gateway || return 1 else dhcpcd $DHCPCD_ARGS $interface || return 1 diff --git a/rc.conf b/rc.conf index b9c468a..c17c48c 100644 --- a/rc.conf +++ b/rc.conf @@ -65,12 +65,14 @@ HOSTNAME="myhost" # - interface: name of device (required) # - address: IP address (leave blank for DHCP) # - netmask: subnet mask (ignored for DHCP) +# - broadcast: broadcast address (ignored for DHCP) (optional) # - gateway: default route (ignored for DHCP) # # Static IP example # interface=eth0 # address=192.168.0.2 # netmask=255.255.255.0 +# broadcast=192.168.0.255 # gateway=192.168.0.1 # # DHCP example @@ -82,6 +84,7 @@ HOSTNAME="myhost" interface= address= netmask= +broadcast= gateway= # Setting this to "yes" will skip network shutdown. -- 1.7.5.2
On Thu, Jun 09, 2011 at 09:51:14PM -0300, Gerardo Exequiel Pozzi wrote:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+).
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- network | 2 +- rc.conf | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/network b/network index b8c900d..c2ad9ba 100755 --- a/network +++ b/network @@ -32,7 +32,7 @@ network_up() { return 1 fi done - ip addr add $address/$netmask dev $interface || return 1 + ip addr add $address/$netmask broadcast ${broadcast:-+} dev $interface || return 1 ip route add default via $gateway || return 1 else dhcpcd $DHCPCD_ARGS $interface || return 1 diff --git a/rc.conf b/rc.conf index b9c468a..c17c48c 100644 --- a/rc.conf +++ b/rc.conf @@ -65,12 +65,14 @@ HOSTNAME="myhost" # - interface: name of device (required) # - address: IP address (leave blank for DHCP) # - netmask: subnet mask (ignored for DHCP) +# - broadcast: broadcast address (ignored for DHCP) (optional) # - gateway: default route (ignored for DHCP) # # Static IP example # interface=eth0 # address=192.168.0.2 # netmask=255.255.255.0 +# broadcast=192.168.0.255 # gateway=192.168.0.1 # # DHCP example @@ -82,6 +84,7 @@ HOSTNAME="myhost" interface= address= netmask= +broadcast= gateway=
# Setting this to "yes" will skip network shutdown. -- 1.7.5.2
Ack. And thanks. dave
Am 10.06.2011 02:51, schrieb Gerardo Exequiel Pozzi:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+).
ACK, this looks sane. (However, I just found the + flag by accident in netcfg - I couldn't find documentation for it).
On 06/10/2011 04:57 AM, Thomas Bächler wrote:
Am 10.06.2011 02:51, schrieb Gerardo Exequiel Pozzi:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+). ACK, this looks sane.
(However, I just found the + flag by accident in netcfg - I couldn't find documentation for it).
I see it at least here: http://www.policyrouting.org/iproute2.doc.html#ss9.2.1 PS: man pages of iproute2 are out-of-sync respect to iproute2 commands, like the internal help of commands. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Fri, Jun 10, 2011 at 01:03:36PM -0300, Gerardo Exequiel Pozzi wrote:
On 06/10/2011 04:57 AM, Thomas Bächler wrote:
Am 10.06.2011 02:51, schrieb Gerardo Exequiel Pozzi:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+). ACK, this looks sane.
(However, I just found the + flag by accident in netcfg - I couldn't find documentation for it).
I see it at least here: http://www.policyrouting.org/iproute2.doc.html#ss9.2.1
PS: man pages of iproute2 are out-of-sync respect to iproute2 commands, like the internal help of commands.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
It's in the man page for 'ip': broadcast ADDRESS the broadcast address on the interface. It is possible to use the special symbols '+' and '-' instead of the broadcast address. In this case, the broadcast address is derived by setting/resetting the host bits of the interface pre‐ fix. d
On 06/10/2011 01:19 PM, Dave Reisner wrote:
On Fri, Jun 10, 2011 at 01:03:36PM -0300, Gerardo Exequiel Pozzi wrote:
On 06/10/2011 04:57 AM, Thomas Bächler wrote:
Am 10.06.2011 02:51, schrieb Gerardo Exequiel Pozzi:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+). ACK, this looks sane.
(However, I just found the + flag by accident in netcfg - I couldn't find documentation for it).
I see it at least here: http://www.policyrouting.org/iproute2.doc.html#ss9.2.1
PS: man pages of iproute2 are out-of-sync respect to iproute2 commands, like the internal help of commands.
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
It's in the man page for 'ip':
broadcast ADDRESS the broadcast address on the interface.
It is possible to use the special symbols '+' and '-' instead of the broadcast address. In this case, the broadcast address is derived by setting/resetting the host bits of the interface pre‐ fix.
d
Oops, true true. Anyway the argument is still valid. See for example the output of "ip link help" (list of TYPE) and the man page. Also the "TYPE macvtap" is not listed in internal help. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Fri, Jun 10, 2011 at 2:51 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Without this broadcast address is not set.
broadcast= parameter can be empty. In this case the broadcast address is derived by setting all of the interface host bits to one (+).
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Thanks to all. Applied and pushed. -t
participants (4)
-
Dave Reisner
-
Gerardo Exequiel Pozzi
-
Thomas Bächler
-
Tom Gundersen