nettrace - skip over a single hopopts or dstops ipv6 extension header
Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Iad7800387e1b84587794be93d037f712ac95fa07
This commit is contained in:
parent
365cf0a393
commit
73896a7b70
1 changed files with 10 additions and 0 deletions
|
|
@ -272,6 +272,16 @@ static __always_inline inline void do_packet_tracing(
|
|||
(void)bpf_skb_load_bytes_net(skb, IP6_OFFSET(nexthdr), &proto, sizeof(proto), kver);
|
||||
L4_off = sizeof(struct ipv6hdr);
|
||||
ipVersion = 6;
|
||||
// skip over a *single* HOPOPTS or DSTOPTS extension header (if present)
|
||||
if (proto == IPPROTO_HOPOPTS || proto == IPPROTO_DSTOPTS) {
|
||||
struct {
|
||||
uint8_t proto, len;
|
||||
} ext_hdr;
|
||||
if (!bpf_skb_load_bytes_net(skb, L4_off, &ext_hdr, sizeof(ext_hdr), kver)) {
|
||||
proto = ext_hdr.proto;
|
||||
L4_off += (ext_hdr.len + 1) * 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t flags = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue