Fix build without import C

This commit is contained in:
Zoltan Papp 2023-08-01 10:31:03 +02:00
parent f185107268
commit 32b7ced0f8
6 changed files with 4 additions and 2 deletions

View File

@ -115,5 +115,6 @@ func _BpfClose(closers ...io.Closer) error {
}
// Do not access this directly.
//
//go:embed bpf_bpfeb.o
var _BpfBytes []byte

View File

@ -115,5 +115,6 @@ func _BpfClose(closers ...io.Closer) error {
}
// Do not access this directly.
//
//go:embed bpf_bpfel.o
var _BpfBytes []byte

View File

@ -3,11 +3,11 @@ package forwarder
import (
_ "embed"
"encoding/binary"
log "github.com/sirupsen/logrus"
"net"
"github.com/cilium/ebpf/link"
"github.com/cilium/ebpf/rlimit"
log "github.com/sirupsen/logrus"
)
const (
@ -17,7 +17,7 @@ const (
// libbpf-dev, libc6-dev-i386-amd64-cross
//
//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang-14 bpf port_fwd.c -- -I /usr/x86_64-linux-gnu/include
//go:generate go run github.com/cilium/ebpf/cmd/bpf2go -cc clang-14 bpf src/port_fwd.c -- -I /usr/x86_64-linux-gnu/include
type TrafficForwarder struct {
link link.Link
iFaceName string