diff --git a/src/xdp/prog.c b/src/xdp/prog.c index d2aaeff..7304fe0 100644 --- a/src/xdp/prog.c +++ b/src/xdp/prog.c @@ -341,7 +341,9 @@ int xdp_prog_main(struct xdp_md *ctx) rule.now = now; rule.pkt_len = pkt_len; rule.src_port = src_port; +#ifdef ENABLE_FILTER_LOGGING rule.dst_port = dst_port; +#endif rule.protocol = protocol; rule.iph = iph; diff --git a/src/xdp/utils/rule.h b/src/xdp/utils/rule.h index 5d39a52..3b8cdb3 100644 --- a/src/xdp/utils/rule.h +++ b/src/xdp/utils/rule.h @@ -28,7 +28,9 @@ struct rule_ctx u64 now; int pkt_len; u16 src_port; +#ifdef ENABLE_FILTER_LOGGING u16 dst_port; +#endif u8 protocol; struct iphdr* iph;