Skip to content

Commit

Permalink
Use switch
Browse files Browse the repository at this point in the history
  • Loading branch information
lixmal committed Dec 21, 2024
1 parent fa38d8e commit 0970b75
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/firewall/uspfilter/conntrack/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,13 @@ func (t *TCPTracker) updateState(conn *TCPConnTrack, flags uint8, isOutbound boo
}

case TCPStateFinWait1:
if flags&TCPFin != 0 && flags&TCPAck != 0 {
switch {
case flags&TCPFin != 0 && flags&TCPAck != 0:
// Simultaneous close
conn.State = TCPStateClosing
} else if flags&TCPFin != 0 {
case flags&TCPFin != 0:
conn.State = TCPStateFinWait2
} else if flags&TCPAck != 0 {
case flags&TCPAck != 0:
conn.State = TCPStateFinWait2
}

Expand Down

0 comments on commit 0970b75

Please sign in to comment.