Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SCTPDBG statement for connections closing. #707

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion usrsctplib/netinet/sctp_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ extern void getwintimeofday(struct timeval *tv);
#define SCTP_DEBUG_PCB4 0x00800000
#define SCTP_DEBUG_INDATA1 0x01000000
#define SCTP_DEBUG_INDATA2 0x02000000 /* unused */
#define SCTP_DEBUG_INDATA3 0x04000000 /* unused */
#define SCTP_DEBUG_CLOSING 0x04000000
#define SCTP_DEBUG_CRCOFFLOAD 0x08000000 /* unused */
#define SCTP_DEBUG_USRREQ1 0x10000000 /* unused */
#define SCTP_DEBUG_USRREQ2 0x20000000 /* unused */
Expand Down
3 changes: 3 additions & 0 deletions usrsctplib/netinet/sctputil.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc)
sctp_clog.x.misc.log3,
sctp_clog.x.misc.log4);
#endif
SCTPDBG(SCTP_DEBUG_CLOSING,
"Connection closing: inp=%p, flags=%x, stcb=%p, state=%d, loc=%d\n",
inp, inp->sctp_flags, stcb, stcb ? stcb->asoc.state : 0, loc);
}

void
Expand Down
4 changes: 4 additions & 0 deletions usrsctplib/netinet/sctputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ void rto_logging(struct sctp_nets *net, int from);

void sctp_log_closing(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int16_t loc);

#ifdef SCTP_DEBUG
#define SCTP_LOG_CLOSING 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SCTP_LOG_CLOSING should be defined via the build system. Since you use it for debugging, maybe something like
env CFLAGS=-DSCTP_LOG_CLOSING ./configure
is good enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to put the new log statement in a single place, and the existing sctp_log_closing function was only called if the SCTP_LOG_CLOSING define is set.

Currently (prior to my patch), sctp_log_closing only does something if SCTP_LOCAL_TRACE_BUF is set.

With my latest commit, the behavior (other than the addition of the new debug message) should be the same as it was previously for all compiler flags.

#endif

void sctp_log_lock(struct sctp_inpcb *inp, struct sctp_tcb *stcb, uint8_t from);
void sctp_log_maxburst(struct sctp_tcb *stcb, struct sctp_nets *, int, int, uint8_t);
void sctp_log_block(uint8_t, struct sctp_association *, ssize_t);
Expand Down
Loading