all: use buildfeatures.HasCapture const in a handful of places

Help out the linker's dead code elimination.

Updates #12614

Change-Id: I6c13cb44d3250bf1e3a01ad393c637da4613affb
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2025-09-23 18:15:48 -07:00
committed by Brad Fitzpatrick
parent 8fe575409f
commit b54cdf9f38
5 changed files with 21 additions and 0 deletions
+3
View File
@@ -890,6 +890,9 @@ func deregisterMetrics(m *metrics) {
// can be called with a nil argument to uninstall the capture
// hook.
func (c *Conn) InstallCaptureHook(cb packet.CaptureCallback) {
if !buildfeatures.HasCapture {
return
}
c.captureHook.Store(cb)
}