]> git.baikalelectronics.ru Git - kernel.git/commit
Ipvlan should return an error when an address is already in use.
authorKrister Johansen <kjlx@templeofstupid.com>
Thu, 8 Jun 2017 20:12:14 +0000 (13:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jun 2017 16:26:07 +0000 (12:26 -0400)
commit8a4cff94e041c93a57eb95a1d933203ef7f390b2
tree5a742b551c95c8587e40bb5421c214e76d78c5d8
parentbd49ec2eccd7722d3db582e8eaeee03f8ac5afd0
Ipvlan should return an error when an address is already in use.

The ipvlan code already knows how to detect when a duplicate address is
about to be assigned to an ipvlan device.  However, that failure is not
propogated outward and leads to a silent failure.

Introduce a validation step at ip address creation time and allow device
drivers to register to validate the incoming ip addresses.  The ipvlan
code is the first consumer.  If it detects an address in use, we can
return an error to the user before beginning to commit the new ifa in
the networking code.

This can be especially useful if it is necessary to provision many
ipvlans in containers.  The provisioning software (or operator) can use
this to detect situations where an ip address is unexpectedly in use.

Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_main.c
include/linux/inetdevice.h
include/net/addrconf.h
net/ipv4/devinet.c
net/ipv6/addrconf.c
net/ipv6/addrconf_core.c