diff options
author | mlaier <mlaier@FreeBSD.org> | 2006-06-19 22:20:45 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2006-06-19 22:20:45 +0000 |
commit | f5cde2819f76cb3f86ff02a0c422b289ce94a096 (patch) | |
tree | 1d514a3c44a007d12f9a4007d15e7afe23180bb0 /sys/net/if_clone.c | |
parent | 5a4834b848117e80b174a1d51aff1cfd5e9c8c2d (diff) | |
download | FreeBSD-src-f5cde2819f76cb3f86ff02a0c422b289ce94a096.zip FreeBSD-src-f5cde2819f76cb3f86ff02a0c422b289ce94a096.tar.gz |
Import interface groups from OpenBSD. This allows to group interfaces in
order to - for example - apply firewall rules to a whole group of
interfaces. This is required for importing pf from OpenBSD 3.9
Obtained from: OpenBSD (with changes)
Discussed on: -net (back in April)
Diffstat (limited to 'sys/net/if_clone.c')
-rw-r--r-- | sys/net/if_clone.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 89d679d..aa2c21a 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -158,6 +158,8 @@ if_clone_createif(struct if_clone *ifc, char *name, size_t len) if (ifp == NULL) panic("%s: lookup failed for %s", __func__, name); + if_addgroup(ifp, ifc->ifc_name); + IF_CLONE_LOCK(ifc); IFC_IFLIST_INSERT(ifc, ifp); IF_CLONE_UNLOCK(ifc); @@ -210,9 +212,13 @@ if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp) IFC_IFLIST_REMOVE(ifc, ifp); IF_CLONE_UNLOCK(ifc); + if_delgroup(ifp, ifc->ifc_name); + err = (*ifc->ifc_destroy)(ifc, ifp); if (err != 0) { + if_addgroup(ifp, ifc->ifc_name); + IF_CLONE_LOCK(ifc); IFC_IFLIST_INSERT(ifc, ifp); IF_CLONE_UNLOCK(ifc); |