-/* $OpenBSD: pf_if.c,v 1.109 2022/11/22 22:28:40 sashan Exp $ */
+/* $OpenBSD: pf_if.c,v 1.110 2023/05/18 14:11:18 kn Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
{
struct pfi_kif_cmp s;
+ PF_ASSERT_LOCKED();
+
memset(&s, 0, sizeof(s));
strlcpy(s.pfik_name, kif_name, sizeof(s.pfik_name));
return (RB_FIND(pfi_ifhead, &pfi_ifs, (struct pfi_kif *)&s));
{
struct pfi_kif *kif;
+ PF_ASSERT_LOCKED();
+
if ((kif = pfi_kif_find(kif_name)))
return (kif);
void
pfi_kif_ref(struct pfi_kif *kif, enum pfi_kif_refs what)
{
+ PF_ASSERT_LOCKED();
+
switch (what) {
case PFI_KIF_REF_RULE:
kif->pfik_rules++;
if (kif == NULL)
return;
+ PF_ASSERT_LOCKED();
+
switch (what) {
case PFI_KIF_REF_NONE:
break;
struct ifg_list *i;
int n;
+ PF_ASSERT_LOCKED();
+
if (filter == NULL || !*filter)
return (0);
if (!strcmp(p->pfik_name, filter))
struct pfi_kif *p;
size_t n;
+ PF_ASSERT_LOCKED();
+
if (name != NULL && name[0] != '\0') {
p = pfi_kif_find(name);
if (p == NULL) {
{
struct pfi_kif *p, *w;
+ PF_ASSERT_LOCKED();
+
if (name != NULL && name[0] != '\0') {
p = pfi_kif_find(name);
if (p != NULL) {
struct ifnet *ifp;
size_t n;
+ PF_ASSERT_LOCKED();
+
RB_FOREACH(p, pfi_ifhead, &pfi_ifs) {
p->pfik_flags = p->pfik_flags_new;
n = strlen(p->pfik_name);