>+       if (res->ai_family == PF_INET || res->ai_family == PF_INET6 ) {
>+               *(struct sockaddr_storage *)addr =
>+                       *(struct sockaddr_storage *)res->ai_addr;

I changed this part around to this:

        if (res->ai_family == PF_INET)
                memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in));
        else if (res->ai_family == PF_INET6)
                memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in6));
        else
                ret = -1;

I don't think always res->ai_addr points to memory the sizeof sockaddr_storage.

- Sean
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to