projects
/
project
/
unetd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a23ad49
)
bpf_skb_utils: fix skb parsing on older kernels
author
Felix Fietkau
<nbd@nbd.name>
Sat, 13 Aug 2022 12:55:02 +0000
(14:55 +0200)
committer
Felix Fietkau
<nbd@nbd.name>
Sat, 13 Aug 2022 12:55:15 +0000
(14:55 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
bpf_skb_utils.h
patch
|
blob
|
history
diff --git
a/bpf_skb_utils.h
b/bpf_skb_utils.h
index 4953c86ca3b78cd00e905a34efb9663b40329050..643803dd3fc8b384881c42c245b9e0751d2b3016 100644
(file)
--- a/
bpf_skb_utils.h
+++ b/
bpf_skb_utils.h
@@
-56,6
+56,12
@@
static __always_inline struct ethhdr *
skb_parse_ethernet(struct skb_parser_info *info)
{
struct ethhdr *eth;
+ int len;
+
+ len = sizeof(*eth) + 2 * sizeof(struct vlan_hdr) + sizeof(struct ipv6hdr);
+ if (len > info->skb->len)
+ len = info->skb->len;
+ bpf_skb_pull_data(info->skb, len);
eth = skb_info_ptr(info, sizeof(*eth));
if (!eth)