diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-03 01:08:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-05 04:09:53 -0400 |
commit | 0b399d46b317a6d0a73ad523e014ecfa4d449769 (patch) | |
tree | f1023f047862ec7c0171c238878895aea865e85f /drivers/scsi/cxgbi/libcxgbi.c | |
parent | 24db1ba866eebf5b516df80ea2212d2479bfb502 (diff) |
cxgbi: Convert over to dst_neigh_lookup().
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/cxgbi/libcxgbi.c')
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index d9253db1d0e2..b44c1cff3114 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -494,7 +494,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
494 | goto err_out; | 494 | goto err_out; |
495 | } | 495 | } |
496 | dst = &rt->dst; | 496 | dst = &rt->dst; |
497 | n = dst_get_neighbour_noref(dst); | 497 | n = dst_neigh_lookup(dst, &daddr->sin_addr.s_addr); |
498 | if (!n) { | 498 | if (!n) { |
499 | err = -ENODEV; | 499 | err = -ENODEV; |
500 | goto rel_rt; | 500 | goto rel_rt; |
@@ -506,7 +506,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
506 | &daddr->sin_addr.s_addr, ntohs(daddr->sin_port), | 506 | &daddr->sin_addr.s_addr, ntohs(daddr->sin_port), |
507 | ndev->name); | 507 | ndev->name); |
508 | err = -ENETUNREACH; | 508 | err = -ENETUNREACH; |
509 | goto rel_rt; | 509 | goto rel_neigh; |
510 | } | 510 | } |
511 | 511 | ||
512 | if (ndev->flags & IFF_LOOPBACK) { | 512 | if (ndev->flags & IFF_LOOPBACK) { |
@@ -521,7 +521,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
521 | pr_info("dst %pI4, %s, NOT cxgbi device.\n", | 521 | pr_info("dst %pI4, %s, NOT cxgbi device.\n", |
522 | &daddr->sin_addr.s_addr, ndev->name); | 522 | &daddr->sin_addr.s_addr, ndev->name); |
523 | err = -ENETUNREACH; | 523 | err = -ENETUNREACH; |
524 | goto rel_rt; | 524 | goto rel_neigh; |
525 | } | 525 | } |
526 | log_debug(1 << CXGBI_DBG_SOCK, | 526 | log_debug(1 << CXGBI_DBG_SOCK, |
527 | "route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n", | 527 | "route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n", |
@@ -531,7 +531,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
531 | csk = cxgbi_sock_create(cdev); | 531 | csk = cxgbi_sock_create(cdev); |
532 | if (!csk) { | 532 | if (!csk) { |
533 | err = -ENOMEM; | 533 | err = -ENOMEM; |
534 | goto rel_rt; | 534 | goto rel_neigh; |
535 | } | 535 | } |
536 | csk->cdev = cdev; | 536 | csk->cdev = cdev; |
537 | csk->port_id = port; | 537 | csk->port_id = port; |
@@ -541,9 +541,13 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
541 | csk->daddr.sin_port = daddr->sin_port; | 541 | csk->daddr.sin_port = daddr->sin_port; |
542 | csk->daddr.sin_family = daddr->sin_family; | 542 | csk->daddr.sin_family = daddr->sin_family; |
543 | csk->saddr.sin_addr.s_addr = fl4.saddr; | 543 | csk->saddr.sin_addr.s_addr = fl4.saddr; |
544 | neigh_release(n); | ||
544 | 545 | ||
545 | return csk; | 546 | return csk; |
546 | 547 | ||
548 | rel_neigh: | ||
549 | neigh_release(n); | ||
550 | |||
547 | rel_rt: | 551 | rel_rt: |
548 | ip_rt_put(rt); | 552 | ip_rt_put(rt); |
549 | if (csk) | 553 | if (csk) |