summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-06-17 09:28:37 +0200
committerSteven Barth <steven@midlink.org>2014-06-17 09:28:37 +0200
commite7098a5d1dbcabb12bc870ef6aa412c7b3235ab2 (patch)
tree2c93262405dd4552005dd94e9c1eaeb0d84bb14f /src/config.c
parentda2657472b642a266c8a80763a51868e2af6b050 (diff)
downloadodhcpd-e7098a5d1dbcabb12bc870ef6aa412c7b3235ab2.tar.gz
Make hostid more convenient
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c
index 75e9239..068d1a7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -255,10 +255,12 @@ static int set_lease(struct uci_section *s)
lease->duid_len = len;
}
- if ((c = tb[LEASE_ATTR_HOSTID]))
- if (odhcpd_unhexlify((uint8_t*)&lease->hostid, sizeof(lease->hostid),
- blobmsg_get_string(c)) < 0)
+ if ((c = tb[LEASE_ATTR_HOSTID])) {
+ errno = 0;
+ lease->hostid = strtoul(blobmsg_get_string(c), NULL, 16);
+ if (errno)
goto err;
+ }
list_add(&lease->head, &leases);
return 0;