Skip to content

Commit

Permalink
Fix dividing out direction of arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki committed Mar 4, 2018
1 parent 29111aa commit ef757fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion conntrack/conntrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ func (f *HostFlow) HasDirection(dire FlowDirection) bool {

// String returns the string representation of HostFlow.
func (f *HostFlow) String() string {
return fmt.Sprintf("%s\t --> \t%s \t%s", f.Local, f.Peer, f.Stat)
switch f.Direction {
case FlowActive:
return fmt.Sprintf("%s\t --> \t%s \t%s", f.Local, f.Peer, f.Stat)
case FlowPassive:
return fmt.Sprintf("%s\t <-- \t%s \t%s", f.Local, f.Peer, f.Stat)
}
return ""
}

// ReplaceLookupedName replaces f.Addr into lookuped name.
Expand Down

0 comments on commit ef757fb

Please sign in to comment.