On Tue, 2010-12-14 at 11:27 -0700, Jason Gunthorpe wrote:

> This should be:
> 
> static void format_address(const void *addr,size_t alen,
>                          char *buff, size_t len)
> {
>       const sockaddr_storage *ss = addr;
>       if (ss->ss_family == AF_INET && alen == sizeof(sockaddr_in)) {
>               const sockaddr_in *ss4 = addr;
>                 char S[64];
>                 
> snprintf(buff,len,"%s-%d",inet_ntop(ss->ss_family,ss4->sin_addr,S,sizeof(S)),ntohs(ss4->sin_port));
>               return;
>         }
>       if (ss->ss_family == AF_INET6 && alen == sizeof(sockaddr_in6)) {
>               const sockaddr_in6 *ss6 = addr;
>                 char S[64];
>                 
> snprintf(buff,len,"%s-%d",inet_ntop(ss->ss_family,ss6->sin6_addr,S,sizeof(S)),ntohs(ss6->sin6_port));
>               return;
>         }
>       snprintf(buff,len,"??");
> }
> 
> Jason

Don't believe all this IPv6 hype ;)
seriously though, The demo application is solely meant as an
illustration for the means of communications with the current design.
It's going to be rewritten in the future.

Nir

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to