diff options
author | rrs <rrs@FreeBSD.org> | 2011-01-20 12:40:09 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2011-01-20 12:40:09 +0000 |
commit | cf6406f93b60578eadb0ff3aad0396a192d1543e (patch) | |
tree | 3106b6a9a295949aa4329aec55bcea0b38e315d6 /sys/netinet/sctp_usrreq.c | |
parent | 2d762880b382332f9c370074912c7a597cb2325d (diff) | |
download | FreeBSD-src-cf6406f93b60578eadb0ff3aad0396a192d1543e.zip FreeBSD-src-cf6406f93b60578eadb0ff3aad0396a192d1543e.tar.gz |
Fix it so we align with new socket API draft for
state's in destination (i.e. ACTIVE/INACTIVE/UNCONFIRMED)
MFC after: 1 week
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index dba94b6..af3c2c7 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -2341,7 +2341,16 @@ flags_out: } if ((stcb) && (net)) { - paddri->spinfo_state = net->dest_state & (SCTP_REACHABLE_MASK | SCTP_ADDR_NOHB); + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* Its unconfirmed */ + paddri->spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* The Active */ + paddri->spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + paddri->spinfo_state = SCTP_INACTIVE; + } paddri->spinfo_cwnd = net->cwnd; paddri->spinfo_srtt = ((net->lastsa >> 2) + net->lastsv) >> 1; paddri->spinfo_rto = net->RTO; @@ -2409,7 +2418,16 @@ flags_out: * Again the user can get info from sctp_constants.h * for what the state of the network is. */ - sstat->sstat_primary.spinfo_state = net->dest_state & SCTP_REACHABLE_MASK; + if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { + /* It's unconfirmed */ + sstat->sstat_primary.spinfo_state = SCTP_UNCONFIRMED; + } else if (net->dest_state & SCTP_ADDR_REACHABLE) { + /* Its active */ + sstat->sstat_primary.spinfo_state = SCTP_ACTIVE; + } else { + /* It's Inactive */ + sstat->sstat_primary.spinfo_state = SCTP_INACTIVE; + } sstat->sstat_primary.spinfo_cwnd = net->cwnd; sstat->sstat_primary.spinfo_srtt = net->lastsa; sstat->sstat_primary.spinfo_rto = net->RTO; |