Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/common_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct ingressinfo {

#define PORT_AVAILABLE 1024

int verbose;
static int verbose = 0;

#define EXIT_OK 0 /* == EXIT_SUCCESS (stdlib.h) man exit(3) */
#define EXIT_FAIL 1 /* == EXIT_FAILURE (stdlib.h) man exit(3) */
Expand Down
8 changes: 5 additions & 3 deletions tc_prog/tc_prog_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct bpf_elf_map SEC("maps") devmap = {

SEC("tc_init_e")
int tc_init_e_func(struct __sk_buff *skb) {
int err;
// int err;
void *data = (void *)(long)skb->data;
void *data_end = (void *)(long)skb->data_end;
////////////////// Check if the packet is a VXLAN packet ////////////////////
Expand Down Expand Up @@ -95,12 +95,14 @@ int tc_init_e_func(struct __sk_buff *skb) {
// Make sure there is elem in the map
struct egressinfo tmpnodeegressinfo_;
initegressinfo(&tmpnodeegressinfo_, data, skb->ifindex);
err = bpf_map_update_elem(&egress_cache, &outer_iph->daddr, &tmpnodeegressinfo_, BPF_NOEXIST);
// err =
bpf_map_update_elem(&egress_cache, &outer_iph->daddr, &tmpnodeegressinfo_, BPF_NOEXIST);
// if(!err) {
// bpf_printkm("(tc_init_e)INFO: Updated an nodeegressinfo element");
// }

err = bpf_map_update_elem(&egressip_cache, &inner_iph->daddr, &outer_iph->daddr, BPF_NOEXIST);
// err =
bpf_map_update_elem(&egressip_cache, &inner_iph->daddr, &outer_iph->daddr, BPF_NOEXIST);
// if(!err) {
// bpf_printkm("(tc_init_e)INFO: Added an podip element. RemoteIP is %x", inner_iph->daddr);
// }
Expand Down