summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_pcb.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-06-13 01:31:53 +0000
committerrrs <rrs@FreeBSD.org>2007-06-13 01:31:53 +0000
commit20ad8ecfb0af809f13b9dc6e5ab994548e0d785c (patch)
tree8d5bbe40650c2eb2f33e58ff8a55f66ae96d6c38 /sys/netinet/sctp_pcb.c
parentec70de06d657f80cf4eaa0dee9fa7938ca45ac46 (diff)
downloadFreeBSD-src-20ad8ecfb0af809f13b9dc6e5ab994548e0d785c.zip
FreeBSD-src-20ad8ecfb0af809f13b9dc6e5ab994548e0d785c.tar.gz
- Fixed cookie handling to calc an RTO when
its an INIT collision case. - Fixed RTO calc to maintain a seperate variable to track if a RTO calc as been done, this allows the RTO var to be doubled during initial timeouts. - Reduces the amount of stack used by process control. - Use a constant for the peer chunk overhead. - Name change to spell candidate correctly.
Diffstat (limited to 'sys/netinet/sctp_pcb.c')
-rw-r--r--sys/netinet/sctp_pcb.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index 1db8d33..ce71edc 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -1274,7 +1274,8 @@ sctp_pcb_findep(struct sockaddr *nam, int find_tcp_pool, int have_lock,
*/
struct sctp_tcb *
sctp_findassociation_addr_sa(struct sockaddr *to, struct sockaddr *from,
- struct sctp_inpcb **inp_p, struct sctp_nets **netp, int find_tcp_pool, uint32_t vrf_id)
+ struct sctp_inpcb **inp_p, struct sctp_nets **netp, int find_tcp_pool,
+ uint32_t vrf_id)
{
struct sctp_inpcb *inp = NULL;
struct sctp_tcb *retval;
@@ -1282,9 +1283,11 @@ sctp_findassociation_addr_sa(struct sockaddr *to, struct sockaddr *from,
SCTP_INP_INFO_RLOCK();
if (find_tcp_pool) {
if (inp_p != NULL) {
- retval = sctp_tcb_special_locate(inp_p, from, to, netp, vrf_id);
+ retval = sctp_tcb_special_locate(inp_p, from, to, netp,
+ vrf_id);
} else {
- retval = sctp_tcb_special_locate(&inp, from, to, netp, vrf_id);
+ retval = sctp_tcb_special_locate(&inp, from, to, netp,
+ vrf_id);
}
if (retval != NULL) {
SCTP_INP_INFO_RUNLOCK();
@@ -1307,9 +1310,11 @@ sctp_findassociation_addr_sa(struct sockaddr *to, struct sockaddr *from,
* inbound packet side.
*/
if (inp_p != NULL) {
- retval = sctp_findassociation_ep_addr(inp_p, from, netp, to, NULL);
+ retval = sctp_findassociation_ep_addr(inp_p, from, netp, to,
+ NULL);
} else {
- retval = sctp_findassociation_ep_addr(&inp, from, netp, to, NULL);
+ retval = sctp_findassociation_ep_addr(&inp, from, netp, to,
+ NULL);
}
return retval;
}
@@ -2216,7 +2221,7 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
}
}
} else {
- uint16_t first, last, candiate;
+ uint16_t first, last, candidate;
uint16_t count;
int done;
@@ -2246,11 +2251,11 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
last = temp;
}
count = last - first + 1; /* number of candidates */
- candiate = first + sctp_select_initial_TSN(&inp->sctp_ep) % (count);
+ candidate = first + sctp_select_initial_TSN(&inp->sctp_ep) % (count);
done = 0;
while (!done) {
- if (sctp_isport_inuse(inp, htons(candiate), inp->def_vrf_id) == 0) {
+ if (sctp_isport_inuse(inp, htons(candidate), inp->def_vrf_id) == 0) {
done = 1;
}
if (!done) {
@@ -2260,13 +2265,13 @@ sctp_inpcb_bind(struct socket *so, struct sockaddr *addr, struct thread *p)
SCTP_INP_INFO_WUNLOCK();
return (EADDRINUSE);
}
- if (candiate == last)
- candiate = first;
+ if (candidate == last)
+ candidate = first;
else
- candiate = candiate + 1;
+ candidate = candidate + 1;
}
}
- lport = htons(candiate);
+ lport = htons(candidate);
}
SCTP_INP_DECR_REF(inp);
if (inp->sctp_flags & (SCTP_PCB_FLAGS_SOCKET_GONE |
@@ -3063,6 +3068,7 @@ sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr,
* initial value
*/
net->RTO = 0;
+ net->RTO_measured = 0;
stcb->asoc.numnets++;
*(&net->ref_count) = 1;
net->tos_flowlabel = 0;
OpenPOWER on IntegriCloud