The branch main has been updated by mjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6f1fb6561236fa933835a9a67bd442053fb509e9

commit 6f1fb6561236fa933835a9a67bd442053fb509e9
Author:     Mateusz Guzik <m...@freebsd.org>
AuthorDate: 2021-07-24 05:17:27 +0000
Commit:     Mateusz Guzik <m...@freebsd.org>
CommitDate: 2021-07-25 08:22:16 +0000

    pf: drop redundant 'else' in pf_normalize_*
    
    Reviewed by:    kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/pf/pf_norm.c | 21 +++++++++------------
 1 file 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;
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to