Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions netfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ package netfilter
import "C"

import (
"code.google.com/p/gopacket"
"code.google.com/p/gopacket/layers"
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"unsafe"
)

Expand All @@ -57,8 +57,8 @@ func (p *NFPacket) SetRequeueVerdict(newQueueId uint16) {
}

type NFQueue struct {
h *[0]byte
qh *[0]byte
h *C.struct_nfq_handle
qh *C.struct_nfq_q_handle
fd C.int
packets chan NFPacket
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func (nfq *NFQueue) run() {
//export go_callback
func go_callback(queueId C.int, data *C.uchar, len C.int, cb *chan NFPacket) Verdict {
xdata := C.GoBytes(unsafe.Pointer(data), len)
packet := gopacket.NewPacket(xdata, layers.LayerTypeIPv4, gopacket.DecodeOptions{true, true})
packet := gopacket.NewPacket(xdata, layers.LayerTypeIPv4, gopacket.DecodeOptions{Lazy: true, NoCopy: true})
p := NFPacket{verdictChannel: make(chan Verdict), Packet: packet}
select {
case (*cb) <- p:
Expand Down