summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/sd-dhcp6-lease.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-06-25 16:54:30 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2014-06-26 16:10:47 +0300
commited6ee21953dac9c78383da00bc4514ece6b75ab5 (patch)
tree9c2b6215d998e2ec5ab039182884b1530baae77e /src/libsystemd-network/sd-dhcp6-lease.c
parent3dc34fcc97b41f8b7b019027225b121dfbb9871d (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/sd-dhcp6-lease.c')
-rw-r--r--src/libsystemd-network/sd-dhcp6-lease.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libsystemd-network/sd-dhcp6-lease.c b/src/libsystemd-network/sd-dhcp6-lease.c
index 17a4b64063..b9d0503642 100644
--- a/src/libsystemd-network/sd-dhcp6-lease.c
+++ b/src/libsystemd-network/sd-dhcp6-lease.c
@@ -118,6 +118,23 @@ int dhcp6_lease_get_preference(sd_dhcp6_lease *lease, uint8_t *preference) {
return 0;
}
+int dhcp6_lease_set_rapid_commit(sd_dhcp6_lease *lease) {
+ assert_return(lease, -EINVAL);
+
+ lease->rapid_commit = true;
+
+ return 0;
+}
+
+int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *rapid_commit) {
+ assert_return(lease, -EINVAL);
+ assert_return(rapid_commit, -EINVAL);
+
+ *rapid_commit = lease->rapid_commit;
+
+ return 0;
+}
+
int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid) {
assert_return(lease, -EINVAL);
assert_return(iaid, -EINVAL);