Skip to content

Commit d7243ea

Browse files
authored
Need to differentiate between cached dns response vs incomplete ones [BP] (#402)
* Need to differentiate between cached dns response vs incomplete ones Signed-off-by: Mohamed Mahmoud <[email protected]> (cherry picked from commit 1f10618) Signed-off-by: Mohamed Mahmoud <[email protected]> * fix issue with protocol matching Signed-off-by: Mohamed Mahmoud <[email protected]> --------- Signed-off-by: Mohamed Mahmoud <[email protected]>
1 parent 00b0d22 commit d7243ea

File tree

7 files changed

+4
-1
lines changed

7 files changed

+4
-1
lines changed

bpf/flows_filter.h

+3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ static __always_inline int do_flow_filter_lookup(flow_id *id, struct filter_key_
140140
}
141141
break;
142142
}
143+
} else {
144+
result = 0;
145+
goto end;
143146
}
144147

145148
if (!is_zero_ip(rule->ip, len)) {

pkg/ebpf/bpf_arm64_bpfel.o

88 Bytes
Binary file not shown.

pkg/ebpf/bpf_powerpc_bpfel.o

88 Bytes
Binary file not shown.

pkg/ebpf/bpf_s390_bpfeb.o

88 Bytes
Binary file not shown.

pkg/ebpf/bpf_x86_bpfel.o

88 Bytes
Binary file not shown.

pkg/flow/deduper.go

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ func (c *deduperCache) checkDupe(r *Record, justMark, mergeDup bool, fwd *[]*Rec
8888
fEntry.dnsRecord.Flags = r.Metrics.DnsRecord.Flags
8989
fEntry.dnsRecord.Id = r.Metrics.DnsRecord.Id
9090
fEntry.dnsRecord.Latency = r.Metrics.DnsRecord.Latency
91+
fEntry.dnsRecord.Errno = r.Metrics.DnsRecord.Errno
9192
}
9293
// If the new flow has flowRTT then enrich the flow in the case with the same RTT and mark it duplicate
9394
if r.Metrics.FlowRtt != 0 && *fEntry.flowRTT == 0 {

pkg/flow/record.go

-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func Accumulate(r *ebpf.BpfFlowMetrics, src *ebpf.BpfFlowMetrics) {
105105
r.DnsRecord.Flags |= src.DnsRecord.Flags
106106
if src.DnsRecord.Id != 0 {
107107
r.DnsRecord.Id = src.DnsRecord.Id
108-
r.DnsRecord.Errno = src.DnsRecord.Errno
109108
}
110109
if r.DnsRecord.Errno != src.DnsRecord.Errno {
111110
r.DnsRecord.Errno = src.DnsRecord.Errno

0 commit comments

Comments
 (0)