From 809f74071b244e1888cd20e529b97c6c8aa1ec76 Mon Sep 17 00:00:00 2001 From: Brenden Blanco Date: Fri, 18 Mar 2016 11:13:40 -0700 Subject: [PATCH] Fix 32bit warnings in bpf_linux.go The underlying struct type is still u64 regardless of architecture, but the local cast should be to uintptr_t to squelch the warning. --- bpf_linux.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bpf_linux.go b/bpf_linux.go index 9b87ba4..acd9490 100644 --- a/bpf_linux.go +++ b/bpf_linux.go @@ -5,6 +5,7 @@ package netlink #include #include #include +#include #include static int load_simple_bpf(int prog_type) { @@ -30,8 +31,8 @@ static int load_simple_bpf(int prog_type) { } __attribute__((aligned(8))) attr = { .prog_type = prog_type, .insn_cnt = 2, - .insns = (__u64)&insns, - .license = (__u64)&license, + .insns = (uintptr_t)&insns, + .license = (uintptr_t)&license, }; return syscall(__NR_bpf, 5, &attr, sizeof(attr)); #else