aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/protocol.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-05-03 23:55:05 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-03 23:55:05 -0400
commit18a353f42817f08e3501162ceda9d2efddb08a40 (patch)
tree250d1977232b7a14330b18758e091c0b3ac5d73e /net/sctp/protocol.c
parent492f64ce12e259abd85714d05b885e105bd8aeef (diff)
sctp: Use flowi4's {saddr,daddr} in sctp_v4_dst_saddr() and sctp_v4_get_dst()
Instead of rt->rt_{src,dst} Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/protocol.c')
-rw-r--r--net/sctp/protocol.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 9d3f15957d12..69fbc55cf18e 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -339,13 +339,12 @@ static int sctp_v4_to_addr_param(const union sctp_addr *addr,
339} 339}
340 340
341/* Initialize a sctp_addr from a dst_entry. */ 341/* Initialize a sctp_addr from a dst_entry. */
342static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct dst_entry *dst, 342static void sctp_v4_dst_saddr(union sctp_addr *saddr, struct flowi4 *fl4,
343 __be16 port) 343 __be16 port)
344{ 344{
345 struct rtable *rt = (struct rtable *)dst;
346 saddr->v4.sin_family = AF_INET; 345 saddr->v4.sin_family = AF_INET;
347 saddr->v4.sin_port = port; 346 saddr->v4.sin_port = port;
348 saddr->v4.sin_addr.s_addr = rt->rt_src; 347 saddr->v4.sin_addr.s_addr = fl4->saddr;
349} 348}
350 349
351/* Compare two addresses exactly. */ 350/* Compare two addresses exactly. */
@@ -508,7 +507,7 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
508 /* Walk through the bind address list and look for a bind 507 /* Walk through the bind address list and look for a bind
509 * address that matches the source address of the returned dst. 508 * address that matches the source address of the returned dst.
510 */ 509 */
511 sctp_v4_dst_saddr(&dst_saddr, dst, htons(bp->port)); 510 sctp_v4_dst_saddr(&dst_saddr, fl4, htons(bp->port));
512 rcu_read_lock(); 511 rcu_read_lock();
513 list_for_each_entry_rcu(laddr, &bp->address_list, list) { 512 list_for_each_entry_rcu(laddr, &bp->address_list, list) {
514 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC)) 513 if (!laddr->valid || (laddr->state != SCTP_ADDR_SRC))
@@ -550,7 +549,7 @@ out:
550 t->dst = dst; 549 t->dst = dst;
551 if (dst) 550 if (dst)
552 SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n", 551 SCTP_DEBUG_PRINTK("rt_dst:%pI4, rt_src:%pI4\n",
553 &rt->rt_dst, &rt->rt_src); 552 &fl4->daddr, &fl4->saddr);
554 else 553 else
555 SCTP_DEBUG_PRINTK("NO ROUTE\n"); 554 SCTP_DEBUG_PRINTK("NO ROUTE\n");
556} 555}