Skip to content
Snippets Groups Projects
Commit 2d80707a authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

remove log

parent 95c682c1
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment