Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223245
b: refs/heads/master
c: 40a0103
h: refs/heads/master
i:
  223243: ebcfccd
v: v3
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Dec 10, 2010
1 parent 37bad43 commit 348fdae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 79aeec5822cea63cf732bbc0c9f3337542352616
refs/heads/master: 40a010395cd66053f07bffeb3da5e44683bac30e
8 changes: 8 additions & 0 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 348fdae

Please sign in to comment.