Skip to content

Commit

Permalink
Add SCTPDBG statements for soref/sorele. (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLennox committed Apr 17, 2024
1 parent d45b53f commit dee4740
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion usrsctplib/user_socketvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -404,15 +404,25 @@ void sofree(struct socket *so);
#define soref(so) do { \
SOCK_LOCK_ASSERT(so); \
++(so)->so_count; \
SCTPDBG(SCTP_DEBUG_USR, "soref(%p) -> %d, %s:%s:%d\n", \
(so), (so)->so_count, \
__func__, __FILE__, __LINE__) \
} while (0)

#define sorele(so) do { \
ACCEPT_LOCK_ASSERT(); \
SOCK_LOCK_ASSERT(so); \
KASSERT((so)->so_count > 0, ("sorele")); \
if (--(so)->so_count == 0) \
if (--(so)->so_count == 0) { \
SCTPDBG(SCTP_DEBUG_USR, "sorele(%p) -> %d, %s:%s:%d\n", \
(so), (so)->so_count, \
__func__, __FILE__, __LINE__) \
sofree(so); \
} \
else { \
SCTPDBG(SCTP_DEBUG_USR, "sorele(%p) -> %d, %s:%s:%d\n", \
(so), (so)->so_count, \
__func__, __FILE__, __LINE__) \
SOCK_UNLOCK(so); \
ACCEPT_UNLOCK(); \
} \
Expand Down

0 comments on commit dee4740

Please sign in to comment.