aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/cma.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/cma.c')
-rw-r--r--drivers/infiniband/core/cma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 637efead97a0..1eff1b2c0e08 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -630,7 +630,8 @@ static inline int cma_zero_addr(struct sockaddr *addr)
630 struct in6_addr *ip6; 630 struct in6_addr *ip6;
631 631
632 if (addr->sa_family == AF_INET) 632 if (addr->sa_family == AF_INET)
633 return ZERONET(((struct sockaddr_in *) addr)->sin_addr.s_addr); 633 return ipv4_is_zeronet(
634 ((struct sockaddr_in *)addr)->sin_addr.s_addr);
634 else { 635 else {
635 ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr; 636 ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr;
636 return (ip6->s6_addr32[0] | ip6->s6_addr32[1] | 637 return (ip6->s6_addr32[0] | ip6->s6_addr32[1] |
@@ -640,7 +641,7 @@ static inline int cma_zero_addr(struct sockaddr *addr)
640 641
641static inline int cma_loopback_addr(struct sockaddr *addr) 642static inline int cma_loopback_addr(struct sockaddr *addr)
642{ 643{
643 return LOOPBACK(((struct sockaddr_in *) addr)->sin_addr.s_addr); 644 return ipv4_is_loopback(((struct sockaddr_in *) addr)->sin_addr.s_addr);
644} 645}
645 646
646static inline int cma_any_addr(struct sockaddr *addr) 647static inline int cma_any_addr(struct sockaddr *addr)
@@ -1288,7 +1289,7 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id,
1288 atomic_inc(&conn_id->dev_remove); 1289 atomic_inc(&conn_id->dev_remove);
1289 conn_id->state = CMA_CONNECT; 1290 conn_id->state = CMA_CONNECT;
1290 1291
1291 dev = ip_dev_find(iw_event->local_addr.sin_addr.s_addr); 1292 dev = ip_dev_find(&init_net, iw_event->local_addr.sin_addr.s_addr);
1292 if (!dev) { 1293 if (!dev) {
1293 ret = -EADDRNOTAVAIL; 1294 ret = -EADDRNOTAVAIL;
1294 cma_enable_remove(conn_id); 1295 cma_enable_remove(conn_id);