This is mostly cosmetic, skip writing out hosts files for interfaces
where it makes little sense to do so (i.e. where the hosts file will
anyway be empty).
Closes: https://github.com/openwrt/odhcpd/issues/338
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/odhcpd/pull/342
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
return;
avl_for_each_element(&interfaces, ctxt.iface, avl) {
+ if (ctxt.iface->ignore)
+ continue;
+
+ if (ctxt.iface->dhcpv4 != MODE_SERVER && ctxt.iface->dhcpv6 != MODE_SERVER)
+ continue;
+
ctxt.fp = statefiles_open_tmp_file(config.dhcp_hostsdir_fd);
+ if (!ctxt.fp)
+ continue;
if (ctxt.iface->dhcpv6 == MODE_SERVER) {
struct dhcpv6_lease *lease;
};
uint8_t newmd5[16];
+ /* Return value unchecked, continue in order to get the md5 */
ctxt.fp = statefiles_open_tmp_file(config.dhcp_statedir_fd);
md5_begin(&ctxt.md5);