Merge "Return false when tetherOffloadRuleAdd doesn't really add items" into main

This commit is contained in:
Treehugger Robot 2024-09-02 08:18:57 +00:00 • committed by Gerrit Code Review
commit c694c351c0
2 changed files with 3 additions and 0 deletions

View file

@ -359,6 +359,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;
}

View file

@ -140,6 +140,8 @@ public abstract class BpfCoordinatorShim {
/**
* Adds a tethering IPv4 offload rule to appropriate BPF map.
*
* @return true iff the map was modified, false if the key already exists or there was an error.
*/
public abstract boolean tetherOffloadRuleAdd(boolean downstream, @NonNull Tether4Key key,
@NonNull Tether4Value value);