vendor: github.com/vishvananda/netlink@a1f8555

Update to current master, to get IPVLAN L3s def.
This commit is contained in:
Lincoln Stoll
2016-11-05 13:40:34 -07:00
parent 0e09ad29df
commit 2ad1d04561
10 changed files with 321 additions and 24 deletions

View File

@ -8,11 +8,11 @@ package netlink
#include <stdint.h>
#include <unistd.h>
static int load_simple_bpf(int prog_type) {
static int load_simple_bpf(int prog_type, int ret) {
#ifdef __NR_bpf
// { return 1; }
// { return ret; }
__u64 __attribute__((aligned(8))) insns[] = {
0x00000001000000b7ull,
0x00000000000000b7ull | ((__u64)ret<<32),
0x0000000000000095ull,
};
__u8 __attribute__((aligned(8))) license[] = "ASL2";
@ -51,10 +51,12 @@ const (
BPF_PROG_TYPE_KPROBE
BPF_PROG_TYPE_SCHED_CLS
BPF_PROG_TYPE_SCHED_ACT
BPF_PROG_TYPE_TRACEPOINT
BPF_PROG_TYPE_XDP
)
// loadSimpleBpf loads a trivial bpf program for testing purposes
func loadSimpleBpf(progType BpfProgType) (int, error) {
fd, err := C.load_simple_bpf(C.int(progType))
func loadSimpleBpf(progType BpfProgType, ret int) (int, error) {
fd, err := C.load_simple_bpf(C.int(progType), C.int(ret))
return int(fd), err
}