Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 392593

Summary: sys-apps/openrc-0.9.4 does not set network interface broadcast address when using iproute2
Product: Gentoo Hosted Projects Reporter: Spooky Ghost <spookyghost>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal CC: bug
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: openrc:oldnet
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 394205    

Description Spooky Ghost 2011-11-30 12:08:47 UTC
After upgrading to OpenRC 0.9.4 the broadcast address does not get set on net.eth0 and defaults to 0.0.0.0.  I have a number of VMs which are essentially identical and those which do not have iproute2 installed (i.e. use ifconfig) do not have a problem.

$ equery l openrc
 * Searching for openrc ...
[IP-] [  ] sys-apps/openrc-0.9.4:0
$ equery l iproute2
 * Searching for iproute2 ...
[IP-] [  ] sys-apps/iproute2-2.6.35-r2:0

$ grep eth0 /etc/conf.d/net
config_eth0="192.168.2.100/24"
dns_domain_eth0="sub.example.com"
dns_servers_eth0="192.168.2.50 192.168.2.100"
dns_search_eth0="example.com sub.example.com"
routes_eth0="default via 192.168.2.254"

If I compare the output of a working/non-working machine when running the init 
script with --debug I see the following interesting difference:

-+ ip addr add 192.168.2.100/24 dev eth0
++ ifconfig eth0 192.168.2.155 netmask 255.255.255.0

I believe in the case with iproute2 then it should execute this line when a broadcast address is not specified in the net conf.d
ip addr add 192.168.2.100/24 broadcast + dev eth0

Apparently the behaviour of ifconfig automatically calculates the broadcast address when it is not specified.

I believe the fix is to intialise the broadcast variable as "broadcast +" in the _add_address() function of /lib/rc/net/iproute2.sh or to set it to "broadcast +" if it is empty after the options are parsed.

Reproducible: Always

Steps to Reproduce:
1. Reboot virtual machine, examine interface configuration
2.
3.
Actual Results:  
broadcast address is 0.0.0.0

Expected Results:  
broadcast address is 192.168.2.255
Comment 1 William Hubbs gentoo-dev 2011-12-10 03:01:03 UTC
This is fixed in commit a1c6559.
Thanks for the report.