Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2022 13:52:12 GMT
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 80bbd5a14914 - stable/13 - ipfilter: Remove redundant else if
Message-ID:  <202202071352.217DqCKc080562@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=80bbd5a1491422d52db5f69e5100ddf0c2c21a1f

commit 80bbd5a1491422d52db5f69e5100ddf0c2c21a1f
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-10 17:45:27 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-02-07 13:51:18 +0000

    ipfilter: Remove redundant else if
    
    Combine two else ifs using an or.
    
    (cherry picked from commit f98cc177f7b8afae670f28adf2b88cc00b990bf7)
---
 sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
index 986cca30c94d..72e2a42695c4 100644
--- a/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/netpfil/ipfilter/netinet/ip_fil_freebsd.c
@@ -1081,10 +1081,8 @@ ipf_checkv4sum(fr_info_t *fin)
 			fin->fin_cksum = FI_CK_L4FULL;
 			return (0);
 		} else if (m->m_pkthdr.csum_flags == CSUM_TCP ||
-			   m->m_pkthdr.csum_flags == CSUM_UDP) {
-			fin->fin_cksum = FI_CK_L4PART;
-			return (0);
-		} else if (m->m_pkthdr.csum_flags == CSUM_IP) {
+			   m->m_pkthdr.csum_flags == CSUM_UDP ||
+			   m->m_pkthdr.csum_flags == CSUM_IP) {
 			fin->fin_cksum = FI_CK_L4PART;
 			return (0);
 		} else {



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