diff mbox series

[iptables,11/13] extensions: libebt_log: Add comment to clarify xlate callback

Message ID 20221123164350.10502-12-phil@nwl.cc
State Accepted
Delegated to: Pablo Neira
Headers show
Series Extensions: Review xlate callbacks | expand

Commit Message

Phil Sutter Nov. 23, 2022, 4:43 p.m. UTC
Several log flags are ignored by the function. Add a comment explaining
why this is correct.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 extensions/libebt_log.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/extensions/libebt_log.c b/extensions/libebt_log.c
index 47708d79310e0..13c7fafecb11e 100644
--- a/extensions/libebt_log.c
+++ b/extensions/libebt_log.c
@@ -191,6 +191,8 @@  static int brlog_xlate(struct xt_xlate *xl,
 	if (loginfo->loglevel != LOG_DEFAULT_LEVEL)
 		xt_xlate_add(xl, " level %s", eight_priority[loginfo->loglevel].c_name);
 
+	/* ebt_log always decodes MAC header, nft_log always decodes upper header -
+	 * so set flags ether and ignore EBT_LOG_IP, EBT_LOG_ARP and EBT_LOG_IP6 */
 	xt_xlate_add(xl, " flags ether ");
 
 	return 1;