[ofa-general] IPv6 RDMA CM PATCHv2
Hefty, Sean
sean.hefty at intel.com
Mon Aug 11 12:18:23 PDT 2008
Mostly minor nits on a few of these patches.
>@@ -113,15 +114,30 @@ EXPORT_SYMBOL(rdma_copy_addr);
> int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
> {
> struct net_device *dev;
>- __be32 ip = ((struct sockaddr_in *) addr)->sin_addr.s_addr;
>- int ret;
>+ int ret = -EADDRNOTAVAIL;
>
>- dev = ip_dev_find(&init_net, ip);
>- if (!dev)
>- return -EADDRNOTAVAIL;
>+ switch (addr->sa_family) {
>+ case AF_INET:
>+ dev = ip_dev_find(&init_net,
>+ ((struct sockaddr_in *) addr)->sin_addr.s_addr);
>
>- ret = rdma_copy_addr(dev_addr, dev, NULL);
>- dev_put(dev);
>+ if (!dev)
>+ return -EADDRNOTAVAIL;
We can just break here. Also, my personal preferences is to have the assignment of dev and the if check together, without an extra blank line.
>+
>+ ret = rdma_copy_addr(dev_addr, dev, NULL);
>+ dev_put(dev);
>+ break;
>+ case AF_INET6:
>+ for_each_netdev(&init_net, dev) {
>+ if (ipv6_chk_addr(&init_net, &((struct sockaddr_in6 *)
>addr)->sin6_addr, dev, 1)) {
Line is a little long, plus it gets removed by a later patch.
- Sean
More information about the general
mailing list