@@ -1267,7 +1267,7 @@ func (c *Conn) sendUDPBatch(addr netip.AddrPort, buffs [][]byte) (sent bool, err
12671267
12681268// sendUDP sends UDP packet b to ipp.
12691269// See sendAddr's docs on the return value meanings.
1270- func (c * Conn ) sendUDP (ipp netip.AddrPort , b []byte ) (sent bool , err error ) {
1270+ func (c * Conn ) sendUDP (ipp netip.AddrPort , b []byte , isDisco bool ) (sent bool , err error ) {
12711271 if runtime .GOOS == "js" {
12721272 return false , errNoUDP
12731273 }
@@ -1276,7 +1276,7 @@ func (c *Conn) sendUDP(ipp netip.AddrPort, b []byte) (sent bool, err error) {
12761276 metricSendUDPError .Add (1 )
12771277 _ = c .maybeRebindOnError (runtime .GOOS , err )
12781278 } else {
1279- if sent {
1279+ if sent && ! isDisco {
12801280 switch {
12811281 case ipp .Addr ().Is4 ():
12821282 c .metrics .outboundPacketsIPv4Total .Add (1 )
@@ -1371,7 +1371,7 @@ func (c *Conn) sendUDPStd(addr netip.AddrPort, b []byte) (sent bool, err error)
13711371// returns (false, nil); it's not an error, but nothing was sent.
13721372func (c * Conn ) sendAddr (addr netip.AddrPort , pubKey key.NodePublic , b []byte , isDisco bool ) (sent bool , err error ) {
13731373 if addr .Addr () != tailcfg .DerpMagicIPAddr {
1374- return c .sendUDP (addr , b )
1374+ return c .sendUDP (addr , b , isDisco )
13751375 }
13761376
13771377 regionID := int (addr .Port ())
0 commit comments