Calling gettimeofday on a struct bpf_timeval is harmful
This commit is contained in:
parent
7df041638d
commit
f7ef33bc4b
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.15 2019/03/04 13:01:53 jca Exp $
|
||||
# $OpenBSD: Makefile,v 1.16 2019/03/04 13:25:56 jca Exp $
|
||||
|
||||
COMMENT= cisco 3600/7200 platform emulator
|
||||
|
||||
@ -6,7 +6,7 @@ USE_WXNEEDED= Yes
|
||||
|
||||
DISTNAME= dynamips-0.2.8-RC2
|
||||
PKGNAME= ${DISTNAME:S/-RC/rc/}
|
||||
REVISION= 8
|
||||
REVISION= 9
|
||||
CATEGORIES= emulators
|
||||
|
||||
HOMEPAGE= http://www.gns3.net/dynamips/
|
||||
|
19
emulators/dynamips/patches/patch-net_io_filter_c
Normal file
19
emulators/dynamips/patches/patch-net_io_filter_c
Normal file
@ -0,0 +1,19 @@
|
||||
$OpenBSD: patch-net_io_filter_c,v 1.1 2019/03/04 13:25:56 jca Exp $
|
||||
|
||||
Index: net_io_filter.c
|
||||
--- net_io_filter.c.orig
|
||||
+++ net_io_filter.c
|
||||
@@ -211,9 +211,12 @@ static int pf_capture_pkt_handler(netio_desc_t *nio,vo
|
||||
{
|
||||
struct netio_filter_capture *c = opt;
|
||||
struct pcap_pkthdr pkt_hdr;
|
||||
+ struct timeval tv;
|
||||
|
||||
if (c != NULL) {
|
||||
- gettimeofday(&pkt_hdr.ts,0);
|
||||
+ gettimeofday(&tv,0);
|
||||
+ pkt_hdr.ts.tv_sec = tv.tv_sec;
|
||||
+ pkt_hdr.ts.tv_usec = tv.tv_usec;
|
||||
pkt_hdr.caplen = len;
|
||||
pkt_hdr.len = len;
|
||||
|
Loading…
x
Reference in New Issue
Block a user