Skip to content
Snippets Groups Projects
Commit c4f63b84 authored by Moe Jette's avatar Moe Jette
Browse files

Fixed code to check version numbers on messages.

parent 4a6eea77
No related branches found
No related tags found
No related merge requests found
...@@ -60,14 +60,15 @@ slurm_load_build (time_t update_time, struct build_table **build_table_ptr ) ...@@ -60,14 +60,15 @@ slurm_load_build (time_t update_time, struct build_table **build_table_ptr )
if ( ( rc = slurm_send_controller_msg ( sockfd , & request_msg ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_send_controller_msg ( sockfd , & request_msg ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
/* receive message */ /* receive message */
if ( ( msg_size = slurm_receive_msg ( sockfd , & response_msg ) ) == SLURM_SOCKET_ERROR ) if ( ( msg_size = slurm_receive_msg ( sockfd , & response_msg ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
/* shutdown message connection */ /* shutdown message connection */
if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
if ( msg_size )
return msg_size;
switch ( response_msg . msg_type ) switch ( response_msg . msg_type )
{ {
case RESPONSE_BUILD_INFO: case RESPONSE_BUILD_INFO:
......
...@@ -123,6 +123,8 @@ slurm_load_jobs (time_t update_time, job_info_msg_t **job_info_msg_pptr) ...@@ -123,6 +123,8 @@ slurm_load_jobs (time_t update_time, job_info_msg_t **job_info_msg_pptr)
/* shutdown message connection */ /* shutdown message connection */
if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
if ( msg_size )
return msg_size;
switch ( response_msg . msg_type ) switch ( response_msg . msg_type )
{ {
......
...@@ -106,6 +106,8 @@ slurm_load_node (time_t update_time, node_info_msg_t **node_info_msg_pptr) ...@@ -106,6 +106,8 @@ slurm_load_node (time_t update_time, node_info_msg_t **node_info_msg_pptr)
/* shutdown message connection */ /* shutdown message connection */
if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
if ( msg_size )
return msg_size;
switch ( response_msg . msg_type ) switch ( response_msg . msg_type )
{ {
......
...@@ -100,6 +100,8 @@ slurm_load_partitions (time_t update_time, partition_info_msg_t **partition_info ...@@ -100,6 +100,8 @@ slurm_load_partitions (time_t update_time, partition_info_msg_t **partition_info
/* shutdown message connection */ /* shutdown message connection */
if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_shutdown_msg_conn ( sockfd ) ) == SLURM_SOCKET_ERROR )
return SLURM_SOCKET_ERROR ; return SLURM_SOCKET_ERROR ;
if ( msg_size )
return msg_size;
switch ( response_msg . msg_type ) switch ( response_msg . msg_type )
{ {
......
...@@ -598,7 +598,7 @@ void pack_job_desc ( job_desc_msg_t * job_desc_ptr, void ** buf_ptr , int * buff ...@@ -598,7 +598,7 @@ void pack_job_desc ( job_desc_msg_t * job_desc_ptr, void ** buf_ptr , int * buff
} }
/* unpack_msg /* unpack_job_desc
* unpacks a job_desc struct * unpacks a job_desc struct
* header - the body structure to unpack * header - the body structure to unpack
* buf_ptr - destination of the pack, note buffer will be incremented by underlying unpack routines * buf_ptr - destination of the pack, note buffer will be incremented by underlying unpack routines
......
...@@ -8,7 +8,7 @@ uint32_t check_header_version( header_t * header) ...@@ -8,7 +8,7 @@ uint32_t check_header_version( header_t * header)
{ {
if ( header -> version != SLURM_PROTOCOL_VERSION ) if ( header -> version != SLURM_PROTOCOL_VERSION )
{ {
debug ( "Invalid Protocol Version from " ) ; info ( "Invalid Protocol Version %d ", header -> version ) ;
return SLURM_PROTOCOL_VERSION_ERROR ; return SLURM_PROTOCOL_VERSION_ERROR ;
} }
return SLURM_PROTOCOL_SUCCESS ; return SLURM_PROTOCOL_SUCCESS ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment