diff options
author | Michael Tuexen <tuexen@fh-muenster.de> | 2019-10-14 22:42:12 +0200 |
---|---|---|
committer | Michael Tuexen <tuexen@fh-muenster.de> | 2019-10-14 22:42:12 +0200 |
commit | 09768bfcf22f91f6e43f0e692fc612564621d02f (patch) | |
tree | 0ccb56a2afb8478597ef608d8390ff89705b063d | |
parent | d2f065ca7c55c5eaf50f2f3cadb4d0f178c894fd (diff) | |
download | usrsctp-09768bfcf22f91f6e43f0e692fc612564621d02f.tar.gz |
Separate out SCTP related dtrace code.
-rwxr-xr-x | usrsctplib/netinet/sctp_input.c | 6 | ||||
-rwxr-xr-x | usrsctplib/netinet/sctp_output.c | 6 | ||||
-rwxr-xr-x | usrsctplib/netinet/sctputil.c | 10 |
3 files changed, 10 insertions, 12 deletions
diff --git a/usrsctplib/netinet/sctp_input.c b/usrsctplib/netinet/sctp_input.c index f958dc4b..d711056f 100755 --- a/usrsctplib/netinet/sctp_input.c +++ b/usrsctplib/netinet/sctp_input.c @@ -34,7 +34,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 353122 2019-10-05 12:34:50Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 353518 2019-10-14 20:32:11Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -51,13 +51,15 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 353122 2019-10-05 12:34:50Z tu #include <netinet/sctp_bsd_addr.h> #include <netinet/sctp_timer.h> #include <netinet/sctp_crc32.h> +#if defined(__FreeBSD__) +#include <netinet/sctp_kdtrace.h> +#endif #if defined(INET) || defined(INET6) #if !defined(__Userspace_os_Windows) #include <netinet/udp.h> #endif #endif #if defined(__FreeBSD__) -#include <netinet/in_kdtrace.h> #include <sys/smp.h> #endif diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c index 579d7313..ee4c139f 100755 --- a/usrsctplib/netinet/sctp_output.c +++ b/usrsctplib/netinet/sctp_output.c @@ -34,7 +34,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 353452 2019-10-12 17:57:03Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 353518 2019-10-14 20:32:11Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -56,6 +56,9 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 353452 2019-10-12 17:57:03Z t #include <netinet/sctp_bsd_addr.h> #include <netinet/sctp_input.h> #include <netinet/sctp_crc32.h> +#if defined(__FreeBSD__) +#include <netinet/sctp_kdtrace.h> +#endif #if defined(__Userspace_os_Linux) #define __FAVOR_BSD /* (on Ubuntu at least) enables UDP header field names like BSD in RFC 768 */ #endif @@ -72,7 +75,6 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 353452 2019-10-12 17:57:03Z t #include <netinet/udp_var.h> #endif #include <machine/in_cksum.h> -#include <netinet/in_kdtrace.h> #endif #if defined(__Userspace__) && defined(INET6) #include <netinet6/sctp6_var.h> diff --git a/usrsctplib/netinet/sctputil.c b/usrsctplib/netinet/sctputil.c index a350574e..cb307d7a 100755 --- a/usrsctplib/netinet/sctputil.c +++ b/usrsctplib/netinet/sctputil.c @@ -34,7 +34,7 @@ #ifdef __FreeBSD__ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 352592 2019-09-22 10:40:15Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 353518 2019-10-14 20:32:11Z tuexen $"); #endif #include <netinet/sctp_os.h> @@ -59,12 +59,12 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 352592 2019-09-22 10:40:15Z tuex #include <netinet/sctp_constants.h> #endif #if defined(__FreeBSD__) +#include <netinet/sctp_kdtrace.h> #if defined(INET6) || defined(INET) #include <netinet/tcp_var.h> #endif #include <netinet/udp.h> #include <netinet/udp_var.h> -#include <netinet/in_kdtrace.h> #include <sys/proc.h> #ifdef INET6 #include <netinet/icmp6.h> @@ -913,15 +913,9 @@ sctp_fill_random_store(struct sctp_pcb *m) * numbers, but thats ok too since that is random as well :-> */ m->store_at = 0; -#if defined(__Userspace__) && defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) - for (int i = 0; i < (int) (sizeof(m->random_store) / sizeof(m->random_store[0])); i++) { - m->random_store[i] = (uint8_t) rand(); - } -#else (void)sctp_hmac(SCTP_HMAC, (uint8_t *)m->random_numbers, sizeof(m->random_numbers), (uint8_t *)&m->random_counter, sizeof(m->random_counter), (uint8_t *)m->random_store); -#endif m->random_counter++; } |