mirror of
https://github.com/h3xduck/TripleCross.git
synced 2026-01-23 07:43:08 +08:00
Fixed the whole header setup, now correctly using the kernel headers instead of normal development ones. Ready to go on with original plan of file system hooking
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#ifndef __XDP_HELPER_H__
|
||||
#define __XDP_HELPER_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
//#include <linux/types.h>
|
||||
#include "newnewvmlinux.h"
|
||||
|
||||
#include <bpf/bpf_helpers.h>
|
||||
|
||||
@@ -84,7 +85,7 @@ static __always_inline struct expand_return expand_tcp_packet_payload(struct xdp
|
||||
|
||||
//We modify the fields we care about of the headers
|
||||
bpf_printk("before: %i, checksum %u\n", ret.ip->tot_len, ret.ip->check);
|
||||
ret.ip->tot_len = htons(ntohs(ret.ip->tot_len) + more_bytes);
|
||||
ret.ip->tot_len = bpf_htons(bpf_ntohs(ret.ip->tot_len) + more_bytes);
|
||||
__u32 csum = 0;
|
||||
ret.ip->check = 0;
|
||||
ipv4_csum(ret.ip, sizeof(struct iphdr), &csum);
|
||||
|
||||
Reference in New Issue
Block a user