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:
> 
> > 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
> 
> There is also the questions of netmask that aren't in the CIDR style
> (so 255.255.0.255 instead of 255.255.255.0).  Are they still
> supported?

Nope -- I tried setting such a mask with ifconfig and got EINVAL back
from the kernel, while iproute2 doesn't even allow specifying a netmask
as opposed to a prefix length.

This EINVAL comes from here

https://github.com/torvalds/linux/blob/4ee998b0ef8b6d7b1267cd4d953182224929abba/net/ipv4/devinet.c#L1214

where the bad_mask() macro is checked to see if the mask is valid.  (I
haven't reasoned about the way bad_mask() is implemented, but the purpose
of the check seems to be whether the requested mask is CIDR-valid.)

> > 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.
> 
> Are there network devices that are neither point-to-point, nor do they
> have broadcast support?

We've talked about this question a bit in our project before.  I don't
believe so, but I can look into it further.  It's logically conceivable
that there could be such devices.

> > 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"?
> 
> My main concern is that the language should not imply that something
> cannot happen if it actually can.  Otherwise programmers will end up
> using this guidance and create software that won't work in such
> configurations.

That makes sense.  Are you OK with the "are both designated, by default,
as broadcast addresses" or similar language?

-- 
Seth David Schoen <schoen@xxxxxxxxxxx>      |  Qué empresa fácil no pensar
     http://www.loyalty.org/~schoen/        |  en un tigre, reflexioné.
                                            |        -- Borges, "El Zahir"



[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