Date: Thu, 11 Jan 2024 12:47:12 GMT From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: eb62bba325f3 - stable/13 - sctp: fix a warning Message-ID: <202401111247.40BClCvZ035773@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=eb62bba325f31384a6ae193c655dc1f5ca43f2c7 commit eb62bba325f31384a6ae193c655dc1f5ca43f2c7 Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2023-08-19 11:24:02 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2024-01-11 12:46:47 +0000 sctp: fix a warning Fix an unused-but-set-variable warning for builds without INVARIANTS. Reported by: O. Hartmann (cherry picked from commit 1095da75032b439d893c0947eda2f3738ecfe494) --- sys/netinet/sctp_input.c | 15 +++++---------- 1 file 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"); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401111247.40BClCvZ035773>