Change in ...osmo-ggsn[master]: ggsn: Avoid unaligned mem access reading PCO proto id

pespin gerrit-no-reply at lists.osmocom.org
Mon Jul 1 10:31:22 UTC 2019


pespin has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ggsn/+/14619 )

Change subject: ggsn: Avoid unaligned mem access reading PCO proto id
......................................................................

ggsn: Avoid unaligned mem access reading PCO proto id

Change-Id: I3d80833319869503691a52927892e6ac30744915
---
M ggsn/ggsn.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 968d4dd..78987e4 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -671,7 +671,7 @@
 static void process_pco_element(const struct pco_element *pco_elem, struct msgb *resp,
 				const struct apn_ctx *apn, struct pdp_t *pdp)
 {
-	uint16_t protocol_id = ntohs(pco_elem->protocol_id);
+	uint16_t protocol_id = osmo_load16be(&pco_elem->protocol_id);
 
 	LOGPPDP(LOGL_DEBUG, pdp, "PCO Protocol 0x%04x\n", protocol_id);
 	switch (protocol_id) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ggsn/+/14619
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Change-Id: I3d80833319869503691a52927892e6ac30744915
Gerrit-Change-Number: 14619
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190701/941bfa1d/attachment.html>


More information about the gerrit-log mailing list