From c25bc756ea80999af460516a916942b39ef86745 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 7 Apr 2016 13:15:41 +0200 Subject: [PATCH] Update tsg/gopacket to HEAD as of 8c16bb8 --- vendor/github.com/tsg/gopacket/layers/pflog.go | 9 ++------- vendor/github.com/tsg/gopacket/pcap/pcap.go | 5 +++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/github.com/tsg/gopacket/layers/pflog.go b/vendor/github.com/tsg/gopacket/layers/pflog.go index f8762d906666..7815b9c593f4 100644 --- a/vendor/github.com/tsg/gopacket/layers/pflog.go +++ b/vendor/github.com/tsg/gopacket/layers/pflog.go @@ -8,7 +8,6 @@ package layers import ( "encoding/binary" - "errors" "github.com/tsg/gopacket" ) @@ -52,12 +51,8 @@ func (pf *PFLog) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error pf.RuleUID = binary.BigEndian.Uint32(data[52:56]) pf.RulePID = int32(binary.BigEndian.Uint32(data[56:60])) pf.Direction = PFDirection(data[60]) - if pf.Length%4 != 1 { - return errors.New("PFLog header length should be 3 less than multiple of 4") - } - actualLength := int(pf.Length) + 3 - pf.Contents = data[:actualLength] - pf.Payload = data[actualLength:] + pf.Contents = data[:pf.Length] + pf.Payload = data[pf.Length:] return nil } diff --git a/vendor/github.com/tsg/gopacket/pcap/pcap.go b/vendor/github.com/tsg/gopacket/pcap/pcap.go index 3b015c1e6b5f..f5612e6ffd29 100644 --- a/vendor/github.com/tsg/gopacket/pcap/pcap.go +++ b/vendor/github.com/tsg/gopacket/pcap/pcap.go @@ -10,6 +10,7 @@ package pcap /* #cgo linux LDFLAGS: -lpcap #cgo freebsd LDFLAGS: -lpcap +#cgo openbsd LDFLAGS: -lpcap #cgo darwin LDFLAGS: -lpcap #cgo solaris LDFLAGS: -lpcap #cgo windows CFLAGS: -I C:/WpdPack/Include @@ -83,6 +84,10 @@ int pcap_set_rfmon(pcap_t *p, int rfmon) { #elif __GLIBC__ #define gopacket_time_secs_t __time_t #define gopacket_time_usecs_t __suseconds_t +#elif __OpenBSD__ +// time_t is 64-bit, however bpf_timeval uses 32 bit fields +#define gopacket_time_secs_t u_int32_t +#define gopacket_time_usecs_t u_int32_t #else #define gopacket_time_secs_t time_t #define gopacket_time_usecs_t suseconds_t