* Incorrect computation of the MTU in wg-quick
@ 2025-02-02 23:47 Ismael Bouya
2025-05-21 21:08 ` Jason A. Donenfeld
0 siblings, 1 reply; 3+ messages in thread
From: Ismael Bouya @ 2025-02-02 23:47 UTC (permalink / raw)
To: wireguard
[-- Attachment #1: Type: text/plain, Size: 949 bytes --]
Hi,
I would like to report a behavior that seems to be incorrect in the way
wg-quick computes the MTU to assign to a wireguard interface:
https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash#n125
In this block, wg-quick goes through every endpoint it knows about,
gets the mtu of the route to reach the endpoint, and takes the highest
value among all the computed values.
However it appears to me that the chosen value should instead be the
lowest among all endpoints rather than the highest.
As an example, if I declare myself (localhost) as an endpoint (it may or
may not be supported, but that’s how I found about this issue), then the
mtu will be set to 65456 (65536-80) which is higher than what the other
endpoints are able to manage, and I’ll only be able to contact myself
properly.
I can provide a (trivial) patch, but I would like confirmation that my
report is correct?
Kind regards,
--
Ismael
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Incorrect computation of the MTU in wg-quick
2025-02-02 23:47 Incorrect computation of the MTU in wg-quick Ismael Bouya
@ 2025-05-21 21:08 ` Jason A. Donenfeld
2025-05-25 22:51 ` Ismael Bouya
0 siblings, 1 reply; 3+ messages in thread
From: Jason A. Donenfeld @ 2025-05-21 21:08 UTC (permalink / raw)
To: Ismael Bouya; +Cc: wireguard
> I would like to report a behavior that seems to be incorrect in the way
> wg-quick computes the MTU to assign to a wireguard interface:
> https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash#n125
> In this block, wg-quick goes through every endpoint it knows about,
> gets the mtu of the route to reach the endpoint, and takes the highest
> value among all the computed values.
> However it appears to me that the chosen value should instead be the
> lowest among all endpoints rather than the highest.
>
> As an example, if I declare myself (localhost) as an endpoint (it may or
> may not be supported, but that’s how I found about this issue), then the
> mtu will be set to 65456 (65536-80) which is higher than what the other
> endpoints are able to manage, and I’ll only be able to contact myself
> properly.
Thanks for the report. Fixed:
https://git.zx2c4.com/wireguard-tools/commit/?id=5150cd647073be1f1c12688aef291bdf17970154
Let me know if that looks okay to you.
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Incorrect computation of the MTU in wg-quick
2025-05-21 21:08 ` Jason A. Donenfeld
@ 2025-05-25 22:51 ` Ismael Bouya
0 siblings, 0 replies; 3+ messages in thread
From: Ismael Bouya @ 2025-05-25 22:51 UTC (permalink / raw)
To: Jason A. Donenfeld; +Cc: wireguard
[-- Attachment #1: Type: text/plain, Size: 1223 bytes --]
Hi Jason,
It seems to work correctly now, thanks for the fix!
Kind regards,
(Wed, May 21, 2025 at 11:08:43PM +0200) Jason A. Donenfeld :
> > I would like to report a behavior that seems to be incorrect in the way
> > wg-quick computes the MTU to assign to a wireguard interface:
> > https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash#n125
> > In this block, wg-quick goes through every endpoint it knows about,
> > gets the mtu of the route to reach the endpoint, and takes the highest
> > value among all the computed values.
> > However it appears to me that the chosen value should instead be the
> > lowest among all endpoints rather than the highest.
> >
> > As an example, if I declare myself (localhost) as an endpoint (it may or
> > may not be supported, but that’s how I found about this issue), then the
> > mtu will be set to 65456 (65536-80) which is higher than what the other
> > endpoints are able to manage, and I’ll only be able to contact myself
> > properly.
>
> Thanks for the report. Fixed:
> https://git.zx2c4.com/wireguard-tools/commit/?id=5150cd647073be1f1c12688aef291bdf17970154
>
> Let me know if that looks okay to you.
>
> Jason
--
Ismael
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-25 22:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-02 23:47 Incorrect computation of the MTU in wg-quick Ismael Bouya
2025-05-21 21:08 ` Jason A. Donenfeld
2025-05-25 22:51 ` Ismael Bouya
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).