Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 111640 - incorrect default broadcast address /etc/conf.d/net
Summary: incorrect default broadcast address /etc/conf.d/net
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Roy Marples (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-05 16:37 UTC by steve
Modified: 2005-11-07 23:51 UTC (History)
0 users

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 steve 2005-11-05 16:37:07 UTC
With a netmask of 255.255.255.0 the correct broadcast ip address is x.x.x.255,
but gentoo is choosing x.255.255.255. For example:

config_eth0=( "10.1.206.16 netmask 255.255.255.0" )

/sbin/ifcong shows a broadcast of 10.255.255.255. It should be 10.1.206.255

Reproducible: Always
Steps to Reproduce:
1. Set a netmask of 255.255.255.0 in /etc/conf.d/net
2. Run /sbin/ifconfig and observe broadcast address
3.

Actual Results:  
Incorrect broadcast chosen by default

Expected Results:  
Chosen correct broadcast address for netmask

Workaround:

Specify a  broadcast address:

config_eth0=( "10.1.206.16 netmask 255.255.255.0 broadcast 10.1.206.255" )
Comment 1 Roy Marples (RETIRED) gentoo-dev 2005-11-06 05:16:42 UTC
broadcast options are specified in conf.d/net.example - or are you suggesting
the handbook should be updated?
Comment 2 steve 2005-11-07 08:23:39 UTC
I expected the *default* broadcast for an ipaddress with a class C netmask:

netmask 255.255.255.0

to be the class C portion with .255 appended:

10.1.206.16 netmask 255.255.255.0 should this not yield a default broadcast of 
10.1.206.255 ??

It seems to me that this is the most correct *default* broadcast address for
this address / netmask pair. Maybe I am wrong?? I've had "networking gurus"
insist to me that that the *most correct* default broadcast address is always

ipaddress | (~netmask)

BUT look at this:
/sbin/ifconfig eth0:0 209.209.209.18 netmask 255.0.0.0
/sbin/ifconfig eth0:0 209.209.209.18 netmask 255.255.0.0
/sbin/ifconfig eth0:0 209.209.209.18 netmask 255.255.255.0

ALL give the following for Bcast:
/sbin/ifconfig eth0:0
=>          inet addr:209.209.209.18  Bcast:209.209.209.255  Mask:255.255.255.0


And these:
/sbin/ifconfig eth0:0 10.0.0.18 netmask 255.0.0.0
/sbin/ifconfig eth0:0 10.0.0.18 netmask 255.255.0.0
/sbin/ifconfig eth0:0 10.0.0.18 netmask 255.255.255.0

ALL give the following for Bcast:
=>          inet addr:10.0.0.18  Bcast:10.255.255.255  Mask:255.255.0.0

Is this something special in place for all 10.x.x.x addresses??
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-11-07 23:51:19 UTC
Oh I understand now

The default broadcast as set by ifconfig does not take into account netmask.
However, when using iproute2, it does take into account the netmask (actually
the CIDR, but they are the same)

So the solution is to emerge iproute2 - and if you're using baselayout-1.11 then
specify
modules=( "iproute2" )
in /etc/conf.d/net

(baselayout-1.12 prefers iproute2)