Module Name:    src
Committed By:   mlelstv
Date:           Mon Jan 27 07:54:30 UTC 2025

Modified Files:
        src/usr.sbin/npf/npfctl: npf_show.c

Log Message:
Collect compiler marks for decompilation.
Fixes PR 58884


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/npf/npfctl/npf_show.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_show.c
diff -u src/usr.sbin/npf/npfctl/npf_show.c:1.33 src/usr.sbin/npf/npfctl/npf_show.c:1.34
--- src/usr.sbin/npf/npfctl/npf_show.c:1.33	Tue Aug  1 20:09:12 2023
+++ src/usr.sbin/npf/npfctl/npf_show.c	Mon Jan 27 07:54:30 2025
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: npf_show.c,v 1.33 2023/08/01 20:09:12 andvar Exp $");
+__RCSID("$NetBSD: npf_show.c,v 1.34 2025/01/27 07:54:30 mlelstv Exp $");
 
 #include <sys/socket.h>
 #define	__FAVOR_BSD
@@ -378,7 +378,7 @@ scan_marks(npf_conf_info_t *ctx, const s
 			 */
 			ctx->curmark = m;
 			assert(BM_COUNT < (sizeof(uint64_t) * CHAR_BIT));
-			ctx->seen_marks = UINT64_C(1) << m;
+			ctx->seen_marks |= UINT64_C(1) << m;
 			assert(mk->fwords == nwords);
 
 			if (mk->printfn) {
@@ -499,6 +499,7 @@ npfctl_print_filter(npf_conf_info_t *ctx
 	/*
 	 * BPF filter criteria described by the byte-code marks.
 	 */
+	ctx->seen_marks = 0;
 	for (unsigned i = 0; i < __arraycount(mark_keyword_map); i++) {
 		const struct mark_keyword_mapent *mk = &mark_keyword_map[i];
 		scan_marks(ctx, mk, marks, mlen);

Reply via email to