Re: Routing loops & TTL tracking with tunnel devices

From: Eric Dumazet
Date: Fri Apr 29 2022 - 18:46:41 EST


On Fri, Apr 29, 2022 at 3:09 PM Jason A. Donenfeld <Jason@xxxxxxxxx> wrote:
>
> Hi Eric,
>
> On Sat, Apr 30, 2022 at 12:05 AM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
> > I assume you add encap headers to the skb ?
>
> Yes; it's encapsulated in UDP, and under that some short header.
> However, everything under that is encrypted. So,
>
> > You could check if the wireguard header is there already, or if the
> > amount of headers is crazy.
>
> so it's not quite possible to peer down further to see.
>
> > You also can take a look at CONFIG_SKB_EXTENSIONS infrastructure.
>
> Blech, this involves some kind of per-packet allocation, right? I was
> hoping there might be some 6 or 7 or 8 bit field in sk_buff that's not
> used anywhere on the TX path that maybe I could overload for this
> purpose...
>

Maybe reuse redirected / tc_skip_classify (used in drivers/net/ifb.c)