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

Thomas Haller thaller at redhat.com
Wed Nov 26 09:13:35 PST 2014


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(-)

-- 
1.9.3




More information about the libnl mailing list