Change in libosmocore[master]: gprs_ns2_frgre: set a correct gre pointer for ipv6

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/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Wed Feb 3 10:58:11 UTC 2021


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22647 )


Change subject: gprs_ns2_frgre: set a correct gre pointer for ipv6
......................................................................

gprs_ns2_frgre: set a correct gre pointer for ipv6

Also fixes a nullpointer deref because iph is NULL on IPv6

Related: CID#216555
Change-Id: I2ff868a7bba6151a2202df774ff022c02b8c34cb
---
M src/gb/gprs_ns2_frgre.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/22647/1

diff --git a/src/gb/gprs_ns2_frgre.c b/src/gb/gprs_ns2_frgre.c
index 8b40d7b..2c5fe2f 100644
--- a/src/gb/gprs_ns2_frgre.c
+++ b/src/gb/gprs_ns2_frgre.c
@@ -339,7 +339,11 @@
 		break;
 	}
 
-	greh = (struct gre_hdr *) (msg->data + iph->ihl*4);
+	if (iph)
+		greh = (struct gre_hdr *) (msg->data + iph->ihl*4);
+	else
+		greh = (struct gre_hdr *) (msg->data + sizeof(struct ip6_hdr));
+
 	if (greh->flags) {
 		LOGBIND(bind, LOGL_NOTICE, "Unknown GRE flags 0x%04x\n", osmo_ntohs(greh->flags));
 	}

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I2ff868a7bba6151a2202df774ff022c02b8c34cb
Gerrit-Change-Number: 22647
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210203/6e85f44f/attachment.htm>


More information about the gerrit-log mailing list