diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-05-31 11:02:57 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-05-31 11:02:57 +0200 |
commit | 9681ce359d65060b7f9da14c3adb3bdaf9e48d11 (patch) | |
tree | 4aaf036438d9b3efc6797fcb451babc78034b86d /openbsc | |
parent | a8aa4df813be0819c1c3e02fc3b974388a4b170e (diff) |
[GPRS] NS: Fix GRE keepalive response in FR-GRE encapsulation
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/gprs/gprs_ns_frgre.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsc/src/gprs/gprs_ns_frgre.c b/openbsc/src/gprs/gprs_ns_frgre.c index 326bd70f..7436d0dc 100644 --- a/openbsc/src/gprs/gprs_ns_frgre.c +++ b/openbsc/src/gprs/gprs_ns_frgre.c @@ -62,7 +62,7 @@ static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg, gre_payload_len = msg->len - (iph->ihl*4 + sizeof(*greh)); - inner_iph = (struct iphdr *) (uint8_t *)greh + sizeof(*greh); + inner_iph = (struct iphdr *) ((uint8_t *)greh + sizeof(*greh)); if (gre_payload_len < inner_iph->ihl*4 + sizeof(*inner_greh)) { LOGP(DNS, LOGL_ERROR, "GRE keepalive too short\n"); @@ -81,7 +81,7 @@ static int handle_rx_gre_ipv4(struct bsc_fd *bfd, struct msgb *msg, return -EIO; } - inner_greh = (struct gre_hdr *) ((uint8_t *)iph + iph->ihl*4); + inner_greh = (struct gre_hdr *) ((uint8_t *)inner_iph + iph->ihl*4); if (inner_greh->ptype != htons(GRE_PTYPE_KAR)) { LOGP(DNS, LOGL_ERROR, "GRE keepalive inner GRE type != 0\n"); return -EIO; |