Commit c288a731 authored by Juan Benet's avatar Juan Benet

fix silly if error. Fixes #10

parent 48959f1f
......@@ -106,7 +106,7 @@ func dial(dialer net.Dialer, netw, addr string) (c net.Conn, err error) {
// check family and protocols match.
lfamily = sockaddrnet.NetAddrAF(dialer.LocalAddr)
lprotocol = sockaddrnet.NetAddrIPPROTO(dialer.LocalAddr)
if lfamily != rfamily && lprotocol != rfamily {
if lfamily != rfamily || lprotocol != rprotocol {
return nil, &net.AddrError{Err: "unexpected address type", Addr: netAddr.String()}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment