This commit is contained in:
purplerain 2023-06-28 12:22:15 +00:00
parent 777fb69d26
commit 905ea23f06
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
42 changed files with 776 additions and 381 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_var.h,v 1.127 2023/05/30 08:30:01 jsg Exp $ */
/* $OpenBSD: if_var.h,v 1.128 2023/06/28 11:49:49 kn Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@ -255,7 +255,7 @@ struct ifaddr {
struct ifmaddr {
struct sockaddr *ifma_addr; /* Protocol address */
unsigned int ifma_ifidx; /* Index of the interface */
unsigned int ifma_refcnt; /* Count of references */
struct refcnt ifma_refcnt; /* Count of references */
TAILQ_ENTRY(ifmaddr) ifma_list; /* Per-interface list */
};

View file

@ -1,4 +1,4 @@
/* $OpenBSD: pf_ioctl.c,v 1.408 2023/06/27 17:36:56 kn Exp $ */
/* $OpenBSD: pf_ioctl.c,v 1.409 2023/06/28 15:36:08 kn Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@ -118,7 +118,6 @@ int pf_states_clr(struct pfioc_state_kill *);
int pf_states_get(struct pfioc_states *);
struct pf_trans *pf_open_trans(uint32_t);
void pf_close_all_trans(uint32_t);
struct pf_trans *pf_find_trans(uint32_t, uint64_t);
void pf_free_trans(struct pf_trans *);
void pf_rollback_trans(struct pf_trans *);
@ -1492,7 +1491,6 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
PF_UNLOCK();
NET_UNLOCK();
pf_close_all_trans(minor(dev));
t = pf_open_trans(minor(dev));
pf_init_tgetrule(t, ruleset->anchor, ruleset_version, rule);
pr->ticket = t->pft_ticket;
@ -3271,19 +3269,6 @@ pf_open_trans(uint32_t unit)
return (t);
}
void
pf_close_all_trans(uint32_t unit)
{
struct pf_trans *t, *nt;
rw_assert_wrlock(&pfioctl_rw);
LIST_FOREACH_SAFE(t, &pf_ioctl_trans, pft_entry, nt) {
if (t->pft_unit == unit)
pf_rollback_trans(t);
}
}
struct pf_trans *
pf_find_trans(uint32_t unit, uint64_t ticket)
{