aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/ipv6.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/ipv6.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/ipv6.c')
-rw-r--r--net/sctp/ipv6.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index a1913a4b6f3a..500875f4dc41 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -247,17 +247,16 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
247/* Returns the dst cache entry for the given source and destination ip 247/* Returns the dst cache entry for the given source and destination ip
248 * addresses. 248 * addresses.
249 */ 249 */
250static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc, 250static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
251 union sctp_addr *daddr, 251 struct flowi *fl, struct sock *sk)
252 union sctp_addr *saddr,
253 struct flowi *fl,
254 struct sock *sk)
255{ 252{
253 struct sctp_association *asoc = t->asoc;
256 struct dst_entry *dst = NULL; 254 struct dst_entry *dst = NULL;
257 struct flowi6 *fl6 = &fl->u.ip6; 255 struct flowi6 *fl6 = &fl->u.ip6;
258 struct sctp_bind_addr *bp; 256 struct sctp_bind_addr *bp;
259 struct sctp_sockaddr_entry *laddr; 257 struct sctp_sockaddr_entry *laddr;
260 union sctp_addr *baddr = NULL; 258 union sctp_addr *baddr = NULL;
259 union sctp_addr *daddr = &t->ipaddr;
261 union sctp_addr dst_saddr; 260 union sctp_addr dst_saddr;
262 __u8 matchlen = 0; 261 __u8 matchlen = 0;
263 __u8 bmatchlen; 262 __u8 bmatchlen;
@@ -270,7 +269,6 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
270 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) 269 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
271 fl6->flowi6_oif = daddr->v6.sin6_scope_id; 270 fl6->flowi6_oif = daddr->v6.sin6_scope_id;
272 271
273
274 SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl6->daddr); 272 SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl6->daddr);
275 273
276 if (asoc) 274 if (asoc)
@@ -343,12 +341,13 @@ out:
343 if (!IS_ERR(dst)) { 341 if (!IS_ERR(dst)) {
344 struct rt6_info *rt; 342 struct rt6_info *rt;
345 rt = (struct rt6_info *)dst; 343 rt = (struct rt6_info *)dst;
344 t->dst = dst;
346 SCTP_DEBUG_PRINTK("rt6_dst:%pI6 rt6_src:%pI6\n", 345 SCTP_DEBUG_PRINTK("rt6_dst:%pI6 rt6_src:%pI6\n",
347 &rt->rt6i_dst.addr, &fl6->saddr); 346 &rt->rt6i_dst.addr, &fl6->saddr);
348 return dst; 347 } else {
348 t->dst = NULL;
349 SCTP_DEBUG_PRINTK("NO ROUTE\n");
349 } 350 }
350 SCTP_DEBUG_PRINTK("NO ROUTE\n");
351 return NULL;
352} 351}
353 352
354/* Returns the number of consecutive initial bits that match in the 2 ipv6 353/* Returns the number of consecutive initial bits that match in the 2 ipv6