First, log prefix will be truncated to NF_LOG_PREFIXLEN-1, i.e. 127, at nf_log_packet(), so the extra part is useless. Second, after adding a log rule with a very very long prefix, we will fail to dump the nft rules after this _special_ one, but acctually, they do exist. For example: # name_65000=$(printf "%0.sQ" {1..65000}) # nft add rule filter output log prefix "$name_65000" # nft add rule filter output counter # nft add rule filter output counter # nft list chain filter output table ip filter { chain output { type filter hook output priority 0; policy accept; } } So now, restrict the log prefix length to NF_LOG_PREFIXLEN-1.
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -9,4 +9,6 @@ · 8 unmodified lines | |||
| 9 | #define NF_LOG_MACDECODE 0x20 /* Decode MAC header */ | 9 | #define NF_LOG_MACDECODE 0x20 /* Decode MAC header */ |
| 10 | #define NF_LOG_MASK 0x2f | 10 | #define NF_LOG_MASK 0x2f |
| 11 | 11 | ||
| 12 | #define NF_LOG_PREFIXLEN 128 | ||
| 13 | |||
| 12 | #endif /* _NETFILTER_NF_LOG_H */ | 14 | #endif /* _NETFILTER_NF_LOG_H */ |