AdguardTeam/AdGuardHome · error

dhcpv6 ra: SetMulticastHopLimit: %w

Error message

dhcpv6 ra: SetMulticastHopLimit: %w

What it means

The DHCPv6 RA server failed to set the multicast hop limit to 255 on its IPv6 packet connection. Multicast router advertisements require hop limit 255 (RFC 4861), and the RA Init aborts when SetMulticastHopLimit fails. This usually reflects a platform or socket that does not support the IPV6_MULTICAST_HOPS socket option.

Source

Thrown at internal/dhcpd/routeradv.go:273

	ra.conn, err = icmp.ListenPacket("ip6:ipv6-icmp", ipAndScope)
	if err != nil {
		return fmt.Errorf("dhcpv6 ra: icmp.ListenPacket: %w", err)
	}

	defer func() {
		if err != nil {
			err = errors.WithDeferred(err, ra.Close())
		}
	}()

	con6 := ra.conn.IPv6PacketConn()

	if err = con6.SetHopLimit(255); err != nil {
		return fmt.Errorf("dhcpv6 ra: SetHopLimit: %w", err)
	}

	if err = con6.SetMulticastHopLimit(255); err != nil {
		return fmt.Errorf("dhcpv6 ra: SetMulticastHopLimit: %w", err)
	}

	msg := &ipv6.ControlMessage{
		HopLimit: 255,
		Src:      ra.ipAddr,
		IfIndex:  ra.iface.Index,
	}
	addr := &net.UDPAddr{
		IP: net.ParseIP("ff02::1"),
	}

	go func() {
		log.Debug("dhcpv6 ra: starting to send periodic RouterAdvertisement packets")
		for ra.stop.Load() == 0 {
			_, err = con6.WriteTo(data, msg, addr)
			if err != nil {
				log.Error("dhcpv6 ra: WriteTo: %s", err)
			}

View on GitHub (pinned to b41aefbe51)

Solutions

  1. Grant the process NET_RAW/NET_ADMIN capabilities or run with host networking
  2. Confirm the interface actually supports IPv6 multicast (has link-local scope)
  3. Disable RA/DHCPv6 if the environment cannot support it
  4. Update the kernel/network stack if IPV6_MULTICAST_HOPS is unsupported
Defensive patterns

Strategy: validation

Validate before calling

p6 := ipv6.NewPacketConn(conn)
if err := p6.SetMulticastHopLimit(255); err != nil { /* disable RA */ }

Try / catch

if err := ra.Init(); err != nil {
    log.Printf("RA unavailable: %v", err)
    // continue without router advertisements
}

Prevention

When it happens

Trigger: RA Init (initRA) is called and con6.SetMulticastHopLimit(255) returns an error — restricted container, unusual network interface, or OS lacking multicast hop limit socket option support.

Common situations: Containerized deployment without NET_RAW capability; running on virtual network devices (some VPN tun interfaces, userspace network stacks); hardened kernels restricting multicast socket options.

Related errors


AI-assisted analysis of AdguardTeam/AdGuardHome@b41aefbe51 (2026-08-27). Data as JSON: /api/errors/5f1617546cfa53bd. Report an issue: GitHub.