Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GNS3_unikernel_testbed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NGUYEN Do Duc Anh
GNS3_unikernel_testbed
Commits
2d80707a
Commit
2d80707a
authored
3 months ago
by
NGUYEN Do Duc Anh
Browse files
Options
Downloads
Patches
Plain Diff
remove log
parent
95c682c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ubuntu_base/op_ebpf.c
+1
-1
1 addition, 1 deletion
ubuntu_base/op_ebpf.c
ubuntu_intermediate/inter_op_ebpf.c
+4
-4
4 additions, 4 deletions
ubuntu_intermediate/inter_op_ebpf.c
with
5 additions
and
5 deletions
ubuntu_base/op_ebpf.c
+
1
−
1
View file @
2d80707a
...
...
@@ -83,7 +83,7 @@ int op_ebpf(struct xdp_md *ctx)
int
options_len
=
(
ip
->
ihl
*
4
)
-
sizeof
(
struct
iphdr
);
__u8
*
options
=
(
__u8
*
)(
ip
+
1
);
bpf_trace_printk
(
"Packet received on interface %d and option length %d
\n
"
,
ctx
->
ingress_ifindex
,
options_len
);
//
bpf_trace_printk("Packet received on interface %d and option length %d\n", ctx->ingress_ifindex, options_len);
__u8
is_register
=
1
;
__u8
is_exist_custom_option
=
0
;
...
...
This diff is collapsed.
Click to expand it.
ubuntu_intermediate/inter_op_ebpf.c
+
4
−
4
View file @
2d80707a
...
...
@@ -76,14 +76,14 @@ static inline __u16 tcp_checksum(struct iphdr *ip, struct tcphdr *tcp, void *dat
csum
+=
(
ip
->
daddr
>>
16
)
+
(
ip
->
daddr
&
0xFFFF
);
csum
+=
htons
(
6
);
csum
+=
htons
(
tcp_len
);
bpf_trace_printk
(
"csum1: %lx"
,
csum
);
//
bpf_trace_printk("csum1: %lx", csum);
// 3. Manual unrolling (safer than loops)
__u16
*
ptr
=
(
__u16
*
)
tcp
;
__u16
words
=
tcp_len
/
2
;
csum
+=
sum16
(
tcp
,
tcp_len
,
data_end
);
bpf_trace_printk
(
"csum2: %lx"
,
csum
);
//
bpf_trace_printk("csum2: %lx", csum);
return
csum_fold_helper
(
csum
);
}
...
...
@@ -276,14 +276,14 @@ int inter_op_ebpf(struct xdp_md *ctx)
if
(
saved_daddr
)
{
ip
->
daddr
=
*
saved_daddr
;
bpf_trace_printk
(
"Change dest"
);
//
bpf_trace_printk("Change dest");
ip
->
check
=
iph_csum
(
ip
,
data_end
);
tcp
->
check
=
tcp_checksum
(
ip
,
tcp
,
data_end
);
}
else
if
(
saved_saddr
)
{
ip
->
saddr
=
*
saved_saddr
;
bpf_trace_printk
(
"Change src"
);
//
bpf_trace_printk("Change src");
ip
->
check
=
iph_csum
(
ip
,
data_end
);
tcp
->
check
=
tcp_checksum
(
ip
,
tcp
,
data_end
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment