diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-24 04:17:20 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-05-24 04:17:20 +0000 |
commit | 361cb4c97740f40c5cd3808004369134731beb44 (patch) | |
tree | ba812e368e61922a3e442a8166532243f6a4c92f | |
parent | e87333a6ae634b7bf229d48ef588b1d14f02dfd9 (diff) |
add support for brace notation for interface groups, i. e. (testgroup) matches
all IPs on all interfaces in testgroup
-rw-r--r-- | sys/net/pf_if.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 8d9ba2b3871..fcbdca87b1f 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.30 2005/05/23 22:30:21 henning Exp $ */ +/* $OpenBSD: pf_if.c,v 1.31 2005/05/24 04:17:19 henning Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -391,6 +391,8 @@ pfi_dynaddr_update(struct pfi_dynaddr *dyn) { struct pfi_kif *kif; struct pfr_ktable *kt; + struct ifg_list *ifgl; + struct pfi_dynaddr *p; if (dyn == NULL || dyn->pfid_kif == NULL || dyn->pfid_kt == NULL) panic("pfi_dynaddr_update"); @@ -404,6 +406,12 @@ pfi_dynaddr_update(struct pfi_dynaddr *dyn) kt->pfrkt_larg = pfi_update; } pfr_dynaddr_update(kt, dyn); + + if (kif->pfik_ifp != NULL) + TAILQ_FOREACH(ifgl, &kif->pfik_ifp->if_groups, ifgl_next) + TAILQ_FOREACH(p, &((struct pfi_kif *) + ifgl->ifgl_group->ifg_pf_kif)->pfik_dynaddrs, entry) + pfi_dynaddr_update(p); } void @@ -412,8 +420,9 @@ pfi_table_update(struct pfr_ktable *kt, struct pfi_kif *kif, int net, int flags) int e, size2 = 0; struct pfi_kif *p; struct pfr_table t; + struct ifg_member *ifgm; - if (kif->pfik_ifp == NULL) { + if (kif->pfik_ifp == NULL && kif->pfik_group == NULL) { pfr_clr_addrs(&kt->pfrkt_t, NULL, 0); return; } @@ -421,7 +430,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 + 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 RB_FOREACH(p, pfi_ifhead, &pfi_ifs) if (p->pfik_ifp != NULL) pfi_instance_add(p->pfik_ifp, net, flags); |