From: Matan Barak <[email protected]>

When marsheling a user path to the kernel struct ib_sa_path, need
to zero smac, dmac and set the vlan id to the "no vlan" value.

Fixes: dd5f03b ('IB/core: Ethernet L2 attributes in verbs/cm structures')
Reported-by: Aleksey Senin <[email protected]>
Signed-off-by: Matan Barak <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
---
 drivers/infiniband/core/uverbs_marshall.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/uverbs_marshall.c 
b/drivers/infiniband/core/uverbs_marshall.c
index e7bee46..5c4a040 100644
--- a/drivers/infiniband/core/uverbs_marshall.c
+++ b/drivers/infiniband/core/uverbs_marshall.c
@@ -140,5 +140,9 @@ void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst,
        dst->packet_life_time   = src->packet_life_time;
        dst->preference         = src->preference;
        dst->packet_life_time_selector = src->packet_life_time_selector;
+
+       memset(dst->smac, 0, sizeof(dst->smac));
+       memset(dst->dmac, 0, sizeof(dst->dmac));
+       dst->vlan_id = be16_to_cpu(0xffff);
 }
 EXPORT_SYMBOL(ib_copy_path_rec_from_user);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to