aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2021-07-24 05:17:27 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2021-08-11 13:37:53 +0000
commit5640fea1e37323133cc8447e050ec44012389883 (patch)
treedec73168a5fb4a28f334a67c06f15b9890229e58
parent67ed59f6a8261e6cbb82554c72e59ae81afb0b36 (diff)
downloadsrc-5640fea1e37323133cc8447e050ec44012389883.tar.gz
src-5640fea1e37323133cc8447e050ec44012389883.zip
pf: drop redundant 'else' in pf_normalize_*
Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 6f1fb6561236fa933835a9a67bd442053fb509e9)
-rw-r--r--sys/netpfil/pf/pf_norm.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 561181eb1b56..3df4e06f15b6 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -1065,10 +1065,9 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct pfi_kkif *kif, u_short *reason
if (r == NULL || r->action == PF_NOSCRUB)
return (PF_PASS);
- else {
- counter_u64_add(r->packets[dir == PF_OUT], 1);
- counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
- }
+
+ counter_u64_add(r->packets[dir == PF_OUT], 1);
+ counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
/* Check for illegal packets */
if (hlen < (int)sizeof(struct ip)) {
@@ -1207,10 +1206,9 @@ pf_normalize_ip6(struct mbuf **m0, int dir, struct pfi_kkif *kif,
if (r == NULL || r->action == PF_NOSCRUB)
return (PF_PASS);
- else {
- counter_u64_add(r->packets[dir == PF_OUT], 1);
- counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
- }
+
+ counter_u64_add(r->packets[dir == PF_OUT], 1);
+ counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
/* Check for illegal packets */
if (sizeof(struct ip6_hdr) + IPV6_MAXPACKET < m->m_pkthdr.len)
@@ -1369,10 +1367,9 @@ pf_normalize_tcp(int dir, struct pfi_kkif *kif, struct mbuf *m, int ipoff,
if (rm == NULL || rm->action == PF_NOSCRUB)
return (PF_PASS);
- else {
- counter_u64_add(r->packets[dir == PF_OUT], 1);
- counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
- }
+
+ counter_u64_add(r->packets[dir == PF_OUT], 1);
+ counter_u64_add(r->bytes[dir == PF_OUT], pd->tot_len);
if (rm->rule_flag & PFRULE_REASSEMBLE_TCP)
pd->flags |= PFDESC_TCP_NORM;