Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27589
b: refs/heads/master
c: 402d68c
h: refs/heads/master
i:
  27587: 3557321
v: v3
  • Loading branch information
Vlad Yasevich authored and David S. Miller committed Jun 18, 2006
1 parent 59dbe3c commit 2c57c90
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 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: c7ce1ae21223fe1f905feba272bc14b87994a57d
refs/heads/master: 402d68c43326d2f0e7e2e9a9013cd4c098d9b87c
26 changes: 25 additions & 1 deletion trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2530,8 +2530,32 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o

/* Set the values to the specific association */
if (asoc) {
if (assocparams.sasoc_asocmaxrxt != 0)
if (assocparams.sasoc_asocmaxrxt != 0) {
__u32 path_sum = 0;
int paths = 0;
struct list_head *pos;
struct sctp_transport *peer_addr;

list_for_each(pos, &asoc->peer.transport_addr_list) {
peer_addr = list_entry(pos,
struct sctp_transport,
transports);
path_sum += peer_addr->pathmaxrxt;
paths++;
}

/* Only validate asocmaxrxt if we have more then
* one path/transport. We do this because path
* retransmissions are only counted when we have more
* then one path.
*/
if (paths > 1 &&
assocparams.sasoc_asocmaxrxt > path_sum)
return -EINVAL;

asoc->max_retrans = assocparams.sasoc_asocmaxrxt;
}

if (assocparams.sasoc_cookie_life != 0) {
asoc->cookie_life.tv_sec =
assocparams.sasoc_cookie_life / 1000;
Expand Down

0 comments on commit 2c57c90

Please sign in to comment.