Skip to content

Commit

Permalink
use net.LookupPort to resolve port numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
HouseK committed Oct 18, 2022
1 parent 56aed06 commit d804107
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssh/tcpip.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,11 @@ func (c *Client) Dial(n, addr string) (net.Conn, error) {
if err != nil {
return nil, err
}
port, err := strconv.ParseUint(portString, 10, 16)
port, err := net.LookupPort(portString)
if err != nil {
return nil, err
}
ch, err = c.dial(net.IPv4zero.String(), 0, host, int(port))
ch, err = c.dial(net.IPv4zero.String(), 0, host, port)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d804107

Please sign in to comment.