Commit 26ea73a0 authored by Pavan Kumar M's avatar Pavan Kumar M
Browse files

Avoid recording negative data

If Android XLAT interface is up, xlatAdjustments are done
while calculating stats to account respectively for
double-counted traffic and IPv4/IPv6 header size difference.

NetworkStatsEntry with 464xlat traffic entries to be deducted
on the base interface will have negative entries and the
entries will be unnecessarily assigned LONG_MAX value while
combining/adding the values with base traffic entries. This
results in the netstats_error.

This change avoids assigning LONG_MAX value to entries unless
there is a overflow and thereby avoiding the netstats_errors.

Test :

    - Builds, Boots
    - Stats related tests
    - Tethering with Android XLAT up

Change-Id: Iebb655a96def290d714c16184a47ec007b4da4b8
CRs-Fixed: 2370692
parent ca06a6dd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment