--- dhcpdump.c.orig Tue Jun 24 05:26:52 2008 +++ dhcpdump.c Fri Aug 19 14:33:57 2016 @@ -11,10 +11,16 @@ #include #include #include +#ifndef __OpenBSD__ #include +#endif #include #include #include +#ifdef __OpenBSD__ +#include +#include +#endif #include #include #include @@ -26,10 +32,6 @@ #include #include "dhcp_options.h" -#ifndef HAVE_STRSEP -#include "strsep.c" -#endif - #define SPERW (7 * 24 * 3600) #define SPERD (24 * 3600) #define SPERH (3600) @@ -156,12 +158,12 @@ void pcap_callback(u_char *user, const struct pcap_pkt tp.tv_usec / 1000); } - strcpy(mac_origin, ether_ntoa((struct ether_addr *)eh->ether_shost)); - strcpy(mac_destination, - ether_ntoa((struct ether_addr *)eh->ether_dhost)); + strlcpy(mac_origin, ether_ntoa((struct ether_addr *)eh->ether_shost), sizeof(mac_origin)); + strlcpy(mac_destination, + ether_ntoa((struct ether_addr *)eh->ether_dhost), sizeof(mac_destination)); - strcpy(ip_origin, (u_char *)inet_ntoa(ip->ip_src)); - strcpy(ip_destination, (u_char *)inet_ntoa(ip->ip_dst)); + strlcpy(ip_origin, (u_char *)inet_ntoa(ip->ip_src), sizeof(ip_origin)); + strlcpy(ip_destination, (u_char *)inet_ntoa(ip->ip_dst), sizeof(ip_destination)); if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->uh_ulen))) return;