From 4d228aebbdf5d584cf43a70592cd565b45dc2fc6 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 11 Jul 2018 09:05:52 +0000 Subject: provide pfi_group_addmember(), which makes the new member interface inherit set flags from the group. ok phessler benno --- sys/net/pf_if.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys/net/pf_if.c') 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 @@ -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) { -- cgit v1.2.3