Skip to content

Commit

Permalink
Merge pull request kavu#33 from quentinmit/emptyaddr
Browse files Browse the repository at this point in the history
Remove bogus check for tcp.IP and udp.IP.
  • Loading branch information
kavu authored Oct 29, 2019
2 parents 1f6171f + d3660d6 commit 47bb7f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func getTCPSockaddr(proto, addr string) (sa syscall.Sockaddr, soType int, err er
var tcp *net.TCPAddr

tcp, err = net.ResolveTCPAddr(proto, addr)
if err != nil && tcp.IP != nil {
if err != nil {
return nil, -1, err
}

Expand Down
2 changes: 1 addition & 1 deletion udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func getUDPSockaddr(proto, addr string) (sa syscall.Sockaddr, soType int, err er
var udp *net.UDPAddr

udp, err = net.ResolveUDPAddr(proto, addr)
if err != nil && udp.IP != nil {
if err != nil {
return nil, -1, err
}

Expand Down

0 comments on commit 47bb7f1

Please sign in to comment.