[PATCH 2/6] nf: nfnl_*_str2copy_mode() should return int

Thomas Graf tgraf at suug.ch
Tue Aug 26 03:21:37 PDT 2014


On 08/26/14 at 12:03pm, Thomas Haller wrote:
> On Tue, 2014-08-26 at 01:09 +0200, Thomas Graf wrote:
> > ... to be able to return a negative error code for unknown modes.
> > 
> > Signed-off-by: Thomas Graf <tgraf at suug.ch>
> > ---
> >  include/netlink/netfilter/log.h   | 2 +-
> >  include/netlink/netfilter/queue.h | 2 +-
> >  lib/netfilter/log_obj.c           | 2 +-
> >  lib/netfilter/queue_obj.c         | 2 +-
> >  src/nf-log.c                      | 2 +-
> >  src/nf-queue.c                    | 2 +-
> >  6 files changed, 6 insertions(+), 6 deletions(-)
> 
> 
> isn't this an ABI break?

Strictly speaking it is. We should be fine unless we compile
with -fshort-enums though.

I should have mentioned this in the commit message actually:
assuming that enum can translate to anything, I can't see how
a caller could correctly check for the -1 error condition.
Even if we require the caller to cast, what do we have him cast
it to?

So either way, we are breaking the ABI in a minor way.

Thoughts?



More information about the libnl mailing list