projects
/
oweals
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da26574
)
Make hostid more convenient
author
Steven Barth
<steven@midlink.org>
Tue, 17 Jun 2014 07:28:37 +0000
(09:28 +0200)
committer
Steven Barth
<steven@midlink.org>
Tue, 17 Jun 2014 07:28:37 +0000
(09:28 +0200)
src/config.c
patch
|
blob
|
history
diff --git
a/src/config.c
b/src/config.c
index 75e9239451b4e80c859ceade540e36e9f5de898a..068d1a7483a14cba591ec0dd3c1fdbd852e484c1 100644
(file)
--- 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;