mlxsw: spectrum_router: Add IPv6 neighbor access helper
authorArkadi Sharshevsky <arkadis@mellanox.com>
Thu, 31 Aug 2017 15:59:15 +0000 (17:59 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Aug 2017 21:42:19 +0000 (14:42 -0700)
Add helper for accessing destination IP in case of IPv6 neighbor.

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_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h

index 1f41bcdf04ca2f6e199673356fe4dd81dff2cbc0..db57c0c4c9d8c07728267cf95348664f46cb4dbf 100644 (file)
@@ -947,6 +947,15 @@ u32 mlxsw_sp_neigh4_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry)
        return ntohl(*((__be32 *) n->primary_key));
 }
 
+struct in6_addr *
+mlxsw_sp_neigh6_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry)
+{
+       struct neighbour *n;
+
+       n = neigh_entry->key.n;
+       return (struct in6_addr *) &n->primary_key;
+}
+
 int mlxsw_sp_neigh_counter_get(struct mlxsw_sp *mlxsw_sp,
                               struct mlxsw_sp_neigh_entry *neigh_entry,
                               u64 *p_counter)
index 5b68616a42343f9e4a38140f8479bf064527d88c..87a04afee138572cadaf586c6304783ee160820a 100644 (file)
@@ -65,6 +65,8 @@ int mlxsw_sp_neigh_entry_type(struct mlxsw_sp_neigh_entry *neigh_entry);
 unsigned char *
 mlxsw_sp_neigh_entry_ha(struct mlxsw_sp_neigh_entry *neigh_entry);
 u32 mlxsw_sp_neigh4_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry);
+struct in6_addr *
+mlxsw_sp_neigh6_entry_dip(struct mlxsw_sp_neigh_entry *neigh_entry);
 
 #define mlxsw_sp_rif_neigh_for_each(neigh_entry, rif)                          \
        for (neigh_entry = mlxsw_sp_rif_neigh_next(rif, NULL); neigh_entry;     \