If -b bindaddr is used, then created sockets must be of the same address family as bindaddr (otherwise, calls to bind() will fail).
This patch harmonizes the address family across the calls to socket(), bind(), and connect().
Prior to this patch, microsocks would use the first addrinfo record returned by getaddrinfo(). On systems with both IPv4 and IPv6 enabled, frequently the address family of the first record would be a mismatch with bindaddr. As a result, the call to bind() would fail.
If
-b bindaddr
is used, then created sockets must be of the same address family asbindaddr
(otherwise, calls tobind()
will fail).This patch harmonizes the address family across the calls to
socket()
,bind()
, andconnect()
.Prior to this patch,
microsocks
would use the firstaddrinfo
record returned bygetaddrinfo()
. On systems with both IPv4 and IPv6 enabled, frequently the address family of the first record would be a mismatch withbindaddr
. As a result, the call tobind()
would fail.This patch may fix issue #30. (And issue #40?)