diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-17 20:27:22 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-17 20:27:22 (GMT) |
commit | b4aa9e05a61b845541fa6f5b1d246976922601f0 (patch) | |
tree | ca94478c3df281ab76a3399f5ba6341ade3f5791 /net/sctp | |
parent | 1dc0f3c54ce1df957f99c17b145488fd03eb1a59 (diff) | |
parent | 4b8fe66300acb2fba8b16d62606e0d30204022fc (diff) | |
download | linux-fsl-qoriq-b4aa9e05a61b845541fa6f5b1d246976922601f0.tar.xz |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bnx2x/bnx2x.h
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/vhost/vhost.c
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/socket.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 842c7f3..a09b0dd 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -2932,6 +2932,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva struct sctp_association *asoc = NULL; struct sctp_setpeerprim prim; struct sctp_chunk *chunk; + struct sctp_af *af; int err; sp = sctp_sk(sk); @@ -2959,6 +2960,13 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva if (!sctp_state(asoc, ESTABLISHED)) return -ENOTCONN; + af = sctp_get_af_specific(prim.sspp_addr.ss_family); + if (!af) + return -EINVAL; + + if (!af->addr_valid((union sctp_addr *)&prim.sspp_addr, sp, NULL)) + return -EADDRNOTAVAIL; + if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) return -EADDRNOTAVAIL; @@ -5045,7 +5053,7 @@ static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len, if (copy_to_user(optval, &val, len)) return -EFAULT; - return -ENOTSUPP; + return 0; } /* |