merge
This commit is contained in:
commit
d1204d9b80
2 changed files with 17 additions and 4 deletions
|
@ -155,11 +155,25 @@ dhcpinit(void)
|
|||
memcpy(requested, defrequested, nrequested);
|
||||
}
|
||||
|
||||
static void
|
||||
removenulladdr(void)
|
||||
{
|
||||
fprint(conf.cfd, "remove %I %M", IPnoaddr, IPnoaddr);
|
||||
atexitdont(removenulladdr);
|
||||
}
|
||||
|
||||
static void
|
||||
addnulladdr(void)
|
||||
{
|
||||
atexit(removenulladdr);
|
||||
fprint(conf.cfd, "add %I %M", IPnoaddr, IPnoaddr);
|
||||
}
|
||||
|
||||
void
|
||||
dhcpquery(int needconfig, int startstate)
|
||||
{
|
||||
if(needconfig)
|
||||
fprint(conf.cfd, "add %I %M", IPnoaddr, IPnoaddr);
|
||||
addnulladdr();
|
||||
|
||||
conf.fd = openlisten();
|
||||
if(conf.fd < 0){
|
||||
|
@ -192,8 +206,7 @@ dhcpquery(int needconfig, int startstate)
|
|||
close(conf.fd);
|
||||
|
||||
if(needconfig)
|
||||
fprint(conf.cfd, "remove %I %M", IPnoaddr, IPnoaddr);
|
||||
|
||||
removenulladdr();
|
||||
}
|
||||
|
||||
enum {
|
||||
|
|
|
@ -806,7 +806,7 @@ catch(void*, char *msg)
|
|||
{
|
||||
if(strstr(msg, "alarm"))
|
||||
noted(NCONT);
|
||||
noted(NDFLT);
|
||||
exits(msg);
|
||||
}
|
||||
|
||||
/* return pseudo-random integer in range low...(hi-1) */
|
||||
|
|
Loading…
Reference in a new issue