shithub: riscv

Download patch

ref: c4c1ce10933423f5378cd68972ee12137152ad1f
parent: d73932922bc597f312b45ac39dbd4f5d9a944239
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Jan 11 23:16:03 EST 2025

ip/ipconfig: unconditionally refresh when adding addresses manually (thanks chilledfrogs)

The issue is that ndb/cs refuses to serve ipv6 only
protocols (such as icmpv6) when it doesnt know we
have ipv6 addresses (link local).

So refreshing here is mandatory when we add/remove
our link-local addresses. As link-local addresses
are not added to ndb, so there is no change,
but ndb/cs still needs to get refreshed.

--- a/sys/src/cmd/ip/ipconfig/main.c
+++ b/sys/src/cmd/ip/ipconfig/main.c
@@ -556,8 +556,8 @@
 	}
 
 	/* leave everything we've learned somewhere other procs can find it */
-	if(putndb(1))
-		refresh();
+	putndb(1);
+	refresh();
 }
 
 static void
@@ -578,8 +578,8 @@
 		warning("can't delete %I %M: %r", conf.laddr, conf.mask);
 
 	/* remove ndb entries matching our ip address */
-	if(putndb(0))
-		refresh();
+	putndb(0);
+	refresh();
 }
 
 static void
--