From 631bbe71298ec892f77f44f94feb612646fe6853 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Thu, 19 Jun 2014 15:39:42 +0300 Subject: sd-dhcp6-client: Receive and parse Advertise messages When receiving DHCPv6 messages, discard the ones that are not meant for DHCPv6 clients and verify the transaction id. Once that is done, process the Advertise message and select the Advertise with the highest preference. Create a separate function for lease information parsing so that it can be reused in other parts of the protocol. Verify both DUID and IAID in the received message and store other necessary information with the lease structure. --- src/libsystemd-network/dhcp6-protocol.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsystemd-network/dhcp6-protocol.h') diff --git a/src/libsystemd-network/dhcp6-protocol.h b/src/libsystemd-network/dhcp6-protocol.h index c58a07b176..1303a55a82 100644 --- a/src/libsystemd-network/dhcp6-protocol.h +++ b/src/libsystemd-network/dhcp6-protocol.h @@ -21,6 +21,9 @@ along with systemd; If not, see . ***/ +#include +#include + #include "macro.h" #include "sparse-endian.h" @@ -36,6 +39,9 @@ struct DHCP6Message { typedef struct DHCP6Message DHCP6Message; +#define DHCP6_MIN_OPTIONS_SIZE \ + 1280 - sizeof(struct ip6_hdr) - sizeof(struct udphdr) + #define IN6ADDR_ALL_DHCP6_RELAY_AGENTS_AND_SERVERS_INIT \ { { { 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02 } } } -- cgit v1.2.3-54-g00ecf