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

Commit ff01f81f authored by Lorenzo Colitti's avatar Lorenzo Colitti Committed by Android Git Automerger
Browse files

am e9f7e65c: Merge "Populate 464xlat LinkProperties only when the interface...

am e9f7e65c: Merge "Populate 464xlat LinkProperties only when the interface comes up." into lmp-mr1-dev

* commit 'e9f7e65c':
  Populate 464xlat LinkProperties only when the interface comes up.
parents 2f74e913 e9f7e65c
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -63,8 +63,8 @@ public class Nat464Xlat extends BaseNetworkObserver {
    //  - Idle: start() not called. Everything is null.
    //  - Idle: start() not called. Everything is null.
    //  - Starting: start() called. Interfaces are non-null. isStarted() returns true.
    //  - Starting: start() called. Interfaces are non-null. isStarted() returns true.
    //    mIsRunning is false.
    //    mIsRunning is false.
    //  - Running: start() called, and interfaceAdded() told us that mIface is up. Clat IP address
    //  - Running: start() called, and interfaceLinkStateChanged() told us that mIface is up.
    //    is non-null. mIsRunning is true.
    //    mIsRunning is true.
    //
    //
    // Once mIface is non-null and isStarted() is true, methods called by ConnectivityService on
    // Once mIface is non-null and isStarted() is true, methods called by ConnectivityService on
    // its handler thread must not modify any internal state variables; they are only updated by the
    // its handler thread must not modify any internal state variables; they are only updated by the
@@ -236,10 +236,10 @@ public class Nat464Xlat extends BaseNetworkObserver {
    }
    }


    @Override
    @Override
    public void interfaceAdded(String iface) {
    public void interfaceLinkStateChanged(String iface, boolean up) {
        // Called by the InterfaceObserver on its own thread, so can race with stop().
        // Called by the InterfaceObserver on its own thread, so can race with stop().
        if (isStarted() && mIface.equals(iface)) {
        if (isStarted() && up && mIface.equals(iface)) {
            Slog.i(TAG, "interface " + iface + " added, mIsRunning " + mIsRunning + "->true");
            Slog.i(TAG, "interface " + iface + " is up, mIsRunning " + mIsRunning + "->true");


            if (!mIsRunning) {
            if (!mIsRunning) {
                LinkAddress clatAddress = getLinkAddress(iface);
                LinkAddress clatAddress = getLinkAddress(iface);