summaryrefslogtreecommitdiffstats
path: root/include/linux/inetdevice.h
diff options
context:
space:
mode:
authorKrister Johansen <kjlx@templeofstupid.com>2017-06-08 16:12:14 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-09 12:26:07 -0400
commit3ad7d2468f79fc13215eb941f766a692d34b1381 (patch)
tree5a742b551c95c8587e40bb5421c214e76d78c5d8 /include/linux/inetdevice.h
parent2b3a9afc63ab6af58417b3aaca2746dee2fbdc86 (diff)
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>
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r--include/linux/inetdevice.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index a2e9d6ea1349..e7c04c4e4bcd 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -150,8 +150,15 @@ struct in_ifaddr {
150 unsigned long ifa_tstamp; /* updated timestamp */ 150 unsigned long ifa_tstamp; /* updated timestamp */
151}; 151};
152 152
153struct in_validator_info {
154 __be32 ivi_addr;
155 struct in_device *ivi_dev;
156};
157
153int register_inetaddr_notifier(struct notifier_block *nb); 158int register_inetaddr_notifier(struct notifier_block *nb);
154int unregister_inetaddr_notifier(struct notifier_block *nb); 159int unregister_inetaddr_notifier(struct notifier_block *nb);
160int register_inetaddr_validator_notifier(struct notifier_block *nb);
161int unregister_inetaddr_validator_notifier(struct notifier_block *nb);
155 162
156void inet_netconf_notify_devconf(struct net *net, int event, int type, 163void inet_netconf_notify_devconf(struct net *net, int event, int type,
157 int ifindex, struct ipv4_devconf *devconf); 164 int ifindex, struct ipv4_devconf *devconf);