On 22/12/16(Thu) 20:45, Mike Belopuhov wrote:
> On Wed, Dec 21, 2016 at 13:06 +0100, Alexander Bluhm wrote:
> > On Wed, Dec 21, 2016 at 12:45:37PM +0100, Mike Belopuhov wrote:
> > > Anyways, OK for the diff below?
> > 
> > OK bluhm@
> > 
> > > diff --git sys/net/if_pflow.c sys/net/if_pflow.c
> > > index 0df0b69fd8a..8592d98a743 100644
> > > --- sys/net/if_pflow.c
> > > +++ sys/net/if_pflow.c
> > > @@ -265,14 +265,11 @@ pflow_clone_destroy(struct ifnet *ifp)
> > >   if (timeout_initialized(&sc->sc_tmo_tmpl))
> > >           timeout_del(&sc->sc_tmo_tmpl);
> > >   pflow_flush(sc);
> > >   m_freem(sc->send_nam);
> > >   if (sc->so != NULL) {
> > > -         /* XXXSMP breaks atomicity */
> > > -         rw_exit_write(&netlock);
> > >           error = soclose(sc->so);
> > > -         rw_enter_write(&netlock);
> > >           sc->so = NULL;
> > >   }
> > >   if (sc->sc_flowdst != NULL)
> > >           free(sc->sc_flowdst, M_DEVBUF, sc->sc_flowdst->sa_len);
> > >   if (sc->sc_flowsrc != NULL)
> 
> I think this is what is required here.  Works here, but YMMV.

splnet() in a pseudo-driver seems completely wrong, you could get rid of
it.

> 
> diff --git sys/net/if_vxlan.c sys/net/if_vxlan.c
> index e9bc1cb8305..dfb71cf9467 100644
> --- sys/net/if_vxlan.c
> +++ sys/net/if_vxlan.c
> @@ -178,13 +178,15 @@ int
>  vxlan_clone_destroy(struct ifnet *ifp)
>  {
>       struct vxlan_softc      *sc = ifp->if_softc;
>       int                      s;
>  
> +     NET_LOCK(s);
>       s = splnet();
>       vxlan_multicast_cleanup(ifp);
>       splx(s);
> +     NET_UNLOCK(s);
>  
>       vxlan_enable--;
>       LIST_REMOVE(sc, sc_entry);
>  
>       ifmedia_delete_instance(&sc->sc_media, IFM_INST_ANY);

Reply via email to