Merge changes Ibe325714,I44f3dc9e

* changes:
  fix whitespace in offload.c macro
  change PRIO_CLAT into a comment
This commit is contained in:
Maciej Żenczykowski
2021-03-18 19:53:24 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -72,11 +72,11 @@
DEFINE_BPF_MAP_GRW(tether_error_map, ARRAY, uint32_t, uint32_t, BPF_TETHER_ERR__MAX,
AID_NETWORK_STACK)
#define COUNT_AND_RETURN(counter, ret) do { \
#define COUNT_AND_RETURN(counter, ret) do { \
uint32_t code = BPF_TETHER_ERR_ ## counter; \
uint32_t *count = bpf_tether_error_map_lookup_elem(&code); \
if (count) __sync_fetch_and_add(count, 1); \
return ret; \
if (count) __sync_fetch_and_add(count, 1); \
return ret; \
} while(0)
#define TC_DROP(counter) COUNT_AND_RETURN(counter, TC_ACT_SHOT)

View File

@@ -56,7 +56,7 @@ public class BpfUtils {
// Sync from system/netd/server/OffloadUtils.h.
static final short PRIO_TETHER6 = 1;
static final short PRIO_TETHER4 = 2;
static final short PRIO_CLAT = 3;
// note that the above must be lower than PRIO_CLAT from netd's OffloadUtils.cpp
private static String makeProgPath(boolean downstream, int ipVersion, boolean ether) {
String path = "/sys/fs/bpf/tethering/prog_offload_schedcls_tether_"