[ovs-dev] [RFC] bfd: Replace bfd.{c, h} with generic implementation.

Ben Pfaff blp at nicira.com
Tue Mar 4 07:38:15 UTC 2014


OK.

I didn't review the whole patch, by the way, I just noticed this
glancing at the first little bit.

On Mon, Mar 03, 2014 at 05:57:55PM -0800, Alex Wang wrote:
> Yeah, I was not sure about this either.
> 
> I was trying to avoid pulling any ovs specific library to the 'libbfd' and
> considering
> that bfd_set_next_tx() (which uses rand()) will only be called while holding
> the global lock.
> 
> I agree that this will leave risk for future development.  I think I will
> just move the
> needed random.c code into the bfd.c.
> 
> Thanks,
> Alex Wang,
> 
> 
> On Mon, Mar 3, 2014 at 5:49 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> > On Mon, Mar 03, 2014 at 05:46:41PM -0800, Alex Wang wrote:
> > > This commit replaces the current bfd.{c,h} with a generic library-like
> > > implementation.  Wrappers (in bfd_ts.{c,h}) are then added to guarantee
> > > the thread-safety and compatibility with current invocation pattern.
> > >
> > > Signed-off-by: Alex Wang <alexw at nicira.com>
> >
> > ...
> >
> > > diff --git a/build-aux/thread-safety-blacklist
> > b/build-aux/thread-safety-blacklist
> > > index 42560df..4db5a84 100644
> > > --- a/build-aux/thread-safety-blacklist
> > > +++ b/build-aux/thread-safety-blacklist
> > > @@ -70,7 +70,6 @@
> > >  \bputchar_unlocked(
> > >  \bputenv(
> > >  \bpututxline(
> > > -\brand(
> > >  \bsetenv(
> > >  \bsetgrent(
> > >  \bsetkey(
> >
> > Why are we removing this?  rand() really isn't thread-safe.
> >



More information about the dev mailing list