Re: [PATCH 1/1] ip.7: Add "special and reserved addresses" section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Florian Weimer writes:

> * Seth David Schoen:
> 
> > +On any locally-attached IP subnet, the lowest-numbered address and
> > +highest-numbered address (e.g., the .0 and .255 addresses on a subnet
> > +with netmask 255.255.255.0) are both designated as broadcast addresses.
> > +These cannot usefully be assigned to an interface, and can only be
> > +addressed with a socket on which the
> > +.B SO_BROADCAST
> > +option has been explicitly enabled.
> 
> I think the broadcast address is actually settable to some degree, and
> /31 subnets do not have them.  I wouldn't be surprised if kernel
> behavior also depended on the network device.

Thanks!  We're somewhat familiar with that because we are currently proposing
to change this behavior. :-)

Both things you noted are true: you can change broadcast addresses with
ifconfig or ip (e.g. ip addr add x/y broadcast z dev d), and /31 subnets
indeed don't have them.  This is defined at

https://github.com/torvalds/linux/blob/master/net/ipv4/fib_frontend.c#L1125

I'm not familiar with a way in which it depends on the network device
other than the /31 issue.  At least, this particular logic isn't
affected by other aspects of the network device type.

Could you suggest a way that these details could usefully be described
here?  The ability to change the broadcast address is very little-used,
so I'm not sure many readers would benefit from details about it here,
but I also wouldn't want to mislead them about that.  Maybe just
changing it to "are both designated, by default, as broadcast
addresses"?

Conceivably it could say something like


On any locally-attached IP subnet that contains more than two IP
addresses, the lowest-numbered address and highest-numbered address
(e.g., the .0 and .255 addresses on a subnet with netmask 255.255.255.0)
are both designated as broadcast addresses by default. These cannot
usefully be assigned to an interface, and can only be addressed with a
socket on which the
.B SO_BROADCAST
option has been explicitly enabled.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux