mlxsw: spectrum_dpipe: Fix host table dump
authorArkadi Sharshevsky <arkadis@mellanox.com>
Sat, 26 Aug 2017 06:35:39 +0000 (08:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Aug 2017 22:41:15 +0000 (15:41 -0700)
During the neighbor traversal the neighbors from different families
should be ignored.

Fixes: c58035a74aba ("mlxsw: spectrum_dpipe: Add support for IPv4 host table dump")
Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c

index 3c8599f14bff0c8ba22ad9d837869ce1b1183f56..3ea13148ed053faa0e68ef2c06d275cbc263e5a6 100644 (file)
@@ -516,6 +516,9 @@ start_again:
 
                rif_neigh_count = 0;
                mlxsw_sp_rif_neigh_for_each(neigh_entry, rif) {
+                       if (mlxsw_sp_neigh_entry_type(neigh_entry) != type)
+                               continue;
+
                        if (rif_neigh_count < rif_neigh_skip)
                                goto skip;