diff options
author | rrs <rrs@FreeBSD.org> | 2007-05-29 09:29:03 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-05-29 09:29:03 +0000 |
commit | f827c93ac67113093cd06e755372cf7cd9302d8f (patch) | |
tree | b0a3898608d9bf9a7a2b4c780e734bf27af057e1 /sys/netinet/sctp_usrreq.c | |
parent | 0cadc213d533d92acab0d770376baacbd16de8bf (diff) | |
download | FreeBSD-src-f827c93ac67113093cd06e755372cf7cd9302d8f.zip FreeBSD-src-f827c93ac67113093cd06e755372cf7cd9302d8f.tar.gz |
- Fixes so we won't try to start a timer when we
hold a wq lock for the iterator. Panda uses a
silly recursive lock they hold through the timer.
- Add poor mans wireshark compile option..
- Allocate and start using SCTP_M_XXX for all SCTP_MALLOC() calls.
- sysctl now will get back the refcnt for viewing by onlookers.
Reviewed by: gnn
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 597705c..2e6f7e2 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_indata.h> #include <netinet/sctp_timer.h> #include <netinet/sctp_auth.h> +#include <netinet/sctp_bsd_addr.h> + @@ -1478,7 +1480,20 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize, *optsize = sizeof(val); } break; + case SCTP_GET_PACKET_LOG: + { +#ifdef SCTP_PACKET_LOGGING + uint8_t *target; + int ret; + SCTP_CHECK_AND_CAST(target, optval, uint8_t, *optsize); + ret = sctp_copy_out_packet_log(target, (int)*optsize); + *optsize = ret; +#else + error = EOPNOTSUPP; +#endif + break; + } case SCTP_PARTIAL_DELIVERY_POINT: { uint32_t *value; @@ -3560,7 +3575,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, error = sctp_addr_mgmt_ep_sa(inp, addr_touse, SCTP_ADD_IP_ADDRESS, vrf_id); } else { - error = EADDRNOTAVAIL; + error = EADDRINUSE; } if (error) break; @@ -3659,13 +3674,13 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt) } optsize = sopt->sopt_valsize; if (optsize) { - SCTP_MALLOC(optval, void *, optsize, "SCTPSockOpt"); + SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT); if (optval == NULL) { return (ENOBUFS); } error = sooptcopyin(sopt, optval, optsize, optsize); if (error) { - SCTP_FREE(optval); + SCTP_FREE(optval, SCTP_M_SOCKOPT); goto out; } } @@ -3679,9 +3694,9 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt) } if ((error == 0) && (optval != NULL)) { error = sooptcopyout(sopt, optval, optsize); - SCTP_FREE(optval); + SCTP_FREE(optval, SCTP_M_SOCKOPT); } else if (optval != NULL) { - SCTP_FREE(optval); + SCTP_FREE(optval, SCTP_M_SOCKOPT); } out: return (error); |