-/* $OpenBSD: pf_if.c,v 1.108 2022/11/21 22:50:07 kn Exp $ */
+/* $OpenBSD: pf_if.c,v 1.109 2022/11/22 22:28:40 sashan Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
#include <net/pfvar.h>
+#include <netinet/ip_icmp.h>
+#include <netinet/tcp.h>
+#include <netinet/udp.h>
+
#ifdef INET6
#include <netinet/ip6.h>
+#include <netinet/icmp6.h>
#endif /* INET6 */
+#include <net/pfvar_priv.h>
+
#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
#define islower(c) ((c) >= 'a' && (c) <= 'z')
#define isalpha(c) (isupper(c)||islower(c))
struct pfi_kif *kif;
struct task *t;
+ PF_LOCK();
pfi_initialize();
pfi_update++;
if ((kif = pfi_kif_get(ifp->if_xname, NULL)) == NULL)
kif->pfik_ah_cookie = t;
pfi_kif_update(kif);
+ PF_UNLOCK();
}
void
if ((kif = (struct pfi_kif *)ifp->if_pf_kif) == NULL)
return;
+ PF_LOCK();
pfi_update++;
t = kif->pfik_ah_cookie;
kif->pfik_ah_cookie = NULL;
kif->pfik_ifp = NULL;
ifp->if_pf_kif = NULL;
pfi_kif_unref(kif, PFI_KIF_REF_NONE);
+ PF_UNLOCK();
}
void
{
struct pfi_kif *kif;
+ PF_LOCK();
pfi_initialize();
pfi_update++;
if ((kif = pfi_kif_get(ifg->ifg_group, NULL)) == NULL)
kif->pfik_group = ifg;
ifg->ifg_pf_kif = (caddr_t)kif;
+ PF_UNLOCK();
}
void
if ((kif = (struct pfi_kif *)ifg->ifg_pf_kif) == NULL)
return;
+ PF_LOCK();
pfi_update++;
kif->pfik_group = NULL;
ifg->ifg_pf_kif = NULL;
pfi_kif_unref(kif, PFI_KIF_REF_NONE);
+ PF_UNLOCK();
}
void
void
pfi_group_delmember(const char *group)
{
+ PF_LOCK();
pfi_group_change(group);
pfi_xcommit();
+ PF_UNLOCK();
}
void
pfi_group_addmember(const char *group)
{
+ PF_LOCK();
pfi_group_change(group);
pfi_xcommit();
+ PF_UNLOCK();
}
int
NET_ASSERT_LOCKED();
+ PF_LOCK();
pfi_update++;
pfi_kif_update(kif);
+ PF_UNLOCK();
}
int