Re: [PATCHv3 bpf-next 07/12] bpf: Add helper to retrieve socket in BPF

2018-09-28 Thread Alexei Starovoitov
On Thu, Sep 27, 2018 at 04:26:54PM -0700, Joe Stringer wrote: > This patch adds new BPF helper functions, bpf_sk_lookup_tcp() and > bpf_sk_lookup_udp() which allows BPF programs to find out if there is a > socket listening on this host, and returns a socket pointer which the > BPF program can then

[PATCHv3 bpf-next 07/12] bpf: Add helper to retrieve socket in BPF

2018-09-27 Thread Joe Stringer
This patch adds new BPF helper functions, bpf_sk_lookup_tcp() and bpf_sk_lookup_udp() which allows BPF programs to find out if there is a socket listening on this host, and returns a socket pointer which the BPF program can then access to determine, for instance, whether to forward or drop traffic.