Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5713e957 authored by Chalard Jean's avatar Chalard Jean Committed by Gerrit Code Review
Browse files

Merge "Add PCSCF to LinkProperties."

parents ec395eb9 6fddc6d1
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -1184,6 +1184,26 @@ public class DataConnection extends StateMachine {
                    throw new UnknownHostException("Empty dns response and no system default dns");
                }

                // set pcscf
                if (response.getPcscfs().size() > 0) {
                    for (String pcscf : response.getPcscfs()) {
                        if (pcscf == null) continue;
                        pcscf = pcscf.trim();
                        if (pcscf.isEmpty()) continue;
                        InetAddress ia;
                        try {
                            ia = NetworkUtils.numericToInetAddress(pcscf);
                        } catch (IllegalArgumentException e) {
                            throw new UnknownHostException("Non-numeric pcscf addr=" + pcscf);
                        }
                        if (!ia.isAnyLocalAddress()) {
                            linkProperties.addPcscfServer(ia);
                        } else {
                            log("bad address in PCSCF");
                        }
                    }
                }

                for (InetAddress gateway : response.getGateways()) {
                    // Allow 0.0.0.0 or :: as a gateway;
                    // this indicates a point-to-point interface.