[CTT-6] Update TCP conntrack entry timeout while adding rules
Needed because a payload data packet may have gone through non-offload path, before we added offload rules, and that this may result in in-kernel conntrack state being in ESTABLISHED but pending ACK (ie. UNACKED) state. But the in-kernel conntrack might never see the ACK because we just added offload rules. As such after adding the rules we need to force the timeout back to the normal ESTABLISHED timeout of 5 days. Issue: the timeout is set to unacknowledged 300s (countdwon to 298s) $ adb shell cat /proc/net/nf_conntrack ipv4 2 tcp 6 298 ESTABLISHED src=192.168.244.128 dst=140.112.8.116 sport=45694 dport=443 .. Test: atest TetheringCoverageTests Manual check: $ adb shell cat /proc/net/nf_conntrack ipv4 2 tcp 6 431988 ESTABLISHED src=192.168.40.162 dst=140.112.8.116 sport=40774 dport=443 .. Bug: 190783768 Bug: 192804833 Change-Id: I8c34e85e26c9d976e5e2b85473db75ff46d8abd4
This commit is contained in:
parent
a5c742be69
commit
299a81157c
2 changed files with 67 additions and 5 deletions
|
|
@ -371,6 +371,7 @@ public class BpfCoordinatorShimImpl
|
|||
} catch (IllegalStateException e) {
|
||||
// Silent if the rule already exists. Note that the errno EEXIST was rethrown as
|
||||
// IllegalStateException. See BpfMap#insertEntry.
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,6 +141,11 @@ public abstract class BpfCoordinatorShim {
|
|||
|
||||
/**
|
||||
* Adds a tethering IPv4 offload rule to appropriate BPF map.
|
||||
*
|
||||
* @param downstream true if downstream, false if upstream.
|
||||
* @param key the key to add.
|
||||
* @param value the value to add.
|
||||
* @return true iff the map was modified, false if the key exists or there was an error.
|
||||
*/
|
||||
public abstract boolean tetherOffloadRuleAdd(boolean downstream, @NonNull Tether4Key key,
|
||||
@NonNull Tether4Value value);
|
||||
|
|
|
|||
Loading…
Reference in a new issue