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

log to see what wrong with checksum computatio

parent a6fcdca2
No related branches found
No related tags found
No related merge requests found
......@@ -69,7 +69,7 @@ int inter_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 and ihl %d option length %d\n", ctx->ingress_ifindex, ip->ihl, options_len);
// bpf_trace_printk("Packet received on interface %d and and ihl %d option length %d\n", ctx->ingress_ifindex, ip->ihl, options_len);
__u8 is_register = 1;
__u8 is_exist_custom_option = 0;
......@@ -175,9 +175,12 @@ int inter_op_ebpf(struct xdp_md *ctx)
// bpf_trace_printk("Packet received on interface %d and option length %d\n", ctx->ingress_ifindex, options_len);
// ip->check = iph_csum(ip, data_end);
}
}
int old_check = ip->check;
ip->check = iph_csum(ip, data_end);
if (old_check != ip->check){
bpf_trace_printk("Old checksum %d - New checksum %d\n", old_check, ip->check);
}
}
return XDP_PASS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment