From 2a888a106da39f1d5e280417e48a05341a41f4dd Mon Sep 17 00:00:00 2001 From: Zeling Feng Date: Tue, 9 Mar 2021 17:58:02 -0800 Subject: Give TCP flags a dedicated type - Implement Stringer for it so that we can improve error messages. - Use TCPFlags through the code base. There used to be a mixed usage of byte, uint8 and int as TCP flags. PiperOrigin-RevId: 361940150 --- pkg/tcpip/link/sniffer/sniffer.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'pkg/tcpip/link/sniffer/sniffer.go') diff --git a/pkg/tcpip/link/sniffer/sniffer.go b/pkg/tcpip/link/sniffer/sniffer.go index 84189bba5..7aaee3d13 100644 --- a/pkg/tcpip/link/sniffer/sniffer.go +++ b/pkg/tcpip/link/sniffer/sniffer.go @@ -398,13 +398,7 @@ func logPacket(prefix string, dir direction, protocol tcpip.NetworkProtocolNumbe // Initialize the TCP flags. flags := tcp.Flags() - flagsStr := []byte("FSRPAU") - for i := range flagsStr { - if flags&(1<