Permalink
Browse files

OSX Lion doesn't seem to appreciate calling getaddrinfo() with IPPROT…

…O_IP as a hint.
  • Loading branch information...
1 parent 3f21661 commit 1725cb468b79290e54ee608a9768f8b61d3b24e1 @jedisct1 committed Jul 27, 2011
Showing with 5 additions and 0 deletions.
  1. +2 −0 src/filter.c
  2. +3 −0 src/hook-bind.c
View
@@ -185,6 +185,8 @@ int filter_overwrite_sa_with_reply_map(const msgpack_object_map * const map,
struct addrinfo *ai, hints;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = NI_NUMERICHOST | AI_ADDRCONFIG;
char new_host[NI_MAXHOST];
memcpy(new_host, obj_host->via.raw.ptr,
View
@@ -20,10 +20,13 @@ static FilterReplyResult filter_parse_reply(FilterReplyResultBase * const rb,
msgpack_get_map_value_for_key(map, "local_host");
if (obj_local_host != NULL &&
obj_local_host->type == MSGPACK_OBJECT_RAW &&
+ obj_local_host->via.raw.size > 0 &&
obj_local_host->via.raw.size < NI_MAXHOST) {
struct addrinfo *ai, hints;
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = NI_NUMERICHOST | AI_PASSIVE;
char new_local_host[NI_MAXHOST];
memcpy(new_local_host, obj_local_host->via.raw.ptr,

0 comments on commit 1725cb4

Please sign in to comment.