diff --git a/ars.c b/ars.c index ae7d50c..2b95b32 100644 --- a/ars.c +++ b/ars.c @@ -914,7 +914,7 @@ int ars_bsd_fix(struct ars_packet *pkt, unsigned char *packet, size_t size) return -ARS_INVALID; } ip = (struct ars_iphdr*) packet; -#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI +#if defined OSTYPE_DARWIN || defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI ip->tot_len = ntohs(ip->tot_len); ip->frag_off = ntohs(ip->frag_off); #endif diff --git a/gethostname.c b/gethostname.c index 3d0ea58..97015ef 100644 --- a/gethostname.c +++ b/gethostname.c @@ -18,8 +18,6 @@ #include #include -size_t strlcpy(char *dst, const char *src, size_t siz); - char *get_hostname(char* addr) { static char answer[1024]; @@ -36,7 +34,7 @@ char *get_hostname(char* addr) if (!strcmp(addr, lastreq)) return last_answerp; - strlcpy(lastreq, addr, 1024); + strncpy(lastreq, addr, 1024); inet_aton(addr, &naddr); he = gethostbyaddr((char*)&naddr, 4, AF_INET); @@ -45,7 +43,7 @@ char *get_hostname(char* addr) return NULL; } - strlcpy(answer, he->h_name, 1024); + strncpy(answer, he->h_name, 1024); last_answerp = answer; return answer; diff --git a/libpcap_stuff.c b/libpcap_stuff.c index 558620b..870add9 100644 --- a/libpcap_stuff.c +++ b/libpcap_stuff.c @@ -16,8 +16,8 @@ #include #include #include -#include #include +#include #include "globals.h" diff --git a/script.c b/script.c index 8caeadb..124370c 100644 --- a/script.c +++ b/script.c @@ -23,8 +23,8 @@ #include #include -#include #include +#include #include "release.h" #include "hping2.h" diff --git a/sendip.c b/sendip.c index cf1eeed..fd2a0c2 100644 --- a/sendip.c +++ b/sendip.c @@ -48,7 +48,7 @@ void send_ip (char* src, char *dst, char *data, unsigned int datalen, ip->ihl = (IPHDR_SIZE + optlen + 3) >> 2; ip->tos = ip_tos; -#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI +#if defined OSTYPE_DARWIN || defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD || defined OSTYPE_BSDI /* FreeBSD */ /* NetBSD */ ip->tot_len = packetsize; @@ -73,7 +73,7 @@ void send_ip (char* src, char *dst, char *data, unsigned int datalen, htons((unsigned short) src_id); } -#if defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI +#if defined OSTYPE_DARWIN || defined OSTYPE_FREEBSD || defined OSTYPE_NETBSD | defined OSTYPE_BSDI /* FreeBSD */ /* NetBSD */ ip->frag_off |= more_fragments;