On Tue, Nov 30, 2010 at 08:13:45AM -0800, Hefty, Sean wrote:
> > +struct rdma_cm_id_stats {
> > +   enum rdma_node_type nt;
> > +   int port_num;
> > +   int bound_dev_if;
> > +   __be16  local_port;
> > +   __be16  remote_port;
> > +   __be32  local_addr[4];
> > +   __be32  remote_addr[4];
> 
> Please use sockaddr_storage, so that we can expand the rdma_cm
> beyond ipv4/6 address support.

Actually for netlink the proper thing to do here is to place the
sockaddr in a sub-attribute that can be variable-sized. Do not put
variably sized data into a struct like this.

Further, sockaddr_storage is not actually ABI guaranteed to be
constant in size, it is just the current largest sockaddr
possible. This is why the sockaddr size in/out parameter associated
with all sockaddrs is so important.

Don't put sockaddrs in fixed-size structures for user/kernel
interfaces.

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

Reply via email to