Skip to content
Open
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
6 changes: 6 additions & 0 deletions tc_prog/common_kern.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ int parse_5tuple_in(struct iphdr * iph, void *data_end, struct fivetuple* tuple)
tuple->protocol = iph->protocol;
if (proto == IPPROTO_TCP) {
struct tcphdr *tcphdr = (struct tcphdr *)(iph + 1);
if (tcphdr->fin) {
return 1;
}
tuple->rport = tcphdr->source;
tuple->lport = tcphdr->dest;
} else if (proto == IPPROTO_UDP) {
Expand All @@ -50,6 +53,9 @@ int parse_5tuple_e(struct iphdr * iph, void *data_end, struct fivetuple* tuple)
tuple->protocol = iph->protocol;
if (proto == IPPROTO_TCP) {
struct tcphdr *tcphdr = (struct tcphdr *)(iph + 1);
if (tcphdr->fin) {
return 1;
}
tuple->lport = tcphdr->source;
tuple->rport = tcphdr->dest;
} else if (proto == IPPROTO_UDP) {
Expand Down