projects
/
project
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b8f5327
)
dhcpv6: fix mac-handling
author
Steven Barth
<steven@midlink.org>
Mon, 7 Sep 2015 09:21:58 +0000
(11:21 +0200)
committer
Steven Barth
<steven@midlink.org>
Mon, 7 Sep 2015 09:21:58 +0000
(11:21 +0200)
src/dhcpv6-ia.c
patch
|
blob
|
history
diff --git
a/src/dhcpv6-ia.c
b/src/dhcpv6-ia.c
index d301b4f0b5b83f01d1df6c1c91c174ef331fb97e..30bffbcf0d921e3d8638254c08c2ebef01cc508a 100644
(file)
--- a/
src/dhcpv6-ia.c
+++ b/
src/dhcpv6-ia.c
@@
-92,14
+92,15
@@
int setup_dhcpv6_ia_interface(struct interface *iface, bool enable)
struct lease *lease;
list_for_each_entry(lease, &leases, head) {
// Construct entry
struct lease *lease;
list_for_each_entry(lease, &leases, head) {
// Construct entry
- struct dhcpv6_assignment *a = calloc(1, sizeof(*a) + lease->duid_len);
+ size_t duid_len = lease->duid_len ? lease->duid_len : 14;
+ struct dhcpv6_assignment *a = calloc(1, sizeof(*a) + duid_len);
if (!a) {
syslog(LOG_ERR, "Calloc failed for static lease assignment on interface %s",
iface->ifname);
return -1;
}
if (!a) {
syslog(LOG_ERR, "Calloc failed for static lease assignment on interface %s",
iface->ifname);
return -1;
}
- a->clid_len =
lease->
duid_len;
+ a->clid_len = duid_len;
a->length = 128;
if (lease->hostid) {
a->assigned = lease->hostid;
a->length = 128;
if (lease->hostid) {
a->assigned = lease->hostid;