Currently 5-tuple(sip+dip+sport+dport+proto) can't identify a uniq connection because there may be multi net namespace. For example, there may be a chance that netns a and netns b all listen on 127.0.0.1:8080 and the client with same port 40782 connect to them. Without netns number, sock ops program can't distinguish them. Using bpf_sock_ops_get_netns helpers to get current connection netns number to distinguish connections. Lingpeng Chen (2): bpf: Add sock ops get netns helpers bpf: Sync uapi bpf.h to tools/ include/uapi/linux/bpf.h | 8 +++++++- net/core/filter.c | 18 ++++++++++++++++++ tools/include/uapi/linux/bpf.h | 8 +++++++- 3 files changed, 32 insertions(+), 2 deletions(-) -- 2.17.1