I reported this bug a while ago, but it appears that it's stuck in limbo.

Can someone with commit privileges take a look at this, as well as the one below to resolve the issues of wg(4) with IPv6?

https://marc.info/?l=openbsd-bugs&m=178629332586524

Thanks.

On 8/7/26 07:17, Zixu Wu wrote:
Zero padding shouldn't cause the packet size to go beyond MTU.

diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c
index 0641c4b5ba9..90ef5b808a0 100644
--- a/sys/net/if_wg.c
+++ b/sys/net/if_wg.c
@@ -1592,6 +1592,9 @@ wg_encap(struct wg_softc *sc, struct mbuf *m)
         peer = t->t_peer;

         plaintext_len = WG_PKT_WITH_PADDING(m->m_pkthdr.len);
+       if (m->m_pkthdr.len <= t->t_mtu && plaintext_len > t->t_mtu) {
+               plaintext_len = t->t_mtu;
+       }
         padding_len = plaintext_len - m->m_pkthdr.len;
         out_len = sizeof(struct wg_pkt_data) + plaintext_len +
             NOISE_AUTHTAG_LEN;

Reply via email to