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

Commit a5ae9056 authored by Erik Kline's avatar Erik Kline
Browse files

Log NAT update descriptions when receiving netlink errors

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - new logging messages observed

    2017-10-06T13:15:25.190 - [OffloadController] ERROR Error updating NAT conntrack entry >TCP (192.168.43.222, 58054) -> (198.35.26.112, 443)<: android.system.ErrnoException: NetlinkErrorMessage{...
Bug: 29337859
Bug: 32163131
Bug: 64976634
Bug: 67396342

Change-Id: Ie05d4e6588d75f8a9798f40b68a317e24b3b5050
parent bb3ff154
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -596,9 +596,10 @@ public class OffloadController {
        }

        mNatUpdateCallbacksReceived++;
        final String natDescription = String.format("%s (%s, %s) -> (%s, %s)",
                protoName, srcAddr, srcPort, dstAddr, dstPort);
        if (DBG) {
            mLog.log(String.format("NAT timeout update: %s (%s, %s) -> (%s, %s)",
                     protoName, srcAddr, srcPort, dstAddr, dstPort));
            mLog.log("NAT timeout update: " + natDescription);
        }

        final int timeoutSec = connectionTimeoutUpdateSecondsFor(proto);
@@ -609,7 +610,7 @@ public class OffloadController {
            NetlinkSocket.sendOneShotKernelMessage(OsConstants.NETLINK_NETFILTER, msg);
        } catch (ErrnoException e) {
            mNatUpdateNetlinkErrors++;
            mLog.e("Error updating NAT conntrack entry: " + e
            mLog.e("Error updating NAT conntrack entry >" + natDescription + "<: " + e
                    + ", msg: " + NetlinkConstants.hexify(msg));
            mLog.log("NAT timeout update callbacks received: " + mNatUpdateCallbacksReceived);
            mLog.log("NAT timeout update netlink errors: " + mNatUpdateNetlinkErrors);