git: 9front

Download patch

ref: c1974cc5447ab04a14d23395c3b5f1aac1f29beb
parent: d98ddf4cbcb76341ae20f4a7ca823b17ff9ecf43
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 27 12:16:55 EDT 2023

ip/ipconfig: avoid refreshing /net/dns for non-primary interface

when not updating /net/ndb, theres no new information
for the dns resolver, so skip refreshing it.

we still refresh /net/cs to notify it for added or
removed interface.

--- a/sys/src/cmd/ip/ipconfig/main.c
+++ b/sys/src/cmd/ip/ipconfig/main.c
@@ -880,6 +880,11 @@
 		write(fd, "refresh", 7);
 		close(fd);
 	}
+
+	/* dns unaffected, no need to refresh dns */
+	if(!beprimary)
+		return;
+
 	snprint(file, sizeof file, "%s/dns", conf.mpoint);
 	if((fd = open(file, OWRITE)) >= 0){
 		write(fd, "refresh", 7);
--