Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Matt Corallo <wg-lists@bluematt.me>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Leaving skb->priority alone when encapsulating?
Date: Sat, 6 Sep 2025 17:12:02 -0400	[thread overview]
Message-ID: <043598bd-198a-4d79-8749-789e578e07fe@bluematt.me> (raw)

Its (I presume) fairly common to have multiple wireguard links on a single machine which ultimately 
has its outbound interface shaped with some tc qdisc. While wg_reset_packet leaves the skb hash flag 
alone to allow that qdisc to have visibility into the header hash, it wipes all other skb headers 
with a `memset(&skb->headers...)`. This makes it (I believe) impossible to allow the primary qdisc 
to operate on the DSCP of the inner packet (which wireguard reasonably wipes, but could otherwise be 
copied into skb->priority, which is generally an appropriate place for it).

This appears to differ from every other tunneling protocol (the only instances of `memset.*headers` 
in the entire tree are in wireguard and the mellanox drivers) and other encapsulation protocols 
appear to rely on iptunnel_xmit's clearing of the relevant flags, rather than doing it themselves.

While most of the fields in a skb's headers are perfectly reasonable to clear, I do wonder why 
wireguard is special here, but in any case it would be very nice to allow at least priority to 
propagate past wg_reset_packet.

                 reply	other threads:[~2025-09-06 21:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=043598bd-198a-4d79-8749-789e578e07fe@bluematt.me \
    --to=wg-lists@bluematt.me \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).