Re: [PATCH ovpn-net-next] ovpn: reset MAC header before passing skb up

Antonio Quartulli <[email protected]>
Newsgroups gmane.network.openvpn.devel
Message-ID <[email protected]>
Hi Qingfang,

thanks for the patch!

On 27/04/2026 06:00, Qingfang Deng wrote:
> After decapsulating a packet, the skb->mac_header still points to the
> outer transport header. Call skb_reset_mac_header() in
> ovpn_netdev_write() to ensure the MAC header points to the beginning of
> the inner IP packet.

May you elaborate on what this is exactly fixing?
Did you encounter a bug triggered by this missing line?

I am asking because I wonder what is "expected" as MAC header for a 
packet not having one at all (packets delivered to the ovpn interface 
are L3 only, as per the interface type itself).

Thanks!

Regards,

> 
> Reported-by: Minqiang Chen <[email protected]>
> Fixes: 8534731dbf2d ("ovpn: implement packet processing")
> Signed-off-by: Qingfang Deng <[email protected]>
> ---
>   drivers/net/ovpn/io.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ovpn/io.c b/drivers/net/ovpn/io.c
> index db43a1f8a07a..d92bb87be2b2 100644
> --- a/drivers/net/ovpn/io.c
> +++ b/drivers/net/ovpn/io.c
> @@ -85,6 +85,7 @@ static void ovpn_netdev_write(struct ovpn_peer *peer, struct sk_buff *skb)
>   	skb_scrub_packet(skb, true);
>   
>   	/* network header reset in ovpn_decrypt_post() */
> +	skb_reset_mac_header(skb);
>   	skb_reset_transport_header(skb);
>   	skb_reset_inner_headers(skb);
>   

-- 
Antonio Quartulli
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.