git: f210e4fbc54a - main - sctp: cleanup, no functional change intended

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sun, 15 May 2022 10:11:31 UTC
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=f210e4fbc54ab78711bd5197b7097002ff3ae891

commit f210e4fbc54ab78711bd5197b7097002ff3ae891
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2022-05-14 06:30:41 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-05-14 06:30:41 +0000

    sctp: cleanup, no functional change intended
    
    MFC after:      3 days
---
 sys/netinet/sctp_input.c  | 2 +-
 sys/netinet/sctp_usrreq.c | 8 ++------
 sys/netinet/sctputil.c    | 2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 2823a38a000f..ff16654968d5 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -992,7 +992,7 @@ sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp SCTP_UNUSED,
 	if (stcb->sctp_socket) {
 		if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
 		    (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) {
-			stcb->sctp_socket->so_snd.sb_cc = 0;
+			SCTP_SB_CLEAR(stcb->sctp_socket->so_snd);
 		}
 		sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED);
 	}
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c
index 02075d79e1aa..98102722c53e 100644
--- a/sys/netinet/sctp_usrreq.c
+++ b/sys/netinet/sctp_usrreq.c
@@ -846,18 +846,14 @@ sctp_flush(struct socket *so, int how)
 		inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ;
 		SCTP_INP_READ_UNLOCK(inp);
 		SCTP_INP_WUNLOCK(inp);
-		so->so_rcv.sb_cc = 0;
-		so->so_rcv.sb_mbcnt = 0;
-		so->so_rcv.sb_mb = NULL;
+		SCTP_SB_CLEAR(so->so_rcv);
 	}
 	if ((how == PRU_FLUSH_WR) || (how == PRU_FLUSH_RDWR)) {
 		/*
 		 * First make sure the sb will be happy, we don't use these
 		 * except maybe the count
 		 */
-		so->so_snd.sb_cc = 0;
-		so->so_snd.sb_mbcnt = 0;
-		so->so_snd.sb_mb = NULL;
+		SCTP_SB_CLEAR(so->so_snd);
 	}
 	return (0);
 }
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 1f0b52a205fa..8ec934e83cfc 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -5674,7 +5674,7 @@ restart_nosblocks:
 #ifdef INVARIANTS
 			panic("Huh, its non zero and nothing on control?");
 #endif
-			so->so_rcv.sb_cc = 0;
+			SCTP_SB_CLEAR(so->so_rcv);
 		}
 		SCTP_INP_READ_UNLOCK(inp);
 		hold_rlock = 0;