mirror of https://gerrit.osmocom.org/libosmocore
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
This commit is contained in:
parent
ca3550a261
commit
47ed2a6b4a
|
@ -339,7 +339,11 @@ static struct msgb *read_nsfrgre_msg(struct osmo_fd *bfd, int *error,
|
|||
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));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue