* Henning Brauer <[EMAIL PROTECTED]> [2005-06-05 22:36]:
> * Frank Denis (Jedi/Sector One) <[EMAIL PROTECTED]> [2005-06-05 22:22]:
> > Since -current changed a bit the way interface groups are working, is
> > there a simple way to emulate the old behavior?
> >
> > Specifically, I have a pptp server using poptop that creates a lot of tun
> > interfaces. But these interfaces are not automatically assigned to an
> > interface group. So is there still a way to match tun* in pf rules?
>
> not currently.
>
> I plan to bring back the interface class groups for cloned
> interfaces, tho there is a bit prerequisite work to do (there is no
> easy way to detect cloned interfaces yet)
actually I just figured out how to do this right... so easy
Index: if.c
===================================================================
RCS file: /cvs/src/sys/net/if.c,v
retrieving revision 1.124
diff -u -p -r1.124 if.c
--- if.c 5 Jun 2005 20:49:25 -0000 1.124
+++ if.c 5 Jun 2005 21:04:12 -0000
@@ -686,7 +686,8 @@ int
if_clone_create(const char *name)
{
struct if_clone *ifc;
- int unit;
+ struct ifnet *ifp;
+ int unit, ret;
ifc = if_clone_lookup(name, &unit);
if (ifc == NULL)
@@ -695,7 +696,11 @@ if_clone_create(const char *name)
if (ifunit(name) != NULL)
return (EEXIST);
- return ((*ifc->ifc_create)(ifc, unit));
+ if ((ret = (*ifc->ifc_create)(ifc, unit)) != -1 &&
+ (ifp = ifunit(name)) != NULL)
+ if_addgroup(ifp, ifc->ifc_name);
+
+ return (ret);
}
/*
@@ -724,6 +729,8 @@ if_clone_destroy(const char *name)
if_down(ifp);
splx(s);
}
+
+ if_delgroup(ifp, ifc->ifc_name);
return ((*ifc->ifc_destroy)(ifp));
}
--
BS Web Services, http://www.bsws.de/
OpenBSD-based Webhosting, Mail Services, Managed Servers, ...
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)