a73x

internal/agent/netenv/snoop_other.go

Ref:   Size: 620 B   History

//go:build !linux

package netenv

import (
	"context"
	"fmt"
	"net"
)

// defaultListen refuses where there is no packet socket to snoop with. Nothing
// reaches it — named networks come from a flag only a Linux host acts on, and
// their taps are created by the Linux backend — so this exists to keep the
// package buildable everywhere the agent is, and to fail loudly rather than
// silently report no address if that ever stops being true.
func defaultListen(_ context.Context, ifname string, _ net.HardwareAddr, _ func(ip string)) error {
	return fmt.Errorf("snoop %s: named networks require linux", ifname)
}