ggsn: make sure ipcp_option_hdr and and ipcp_hdr are packed
struct ipcp_option_hdr and struct ipcp_hdr are not declared as
packed explicitly, but they are used to parse memory blobs by
casting pointers. Add __attribute__((packed)) to ensure that
those structs are stored packed.
Change-Id: I14e10bb3ce482347b3f0c4d3a75168a55df15f20
Related: OS#3288
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 3a8c4be..14bf04f 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -403,14 +403,14 @@
uint8_t type;
uint8_t len;
uint8_t data[0];
-};
+} __attribute__ ((packed));
struct ipcp_hdr {
uint8_t code;
uint8_t id;
uint16_t len;
uint8_t options[0];
-};
+} __attribute__ ((packed));
/* determine if IPCP contains given option */
static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt)