Skip to content

Commit

Permalink
ipn/wg: flood iff not overwriting reserved bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Nov 2, 2024
1 parent 34dc257 commit a8b85ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions intra/ipn/wg/wgconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,11 @@ func (s *StdNetBind) Send(buf [][]byte, peer conn.Endpoint) (err error) {
overwritten = true
}
}
// flood the network with random packets if experimentalWg is enabled
if overwriteReserved && !overwritten && experimentalWg {
if !flooded && len(data) == device.MessageInitiationSize {
if !flooded && !overwritten && (overwriteReserved || experimentalWg) {
if len(data) == device.MessageInitiationSize {
go s.flood(uc, dst, fkHandshake) // probably a handshake
flooded = true
} else if !flooded && len(data) == device.MessageKeepaliveSize {
} else if len(data) == device.MessageKeepaliveSize {
go s.flood(uc, dst, fkKeepalive) // probably a keepalive
flooded = true
}
Expand Down

1 comment on commit a8b85ee

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.