probelabs/goreplay · warning

%q: supported timestamps: %q, interface: %q

Error message

%q: supported timestamps: %q, interface: %q

What it means

When config.TimestampType is set to a value other than empty or "go", PcapHandle resolves it with pcap.TimestampSourceFromString and calls inactive.SetTimestampSource. On failure the error is wrapped with the list of timestamps the interface actually supports: "<err>: supported timestamps: <list>, interface: <name>". It means the requested timestamp source is not available for that interface/libpcap build.

Source

Thrown at internal/capture/capture.go:417

}

// PcapHandle returns new pcap Handle from dev on success.
// this function should be called after setting all necessary options for this listener
func (l *Listener) PcapHandle(ifi pcap.Interface) (handle *pcap.Handle, err error) {
	var inactive *pcap.InactiveHandle
	inactive, err = pcap.NewInactiveHandle(ifi.Name)
	if err != nil {
		return nil, fmt.Errorf("inactive handle error: %q, interface: %q", err, ifi.Name)
	}
	defer inactive.CleanUp()

	if l.config.TimestampType != "" && l.config.TimestampType != "go" {
		var ts pcap.TimestampSource
		ts, err = pcap.TimestampSourceFromString(l.config.TimestampType)
		fmt.Println("Setting custom Timestamp Source. Supported values: `go`, ", inactive.SupportedTimestamps())
		err = inactive.SetTimestampSource(ts)
		if err != nil {
			return nil, fmt.Errorf("%q: supported timestamps: %q, interface: %q", err, inactive.SupportedTimestamps(), ifi.Name)
		}
	}
	if l.config.Promiscuous {
		if err = inactive.SetPromisc(l.config.Promiscuous); err != nil {
			return nil, fmt.Errorf("promiscuous mode error: %q, interface: %q", err, ifi.Name)
		}
	}
	if l.config.Monitor {
		if err = inactive.SetRFMon(l.config.Monitor); err != nil && !errors.Is(err, pcap.CannotSetRFMon) {
			return nil, fmt.Errorf("monitor mode error: %q, interface: %q", err, ifi.Name)
		}
	}

	var snap int

	if !l.config.Snaplen {
		infs, _ := net.Interfaces()
		for _, i := range infs {

View on GitHub (pinned to 251e45abd2)

Solutions

  1. Read the supported list embedded in the error (inactive.SupportedTimestamps()) and pick one of those values
  2. Remove TimestampType or set it to "go" to use the default Go-side timestamping
  3. Upgrade libpcap/kernel/driver if hardware timestamping is required
  4. Validate the requested timestamp source against pcap.TimestampSourceFromString output before applying it

Example fix

// before
cfg.TimestampType = "adapter" // unsupported on this NIC
// after
cfg.TimestampType = "" // use default
// or check:
ts, err := pcap.TimestampSourceFromString(cfg.TimestampType)
_ = ts
Defensive patterns

Strategy: validation

Validate before calling

if cfg.TimestampType != "" && cfg.TimestampType != "go" {
    inact, _ := pcap.NewInactiveHandle(cfg.Iface)
    defer inact.CleanUp()
    ok := false
    for _, ts := range inact.SupportedTimestamps() { if ts.String() == cfg.TimestampType { ok = true } }
    if !ok { return fmt.Errorf("timestamp %q unsupported; supported: %v", cfg.TimestampType, inact.SupportedTimestamps()) }
}

Try / catch

if err != nil && strings.Contains(err.Error(), "supported timestamps") {
    log.Warnf("timestamp source unsupported, falling back to default: %v", err)
    cfg.TimestampType = ""
    handle, err = l.PcapHandle(ifi)
}

Prevention

When it happens

Trigger: Configuring l.config.TimestampType to a source (e.g. "adapter_unsynced", "host_precise", "host_hpcut") that pcap.TimestampSourceFromString accepts but SetTimestampSource rejects for the given interface, because the libpcap build or NIC driver does not support it.

Common situations: Copying a TimestampType from another machine or NIC vendor documentation; libpcap compiled without hardware timestamp support; different kernel/driver (e.g. NIC without PHC); typos like "host-precise" vs "host".

Related errors


AI-assisted analysis of probelabs/goreplay@251e45abd2 (2026-09-02). Data as JSON: /api/errors/82a6a69806358b82. Report an issue: GitHub.