Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 392593 - sys-apps/openrc-0.9.4 does not set network interface broadcast address when using iproute2
Summary: sys-apps/openrc-0.9.4 does not set network interface broadcast address when u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard: openrc:oldnet
Keywords:
Depends on:
Blocks: openrc-tracker
  Show dependency tree
 
Reported: 2011-11-30 12:08 UTC by Spooky Ghost
Modified: 2013-04-25 23:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.