{"record":{"id":"5f1617546cfa53bd","repo":"AdguardTeam/AdGuardHome","slug":"dhcpv6-ra-setmulticasthoplimit-w","errorCode":null,"errorMessage":"dhcpv6 ra: SetMulticastHopLimit: %w","messagePattern":"dhcpv6 ra: SetMulticastHopLimit: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/dhcpd/routeradv.go","lineNumber":273,"sourceCode":"\tra.conn, err = icmp.ListenPacket(\"ip6:ipv6-icmp\", ipAndScope)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"dhcpv6 ra: icmp.ListenPacket: %w\", err)\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\terr = errors.WithDeferred(err, ra.Close())\n\t\t}\n\t}()\n\n\tcon6 := ra.conn.IPv6PacketConn()\n\n\tif err = con6.SetHopLimit(255); err != nil {\n\t\treturn fmt.Errorf(\"dhcpv6 ra: SetHopLimit: %w\", err)\n\t}\n\n\tif err = con6.SetMulticastHopLimit(255); err != nil {\n\t\treturn fmt.Errorf(\"dhcpv6 ra: SetMulticastHopLimit: %w\", err)\n\t}\n\n\tmsg := &ipv6.ControlMessage{\n\t\tHopLimit: 255,\n\t\tSrc:      ra.ipAddr,\n\t\tIfIndex:  ra.iface.Index,\n\t}\n\taddr := &net.UDPAddr{\n\t\tIP: net.ParseIP(\"ff02::1\"),\n\t}\n\n\tgo func() {\n\t\tlog.Debug(\"dhcpv6 ra: starting to send periodic RouterAdvertisement packets\")\n\t\tfor ra.stop.Load() == 0 {\n\t\t\t_, err = con6.WriteTo(data, msg, addr)\n\t\t\tif err != nil {\n\t\t\t\tlog.Error(\"dhcpv6 ra: WriteTo: %s\", err)\n\t\t\t}","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/dhcpd/routeradv.go#L255-L291","documentation":"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.","triggerScenarios":"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.","commonSituations":"Containerized deployment without NET_RAW capability; running on virtual network devices (some VPN tun interfaces, userspace network stacks); hardened kernels restricting multicast socket options.","solutions":["Grant the process NET_RAW/NET_ADMIN capabilities or run with host networking","Confirm the interface actually supports IPv6 multicast (has link-local scope)","Disable RA/DHCPv6 if the environment cannot support it","Update the kernel/network stack if IPV6_MULTICAST_HOPS is unsupported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"p6 := ipv6.NewPacketConn(conn)\nif err := p6.SetMulticastHopLimit(255); err != nil { /* disable RA */ }","typeGuard":null,"tryCatchPattern":"if err := ra.Init(); err != nil {\n    log.Printf(\"RA unavailable: %v\", err)\n    // continue without router advertisements\n}","preventionTips":["Grant NET_RAW/NET_ADMIN capabilities in containers","Prefer host networking for DHCPv6/RA services","Check IPv6 multicast support on the interface (link-local address present)"],"tags":["dhcpv6","router-advertisement","multicast","ipv6","socket-options"],"backgroundTag":"ipv6-socket-option-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}