TUN-8762: fix argument order when invoking tracert and modify network info output parsing.

## Summary

The windows code path has three bugs:

* the -4 and -6 option cannot be passed in the last position
* since there are some lines in the command output that are not parsable the collection fails to parse any kind of output
* the timeout hop is not correctly parsed

This PR also guards the parsing code against empty domains

Closes TUN-8762
This commit is contained in:
Luis Neto
2024-12-03 04:56:28 -08:00
parent 65786597cc
commit 1ef109c042
6 changed files with 186 additions and 47 deletions

View File

@@ -68,7 +68,11 @@ func DecodeLine(text string) (*Hop, error) {
rtts = append(rtts, time.Duration(rtt*MicrosecondsFactor))
}
}
domain, _ = strings.CutSuffix(domain, " ")
if domain == "" {
return nil, ErrEmptyDomain
}
return NewHop(uint8(index), domain, rtts), nil
}