diff options
author | David Ahern <dsahern@gmail.com> | 2017-10-18 12:56:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-20 08:15:07 -0400 |
commit | de95e04791a03de5cb681980a3880db6919e3b4a (patch) | |
tree | bd085d94eee4f421f39b6fc650cdb86a54bb379c /drivers/net/ipvlan/ipvlan_main.c | |
parent | ff7883ea60e7b021bcd6539b8211879554c8db9a (diff) |
net: Add extack to validator_info structs used for address notifier
Add extack to in_validator_info and in6_validator_info. Update the one
user of each, ipvlan, to return an error message for failures.
Only manual configuration of an address is plumbed in the IPv6 code path.
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 6842739b6679..f0ab55df57f1 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c | |||
@@ -847,8 +847,11 @@ static int ipvlan_addr6_validator_event(struct notifier_block *unused, | |||
847 | 847 | ||
848 | switch (event) { | 848 | switch (event) { |
849 | case NETDEV_UP: | 849 | case NETDEV_UP: |
850 | if (ipvlan_addr_busy(ipvlan->port, &i6vi->i6vi_addr, true)) | 850 | if (ipvlan_addr_busy(ipvlan->port, &i6vi->i6vi_addr, true)) { |
851 | NL_SET_ERR_MSG(i6vi->extack, | ||
852 | "Address already assigned to an ipvlan device"); | ||
851 | return notifier_from_errno(-EADDRINUSE); | 853 | return notifier_from_errno(-EADDRINUSE); |
854 | } | ||
852 | break; | 855 | break; |
853 | } | 856 | } |
854 | 857 | ||
@@ -917,8 +920,11 @@ static int ipvlan_addr4_validator_event(struct notifier_block *unused, | |||
917 | 920 | ||
918 | switch (event) { | 921 | switch (event) { |
919 | case NETDEV_UP: | 922 | case NETDEV_UP: |
920 | if (ipvlan_addr_busy(ipvlan->port, &ivi->ivi_addr, false)) | 923 | if (ipvlan_addr_busy(ipvlan->port, &ivi->ivi_addr, false)) { |
924 | NL_SET_ERR_MSG(ivi->extack, | ||
925 | "Address already assigned to an ipvlan device"); | ||
921 | return notifier_from_errno(-EADDRINUSE); | 926 | return notifier_from_errno(-EADDRINUSE); |
927 | } | ||
922 | break; | 928 | break; |
923 | } | 929 | } |
924 | 930 | ||