[openib-general] [PATCH] opensm: osm_sa_path_record: mcast destination detection fix
Sasha Khapyorsky
sashak at voltaire.com
Mon Aug 21 10:22:40 PDT 2006
Return error when mcast destination is not consistently indicated.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
osm/opensm/osm_sa_path_record.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
index caa9f32..6b0fb28 100644
--- a/osm/opensm/osm_sa_path_record.c
+++ b/osm/opensm/osm_sa_path_record.c
@@ -1486,7 +1486,7 @@ __osm_pr_match_mgrp_attributes(
/**********************************************************************
**********************************************************************/
-static boolean_t
+static int
__osm_pr_rcv_check_mcast_dest(
IN osm_pr_rcv_t* const p_rcv,
IN const osm_madw_t* const p_madw )
@@ -1494,7 +1494,7 @@ __osm_pr_rcv_check_mcast_dest(
const ib_path_rec_t* p_pr;
const ib_sa_mad_t* p_sa_mad;
ib_net64_t comp_mask;
- boolean_t is_multicast = FALSE;
+ unsigned is_multicast = 0;
OSM_LOG_ENTER( p_rcv->p_log, __osm_pr_rcv_check_mcast_dest );
@@ -1514,11 +1514,13 @@ __osm_pr_rcv_check_mcast_dest(
{
if( cl_ntoh16( p_pr->dlid ) >= IB_LID_MCAST_START_HO &&
cl_ntoh16( p_pr->dlid ) <= IB_LID_MCAST_END_HO )
- is_multicast = TRUE;
- else if( is_multicast )
+ is_multicast = 1;
+ else if( is_multicast ) {
osm_log( p_rcv->p_log, OSM_LOG_ERROR,
"__osm_pr_rcv_check_mcast_dest: ERR 1F12: "
"PathRecord request indicates MGID but not MLID\n" );
+ return -1;
+ }
}
Exit:
@@ -1693,6 +1695,7 @@ osm_pr_rcv_process(
cl_qlist_t pr_list;
ib_net16_t sa_status;
osm_port_t* requester_port;
+ int ret;
OSM_LOG_ENTER( p_rcv->p_log, osm_pr_rcv_process );
@@ -1737,7 +1740,10 @@ osm_pr_rcv_process(
cl_plock_acquire( p_rcv->p_lock );
/* Handle multicast destinations separately */
- if( __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw ) )
+ if( (ret = __osm_pr_rcv_check_mcast_dest( p_rcv, p_madw )) < 0)
+ goto Exit;
+
+ if(ret > 0)
goto McastDest;
osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
More information about the general
mailing list