On Tue, Sep 20, 2016 at 17:20 +0200, Martin Pieuchot wrote:
> On 20/09/16(Tue) 17:04, Mike Belopuhov wrote:
> > On Tue, Sep 20, 2016 at 10:51 -0400, David Hill wrote:
> > > On Tue, Sep 20, 2016 at 09:53:02AM -0400, David Hill wrote:
> > > > More...
> > > > 
> > > > splassert: sorwakeup: want 5 have 0
> > > > Starting stack trace...
> > > > splassert_check() at splassert_check+0x78
> > > > sorwakeup() at sorwakeup+0x27
> > > > route_input() at route_input+0x284
> > > > pflog_clone_create() at pflog_clone_create+0xa4
> > > > if_clone_create() at if_clone_create+0x7f
> > > > ifioctl() at ifioctl+0x35a
> > > > sys_ioctl() at sys_ioctl+0x196
> > > > syscall() at syscall+0x27b
> > > > --- syscall (number 54) ---
> > > > end of kernel
> > > > end trace frame: 0x7f7ffffc7930, count: 249
> > > > 0x1aeaedf1af1a:
> > > > End of stack trace.
> > > > 
> > > >
> > > 
> > > Another similar...
> > > 
> > > Sep 20 10:33:25 olive /bsd: splassert: sorwakeup: want 5 have 0
> > > Sep 20 10:33:25 olive /bsd: Starting stack trace...
> > > Sep 20 10:33:25 olive /bsd: splassert_check() at splassert_check+0x78
> > > Sep 20 10:33:25 olive /bsd: sorwakeup() at sorwakeup+0x27
> > > Sep 20 10:33:25 olive /bsd: route_input() at route_input+0x284
> > > Sep 20 10:33:25 olive /bsd: vether_clone_create() at
> > > vether_clone_create+0xd9
> > > Sep 20 10:33:25 olive /bsd: if_clone_create() at if_clone_create+0x7f
> > > Sep 20 10:33:25 olive /bsd: ifioctl() at ifioctl+0x35a
> > > Sep 20 10:33:25 olive /bsd: sys_ioctl() at sys_ioctl+0x196
> > > Sep 20 10:33:25 olive /bsd: syscall() at syscall+0x27b
> > > Sep 20 10:33:25 olive /bsd: --- syscall (number 54) ---
> > > Sep 20 10:33:25 olive /bsd: end of kernel
> > > Sep 20 10:33:25 olive /bsd: end trace frame: 0x7f7ffffd0df1, count: 249
> > > Sep 20 10:33:25 olive /bsd: 0x119ca1c1af1a:
> > > Sep 20 10:33:25 olive /bsd: End of stack trace.
> > >  
> > > 
> > 
> > It's all the same.  I'm not certain what would be the best way to
> > go around this, but a cautious approach would be something like this:
> > just wrapping ifc_create, ifc_destroy in splsoftnet.
> 
> ok mpi@
> 

Heh, we can commit the version that has both features :)

Index: if.c
===================================================================
RCS file: /home/cvs/src/sys/net/if.c,v
retrieving revision 1.448
diff -u -p -r1.448 if.c
--- if.c        13 Sep 2016 08:15:01 -0000      1.448
+++ if.c        20 Sep 2016 15:52:51 -0000
@@ -1041,7 +1041,7 @@ if_clone_create(const char *name, int rd
 {
        struct if_clone *ifc;
        struct ifnet *ifp;
-       int unit, ret;
+       int unit, ret, s;
 
        ifc = if_clone_lookup(name, &unit);
        if (ifc == NULL)
@@ -1050,8 +1050,11 @@ if_clone_create(const char *name, int rd
        if (ifunit(name) != NULL)
                return (EEXIST);
 
-       if ((ret = (*ifc->ifc_create)(ifc, unit)) != 0 ||
-           (ifp = ifunit(name)) == NULL)
+       s = splsoftnet();
+       ret = (*ifc->ifc_create)(ifc, unit);
+       splx(s);
+
+       if (ret != 0 || (ifp = ifunit(name)) == NULL)
                return (ret);
 
        if_addgroup(ifp, ifc->ifc_name);
@@ -1069,7 +1072,7 @@ if_clone_destroy(const char *name)
 {
        struct if_clone *ifc;
        struct ifnet *ifp;
-       int s;
+       int error, s;
 
        ifc = if_clone_lookup(name, NULL);
        if (ifc == NULL)
@@ -1088,7 +1091,10 @@ if_clone_destroy(const char *name)
                splx(s);
        }
 
-       return ((*ifc->ifc_destroy)(ifp));
+       s = splsoftnet();
+       error = (*ifc->ifc_destroy)(ifp);
+       splx(s);
+       return (error);
 }
 
 /*

Reply via email to