ebpf: remove BPF_LL_OFF in nhoff offset

It fixes invalid parsing in with recent kernels and does
not affect older kernels.
pull/3952/head
Eric Leblond 6 years ago committed by Victor Julien
parent bd28f77a1e
commit 638a006e87

@ -207,7 +207,7 @@ static __always_inline int ipv6_filter(struct __sk_buff *skb)
* \return 0 to drop packet out and -1 to accept it
*/
int SEC("filter") hashfilter(struct __sk_buff *skb) {
__u32 nhoff = BPF_LL_OFF + ETH_HLEN;
__u32 nhoff = ETH_HLEN;
skb->cb[0] = nhoff;
switch (skb->protocol) {

@ -39,7 +39,7 @@ struct bpf_map_def SEC("maps") ipv4_drop = {
};
int SEC("filter") hashfilter(struct __sk_buff *skb) {
__u32 nhoff = BPF_LL_OFF + ETH_HLEN;
__u32 nhoff = ETH_HLEN;
__u32 ip = 0;
__u32 *value;

Loading…
Cancel
Save