Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

there are pointers in __sk_buff #93

Open
QiongwenXu opened this issue Aug 31, 2020 · 0 comments
Open

there are pointers in __sk_buff #93

QiongwenXu opened this issue Aug 31, 2020 · 0 comments

Comments

@QiongwenXu
Copy link
Collaborator

QiongwenXu commented Aug 31, 2020

struct __sk_buff {
	__u32 len;
	__u32 pkt_type;
	__u32 mark;
	__u32 queue_mapping;
	__u32 protocol;
	__u32 vlan_present;
	__u32 vlan_tci;
	__u32 vlan_proto;
	__u32 priority;
	__u32 ingress_ifindex;
	__u32 ifindex;
	__u32 tc_index;
	__u32 cb[5];
	__u32 hash;
	__u32 tc_classid;
	__u32 data;             // pkt start
	__u32 data_end;         // pkt end
...

bpf bytecode example:
(cilium, bpf_overlay.o, section from-overlay)

       8:	61 62 50 00 00 00 00 00	r2 = *(u32 *)(r6 + 80) // pkt end
       9:	61 61 4c 00 00 00 00 00	r1 = *(u32 *)(r6 + 76) // pkt end
      10:	bf 13 00 00 00 00 00 00	r3 = r1
      11:	07 03 00 00 0e 00 00 00	r3 += 14
      12:	2d 23 71 00 00 00 00 00	if r3 > r2 goto +113 <LBB6_16>
      13:	71 12 0c 00 00 00 00 00	r2 = *(u8 *)(r1 + 12)
      14:	71 18 0d 00 00 00 00 00	r8 = *(u8 *)(r1 + 13)  // load from pkt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant