dhcp6: Fix IA Address option parsing
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 4 Jan 2018 13:11:43 +0000 (15:11 +0200)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 4 Jan 2018 13:22:43 +0000 (15:22 +0200)
commit0dfe2a4b5680f47eafd987fc4cdae6d536b72cb6
treeef6c63501baca04a0384ecfb63c14a0e90d19d72
parentc6b4f32a507c5ad885265309b2ecb56e618564d5
dhcp6: Fix IA Address option parsing

Factor out IA Address option parsing and fix it so that all conditions
are checked before a new address is allocated and added to the address
list. Note also that the IA Address option can contain a nested Status
option. If the status in anything else than zero, the DHCPv6 server is
communicating an error condition and the address cannot be used.
Status option nesting is clarified in RFC 7550, Section 4.1.

The IA Address option is included as a typedef so that the lifetimes
can be inspected before allocating a new address and the option length
needed is easily available.
src/libsystemd-network/dhcp6-internal.h
src/libsystemd-network/dhcp6-option.c