aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2011-04-26 17:54:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-27 16:14:06 -0400
commitda0420bee24a1ba54e55a61e95b1a53205d7e62d (patch)
treeb17401ad5e6d97f8e3c8649725d5ca0a20e1b765 /net/sctp/protocol.c
parentaf1384703f8a4ff3d245925d6596ef1c5c6e469e (diff)
sctp: clean up route lookup calls
Change the call to take the transport parameter and set the cached 'dst' appropriately inside the get_dst() function calls. This will allow us in the future to clean up source address storage as well. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 68b4c4317d61..9d3f15957d12 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -463,17 +463,16 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
463 * addresses. If an association is passed, trys to get a dst entry with a 463 * addresses. If an association is passed, trys to get a dst entry with a
464 * source address that matches an address in the bind address list. 464 * source address that matches an address in the bind address list.
465 */ 465 */
466static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc, 466static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
467 union sctp_addr *daddr, 467 struct flowi *fl, struct sock *sk)
468 union sctp_addr *saddr,
469 struct flowi *fl,
470 struct sock *sk)
471{ 468{
469 struct sctp_association *asoc = t->asoc;
472 struct rtable *rt; 470 struct rtable *rt;
473 struct flowi4 *fl4 = &fl->u.ip4; 471 struct flowi4 *fl4 = &fl->u.ip4;
474 struct sctp_bind_addr *bp; 472 struct sctp_bind_addr *bp;
475 struct sctp_sockaddr_entry *laddr; 473 struct sctp_sockaddr_entry *laddr;
476 struct dst_entry *dst = NULL; 474 struct dst_entry *dst = NULL;
475 union sctp_addr *daddr = &t->ipaddr;
477 union sctp_addr dst_saddr; 476 union sctp_addr dst_saddr;
478 477
479 memset(fl4, 0x0, sizeof(struct flowi4)); 478 memset(fl4, 0x0, sizeof(struct flowi4));
@@ -548,13 +547,12 @@ static struct dst_entry *sctp_v4_get_dst(struct sctp_association *asoc,
548out_unlock: 547out_unlock:
549 rcu_read_unlock(); 548 rcu_read_unlock();
550out: 549out:
550 t->dst = dst;
551 if (dst) 551 if (dst)
552 SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n", 552 SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n",
553 &rt->rt_dst, &rt->rt_src); 553 &rt->rt_dst, &rt->rt_src);
554 else 554 else
555 SCTP_DEBUG_PRINTK("NO ROUTE\n"); 555 SCTP_DEBUG_PRINTK("NO ROUTE\n");
556
557 return dst;
558} 556}
559 557
560/* For v4, the source address is cached in the route entry(dst). So no need 558/* For v4, the source address is cached in the route entry(dst). So no need