Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Feb 2021 16:04:02 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 555726fda685 - stable/12 - pf: Fix build if INVARIANTS is not set
Message-ID:  <202102281604.11SG42Uu099991@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=555726fda685ab5be9ccdbfcb73b9336dc2d75af

commit 555726fda685ab5be9ccdbfcb73b9336dc2d75af
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2018-11-02 19:23:50 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-02-28 15:36:29 +0000

    pf: Fix build if INVARIANTS is not set
    
    r340061 included a number of assertions pf_frent_remove(), but these assertions
    were the only use of the 'prev' variable. As a result builds without
    INVARIANTS had an unused variable, and failed.
    
    Reported by:    vangyzen@
    
    (cherry picked from commit 58ef854f8b05508f41aff3bdaf1564c8dd4c1d4f)
---
 sys/netpfil/pf/pf_norm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index eb310e27b9ae..0770fcfd4c58 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -445,7 +445,9 @@ pf_frent_insert(struct pf_fragment *frag, struct pf_frent *frent,
 void
 pf_frent_remove(struct pf_fragment *frag, struct pf_frent *frent)
 {
+#ifdef INVARIANTS
 	struct pf_frent *prev = TAILQ_PREV(frent, pf_fragq, fr_next);
+#endif
 	struct pf_frent *next = TAILQ_NEXT(frent, fr_next);
 	int index;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102281604.11SG42Uu099991>