[PATCH] tun/netstack: implement MaxHeaderLength

john at gravitl.com john at gravitl.com
Fri Mar 11 05:28:32 UTC 2022


From: John Sahhar <john at gravitl.com>

Signed-off-by: John Sahhar <john at gravitl.com>
---
 tun/netstack/tun.go | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/tun/netstack/tun.go b/tun/netstack/tun.go
index 8b1bb7f..94b59f8 100644
--- a/tun/netstack/tun.go
+++ b/tun/netstack/tun.go
@@ -71,8 +71,11 @@ func (*endpoint) Capabilities() stack.LinkEndpointCapabilities {
 	return stack.CapabilityNone
 }
 
-func (*endpoint) MaxHeaderLength() uint16 {
-	return 0
+func (e *endpoint) MaxHeaderLength() uint16 {
+	if e.hasV6 && !e.hasV4 {
+		return 40
+	}
+	return 60
 }
 
 func (*endpoint) LinkAddress() tcpip.LinkAddress {
-- 
2.32.0



More information about the WireGuard mailing list