- Define changes in sctp.h

- Bug in CA that does not get us incrementing the PBA properly which
  made us more conservative.
- comment updated in sctp_input.c
- memsets added before we log
- added arg to hmac id's
MFC after:	2 weeks
This commit is contained in:
Randall Stewart 2008-05-20 09:51:36 +00:00
parent 8b2898a64d
commit bfefd19036
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179141
5 changed files with 34 additions and 43 deletions

View File

@ -436,12 +436,13 @@ __attribute__((packed));
#define SCTP_PCB_FLAGS_WAKEOUTPUT 0x01000000
#define SCTP_PCB_FLAGS_WAKEINPUT 0x02000000
#define SCTP_PCB_FLAGS_BOUND_V6 0x04000000
#define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4 0x08000000
#define SCTP_PCB_FLAGS_BLOCKING_IO 0x10000000
#define SCTP_PCB_FLAGS_SOCKET_GONE 0x20000000
#define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x40000000
#define SCTP_PCB_FLAGS_BLOCKING_IO 0x08000000
#define SCTP_PCB_FLAGS_SOCKET_GONE 0x10000000
#define SCTP_PCB_FLAGS_SOCKET_ALLGONE 0x20000000
/* flags to copy to new PCB */
#define SCTP_PCB_COPY_FLAGS 0x0e000004
#define SCTP_PCB_COPY_FLAGS (SCTP_PCB_FLAGS_BOUNDALL|\
SCTP_PCB_FLAGS_WAKEINPUT|\
SCTP_PCB_FLAGS_BOUND_V6)
/*
@ -470,6 +471,7 @@ __attribute__((packed));
#define SCTP_PCB_FLAGS_STREAM_RESETEVNT 0x00080000
#define SCTP_PCB_FLAGS_NO_FRAGMENT 0x00100000
#define SCTP_PCB_FLAGS_EXPLICIT_EOR 0x00400000
#define SCTP_PCB_FLAGS_NEEDS_MAPPED_V4 0x00800000
/*-
* mobility_features parameters (by micchie).Note

View File

@ -304,50 +304,25 @@ sctp_cwnd_update_after_sack(struct sctp_tcb *stcb,
}
} else {
/* We are in congestion avoidance */
if (net->flight_size + net->net_ack >=
net->cwnd) {
/*
* add to pba only if we had a
* cwnd's worth (or so) in flight OR
* the burst limit was applied.
*/
net->partial_bytes_acked +=
net->net_ack;
/*
* Add to pba
*/
net->partial_bytes_acked +=
net->net_ack;
/*
* Do we need to increase (if pba is
* > cwnd)?
*/
if (net->partial_bytes_acked >=
net->cwnd) {
if (net->cwnd <
net->partial_bytes_acked) {
net->partial_bytes_acked -=
net->cwnd;
} else {
net->partial_bytes_acked =
0;
}
net->cwnd += net->mtu;
if (sctp_logging_level & SCTP_CWND_MONITOR_ENABLE) {
sctp_log_cwnd(stcb, net, net->mtu,
SCTP_CWND_LOG_FROM_CA);
}
} else {
if (sctp_logging_level & SCTP_CWND_LOGGING_ENABLE) {
sctp_log_cwnd(stcb, net, net->net_ack,
SCTP_CWND_LOG_NOADV_CA);
}
if ((net->flight_size + net->net_ack >= net->cwnd) &&
(net->partial_bytes_acked >= net->cwnd)) {
net->partial_bytes_acked -= net->cwnd;
net->cwnd += net->mtu;
if (sctp_logging_level & SCTP_CWND_MONITOR_ENABLE) {
sctp_log_cwnd(stcb, net, net->mtu,
SCTP_CWND_LOG_FROM_CA);
}
} else {
unsigned int dif;
if (sctp_logging_level & SCTP_CWND_LOGGING_ENABLE) {
sctp_log_cwnd(stcb, net, net->net_ack,
SCTP_CWND_LOG_NOADV_CA);
}
dif = net->cwnd - (net->flight_size +
net->net_ack);
}
}
} else {

View File

@ -102,7 +102,15 @@ sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh,
inp->sctp_socket->so_qlimit);
/*
* FIX ME ?? What about TCP model and we have a
* match/restart case?
* match/restart case? Actually no fix is needed. the lookup
* will always find the existing assoc so stcb would not be
* NULL. It may be questionable to do this since we COULD
* just send back the INIT-ACK and hope that the app did
* accept()'s by the time the COOKIE was sent. But there is
* a price to pay for COOKIE generation and I don't want to
* pay it on the chance that the app will actually do some
* accepts(). The App just looses and should NOT be in this
* state :-)
*/
sctp_abort_association(inp, stcb, m, iphlen, sh, op_err,
vrf_id);

View File

@ -507,6 +507,7 @@ struct sctp_authkey {
/* SCTP_HMAC_IDENT */
struct sctp_hmacalgo {
uint32_t shmac_number_of_idents;
uint16_t shmac_idents[0];
};

View File

@ -110,6 +110,7 @@ rto_logging(struct sctp_nets *net, int from)
{
struct sctp_cwnd_log sctp_clog;
memset(&sctp_clog, 0, sizeof(sctp_clog));
sctp_clog.x.rto.net = (void *)net;
sctp_clog.x.rto.rtt = net->prev_rtt;
SCTP_CTR6(KTR_SCTP, "SCTP:%d[%d]:%x-%x-%x-%x",
@ -187,6 +188,7 @@ sctp_log_map(uint32_t map, uint32_t cum, uint32_t high, int from)
{
struct sctp_cwnd_log sctp_clog;
memset(&sctp_clog, 0, sizeof(sctp_clog));
sctp_clog.x.map.base = map;
sctp_clog.x.map.cum = cum;
sctp_clog.x.map.high = high;
@ -205,6 +207,7 @@ sctp_log_fr(uint32_t biggest_tsn, uint32_t biggest_new_tsn, uint32_t tsn,
{
struct sctp_cwnd_log sctp_clog;
memset(&sctp_clog, 0, sizeof(sctp_clog));
sctp_clog.x.fr.largest_tsn = biggest_tsn;
sctp_clog.x.fr.largest_new_tsn = biggest_new_tsn;
sctp_clog.x.fr.tsn = tsn;
@ -317,6 +320,7 @@ sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from)
{
struct sctp_cwnd_log sctp_clog;
memset(&sctp_clog, 0, sizeof(sctp_clog));
if (inp) {
sctp_clog.x.lock.sock = (void *)inp->sctp_socket;
@ -361,6 +365,7 @@ sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *net, int error, int b
{
struct sctp_cwnd_log sctp_clog;
memset(&sctp_clog, 0, sizeof(sctp_clog));
sctp_clog.x.cwnd.net = net;
sctp_clog.x.cwnd.cwnd_new_value = error;
sctp_clog.x.cwnd.inflight = net->flight_size;