[PATCH] Fix typo in rtnl_neigh_get()

Roopa Prabhu roopa at cumulusnetworks.com
Thu Jan 31 10:12:50 EST 2013


On 1/31/13 6:48 AM, Rich Fought wrote:
> Given Roopa's last patch to remove the AF_UNSPEC check from
> rtnl_get_link() and rtnl_get_link_by_name(), perhaps it should be
> removed from here altogether as well? Are there other functions that
> needs to be reverted in this way?

thanks....yes i was just typing a reply to maximes email.

This is the only other place that i added AF_UNSPEC check that can be 
removed.
I was more worried here about users getting AF_BRIDGE objects 
unexpectedly because AF_BRIDGE and AF_UNSPEC neigh objects differ in 
what fields are filled up in the objects.
But its better to remove the check on the same lines that a user will 
not get bridge objects unless requested and hopefully will not run into 
this.

Patch coming in a short while..


>
>
> On 1/31/2013 6:40 AM, Maxime Bizon wrote:
>> From: Maxime Bizon <mbizon at freebox.fr>
>>
>> Fix typo in rtnl_neigh_get()
>>
>> Signed-off-by: Maxime Bizon <mbizon at freebox.fr>
>> ---
>> lib/route/neigh.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/route/neigh.c b/lib/route/neigh.c
>> index c0f80a2..3ccb126 100644
>> --- a/lib/route/neigh.c
>> +++ b/lib/route/neigh.c
>> @@ -540,7 +540,7 @@ 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_family == AF_UNSPEC &&
>> + if (neigh->n_family != AF_UNSPEC &&
>> neigh->n_ifindex == ifindex &&
>> !nl_addr_cmp(neigh->n_dst, dst)) {
>> nl_object_get((struct nl_object *) neigh);
>
>
> _______________________________________________
> libnl mailing list
> libnl at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libnl




More information about the libnl mailing list