diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2006-06-21 16:43:50 -0400 |
---|---|---|
committer | Auke-jan Kok <ahkok@gitlost.site> | 2006-06-21 16:43:50 -0400 |
commit | 0d204094d15dac2e8a439b993f71eda385b4dccd (patch) | |
tree | 647f0ddec94d0fb4aaf74fa55bcad75946030f8a /net/sctp/socket.c | |
parent | a487a8f7b6947f6445e5a1aa876522916785d5ec (diff) | |
parent | 612eff0e3715a6faff5ba1b74873b99e036c59fe (diff) |
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 174d4d35e951..b811691c35bf 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -172,7 +172,7 @@ static inline int sctp_verify_addr(struct sock *sk, union sctp_addr *addr, | |||
172 | return -EINVAL; | 172 | return -EINVAL; |
173 | 173 | ||
174 | /* Is this a valid SCTP address? */ | 174 | /* Is this a valid SCTP address? */ |
175 | if (!af->addr_valid(addr, sctp_sk(sk))) | 175 | if (!af->addr_valid(addr, sctp_sk(sk), NULL)) |
176 | return -EINVAL; | 176 | return -EINVAL; |
177 | 177 | ||
178 | if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr))) | 178 | if (!sctp_sk(sk)->pf->send_verify(sctp_sk(sk), (addr))) |
@@ -2530,8 +2530,32 @@ static int sctp_setsockopt_associnfo(struct sock *sk, char __user *optval, int o | |||
2530 | 2530 | ||
2531 | /* Set the values to the specific association */ | 2531 | /* Set the values to the specific association */ |
2532 | if (asoc) { | 2532 | if (asoc) { |
2533 | if (assocparams.sasoc_asocmaxrxt != 0) | 2533 | if (assocparams.sasoc_asocmaxrxt != 0) { |
2534 | __u32 path_sum = 0; | ||
2535 | int paths = 0; | ||
2536 | struct list_head *pos; | ||
2537 | struct sctp_transport *peer_addr; | ||
2538 | |||
2539 | list_for_each(pos, &asoc->peer.transport_addr_list) { | ||
2540 | peer_addr = list_entry(pos, | ||
2541 | struct sctp_transport, | ||
2542 | transports); | ||
2543 | path_sum += peer_addr->pathmaxrxt; | ||
2544 | paths++; | ||
2545 | } | ||
2546 | |||
2547 | /* Only validate asocmaxrxt if we have more then | ||
2548 | * one path/transport. We do this because path | ||
2549 | * retransmissions are only counted when we have more | ||
2550 | * then one path. | ||
2551 | */ | ||
2552 | if (paths > 1 && | ||
2553 | assocparams.sasoc_asocmaxrxt > path_sum) | ||
2554 | return -EINVAL; | ||
2555 | |||
2534 | asoc->max_retrans = assocparams.sasoc_asocmaxrxt; | 2556 | asoc->max_retrans = assocparams.sasoc_asocmaxrxt; |
2557 | } | ||
2558 | |||
2535 | if (assocparams.sasoc_cookie_life != 0) { | 2559 | if (assocparams.sasoc_cookie_life != 0) { |
2536 | asoc->cookie_life.tv_sec = | 2560 | asoc->cookie_life.tv_sec = |
2537 | assocparams.sasoc_cookie_life / 1000; | 2561 | assocparams.sasoc_cookie_life / 1000; |