On Wed, 22 Jan 2020 at 13:06, Jakub Sitnicki <jakub@xxxxxxxxxxxxxx> wrote: > @@ -352,7 +376,15 @@ static int sock_map_update_common(struct bpf_map *map, u32 idx, > if (!link) > return -ENOMEM; > > - ret = sock_map_link(map, &stab->progs, sk); > + /* Only established or almost established sockets leaving > + * SYN_RECV state need to hold refs to parser/verdict progs > + * and have their sk_data_ready and sk_write_space callbacks > + * overridden. > + */ > + if (sk->sk_state == TCP_LISTEN) > + ret = sock_map_link_no_progs(map, sk); > + else > + ret = sock_map_link(map, &stab->progs, sk); Could you use sock_map_redirect_okay from the previous patch here instead of checking for TCP_LISTEN? -- Lorenz Bauer | Systems Engineer 6th Floor, County Hall/The Riverside Building, SE1 7PB, UK www.cloudflare.com