> > - if (src_addr) > > - memcpy(&req->src_addr, src_addr, ip_addr_size(src_addr)); > > + if (src_addr->sa_family != dst_addr->sa_family) > > + return -EINVAL; > >The old code seemed to allow for the possibility of src_addr being >NULL. There only seems to be one in-tree caller of rdma_resolve_ip, >which does pass in a src_addr, but the API definition in the header says > > * @src_addr: An optional source address to use in the resolution. If a > >so it seems passing in NULL would be allowed?
I forgot about the header file comments. (I only though about rdma_resolve_addr supporting a NULL src_addr.) I took the check out when I noticed that src_addr was always coming in non-NULL. The address itself doesn't need to be set beyond the address family, so it's still optional in that regard. (A pretty weak argument, but it's all I have. :) I can go either way here - either update the comments in the header file, or allow passing in NULL. Do you or does anyone else have a preference? - Sean -- 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
