Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53502
b: refs/heads/master
c: 16d00fb
h: refs/heads/master
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed May 4, 2007
1 parent fa3946b commit 350b4ab
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: 5a6d34162f5c6f522f857df274f1c8240f161e11
refs/heads/master: 16d00fb7765a43a1b05989062e985d283b3a1f2d
8 changes: 8 additions & 0 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ static int __sctp_connect(struct sock* sk,
int walk_size = 0;
union sctp_addr *sa_addr;
void *addr_buf;
unsigned short port;

sp = sctp_sk(sk);
ep = sp->ep;
Expand All @@ -992,6 +993,7 @@ static int __sctp_connect(struct sock* sk,
while (walk_size < addrs_size) {
sa_addr = (union sctp_addr *)addr_buf;
af = sctp_get_af_specific(sa_addr->sa.sa_family);
port = ntohs(sa_addr->v4.sin_port);

/* If the address family is not supported or if this address
* causes the address buffer to overflow return EINVAL.
Expand All @@ -1005,6 +1007,12 @@ static int __sctp_connect(struct sock* sk,
if (err)
goto out_free;

/* Make sure the destination port is correctly set
* in all addresses.
*/
if (asoc && asoc->peer.port && asoc->peer.port != port)
goto out_free;

memcpy(&to, sa_addr, af->sockaddr_len);

/* Check if there already is a matching association on the
Expand Down

0 comments on commit 350b4ab

Please sign in to comment.