Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57721
b: refs/heads/master
c: 8b35805
h: refs/heads/master
i:
  57719: 0d5a731
v: v3
  • Loading branch information
Vlad Yasevich authored and Vladislav Yasevich committed Jun 13, 2007
1 parent 15cf955 commit f2980ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d570ee490fb18220262cfe41284d7aede797ed4f
refs/heads/master: 8b35805693e1915829355723537f99f1b8bc9cc0
15 changes: 11 additions & 4 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,12 +333,19 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
if (!sp->pf->bind_verify(sp, addr))
return -EADDRNOTAVAIL;

/* We must either be unbound, or bind to the same port. */
if (bp->port && (snum != bp->port)) {
SCTP_DEBUG_PRINTK("sctp_do_bind:"
/* We must either be unbound, or bind to the same port.
* It's OK to allow 0 ports if we are already bound.
* We'll just inhert an already bound port in this case
*/
if (bp->port) {
if (!snum)
snum = bp->port;
else if (snum != bp->port) {
SCTP_DEBUG_PRINTK("sctp_do_bind:"
" New port %d does not match existing port "
"%d.\n", snum, bp->port);
return -EINVAL;
return -EINVAL;
}
}

if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
Expand Down

0 comments on commit f2980ed

Please sign in to comment.