changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: merge

changeset 7367: b744681ba93c
parent 7366: a5fb3861b449
parent 7363: 51d91ffdb9e8
child 7368: d15d7627dee1
child 7370: 442402c215c0
author: Ori Bernstein <ori@eigenstate.org>'
date: Fri, 06 Sep 2019 11:57:08 -0700
files:
description: merge
     1.1--- a/sys/src/cmd/ip/ipconfig/dhcp.c
     1.2+++ b/sys/src/cmd/ip/ipconfig/dhcp.c
     1.3@@ -155,11 +155,25 @@ dhcpinit(void)
     1.4 	memcpy(requested, defrequested, nrequested);
     1.5 }
     1.6 
     1.7+static void
     1.8+removenulladdr(void)
     1.9+{
    1.10+	fprint(conf.cfd, "remove %I %M", IPnoaddr, IPnoaddr);
    1.11+	atexitdont(removenulladdr);
    1.12+}
    1.13+
    1.14+static void
    1.15+addnulladdr(void)
    1.16+{
    1.17+	atexit(removenulladdr);
    1.18+	fprint(conf.cfd, "add %I %M", IPnoaddr, IPnoaddr);
    1.19+}
    1.20+
    1.21 void
    1.22 dhcpquery(int needconfig, int startstate)
    1.23 {
    1.24 	if(needconfig)
    1.25-		fprint(conf.cfd, "add %I %M", IPnoaddr, IPnoaddr);
    1.26+		addnulladdr();
    1.27 
    1.28 	conf.fd = openlisten();
    1.29 	if(conf.fd < 0){
    1.30@@ -192,8 +206,7 @@ dhcpquery(int needconfig, int startstate
    1.31 	close(conf.fd);
    1.32 
    1.33 	if(needconfig)
    1.34-		fprint(conf.cfd, "remove %I %M", IPnoaddr, IPnoaddr);
    1.35-
    1.36+		removenulladdr();
    1.37 }
    1.38 
    1.39 enum {
     2.1--- a/sys/src/cmd/ip/ipconfig/main.c
     2.2+++ b/sys/src/cmd/ip/ipconfig/main.c
     2.3@@ -806,7 +806,7 @@ catch(void*, char *msg)
     2.4 {
     2.5 	if(strstr(msg, "alarm"))
     2.6 		noted(NCONT);
     2.7-	noted(NDFLT);
     2.8+	exits(msg);
     2.9 }
    2.10 
    2.11 /* return pseudo-random integer in range low...(hi-1) */