On Wed, Sep 14, 2011 at 05:55:31PM -0700, Ethan Jackson wrote:
> Quite a bit of code in OVS ignores the return code of
> nln_notifier_register() and will nln_notifier_unregister() on
> notifiers which failed to register in the first place.  This can
> cause segmentation faults.
> 
> Instead of forcing every caller to remember whether or not
> registration failed, this patch allows unregistration of notifiers
> which failed to register.

I don't see an actual problem with this fix.

A different approach, that seems to me more conventional, would be for
nln_notifier_register() to allocate the struct nln_notifier and return
it as a pointer (probably through a struct nln_notifier ** parameter).
Then nln_notifier_unregister() would just ignore a null pointer.  If
we do it this way, then the definition of struct nln_notifier can be
moved into netlink-notifier.c.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to