{"record":{"id":"e38f8d0556a4de80","repo":"netbirdio/netbird","slug":"parse-ifconfig-output-w","errorCode":null,"errorMessage":"parse ifconfig output: %w","messagePattern":"parse ifconfig output: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/freebsd/link.go","lineNumber":41,"sourceCode":"\t}\n}\n\n// LinkByName retrieves a network interface by its name.\nfunc LinkByName(name string) (*Link, error) {\n\tout, err := exec.Command(\"ifconfig\", name).CombinedOutput()\n\tif err != nil {\n\t\tif pErr := parseError(out); pErr != nil {\n\t\t\treturn nil, pErr\n\t\t}\n\n\t\tlog.Debugf(\"ifconfig out: %s\", out)\n\n\t\treturn nil, fmt.Errorf(\"command run: %w\", err)\n\t}\n\n\ti, err := parseIfconfigOutput(out)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse ifconfig output: %w\", err)\n\t}\n\n\tif i.Name != name {\n\t\treturn nil, ErrNameDoesNotMatch\n\t}\n\n\treturn &Link{name: i.Name}, nil\n}\n\n// Recreate - create new interface, remove current before create if it exists\nfunc (l *Link) Recreate() error {\n\tok, err := l.isExist()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"is exist: %w\", err)\n\t}\n\n\tif ok {\n\t\tif err := l.del(l.name); err != nil {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/freebsd/link.go#L23-L59","documentation":"parseIfconfigOutput failed on the combined output of a successful `ifconfig <name>` run in LinkByName, meaning the command exited zero but its text did not match the expected format. The lookup is aborted rather than returning a partially filled Link.","triggerScenarios":"Thrown at client/iface/freebsd/link.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Compare host ifconfig output with the expected format","Update the parser for the FreeBSD version in use","Fall back to netlink-style APIs if available"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}