Issues with rtnl_neigh_get on RHEL 7.0 and RHEL 7.1

Haggai Abramovsky hagaya at mellanox.com
Tue Aug 18 07:32:16 PDT 2015


The following commit:
64fcb47 Add AF_BRIDGE support to neigh cache

Added the following check:
@@ -496,7 +515,8 @@ struct rtnl_neigh * rtnl_neigh_get(struct nl_cache *cache, int ifindex,
        struct rtnl_neigh *neigh;

        nl_list_for_each_entry(neigh, &cache->c_items, ce_list) {
-           if (neigh->n_ifindex == ifindex &&
+         if (neigh->n_family == AF_UNSPEC &&
+             neigh->n_ifindex == ifindex &&
                    !nl_addr_cmp(neigh->n_dst, dst)) {
                        nl_object_get((struct nl_object *) neigh);
                        return neigh;

Which was later removed by the following commit:
8571f58 neigh: Remove check for AF_UNSPEC in rtnl_neigh_get()

Between these two commits, when the n_family doesn't equal to AF_UNSPEC, the libnl won't search for neighbor in the cache, and will return NULL.

RHEL 7.0 and RHEL 7.1 has the previous check, which causes our library, that uses the libnl, to fail although the neighbor is in cache.

Is there a way to solve this? Is there any work around we can use to allow our library to run with the n_family check?

Thanks Haggai 




More information about the libnl mailing list