net/flowtrack: fix, test String method
I meant to do this in the earlier change and had a git fail. To atone, add a test too while I'm here. Updates #12486 Updates #12507 Change-Id: I4943b454a2530cb5047636f37136aa2898d2ffc7 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
9e0a5cc551
commit
162d593514
@@ -56,7 +56,9 @@ func (t Tuple) SrcPort() uint16 { return t.srcPort }
|
||||
func (t Tuple) DstPort() uint16 { return t.dstPort }
|
||||
|
||||
func (t Tuple) String() string {
|
||||
return fmt.Sprintf("(%v %v => %v)", t.proto, t.src, t.dst)
|
||||
return fmt.Sprintf("(%v %v => %v)", t.proto,
|
||||
netip.AddrPortFrom(t.SrcAddr(), t.srcPort),
|
||||
netip.AddrPortFrom(t.DstAddr(), t.dstPort))
|
||||
}
|
||||
|
||||
func (t Tuple) MarshalJSON() ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user