wgengine/magicsock: set Geneve header protocol for WireGuard (#16350)

Otherwise receives interpret as naked WireGuard.

Updates tailscale/corp#27502

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited 2025-06-21 21:14:42 -07:00 committed by GitHub
parent 61958f531c
commit 0905936c45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -114,6 +114,7 @@ func (c *linuxBatchingConn) coalesceMessages(addr *net.UDPAddr, vni virtualNetwo
vniIsSet := vni.isSet()
var gh packet.GeneveHeader
if vniIsSet {
gh.Protocol = packet.GeneveProtocolWireGuard
gh.VNI = vni.get()
}
for i, buff := range buffs {
@ -202,6 +203,7 @@ retry:
vniIsSet := addr.vni.isSet()
var gh packet.GeneveHeader
if vniIsSet {
gh.Protocol = packet.GeneveProtocolWireGuard
gh.VNI = addr.vni.get()
offset -= packet.GeneveFixedHeaderLength
}

View File

@ -85,7 +85,8 @@ func (c *RebindingUDPConn) WriteBatchTo(buffs [][]byte, addr epAddr, offset int)
var gh packet.GeneveHeader
if vniIsSet {
gh = packet.GeneveHeader{
VNI: addr.vni.get(),
Protocol: packet.GeneveProtocolWireGuard,
VNI: addr.vni.get(),
}
}
for _, buf := range buffs {