[PATCHv2 net] bonding: show NS IPv6 targets in proc master info

Subsystems: bonding driver, networking drivers, the rest

2 messages, 1 author, 2022-05-30 · open the first message on its own page

[PATCHv2 net] bonding: show NS IPv6 targets in proc master info

From: Hangbin Liu <hidden>
Date: 2022-05-30 03:03:33

When adding bond new parameter ns_targets. I forgot to print this
in bond master proc info. After updating, the bond master info will looks
like:

ARP IP target/s (n.n.n.n form): 192.168.1.254
NS IPv6 target/s (XX::XX form): 2022::1, 2022::2

Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets")
Reported-by: Li Liang <redacted>
Signed-off-by: Hangbin Liu <redacted>
---
v2: add CONFIG_IPV6 gating
---
 drivers/net/bonding/bond_procfs.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index cfe37be42be4..43be458422b3 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -129,6 +129,21 @@ static void bond_info_show_master(struct seq_file *seq)
 			printed = 1;
 		}
 		seq_printf(seq, "\n");
+
+#if IS_ENABLED(CONFIG_IPV6)
+		printed = 0;
+		seq_printf(seq, "NS IPv6 target/s (xx::xx form):");
+
+		for (i = 0; (i < BOND_MAX_NS_TARGETS); i++) {
+			if (ipv6_addr_any(&bond->params.ns_targets[i]))
+				break;
+			if (printed)
+				seq_printf(seq, ",");
+			seq_printf(seq, " %pI6c", &bond->params.ns_targets[i]);
+			printed = 1;
+		}
+		seq_printf(seq, "\n");
+#endif
 	}
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
-- 
2.35.1

Re: [PATCHv2 net] bonding: show NS IPv6 targets in proc master info

From: Hangbin Liu <hidden>
Date: 2022-05-30 06:28:16

On Mon, May 30, 2022 at 11:03:19AM +0800, Hangbin Liu wrote:
When adding bond new parameter ns_targets. I forgot to print this
in bond master proc info. After updating, the bond master info will looks
like:
Forgot to fix the typo, I will post a new version.

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