diff --git a/portlist/portlist.go b/portlist/portlist.go index 883f373f7..521edcf49 100644 --- a/portlist/portlist.go +++ b/portlist/portlist.go @@ -21,8 +21,6 @@ type Port struct { // List is a list of Ports. type List []Port -var protos = []string{"tcp", "udp"} - func (a *Port) lessThan(b *Port) bool { if a.Port < b.Port { return true diff --git a/portlist/portlist_linux.go b/portlist/portlist_linux.go index 0e4088635..d8756c253 100644 --- a/portlist/portlist_linux.go +++ b/portlist/portlist_linux.go @@ -24,6 +24,7 @@ const pollInterval = 1 * time.Second // TODO(apenwarr): Include IPv6 ports eventually. // Right now we don't route IPv6 anyway so it's better to exclude them. var sockfiles = []string{"/proc/net/tcp", "/proc/net/udp"} +var protos = []string{"tcp", "udp"} func listPorts() (List, error) { l := []Port{}