aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-08-19 11:24:02 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2024-01-11 12:46:47 +0000
commiteb62bba325f31384a6ae193c655dc1f5ca43f2c7 (patch)
tree8dd366d5725eb0d31f9b37c23bac3364b206df97
parent3ec4836e4a1bfcb1d740dddf20b3c7ec8676913c (diff)
downloadsrc-eb62bba325f31384a6ae193c655dc1f5ca43f2c7.tar.gz
src-eb62bba325f31384a6ae193c655dc1f5ca43f2c7.zip
sctp: fix a warning
Fix an unused-but-set-variable warning for builds without INVARIANTS. Reported by: O. Hartmann (cherry picked from commit 1095da75032b439d893c0947eda2f3738ecfe494)
-rw-r--r--sys/netinet/sctp_input.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index f9e49b7b4f62..f93b066f051f 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -833,14 +833,12 @@ static void
sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_flag)
{
- struct sctp_association *asoc;
int some_on_streamwheel;
int old_state;
SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown: handling SHUTDOWN\n");
if (stcb == NULL)
return;
- asoc = &stcb->asoc;
if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) ||
(SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) {
return;
@@ -872,7 +870,7 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
sctp_ulp_notify(SCTP_NOTIFY_PEER_SHUTDOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
/* reset time */
- (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered);
+ (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
}
}
if (SCTP_GET_STATE(stcb) == SCTP_STATE_SHUTDOWN_SENT) {
@@ -886,8 +884,8 @@ sctp_handle_shutdown(struct sctp_shutdown_chunk *cp,
/* Now is there unsent data on a stream somewhere? */
some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED);
- if (!TAILQ_EMPTY(&asoc->send_queue) ||
- !TAILQ_EMPTY(&asoc->sent_queue) ||
+ if (!TAILQ_EMPTY(&stcb->asoc.send_queue) ||
+ !TAILQ_EMPTY(&stcb->asoc.sent_queue) ||
some_on_streamwheel) {
/* By returning we will push more data out */
return;
@@ -916,15 +914,12 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
struct sctp_tcb *stcb,
struct sctp_nets *net)
{
- struct sctp_association *asoc;
-
SCTPDBG(SCTP_DEBUG_INPUT2,
"sctp_handle_shutdown_ack: handling SHUTDOWN ACK\n");
if (stcb == NULL) {
return;
}
- asoc = &stcb->asoc;
/* process according to association state */
if ((SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_WAIT) ||
(SCTP_GET_STATE(stcb) == SCTP_STATE_COOKIE_ECHOED)) {
@@ -946,8 +941,8 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
* case.
*/
#ifdef INVARIANTS
- if (!TAILQ_EMPTY(&asoc->send_queue) ||
- !TAILQ_EMPTY(&asoc->sent_queue) ||
+ if (!TAILQ_EMPTY(&stcb->asoc.send_queue) ||
+ !TAILQ_EMPTY(&stcb->asoc.sent_queue) ||
sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED)) {
panic("Queues are not empty when handling SHUTDOWN-ACK");
}