diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2014-06-25 16:54:30 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2014-06-26 16:10:47 +0300 |
commit | ed6ee21953dac9c78383da00bc4514ece6b75ab5 (patch) | |
tree | 9c2b6215d998e2ec5ab039182884b1530baae77e /src/libsystemd-network/dhcp6-option.c | |
parent | 3dc34fcc97b41f8b7b019027225b121dfbb9871d (diff) |
sd-dhcp6-client: Implement Rapid Commit
Add a Rapid Commit option to Solicit messages and expect a Reply to
be received instead of an Advertise. When receiving a DHCPv6 message
from the server in state Solicit, continue testing whether the
message is a Reply. Ease up the message type checking, it's not fatal
if the message is of a wrong type.
Add helper functions to set/get the rapid commit of a lease. See
RFC 3315, sections 17., 17.1.2., 17.1.4. and 18.1.8.
Diffstat (limited to 'src/libsystemd-network/dhcp6-option.c')
-rw-r--r-- | src/libsystemd-network/dhcp6-option.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index f488832cf9..e9b382c170 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -58,13 +58,14 @@ int dhcp6_option_append(uint8_t **buf, size_t *buflen, uint16_t code, size_t optlen, const void *optval) { int r; - assert_return(optval, -EINVAL); + assert_return(optval || optlen == 0, -EINVAL); r = option_append_hdr(buf, buflen, code, optlen); if (r < 0) return r; - memcpy(*buf, optval, optlen); + if (optval) + memcpy(*buf, optval, optlen); *buf += optlen; *buflen -= optlen; |