]> err.no Git - linux-2.6/blobdiff - net/sctp/ipv6.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / net / sctp / ipv6.c
index 46c5b3c5cb99c699d9c6cdd568405aad27a85c8a..e45e44c6063524b71f0805b4b55938f68961930f 100644 (file)
@@ -110,8 +110,9 @@ static int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
                spin_lock_bh(&sctp_local_addr_lock);
                list_for_each_entry_safe(addr, temp,
                                        &sctp_local_addr_list, list) {
-                       if (ipv6_addr_equal(&addr->a.v6.sin6_addr,
-                                            &ifa->addr)) {
+                       if (addr->a.sa.sa_family == AF_INET6 &&
+                                       ipv6_addr_equal(&addr->a.v6.sin6_addr,
+                                               &ifa->addr)) {
                                found = 1;
                                addr->valid = 0;
                                list_del_rcu(&addr->list);
@@ -316,7 +317,9 @@ static void sctp_v6_get_saddr(struct sctp_association *asoc,
 
        if (!asoc) {
                ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL,
-                                  &daddr->v6.sin6_addr, &saddr->v6.sin6_addr);
+                                  &daddr->v6.sin6_addr,
+                                  inet6_sk(asoc->base.sk)->srcprefs,
+                                  &saddr->v6.sin6_addr);
                SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n",
                                  NIP6(saddr->v6.sin6_addr));
                return;
@@ -634,7 +637,7 @@ static struct sock *sctp_v6_create_accept_sk(struct sock *sk,
        struct ipv6_pinfo *newnp, *np = inet6_sk(sk);
        struct sctp6_sock *newsctp6sk;
 
-       newsk = sk_alloc(sk->sk_net, PF_INET6, GFP_KERNEL, sk->sk_prot);
+       newsk = sk_alloc(sock_net(sk), PF_INET6, GFP_KERNEL, sk->sk_prot);
        if (!newsk)
                goto out;