summaryrefslogtreecommitdiff
path: root/src/odhcp6c.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/odhcp6c.h')
-rw-r--r--src/odhcp6c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/odhcp6c.h b/src/odhcp6c.h
index 928f82f..08a816f 100644
--- a/src/odhcp6c.h
+++ b/src/odhcp6c.h
@@ -18,6 +18,7 @@
#define _unused __attribute__((unused))
#define _packed __attribute__((packed))
+#define __aligned(n) __attribute__((aligned(n)))
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -302,6 +303,14 @@ struct odhcp6c_entry {
uint8_t auxtarget[];
};
+// Include padding after auxtarget to align the next entry
+#define odhcp6c_entry_size(entry) \
+ (sizeof(struct odhcp6c_entry) + (((entry)->auxlen + 3) & ~3))
+
+#define odhcp6c_next_entry(entry) \
+ ((struct odhcp6c_entry *)((uint8_t *)(entry) + odhcp6c_entry_size(entry)))
+
+
struct odhcp6c_request_prefix {
uint32_t iaid;
uint16_t length;