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

2018-09-24 Thread Daniel Borkmann
On 09/24/2018 08:05 PM, Joe Stringer wrote: > On Mon, 24 Sep 2018 at 05:38, Daniel Borkmann wrote: >> On 09/24/2018 02:12 PM, Daniel Borkmann wrote: >>> Hi Joe, >>> >>> couple of comments inline: >>> >>> On 09/21/2018 07:10 PM, Joe Stringer wrote: This patch adds new BPF helper functions, bpf

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

2018-09-24 Thread Joe Stringer
On Mon, 24 Sep 2018 at 05:51, Daniel Borkmann wrote: > > On 09/24/2018 02:12 PM, Daniel Borkmann wrote: > > On 09/21/2018 07:10 PM, Joe Stringer wrote: > [...] > >> +/* bpf_sk_lookup performs the core lookup for different types of sockets, > >> + * taking a reference on the socket if it doesn't ha

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

2018-09-24 Thread Joe Stringer
On Mon, 24 Sep 2018 at 05:38, Daniel Borkmann wrote: > > On 09/24/2018 02:12 PM, Daniel Borkmann wrote: > > Hi Joe, > > > > couple of comments inline: > > > > On 09/21/2018 07:10 PM, Joe Stringer wrote: > >> This patch adds new BPF helper functions, bpf_sk_lookup_tcp() and > >> bpf_sk_lookup_udp()

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

2018-09-24 Thread Joe Stringer
On Mon, 24 Sep 2018 at 05:12, Daniel Borkmann wrote: > > Hi Joe, > > couple of comments inline: Thanks for the review, I'll fix up those bits. > On 09/21/2018 07:10 PM, Joe Stringer wrote: > > This patch adds new BPF helper functions, bpf_sk_lookup_tcp() and > > bpf_sk_lookup_udp() which allows

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

2018-09-24 Thread Daniel Borkmann
On 09/24/2018 02:12 PM, Daniel Borkmann wrote: > On 09/21/2018 07:10 PM, Joe Stringer wrote: [...] >> +/* bpf_sk_lookup performs the core lookup for different types of sockets, >> + * taking a reference on the socket if it doesn't have the flag >> SOCK_RCU_FREE. >> + * Returns the socket as an 'un

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

2018-09-24 Thread Daniel Borkmann
On 09/24/2018 02:12 PM, Daniel Borkmann wrote: > Hi Joe, > > couple of comments inline: > > On 09/21/2018 07:10 PM, 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 listeni

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

2018-09-24 Thread Daniel Borkmann
Hi Joe, couple of comments inline: On 09/21/2018 07:10 PM, 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 > BP

[PATCHv2 bpf-next 07/11] bpf: Add helper to retrieve socket in BPF

2018-09-21 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.