{"record":{"id":"9de9e40a48ed14f6","repo":"netbirdio/netbird","slug":"add-v4-address-s-w","errorCode":null,"errorMessage":"add v4 address: %s: %w","messagePattern":"add v4 address: (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/device_darwin.go","lineNumber":135,"sourceCode":"}\n\nfunc (t *TunDevice) DeviceName() string {\n\treturn t.name\n}\n\nfunc (t *TunDevice) FilteredDevice() *FilteredDevice {\n\treturn t.filteredDevice\n}\n\n// Device returns the wireguard device\nfunc (t *TunDevice) Device() *device.Device {\n\treturn t.device\n}\n\n// assignAddr Adds IP address to the tunnel interface and network route based on the range provided\nfunc (t *TunDevice) assignAddr() error {\n\tif out, err := exec.Command(\"ifconfig\", t.name, \"inet\", t.address.IP.String(), t.address.IP.String()).CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"add v4 address: %s: %w\", string(out), err)\n\t}\n\n\t// Assign a dummy link-local so macOS enables IPv6 on the tun device.\n\t// When a real overlay v6 is present, use that instead.\n\tv6Addr := \"fe80::/64\"\n\tif t.address.HasIPv6() {\n\t\tv6Addr = t.address.IPv6String()\n\t}\n\tif out, err := exec.Command(\"ifconfig\", t.name, \"inet6\", v6Addr).CombinedOutput(); err != nil {\n\t\tlog.Warnf(\"failed to assign IPv6 address %s, continuing v4-only: %s: %v\", v6Addr, string(out), err)\n\t\tt.address.ClearIPv6()\n\t}\n\n\tif out, err := exec.Command(\"route\", \"add\", \"-net\", t.address.Network.String(), \"-interface\", t.name).CombinedOutput(); err != nil {\n\t\treturn fmt.Errorf(\"add route %s via %s: %s: %w\", t.address.Network, t.name, string(out), err)\n\t}\n\n\tif t.address.HasIPv6() {","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/device_darwin.go#L117-L153","documentation":"Error \"add v4 address: %s: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/iface/device/device_darwin.go:135 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}