char buf[512];
int32_t expire;
struct ether_addr mac;
+ char *iface;
char *hostname;
char *duid;
char *iaid;
ea = NULL;
if (lease_state.files[lease_state.off].odhcpd) {
- strtok(e.buf, " \t\n"); /* # */
- strtok(NULL, " \t\n"); /* iface */
+ p = strtok(e.buf, " \t\n"); /* # */
+ if (!p || strcmp(p, "#"))
+ continue;
+
+ e.iface = strtok(NULL, " \t\n"); /* iface */
+ if (!e.iface)
+ continue;
e.duid = strtok(NULL, " \t\n"); /* duid or MAC */
if (!e.duid)
o = blobmsg_open_table(&blob, key);
+ if (lease->iface)
+ blobmsg_add_string(&blob, "interface", lease->iface);
+
blobmsg_add_string(&blob, "duid", lease->duid);
if (lease->iaid)
else
blobmsg_add_u32(&blob, "expires", lease->expire);
+ if (lease->iface)
+ blobmsg_add_string(&blob, "interface", lease->iface);
+
if (lease->hostname)
blobmsg_add_string(&blob, "hostname", lease->hostname);