[ofa-general] RE: RFC PATCHv2 IPv6 support in rping
Hefty, Sean
sean.hefty at intel.com
Thu Aug 14 09:43:05 PDT 2008
>+ 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
More information about the general
mailing list