ret = rdma_copy_addr(dev_addr, dev, NULL);
dev_put(dev);
break;
+
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6:
for_each_netdev(&init_net, dev) {
if (ipv6_chk_addr(&init_net,
}
}
break;
- default:
- break;
+#endif
}
return ret;
}
{
struct rtable *rt;
struct flowi fl;
- struct dst_entry *dst;
memset(&fl, 0, sizeof fl);
- if (dst_in->sa_family == AF_INET) {
+
+ switch (dst_in->sa_family) {
+ case AF_INET:
fl.nl_u.ip4_u.daddr =
((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
neigh_event_send(rt->u.dst.neighbour, NULL);
ip_rt_put(rt);
+ break;
+
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+ case AF_INET6:
+ {
+ struct dst_entry *dst;
- } else {
fl.nl_u.ip6_u.daddr =
((struct sockaddr_in6 *) dst_in)->sin6_addr;
neigh_event_send(dst->neighbour, NULL);
dst_release(dst);
+ break;
+ }
+#endif
}
}
return ret;
}
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
struct sockaddr_in6 *dst_in,
struct rdma_dev_addr *addr)
dst_release(dst);
return ret;
}
+#else
+static int addr6_resolve_remote(struct sockaddr_in6 *src_in,
+ struct sockaddr_in6 *dst_in,
+ struct rdma_dev_addr *addr)
+{
+ return -EADDRNOTAVAIL;
+}
+#endif
static int addr_resolve_remote(struct sockaddr *src_in,
struct sockaddr *dst_in,
struct net_device *dev;
int ret;
- if (dst_in->sa_family == AF_INET) {
+ switch (dst_in->sa_family) {
+ case AF_INET:
+ {
__be32 src_ip = ((struct sockaddr_in *) src_in)->sin_addr.s_addr;
__be32 dst_ip = ((struct sockaddr_in *) dst_in)->sin_addr.s_addr;
memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
}
dev_put(dev);
- } else {
+ break;
+ }
+
+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+ case AF_INET6:
+ {
struct in6_addr *a;
for_each_netdev(&init_net, dev)
if (!ret)
memcpy(addr->dst_dev_addr, dev->dev_addr, MAX_ADDR_LEN);
}
+ break;
+ }
+#endif
+
+ default:
+ ret = -EADDRNOTAVAIL;
+ break;
}
return ret;