diff options
author | rrs <rrs@FreeBSD.org> | 2006-12-29 20:21:42 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2006-12-29 20:21:42 +0000 |
commit | d392a291a28a8cbedf2cc9398d4a03c8467d8c3d (patch) | |
tree | ca49939e7d34d46ab49b2ec2d88653e27f3e43a1 /sys/netinet/sctp_timer.c | |
parent | c2bdc9dc5c518c1a3f29bb61d0d469bb1b6b68a9 (diff) | |
download | FreeBSD-src-d392a291a28a8cbedf2cc9398d4a03c8467d8c3d.zip FreeBSD-src-d392a291a28a8cbedf2cc9398d4a03c8467d8c3d.tar.gz |
a) macro-ization of all mbuf and random number
access plus timers. This makes the code
more portable and able to change out the
mbuf or timer system used more easily ;-)
b) removal of all use of pkt-hdr's until only
the places we need them (before ip_output routines).
c) remove a bunch of code not needed due to <b> aka
worrying about pkthdr's :-)
d) There was one last reorder problem it looks where
if a restart occur's and we release and relock (at
the point where we setup our alias vtag) we would
end up possibly getting the wrong TSN in place. The
code that fixed the TSN's just needed to be shifted
around BEFORE the release of the lock.. also code that
set the state (since this also could contribute).
Approved by: gnn
Diffstat (limited to 'sys/netinet/sctp_timer.c')
-rw-r--r-- | sys/netinet/sctp_timer.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index dc55ef6..dae2a81 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -318,11 +318,11 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_paramhdr *ph; uint32_t *ippp; - oper->m_len = sizeof(struct sctp_paramhdr) + + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + sizeof(uint32_t); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(oper->m_len); + ph->param_length = htons(SCTP_BUF_LEN(oper)); ippp = (uint32_t *) (ph + 1); *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_1); } @@ -544,8 +544,8 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, window_probe, SCTP_FR_T3_MARK_TIME); sctp_log_fr(net->flight_size, - callout_pending(&net->fr_timer.timer), - callout_active(&net->fr_timer.timer), + SCTP_OS_TIMER_PENDING(&net->fr_timer.timer), + SCTP_OS_TIMER_ACTIVE(&net->fr_timer.timer), SCTP_FR_CWND_REPORT); sctp_log_fr(net->flight_size, net->cwnd, stcb->asoc.total_flight, SCTP_FR_CWND_REPORT); #endif @@ -1091,11 +1091,11 @@ sctp_cookie_timer(struct sctp_inpcb *inp, struct sctp_paramhdr *ph; uint32_t *ippp; - oper->m_len = sizeof(struct sctp_paramhdr) + + SCTP_BUF_LEN(oper) = sizeof(struct sctp_paramhdr) + sizeof(uint32_t); ph = mtod(oper, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION); - ph->param_length = htons(oper->m_len); + ph->param_length = htons(SCTP_BUF_LEN(oper)); ippp = (uint32_t *) (ph + 1); *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_2); } @@ -1472,7 +1472,7 @@ sctp_heartbeat_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int sctp_is_hb_timer_running(struct sctp_tcb *stcb) { - if (callout_pending(&stcb->asoc.hb_timer.timer)) { + if (SCTP_OS_TIMER_PENDING(&stcb->asoc.hb_timer.timer)) { /* its running */ return (1); } else { @@ -1484,7 +1484,7 @@ sctp_is_hb_timer_running(struct sctp_tcb *stcb) int sctp_is_sack_timer_running(struct sctp_tcb *stcb) { - if (callout_pending(&stcb->asoc.dack_timer.timer)) { + if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { /* its running */ return (1); } else { @@ -1493,7 +1493,6 @@ sctp_is_sack_timer_running(struct sctp_tcb *stcb) } } - #define SCTP_NUMBER_OF_MTU_SIZES 18 static uint32_t mtu_sizes[] = { 68, @@ -1656,7 +1655,7 @@ done_with_iterator: LIST_REMOVE(it, sctp_nxt_itr); /* stopping the callout is not needed, in theory */ SCTP_INP_INFO_WUNLOCK(); - callout_stop(&it->tmr.timer); + SCTP_OS_TIMER_STOP(&it->tmr.timer); if (it->function_atend != NULL) { (*it->function_atend) (it->pointer, it->val); } |