diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-09-28 12:00:06 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-09-28 14:16:39 -0400 |
commit | 10aeb0e6d8823c1cccf9edc8401c848745c128be (patch) | |
tree | 641cd8b5ff5e82598703a9502622894b78ef75f3 /drivers/infiniband | |
parent | 7dae5bff2e8e4699744e782a6e7605ad18d1240e (diff) |
IB/ipath: RC and UC should validate SLID and DLID
This is required for IB conformance (spec ch. 9.6.1.5).
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
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; |