Blob Blame History Raw
From: Arkadi Sharshevsky <arkadis@mellanox.com>
Date: Sat, 26 Aug 2017 08:35:39 +0200
Subject: mlxsw: spectrum_dpipe: Fix host table dump
Patch-mainline: v4.14-rc1
Git-commit: 18fed7e15d8fd38747819ee8e66c8771e0281226
References: bsc#1112374

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_dpipe.c
@@ -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;