chiark / gitweb /
sd-dhcp: refactor dhcp_option_append
authorTom Gundersen <teg@jklm.no>
Tue, 20 May 2014 09:04:50 +0000 (11:04 +0200)
committerTom Gundersen <teg@jklm.no>
Tue, 20 May 2014 21:31:22 +0000 (23:31 +0200)
commit20b958bf157dfb2f521b191ef7158035bcaa3003
treed5964a60f26aaa1aeb4b0771a1f2a2b0f0efed10
parentece6e766cf89c8ec82ad135969dedf16cd7c1ee8
sd-dhcp: refactor dhcp_option_append

Store a pointer to the options in the DHCPMessage struct, and pass
this together with an offset around, rather than a uint8_t**.

This avoids us having to (re)compute the pointer; and changes
dhcp_option_append from adjusting both the pointer to the next
option and the remaining size of the options, to just adjusting
the current offset.

This makes the code a bit simpler to follow IMHO, but there should
be no functional change.
src/libsystemd-network/dhcp-internal.h
src/libsystemd-network/dhcp-option.c
src/libsystemd-network/dhcp-packet.c
src/libsystemd-network/dhcp-protocol.h
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/test-dhcp-option.c