On 02/06/2017 03:17 AM, Chenbo Feng wrote:
From: Chenbo Feng
Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff
with a known socket. Generates a new cookie if one was not yet set.If
the socket pointer inside sk_buff is NULL, 0 is returned. The helper
function coud be usefu
On Mon, 2017-02-06 at 12:01 +0900, Lorenzo Colitti wrote:
> On Mon, Feb 6, 2017 at 11:17 AM, Chenbo Feng
> wrote:
> > +BPF_CALL_1(bpf_get_socket_cookie, struct sk_buff *, skb)
> > +{
> > + return skb->sk ? sock_gen_cookie(skb->sk) : 0;
> > +}
> > +
>
> Does this code need to increment the s
On Mon, Feb 6, 2017 at 11:17 AM, Chenbo Feng
wrote:
> +BPF_CALL_1(bpf_get_socket_cookie, struct sk_buff *, skb)
> +{
> + return skb->sk ? sock_gen_cookie(skb->sk) : 0;
> +}
> +
Does this code need to increment the socket refcount, or call
ACCESS_ONCE to get skb->sk? The socket filter codepa
On Sun, 2017-02-05 at 18:17 -0800, Chenbo Feng wrote:
> From: Chenbo Feng
>
> Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff
> with a known socket. Generates a new cookie if one was not yet set.If
> the socket pointer inside sk_buff is NULL, 0 is returned. The helper
> f
From: Chenbo Feng
Retrieve the socket cookie generated by sock_gen_cookie() from a sk_buff
with a known socket. Generates a new cookie if one was not yet set.If
the socket pointer inside sk_buff is NULL, 0 is returned. The helper
function coud be useful in monitoring per socket networking traffic