Skip to contentSkip to conversation

IPv6: add extack info for IPv6 address add/delete

PATCH Applied Hangbin Liu 3 participants 3 messages Jul 26, 2023 – Jul 28, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 IPv6: add extack info for IPv6 address add/delete

Add extack info for IPv6 address add/delete, which would be useful for users to understand the problem without having to read kernel code.

---
v4: Split the first long check in ipv6_add_addr(). Use
NL_SET_ERR_MSG_MOD to set the extack message.
v3: * Update extack message. Pass extack to addrconf_f6i_alloc().
* Return "IPv6 is disabled" for addrconf_add_dev(), as the same with ndisc_allow_add() does.
* Set dup addr extack message in inet6_rtm_newaddr() instead of ipv6_add_addr_hash().
v2: Update extack msg for dead dev. Remove msg for NOBUFS error.
Add extack for ipv6_add_addr_hash()

---
 include/net/ip6_route.h |  2 +-
 net/ipv6/addrconf.c     | 77 +++++++++++++++++++++++++++++------------
 net/ipv6/anycast.c      |  2 +-
 net/ipv6/route.c        |  5 +--
 4 files changed, 59 insertions(+), 27 deletions(-)
include/net/ip6_route.h +1 -1
index 3556595ce59a..b32539bb0fb0 100644
@@ -156,7 +156,7 @@ void fib6_force_start_gc(struct net *net);
 
 struct fib6_info *addrconf_f6i_alloc(struct net *net, struct inet6_dev *idev,
 				     const struct in6_addr *addr, bool anycast,
-				     gfp_t gfp_flags);
+				     gfp_t gfp_flags, struct netlink_ext_ack *extack);
 
 struct rt6_info *ip6_dst_alloc(struct net *net, struct net_device *dev,
 			       int flags);
net/ipv6/addrconf.c +54 -23

178 lines not on this page · raw message

net/ipv6/anycast.c +1 -1
index dacdea7fcb62..bb17f484ee2c 100644
@@ -305,7 +305,7 @@ int __ipv6_dev_ac_inc(struct inet6_dev *idev, const struct in6_addr *addr)
 	}
 
 	net = dev_net(idev->dev);
-	f6i = addrconf_f6i_alloc(net, idev, addr, true, GFP_ATOMIC);
+	f6i = addrconf_f6i_alloc(net, idev, addr, true, GFP_ATOMIC, NULL);
 	if (IS_ERR(f6i)) {
 		err = PTR_ERR(f6i);
 		goto out;
net/ipv6/route.c +3 -2
index 64e873f5895f..c90700aed3a1 100644
@@ -4543,7 +4543,8 @@ static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff
 struct fib6_info *addrconf_f6i_alloc(struct net *net,
 				     struct inet6_dev *idev,
 				     const struct in6_addr *addr,
-				     bool anycast, gfp_t gfp_flags)
+				     bool anycast, gfp_t gfp_flags,
+				     struct netlink_ext_ack *extack)
 {
 	struct fib6_config cfg = {
 		.fc_table = l3mdev_fib_table(idev->dev) ? : RT6_TABLE_LOCAL,
@@ -4565,7 +4566,7 @@ struct fib6_info *addrconf_f6i_alloc(struct net *net,
 		cfg.fc_flags |= RTF_LOCAL;
 	}
 
-	f6i = ip6_route_info_create(&cfg, gfp_flags, NULL);
+	f6i = ip6_route_info_create(&cfg, gfp_flags, extack);
 	if (!IS_ERR(f6i)) {
 		f6i->dst_nocount = true;
 
Signature · 1 line
2.38.1
#2 lore raw
In reply to Hangbin Liu
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 9 lines · On Wed, 26 Jul 2023 10:39:05 +0800 you wrote:

Add extack info for IPv6 address add/delete, which would be useful for users to understand the problem without having to read kernel code.

[...]

Here is the summary with links:
- [PATCHv4,net-next] IPv6: add extack info for IPv6 address add/delete

    https://git.kernel.org/netdev/net-next/c/7f6c40391a04

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html