diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-01-26 17:51:55 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-01-26 18:20:22 +0000 |
commit | 4ae8d8232db38cbba898c1a2eedd25552b2ca434 (patch) | |
tree | 832e9a6596acc9d0b1d4b0f5357a3315deff34cb /ggsn/ggsn.c | |
parent | 0bdd8bf5bcfecfc6a8d1228dd2dfebcac3f7f819 (diff) |
ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx
pdp_has_v4 only take into account IPv4 EUAs.
Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3
Diffstat (limited to 'ggsn/ggsn.c')
-rw-r--r-- | ggsn/ggsn.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0ff292d..c4e28f8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -484,15 +484,6 @@ static struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) { return NULL; } -/* determine if PDP context has IPv6 support */ -static bool pdp_has_v4(struct pdp_t *pdp) -{ - if (pdp->eua.l == 4+2) - return true; - else - return false; -} - /* construct an IPCP PCO response from request*/ static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { @@ -540,12 +531,13 @@ static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *m static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); unsigned int i; OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ - if (pdp_has_v4(pdp)) + if (peer_v4) build_ipcp_pco(apn, pdp, msg); if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { |