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
This commit is contained in:
parent
0d95ca59f9
commit
6a2856bab5
|
@ -403,14 +403,14 @@ struct ipcp_option_hdr {
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue