dect
/
libnl
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
libnl/lib
roopa b06c23a9dd link cache: remove AF_UNSPEC check in rtnl_get_link and rtnl_get_link_by_name
This patch reverts back the AF_UNSPEC check introduced by AF_BRIDGE
changes at http://lists.infradead.org/pipermail/libnl/2012-November/000796.html

After the addition of AF_BRIDGE support, link cache can now contain objects of
type AF_BRIDGE. To make sure existing api's did not return AF_BRIDGE objects
and surprise existing callers, I introduced the check for AF_UNSPEC.

But from what Andy Wang reported, rtnl_link_get_by_name returns the first
link object with matching ifindex and that could have not only been AF_UNSPEC
but also of family AF_INET6. And his app always got an AF_INET6 object prior
to the patch that introduced the AF_UNSPEC check.

I could just add AF_INET6 family check along with AF_UNSPEC in the apis and that
should work well.

But thinking about it some more, removing the AF_UNSPEC change seems to be safer at
this point. That way this api will retain its semantics and return the first object
with matching ifindex. It could be of any supported family. The user will know if the
cache contains bridge objects, because they are available only with the cache flag
NL_CACHE_AF_ITER. Besides, if new users want to search for a specific object,
nl_cache_find is a better option.

Reported-by: Andy Wang <Andy.Wang@watchguard.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
2013-01-31 10:09:12 +01:00
..
cli Support plug qdisc - queue traffic until explicit release 2012-02-14 12:02:04 +01:00
fib_lookup Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
genl Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
netfilter Merge pull request #29 from rmfought/natdir32 2013-01-24 08:32:35 -08:00
route link cache: remove AF_UNSPEC check in rtnl_get_link and rtnl_get_link_by_name 2013-01-31 10:09:12 +01:00
.gitignore Added lex.yy.c to .gitignore 2012-08-30 03:19:04 +06:00
Makefile.am link: basic socket-CAN support 2012-11-29 22:17:58 +01:00
addr.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
attr.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
cache.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
cache_mngr.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
cache_mngt.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
data.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
error.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
handlers.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
hash.c Hash: Properly prefix hash functions 2012-11-10 10:22:26 +01:00
hashtable.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
msg.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
nl.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
object.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
socket.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
utils.c Move private header files to <netlink-private/*> 2013-01-24 13:51:24 +01:00
version.c Run-time version information is now available 2012-08-30 03:19:04 +06:00