mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
derp: fix traffic handler peer addresses
Before it was using the local address and port, so fix that. The fields in the response from `ss` are: State, Recv-Q, Send-Q, Local Address:Port, Peer Address:Port, Process Signed-off-by: julianknodt <julianknodt@gmail.com>
This commit is contained in:
parent
297b3d6fa4
commit
3687e5352b
@ -1435,17 +1435,10 @@ func parseSSOutput(raw string) map[netaddr.IPPort]BytesSentRecv {
|
|||||||
if len(ipInfo) < 5 {
|
if len(ipInfo) < 5 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
src, err := netaddr.ParseIPPort(ipInfo[3])
|
src, err := netaddr.ParseIPPort(ipInfo[4])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
TODO(jknodt) do we care about the full route or just the src?
|
|
||||||
dst, err := netaddr.ParseIPPort(string(ipInfo[4]))
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
stats := strings.Fields(strings.TrimSpace(lines[i+1]))
|
stats := strings.Fields(strings.TrimSpace(lines[i+1]))
|
||||||
stat := BytesSentRecv{}
|
stat := BytesSentRecv{}
|
||||||
for _, s := range stats {
|
for _, s := range stats {
|
||||||
|
Loading…
Reference in New Issue
Block a user