Skip to content

Commit

Permalink
Fix UDP outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Dec 9, 2024
1 parent 5a4b31f commit 98cf984
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/tstun/wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,14 @@ func (t *Wrapper) injectedRead(res tunInjectedRead, outBuffs [][]byte, sizes []i
defer parsedPacketPool.Put(p)
p.Decode(pkt)

if !t.disableFilter {
response, _ := t.filterPacketOutboundToWireGuard(p, pc, nil)
if response != filter.Accept {
metricPacketOutDrop.Add(1)
return 0, nil
}
}

invertGSOChecksum(pkt, gso)
pc.snat(p)
invertGSOChecksum(pkt, gso)
Expand Down

0 comments on commit 98cf984

Please sign in to comment.