Review at  https://gerrit.osmocom.org/6102

ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx

pdp_has_v4 only take into account IPv4 EUAs.

Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3
---
M ggsn/ggsn.c
1 file changed, 2 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/02/6102/1

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 @@
        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 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)) {

-- 
To view, visit https://gerrit.osmocom.org/6102
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <[email protected]>

Reply via email to