summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2018-07-11 09:05:52 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2018-07-11 09:05:52 +0000
commit4d228aebbdf5d584cf43a70592cd565b45dc2fc6 (patch)
tree51e04661e83438cf08e71998d6995426e3bfb502 /sys/net
parent98175f825644645913b9890cccfad96f048f6073 (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')
-rw-r--r--sys/net/pf_if.c15
-rw-r--r--sys/net/pfvar.h3
2 files changed, 16 insertions, 2 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)
{
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 8edf918f946..fea4cca9bc8 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfvar.h,v 1.480 2018/07/10 16:48:22 henning Exp $ */
+/* $OpenBSD: pfvar.h,v 1.481 2018/07/11 09:05:51 henning Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1853,6 +1853,7 @@ void pfi_detach_ifnet(struct ifnet *);
void pfi_attach_ifgroup(struct ifg_group *);
void pfi_detach_ifgroup(struct ifg_group *);
void pfi_group_change(const char *);
+void pfi_group_addmember(const char *, struct ifnet *);
int pfi_match_addr(struct pfi_dynaddr *, struct pf_addr *,
sa_family_t);
int pfi_dynaddr_setup(struct pf_addr_wrap *, sa_family_t);