Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Harmonize socket address families: ipv4 vs ipv6
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, sometimes the address family of the first record would be a mismatch with `bindaddr`, resulting in an error. This patch may fix issue rofl0r#30. (And issue rofl0r#40?)
- Loading branch information