Fix arguments of pf_purge_expired_{src_nodes,rules}()
authorsf <sf@openbsd.org>
Sun, 22 Jul 2018 09:09:18 +0000 (09:09 +0000)
committersf <sf@openbsd.org>
Sun, 22 Jul 2018 09:09:18 +0000 (09:09 +0000)
Due to the missing "void", this

   extern void pf_purge_expired_src_nodes();

is no prototype but a declaration. It is enough to suppress the
'implicit declaration' warning but it does not allow the compiler to
check the arguments passed to the calls of the function.

Fix the prototypes and don't pass the waslocked argument anymore. It has
been removed a year ago.

ok sashan henning

sys/net/pf.c
sys/net/pf_ioctl.c
sys/net/pfvar.h

index 00187c9..5f39f29 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf.c,v 1.1072 2018/07/12 14:28:07 sashan Exp $ */
+/*     $OpenBSD: pf.c,v 1.1073 2018/07/22 09:09:18 sf Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -1257,7 +1257,7 @@ pf_purge(void *xnloops)
 
        /* purge other expired types every PFTM_INTERVAL seconds */
        if (++(*nloops) >= pf_default_rule.timeout[PFTM_INTERVAL]) {
-               pf_purge_expired_src_nodes(0);
+               pf_purge_expired_src_nodes();
                pf_purge_expired_rules();
        }
        PF_UNLOCK();
index 5ce121c..a639bd6 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pf_ioctl.c,v 1.335 2018/07/10 09:28:27 henning Exp $ */
+/*     $OpenBSD: pf_ioctl.c,v 1.336 2018/07/22 09:09:18 sf Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -794,7 +794,7 @@ pf_commit_rules(u_int32_t ticket, char *anchor)
        u_int32_t                old_rcount;
 
        /* Make sure any expired rules get removed from active rules first. */
-       pf_purge_expired_rules(1);
+       pf_purge_expired_rules();
 
        rs = pf_find_ruleset(anchor);
        if (rs == NULL || !rs->rules.inactive.open ||
@@ -2580,7 +2580,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
                        pf_src_tree_remove_state(state);
                RB_FOREACH(n, pf_src_tree, &tree_src_tracking)
                        n->expire = 1;
-               pf_purge_expired_src_nodes(1);
+               pf_purge_expired_src_nodes();
                PF_UNLOCK();
                break;
        }
@@ -2613,7 +2613,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
                }
 
                if (killed > 0)
-                       pf_purge_expired_src_nodes(1);
+                       pf_purge_expired_src_nodes();
 
                psnk->psnk_killed = killed;
                PF_UNLOCK();
index fea4cca..faf29f0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pfvar.h,v 1.481 2018/07/11 09:05:51 henning Exp $ */
+/*     $OpenBSD: pfvar.h,v 1.482 2018/07/22 09:09:18 sf Exp $ */
 
 /*
  * Copyright (c) 2001 Daniel Hartmeier
@@ -1697,9 +1697,9 @@ extern int                         pf_tbladdr_setup(struct pf_ruleset *,
 extern void                     pf_tbladdr_remove(struct pf_addr_wrap *);
 extern void                     pf_tbladdr_copyout(struct pf_addr_wrap *);
 extern void                     pf_calc_skip_steps(struct pf_rulequeue *);
-extern void                     pf_purge_expired_src_nodes();
+extern void                     pf_purge_expired_src_nodes(void);
 extern void                     pf_purge_expired_states(u_int32_t);
-extern void                     pf_purge_expired_rules();
+extern void                     pf_purge_expired_rules(void);
 extern void                     pf_remove_state(struct pf_state *);
 extern void                     pf_remove_divert_state(struct pf_state_key *);
 extern void                     pf_free_state(struct pf_state *);