On Wed, Jan 22, 2020 at 02:05:42PM +0100, Jakub Sitnicki wrote: > In order for sockmap type to become a generic collection for storing TCP > sockets we need to loosen the checks during map update, while tightening > the checks in redirect helpers. > > Currently sockmap requires the TCP socket to be in established state (or > transitioning out of SYN_RECV into established state when done from BPF), If I read the SYN_RECV changes correctly, does it mean BPF_SOCK_OPS_PASSIVE_ESTABLISHED_CB currently not work? > which prevents inserting listening sockets. > > Change the update pre-checks so the socket can also be in listening state. > > Since it doesn't make sense to redirect with sockmap to listening sockets, > add appropriate socket state checks to BPF redirect helpers too. Acked-by: Martin KaFai Lau <kafai@xxxxxx>