summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-protocol.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-05-20 11:04:50 +0200
committerTom Gundersen <teg@jklm.no>2014-05-20 23:31:22 +0200
commit20b958bf157dfb2f521b191ef7158035bcaa3003 (patch)
treed5964a60f26aaa1aeb4b0771a1f2a2b0f0efed10 /src/libsystemd-network/dhcp-protocol.h
parentece6e766cf89c8ec82ad135969dedf16cd7c1ee8 (diff)
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.
Diffstat (limited to 'src/libsystemd-network/dhcp-protocol.h')
-rw-r--r--src/libsystemd-network/dhcp-protocol.h1
1 files changed, 1 insertions, 0 deletions
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;