diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-03 23:43:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-03 23:43:40 -0400 |
commit | f4bfd99f8519e2d35541cc4fc383b1b3141a657a (patch) | |
tree | 103f453c2255ada4f0b609f3a88ccfd496c5d4b9 /drivers/scsi/cxgbi | |
parent | 28c90da02ed7367fc5714adefce2a961e5bae306 (diff) |
libcxgbi: Use flowi4's saddr in cxgbi_check_route().
Instead of rt->rt_src
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi/cxgbi')
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 0c33d250c7d7..a2a9c7c6c643 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -450,13 +450,13 @@ static struct cxgbi_sock *cxgbi_sock_create(struct cxgbi_device *cdev) | |||
450 | return csk; | 450 | return csk; |
451 | } | 451 | } |
452 | 452 | ||
453 | static struct rtable *find_route_ipv4(__be32 saddr, __be32 daddr, | 453 | static struct rtable *find_route_ipv4(struct flowi4 *fl4, |
454 | __be32 saddr, __be32 daddr, | ||
454 | __be16 sport, __be16 dport, u8 tos) | 455 | __be16 sport, __be16 dport, u8 tos) |
455 | { | 456 | { |
456 | struct rtable *rt; | 457 | struct rtable *rt; |
457 | struct flowi4 fl4; | ||
458 | 458 | ||
459 | rt = ip_route_output_ports(&init_net, &fl4, NULL, daddr, saddr, | 459 | rt = ip_route_output_ports(&init_net, fl4, NULL, daddr, saddr, |
460 | dport, sport, IPPROTO_TCP, tos, 0); | 460 | dport, sport, IPPROTO_TCP, tos, 0); |
461 | if (IS_ERR(rt)) | 461 | if (IS_ERR(rt)) |
462 | return NULL; | 462 | return NULL; |
@@ -471,6 +471,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
471 | struct net_device *ndev; | 471 | struct net_device *ndev; |
472 | struct cxgbi_device *cdev; | 472 | struct cxgbi_device *cdev; |
473 | struct rtable *rt = NULL; | 473 | struct rtable *rt = NULL; |
474 | struct flowi4 fl4; | ||
474 | struct cxgbi_sock *csk = NULL; | 475 | struct cxgbi_sock *csk = NULL; |
475 | unsigned int mtu = 0; | 476 | unsigned int mtu = 0; |
476 | int port = 0xFFFF; | 477 | int port = 0xFFFF; |
@@ -483,7 +484,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
483 | goto err_out; | 484 | goto err_out; |
484 | } | 485 | } |
485 | 486 | ||
486 | rt = find_route_ipv4(0, daddr->sin_addr.s_addr, 0, daddr->sin_port, 0); | 487 | rt = find_route_ipv4(&fl4, 0, daddr->sin_addr.s_addr, 0, daddr->sin_port, 0); |
487 | if (!rt) { | 488 | if (!rt) { |
488 | pr_info("no route to ipv4 0x%x, port %u.\n", | 489 | pr_info("no route to ipv4 0x%x, port %u.\n", |
489 | daddr->sin_addr.s_addr, daddr->sin_port); | 490 | daddr->sin_addr.s_addr, daddr->sin_port); |
@@ -532,7 +533,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
532 | csk->daddr.sin_addr.s_addr = daddr->sin_addr.s_addr; | 533 | csk->daddr.sin_addr.s_addr = daddr->sin_addr.s_addr; |
533 | csk->daddr.sin_port = daddr->sin_port; | 534 | csk->daddr.sin_port = daddr->sin_port; |
534 | csk->daddr.sin_family = daddr->sin_family; | 535 | csk->daddr.sin_family = daddr->sin_family; |
535 | csk->saddr.sin_addr.s_addr = rt->rt_src; | 536 | csk->saddr.sin_addr.s_addr = fl4.saddr; |
536 | 537 | ||
537 | return csk; | 538 | return csk; |
538 | 539 | ||