diff options
author | rrs <rrs@FreeBSD.org> | 2007-05-09 13:30:06 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-05-09 13:30:06 +0000 |
commit | 8531fb6bb28e0296c5987623d099b38a08ba798a (patch) | |
tree | 5730ba11ad6842199a46899208f93c4ec22a9469 /sys/netinet/sctp_peeloff.c | |
parent | c7d189e526c975d0e57e55dcc56d1c34421395a0 (diff) | |
download | FreeBSD-src-8531fb6bb28e0296c5987623d099b38a08ba798a.zip FreeBSD-src-8531fb6bb28e0296c5987623d099b38a08ba798a.tar.gz |
Two major items here:
- All printf that was surrounded by #ifdef SCTP_DEBUG moves to
a macro that does all of this. This removes all printfs from
the code and makes the code more portable and easier to
read.
- Static Analysis (cisco) - found a few bugs, but mostly we
add checks for NULL pointers and such to make the tool
happy. We now pass the Cisco SA tools checks except for
where it does not understand tailq/lists. We still need
to look at the coverity tools output too (this is like
the cisco SA tool) and see if it wants us to fix any other
items. Hopefully this will be the last major churn in the
code other than bug fixes.
Diffstat (limited to 'sys/netinet/sctp_peeloff.c')
-rw-r--r-- | sys/netinet/sctp_peeloff.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/netinet/sctp_peeloff.c b/sys/netinet/sctp_peeloff.c index 9618ae7..df4afdc 100644 --- a/sys/netinet/sctp_peeloff.c +++ b/sys/netinet/sctp_peeloff.c @@ -113,12 +113,7 @@ sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) struct sctp_inpcb *inp, *n_inp; struct sctp_tcb *stcb; -#ifdef SCTP_DEBUG - if (sctp_debug_on & SCTP_DEBUG_PEEL1) { - printf("SCTP peel-off called\n"); - } -#endif /* SCTP_DEBUG */ - + SCTPDBG(SCTP_DEBUG_PEEL1, "SCTP peel-off called\n"); inp = (struct sctp_inpcb *)head->so_pcb; if (inp == NULL) { *error = EFAULT; @@ -132,11 +127,7 @@ sctp_get_peeloff(struct socket *head, sctp_assoc_t assoc_id, int *error) newso = sonewconn(head, SS_ISCONNECTED ); if (newso == NULL) { -#ifdef SCTP_DEBUG - if (sctp_debug_on & SCTP_DEBUG_PEEL1) { - printf("sctp_peeloff:sonewconn failed err\n"); - } -#endif /* SCTP_DEBUG */ + SCTPDBG(SCTP_DEBUG_PEEL1, "sctp_peeloff:sonewconn failed\n"); *error = ENOMEM; SCTP_TCB_UNLOCK(stcb); return (NULL); |