git: 9front

Download patch

ref: 972b048ddf63dd11f1111475dc414ef686eb8542
parent: 24ca1f2ecfad34b6fdd85ae6a3eb8c3a7750f036
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Dec 8 13:09:34 EST 2025

ip/ipconfig: fix ipnet ip= for point-to-point links (thanks k0ga)

When using ppp, the ipnet entry written should have
an ip= attribute matching our local address, not
the remote servers ip.

--- a/sys/src/cmd/ip/ipconfig/main.c
+++ b/sys/src/cmd/ip/ipconfig/main.c
@@ -555,6 +555,12 @@
 			dhcpwatch(0);
 	}
 
+	/*
+	 * for point-to-point links, conf.raddr wont match our local ip,
+	 * so calculate network address from our local ip before writing ndb.
+	 */
+	maskip(conf.laddr, conf.mask, conf.raddr);
+
 	/* leave everything we've learned somewhere other procs can find it */
 	putndb(1);
 	refresh();
--