@@ -904,7 +904,10 @@ int ib_attach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
{
if (!qp->device->attach_mcast)
return -ENOSYS;
- if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+ if (qp->qp_type == IB_QPT_RAW_PACKET) {
+ if (gid->global.subnet_prefix & cpu_to_be64(~1ULL))
+ return -EINVAL;
+ } else if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
return -EINVAL;
return qp->device->attach_mcast(qp, gid, lid);
@@ -915,7 +918,10 @@ int ib_detach_mcast(struct ib_qp *qp, union ib_gid *gid, u16 lid)
{
if (!qp->device->detach_mcast)
return -ENOSYS;
- if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
+ if (qp->qp_type == IB_QPT_RAW_PACKET) {
+ if (gid->global.subnet_prefix & cpu_to_be64(~1ULL))
+ return -EINVAL;
+ } else if (gid->raw[0] != 0xff || qp->qp_type != IB_QPT_UD)
return -EINVAL;
return qp->device->detach_mcast(qp, gid, lid);