On Thu, Dec 14, 2023 at 4:55 PM Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> wrote: > > We will support arbitrary SYN Cookie with BPF. > > If BPF prog validates ACK and kfunc allocates a reqsk, it will > be carried to TCP stack as skb->sk with req->syncookie 1. > > In skb_steal_sock(), we need to check inet_reqsk(sk)->syncookie > to see if the reqsk is created by kfunc. However, inet_reqsk() > is not available in sock.h. > > Let's move skb_steal_sock() to request_sock.h. > > While at it, we refactor skb_steal_sock() so it returns early if > skb->sk is NULL to minimise the following patch. > > Signed-off-by: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx> Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>