Change in osmo-ggsn[master]: ggsn: make sure ipcp_option_hdr and and ipcp_hdr are packed

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Mon May 28 16:01:01 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/9355


Change subject: ggsn: make sure ipcp_option_hdr and and ipcp_hdr are packed
......................................................................

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
---
M ggsn/ggsn.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/55/9355/1

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)

-- 
To view, visit https://gerrit.osmocom.org/9355
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I14e10bb3ce482347b3f0c4d3a75168a55df15f20
Gerrit-Change-Number: 9355
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180528/c6883bf0/attachment.htm>


More information about the gerrit-log mailing list