From 20b958bf157dfb2f521b191ef7158035bcaa3003 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 20 May 2014 11:04:50 +0200 Subject: 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-protocol.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libsystemd-network/dhcp-protocol.h') diff --git a/src/libsystemd-network/dhcp-protocol.h b/src/libsystemd-network/dhcp-protocol.h index 539606cff6..11de186297 100644 --- a/src/libsystemd-network/dhcp-protocol.h +++ b/src/libsystemd-network/dhcp-protocol.h @@ -44,6 +44,7 @@ struct DHCPMessage { uint8_t sname[64]; uint8_t file[128]; be32_t magic; + uint8_t options[0]; } _packed_; typedef struct DHCPMessage DHCPMessage; -- cgit v1.2.3-54-g00ecf