Skip to content
Snippets Groups Projects
Unverified Commit 553635d9 authored by Mohamed S. Mahmoud's avatar Mohamed S. Mahmoud Committed by GitHub
Browse files

Filter out sockets for loopback and unknown interfaces (#260)


* RTT: filter out sockets for loopback and unknown interfaces

Signed-off-by: default avatarMohamed Mahmoud <mmahmoud@redhat.com>

* filter loopback and unknown interfaces with pkt drop feature

Signed-off-by: default avatarMohamed Mahmoud <mmahmoud@redhat.com>

---------

Signed-off-by: default avatarMohamed Mahmoud <mmahmoud@redhat.com>
parent 340f97c7
Branches
Tags
No related merge requests found
......@@ -17,7 +17,10 @@ static inline int trace_pkt_drop(void *ctx, u8 state,
u16 family = 0,flags = 0;
id.if_index = skb->skb_iif;
// filter out TCP sockets with unknown or loopback interface
if (id.if_index == 0 || id.if_index == 1) {
return 0;
}
// read L2 info
set_key_with_l2_info(skb, &id, &family);
......
......@@ -102,6 +102,10 @@ static inline int calculate_flow_rtt_tcp(struct sock *sk, struct sk_buff *skb) {
__builtin_memset(&id, 0, sizeof(id));
id.if_index = BPF_CORE_READ(skb, skb_iif);
// filter out TCP sockets with unknown or loopback interface
if (id.if_index == 0 || id.if_index == 1) {
return 0;
}
len = BPF_CORE_READ(skb, len);
// read L2 info
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment