summaryrefslogtreecommitdiff
path: root/sys/net/pf_if.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2005-05-25 06:50:06 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2005-05-25 06:50:06 +0000
commit382c311d1f0871b6ed25ccc8058af517300c4f55 (patch)
tree7b5c703defca02090aa9c7f626370e026eba527e /sys/net/pf_if.c
parent11526ce555d6cda677a05ff6a5afd5c247b3f691 (diff)
when an interface joins or leaves a group call back into pf so it can
update the internal tables used for (ifgroup) notation
Diffstat (limited to 'sys/net/pf_if.c')
-rw-r--r--sys/net/pf_if.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c
index fcbdca87b1f..acdef78bdbf 100644
--- a/sys/net/pf_if.c
+++ b/sys/net/pf_if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_if.c,v 1.31 2005/05/24 04:17:19 henning Exp $ */
+/* $OpenBSD: pf_if.c,v 1.32 2005/05/25 06:50:05 henning Exp $ */
/*
* Copyright 2005 Henning Brauer <henning@openbsd.org>
@@ -279,6 +279,24 @@ pfi_detach_ifgroup(struct ifg_group *ifg)
splx(s);
}
+void
+pfi_group_change(char *group)
+{
+ struct pfi_kif *kif;
+ struct pfi_dynaddr *dyn;
+ int s;
+
+ s = splsoftnet();
+ pfi_update++;
+ if ((kif = pfi_kif_get(group)) == NULL)
+ panic("pfi_kif_get failed");
+
+ TAILQ_FOREACH(dyn, &kif->pfik_dynaddrs, entry)
+ pfi_dynaddr_update(dyn);
+
+ splx(s);
+}
+
int
pfi_match_addr(struct pfi_dynaddr *dyn, struct pf_addr *a, sa_family_t af)
{
@@ -430,10 +448,10 @@ pfi_table_update(struct pfr_ktable *kt, struct pfi_kif *kif, int net, int flags)
if (kif->pfik_ifp != NULL)
pfi_instance_add(kif->pfik_ifp, net, flags);
- else if (kif->pfik_group != NULL) {
+ else if (kif->pfik_group != NULL)
TAILQ_FOREACH(ifgm, &kif->pfik_group->ifg_members, ifgm_next)
pfi_instance_add(ifgm->ifgm_ifp, net, flags);
- } else
+ else
RB_FOREACH(p, pfi_ifhead, &pfi_ifs)
if (p->pfik_ifp != NULL)
pfi_instance_add(p->pfik_ifp, net, flags);