[PATCH 0/3] indicate missing kernel support for rtnl_link_get_kernel()

Thomas Haller thaller at redhat.com
Thu Nov 27 01:42:22 PST 2014


On Wed, 2014-11-26 at 18:13 +0100, Thomas Haller wrote:
> Older kernels do not support lookup by name via rtnl_link_get_kernel().
> In this case, the function fails with -NLE_INVAL.
> 
> I feel it would be better to provide the proper error code (NLE_OPNOTSUPP),
> but OTOH, changing error code is an behavioral change.
> 
> I dunny. Is it even worth it? Can we change return codes?
> 
> The first approach does (almost) not change behavior, and sets
> errno in those particular case. Alternatively, another patch
> changes the return code.
> 
> What do you think?
> 
> Thomas Haller (3):
>   trival: white space fix in lib/nl.c
>   nl: add function nl_pickup_keep_syserr()
>   route/link: indicate failure of rtnl_link_get_kernel() for old kernels
> 
>  include/netlink/netlink.h |  5 +++++
>  include/netlink/utils.h   |  8 ++++++++
>  lib/nl.c                  | 49 ++++++++++++++++++++++++++++++++++++++---------
>  lib/route/link.c          | 22 ++++++++++++++++++++-
>  lib/utils.c               |  2 +-
>  5 files changed, 75 insertions(+), 11 deletions(-)
> 


version A (changing return code) merged as
https://github.com/thom311/libnl/commit/cb75576df0468f74b25204e94a6fb897b99dab30


Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20141127/5102bcfe/attachment.sig>


More information about the libnl mailing list