[ODrebindingtime] { "rebindingtime", Tulong },
[ODvendorclass] { "vendorclass", Tvec },
[ODclientid] { "clientid", Tvec },
-[ODtftpserver] { "tftp", Taddr },
+[ODtftpserver] { "tftp", Tstr },
[ODbootfile] { "bootfile", Tstr },
[ODdnsdomain] { "dnsdomain", Tnames },
};
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){
close(conf.fd);
if(needconfig)
- fprint(conf.cfd, "remove %I %M", IPnoaddr, IPnoaddr);
-
+ removenulladdr();
}
enum {
* leave everything we've learned somewhere that
* other procs can find it.
*/
- if(beprimary)
- putndb();
+ putndb();
refresh();
}
}