diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_rc.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_uc.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c index 52caa2edf5a4..898f996513f8 100644 --- a/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/drivers/infiniband/hw/ipath/ipath_rc.c | |||
@@ -1320,6 +1320,10 @@ void ipath_rc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, | |||
1320 | struct ib_reth *reth; | 1320 | struct ib_reth *reth; |
1321 | int header_in_data; | 1321 | int header_in_data; |
1322 | 1322 | ||
1323 | /* Validate the SLID. See Ch. 9.6.1.5 */ | ||
1324 | if (unlikely(be16_to_cpu(hdr->lrh[3]) != qp->remote_ah_attr.dlid)) | ||
1325 | goto done; | ||
1326 | |||
1323 | /* Check for GRH */ | 1327 | /* Check for GRH */ |
1324 | if (!has_grh) { | 1328 | if (!has_grh) { |
1325 | ohdr = &hdr->u.oth; | 1329 | ohdr = &hdr->u.oth; |
diff --git a/drivers/infiniband/hw/ipath/ipath_uc.c b/drivers/infiniband/hw/ipath/ipath_uc.c index 0fd3cded16ba..d550b7aedb8d 100644 --- a/drivers/infiniband/hw/ipath/ipath_uc.c +++ b/drivers/infiniband/hw/ipath/ipath_uc.c | |||
@@ -246,6 +246,10 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr, | |||
246 | struct ib_reth *reth; | 246 | struct ib_reth *reth; |
247 | int header_in_data; | 247 | int header_in_data; |
248 | 248 | ||
249 | /* Validate the SLID. See Ch. 9.6.1.5 */ | ||
250 | if (unlikely(be16_to_cpu(hdr->lrh[3]) != qp->remote_ah_attr.dlid)) | ||
251 | goto done; | ||
252 | |||
249 | /* Check for GRH */ | 253 | /* Check for GRH */ |
250 | if (!has_grh) { | 254 | if (!has_grh) { |
251 | ohdr = &hdr->u.oth; | 255 | ohdr = &hdr->u.oth; |