Skip to content

Commit

Permalink
update: init thw whole packet_t instead of in6_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonymous committed May 5, 2024
1 parent b06fde9 commit ea08ba6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions bpf/flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ static inline int handle_ip_packet(void* head, void* tail, uint32_t* offset, str
return TC_ACT_OK;
}

// Clean the structure before using it
pkt->src_ip = (struct in6_addr){0};
pkt->dst_ip = (struct in6_addr){0};

// Create IPv4-Mapped IPv6 Address
pkt->src_ip.in6_u.u6_addr32[3] = ip->saddr;
pkt->dst_ip.in6_u.u6_addr32[3] = ip->daddr;
Expand Down
4 changes: 0 additions & 4 deletions bpf/flat_portable.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ static inline int handle_ip_packet(void* head, void* tail, uint32_t* offset, str
return TC_ACT_OK;
}

// Clean the structure before using it
pkt->src_ip = (struct in6_addr){0};
pkt->dst_ip = (struct in6_addr){0};

// Create IPv4-Mapped IPv6 Address
pkt->src_ip.in6_u.u6_addr32[3] = ip->saddr;
pkt->dst_ip.in6_u.u6_addr32[3] = ip->daddr;
Expand Down

0 comments on commit ea08ba6

Please sign in to comment.