diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2018-07-11 09:05:52 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2018-07-11 09:05:52 +0000 |
commit | 4d228aebbdf5d584cf43a70592cd565b45dc2fc6 (patch) | |
tree | 51e04661e83438cf08e71998d6995426e3bfb502 /sys/net/pf_if.c | |
parent | 98175f825644645913b9890cccfad96f048f6073 (diff) |
provide pfi_group_addmember(), which makes the new member interface inherit
set flags from the group. ok phessler benno
Diffstat (limited to 'sys/net/pf_if.c')
-rw-r--r-- | sys/net/pf_if.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index 4290ba6636b..7ea1f05ea16 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.93 2018/04/24 20:23:41 bluhm Exp $ */ +/* $OpenBSD: pf_if.c,v 1.94 2018/07/11 09:05:51 henning Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -298,6 +298,19 @@ pfi_group_change(const char *group) pfi_kif_update(kif); } +void +pfi_group_addmember(const char *group, struct ifnet *ifp) +{ + struct pfi_kif *gkif, *ikif; + + if ((gkif = pfi_kif_get(group)) == NULL || + (ikif = pfi_kif_get(ifp->if_xname)) == NULL) + panic("pfi_kif_get failed"); + ikif->pfik_flags |= gkif->pfik_flags; + + pfi_group_change(group); +} + int pfi_match_addr(struct pfi_dynaddr *dyn, struct pf_addr *a, sa_family_t af) { |