Fix issue with dst_port when filter logging is disabled.

This commit is contained in:
Christian Deacon
2025-03-28 13:42:19 -04:00
parent 78de4c0292
commit 05d013ff6a
2 changed files with 4 additions and 0 deletions

View File

@@ -341,7 +341,9 @@ int xdp_prog_main(struct xdp_md *ctx)
rule.now = now; rule.now = now;
rule.pkt_len = pkt_len; rule.pkt_len = pkt_len;
rule.src_port = src_port; rule.src_port = src_port;
#ifdef ENABLE_FILTER_LOGGING
rule.dst_port = dst_port; rule.dst_port = dst_port;
#endif
rule.protocol = protocol; rule.protocol = protocol;
rule.iph = iph; rule.iph = iph;

View File

@@ -28,7 +28,9 @@ struct rule_ctx
u64 now; u64 now;
int pkt_len; int pkt_len;
u16 src_port; u16 src_port;
#ifdef ENABLE_FILTER_LOGGING
u16 dst_port; u16 dst_port;
#endif
u8 protocol; u8 protocol;
struct iphdr* iph; struct iphdr* iph;