Thread (5 messages) flat view 5 messages, 3 authors, 2015-11-24

Re: [PATCH iproute2] ip-address: properly display zero IPv4 peer address

From: Phil Sutter <phil@nwl.cc>
Date: 2015-11-11 11:34:05

On Thu, Oct 22, 2015 at 10:34:28AM +0200, Thomas Haller wrote:
Kernel allows for zero IPv4 peer addresses (IFA_ADDRESS):

   ip address add 192.168.5.1 peer 0.0.0.0/24 dev dummy

which is distinct from a usual address like:

   ip address add 192.168.5.1/24 dev dummy
   ip address add 192.168.5.1 peer 192.168.5.1/24 dev dummy

For IPv4, a missing IFA_ADDRESS attribute means that the peer
is 0.0.0.0. See inet_fill_ifaddr(), which does:

  if ((ifa->ifa_address &&
       nla_put_in_addr(skb, IFA_ADDRESS, ifa->ifa_address)) ||

Signed-off-by: Thomas Haller <redacted>
Acked-by: Phil Sutter <phil@nwl.cc>

I wonder why this is not the case for IPv6. What is the functional
effect of setting a zero peer with non-zero netmask?

Cheers, Phil
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help