{"record":{"id":"de2bfb1e1334c63a","repo":"netbirdio/netbird","slug":"add-route-s-via-s-s-w","errorCode":null,"errorMessage":"add route %s via %s: %s: %w","messagePattern":"add route (.+?) via (.+?): (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/device_darwin.go","lineNumber":150,"sourceCode":"// 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() {\n\t\tif out, err := exec.Command(\"route\", \"add\", \"-inet6\", \"-net\", t.address.IPv6Net.String(), \"-interface\", t.name).CombinedOutput(); err != nil {\n\t\t\tlog.Warnf(\"failed to add route %s via %s, continuing v4-only: %s: %v\", t.address.IPv6Net, t.name, string(out), err)\n\t\t\tt.address.ClearIPv6()\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (t *TunDevice) GetNet() *netstack.Net {\n\treturn nil\n}\n\n// GetICEBind returns the ICEBind instance\nfunc (t *TunDevice) GetICEBind() EndpointManager {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/device_darwin.go#L132-L168","documentation":"Error \"add route %s via %s: %s: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/iface/device/device_darwin.go:150 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"}