diff options
Diffstat (limited to 'net/sctp/ipv6.c')
-rw-r--r-- | net/sctp/ipv6.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c index 85f1495e0edc..e45e44c60635 100644 --- a/net/sctp/ipv6.c +++ b/net/sctp/ipv6.c | |||
@@ -226,7 +226,7 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport, | |||
226 | 226 | ||
227 | SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " | 227 | SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " |
228 | "src:" NIP6_FMT " dst:" NIP6_FMT "\n", | 228 | "src:" NIP6_FMT " dst:" NIP6_FMT "\n", |
229 | __FUNCTION__, skb, skb->len, | 229 | __func__, skb, skb->len, |
230 | NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); | 230 | NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); |
231 | 231 | ||
232 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); | 232 | SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); |
@@ -251,7 +251,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc, | |||
251 | 251 | ||
252 | 252 | ||
253 | SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ", | 253 | SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ", |
254 | __FUNCTION__, NIP6(fl.fl6_dst)); | 254 | __func__, NIP6(fl.fl6_dst)); |
255 | 255 | ||
256 | if (saddr) { | 256 | if (saddr) { |
257 | ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr); | 257 | ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr); |
@@ -260,7 +260,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc, | |||
260 | NIP6(fl.fl6_src)); | 260 | NIP6(fl.fl6_src)); |
261 | } | 261 | } |
262 | 262 | ||
263 | dst = ip6_route_output(NULL, &fl); | 263 | dst = ip6_route_output(&init_net, NULL, &fl); |
264 | if (!dst->error) { | 264 | if (!dst->error) { |
265 | struct rt6_info *rt; | 265 | struct rt6_info *rt; |
266 | rt = (struct rt6_info *)dst; | 266 | rt = (struct rt6_info *)dst; |
@@ -313,10 +313,13 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc, | |||
313 | 313 | ||
314 | SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " | 314 | SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " |
315 | "daddr:" NIP6_FMT " ", | 315 | "daddr:" NIP6_FMT " ", |
316 | __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr)); | 316 | __func__, asoc, dst, NIP6(daddr->v6.sin6_addr)); |
317 | 317 | ||
318 | if (!asoc) { | 318 | if (!asoc) { |
319 | ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr); | 319 | ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, |
320 | &daddr->v6.sin6_addr, | ||
321 | inet6_sk(asoc->base.sk)->srcprefs, | ||
322 | &saddr->v6.sin6_addr); | ||
320 | SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", | 323 | SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", |
321 | NIP6(saddr->v6.sin6_addr)); | 324 | NIP6(saddr->v6.sin6_addr)); |
322 | return; | 325 | return; |
@@ -351,7 +354,7 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc, | |||
351 | } else { | 354 | } else { |
352 | printk(KERN_ERR "%s: asoc:%p Could not find a valid source " | 355 | printk(KERN_ERR "%s: asoc:%p Could not find a valid source " |
353 | "address for the dest:" NIP6_FMT "\n", | 356 | "address for the dest:" NIP6_FMT "\n", |
354 | __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr)); | 357 | __func__, asoc, NIP6(daddr->v6.sin6_addr)); |
355 | } | 358 | } |
356 | 359 | ||
357 | rcu_read_unlock(); | 360 | rcu_read_unlock(); |
@@ -634,7 +637,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk, | |||
634 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); | 637 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); |
635 | struct sctp6_sock *newsctp6sk; | 638 | struct sctp6_sock *newsctp6sk; |
636 | 639 | ||
637 | newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot); | 640 | newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot); |
638 | if (!newsk) | 641 | if (!newsk) |
639 | goto out; | 642 | goto out; |
640 | 643 | ||