git: f98cc177f7b8 - main - ipfilter: Remove redundant else if
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 12 Jan 2022 21:05:16 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/src/commit/?id=f98cc177f7b8afae670f28adf2b88cc00b990bf7
commit f98cc177f7b8afae670f28adf2b88cc00b990bf7
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-01-10 17:45:27 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-01-12 20:58:05 +0000
ipfilter: Remove redundant else if
Combine two else ifs using an or.
MFC after: 3 days
---
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 {