diff --git a/mtce/src/maintenance/mtcNodeComp.cpp b/mtce/src/maintenance/mtcNodeComp.cpp index 246e5f9b..425a9b3a 100644 --- a/mtce/src/maintenance/mtcNodeComp.cpp +++ b/mtce/src/maintenance/mtcNodeComp.cpp @@ -659,8 +659,11 @@ int mtc_socket_init ( void ) /************************************************************/ /* Setup Pxeboot Network messaging sockets to/from mtcAgent */ /************************************************************/ - setup_pxeboot_rx_socket (); - setup_pxeboot_tx_socket (); + if ( ctrl.pxeboot_iface_provisioned ) + { + setup_pxeboot_rx_socket (); + setup_pxeboot_tx_socket (); + } /* Manage Cluster-host network setup */ string mgmnt_iface_name = daemon_mgmnt_iface(); @@ -1305,7 +1308,14 @@ int daemon_init ( string iface, string nodetype_str ) // equal to the management interface, until otherwise updated due // to bonding or vlan modes. ctrl.pxeboot_iface = ctrl.mgmnt_iface ; - ctrl.pxeboot_iface_provisioned = true ; + if ( ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX ) + { + ctrl.pxeboot_iface_provisioned = true ; + } + else + { + ilog ("Simplex Mode: Pxeboot network not provisioned"); + } } } if ( daemon_files_init () != PASS ) @@ -1336,9 +1346,12 @@ int daemon_init ( string iface, string nodetype_str ) rc = FAIL_NODETYPE; } - if (( rc = learn_my_pxeboot_address () ) != PASS ) + if ( ctrl.system_type != SYSTEM_TYPE__AIO__SIMPLEX ) { - wlog ("failed to learn my pxeboot address ; rc:%d", rc ); + if (( rc = learn_my_pxeboot_address () ) != PASS ) + { + wlog ("failed to learn my pxeboot address ; rc:%d", rc ); + } } /* Setup the heartbeat service messaging sockets */ @@ -1487,7 +1500,8 @@ void daemon_service_run ( void ) FD_SET(mtc_sock.mtc_client_clstr_rx_socket->getFD(), &mtc_sock.readfds); } - if ( mtc_sock.pxeboot_rx_socket ) + if (( ctrl.pxeboot_iface_provisioned ) && + ( mtc_sock.pxeboot_rx_socket )) { socks.push_front (mtc_sock.pxeboot_rx_socket); FD_SET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds); @@ -1522,9 +1536,11 @@ void daemon_service_run ( void ) } else { + // Is there a Pxeboot network message present ? - if (mtc_sock.pxeboot_rx_socket && - FD_ISSET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds)) + if (( ctrl.pxeboot_iface_provisioned ) && + ( mtc_sock.pxeboot_rx_socket ) && + ( FD_ISSET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds))) { mlog3 ("pxeboot rx socket fired"); mtc_service_command ( sock_ptr, PXEBOOT_INTERFACE ); @@ -1759,9 +1775,12 @@ void daemon_service_run ( void ) if ( socket_reinit ) { - if (( mtc_sock.pxeboot_tx_socket <= 0 ) || ( mtc_sock.pxeboot_rx_socket <= 0 )) + if (( ctrl.pxeboot_iface_provisioned ) && + (( mtc_sock.pxeboot_tx_socket <= 0 ) || + ( mtc_sock.pxeboot_rx_socket <= 0 ))) + { learn_my_pxeboot_address (); - + } /* re-get identity if interfaces are re-initialized */ string who_i_am = _self_identify ( ctrl.nodetype_str ); } @@ -1771,7 +1790,10 @@ void daemon_service_run ( void ) if ( ! daemon_want_fit ( FIT_CODE__FAIL_PXEBOOT_MTCALIVE ) ) #endif { - send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, PXEBOOT_INTERFACE ); + if ( ctrl.pxeboot_iface_provisioned ) + { + send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, PXEBOOT_INTERFACE ); + } } send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, MGMNT_INTERFACE ); if (( ctrl.clstr_iface_provisioned == true ) && @@ -1788,12 +1810,14 @@ void daemon_service_run ( void ) if ( daemon_is_file_present ( MTC_CMD_FIT__DIR ) ) { - /* fault insertion testing */ - if ( daemon_is_file_present ( MTC_CMD_FIT__PXEBOOT_RXSOCK )) - _close_pxeboot_rx_socket(); - if ( daemon_is_file_present ( MTC_CMD_FIT__PXEBOOT_TXSOCK )) - _close_pxeboot_tx_socket (); - + if ( ctrl.pxeboot_iface_provisioned ) + { + /* fault insertion testing */ + if ( daemon_is_file_present ( MTC_CMD_FIT__PXEBOOT_RXSOCK )) + _close_pxeboot_rx_socket(); + if ( daemon_is_file_present ( MTC_CMD_FIT__PXEBOOT_TXSOCK )) + _close_pxeboot_tx_socket (); + } /* fault insertion testing */ if ( daemon_is_file_present ( MTC_CMD_FIT__MGMNT_RXSOCK )) { @@ -1901,7 +1925,10 @@ void daemon_service_run ( void ) slog ("mtcAlive Stress Test: Sending %d mtcAlive on each network.", loops); for ( int loop = 0 ; loop < loops ; loop++ ) { - send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, PXEBOOT_INTERFACE ); + if ( ctrl.pxeboot_iface_provisioned ) + { + send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, PXEBOOT_INTERFACE ); + } send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, MGMNT_INTERFACE ); send_mtcAlive_msg ( sock_ptr, ctrl.who_i_am, CLSTR_INTERFACE ); diff --git a/mtce/src/maintenance/mtcNodeCtrl.cpp b/mtce/src/maintenance/mtcNodeCtrl.cpp index 4166f433..ba5dd369 100644 --- a/mtce/src/maintenance/mtcNodeCtrl.cpp +++ b/mtce/src/maintenance/mtcNodeCtrl.cpp @@ -249,8 +249,11 @@ static void mtc_socket_fini(void) set_inotify_close(mtcInv.inotify_shadow_file_fd, mtcInv.inotify_shadow_file_wd); - pxeboot_tx_socket_close(); - pxeboot_rx_socket_close(); + if ( mtcInv.pxeboot_network_provisioned ) + { + pxeboot_tx_socket_close(); + pxeboot_rx_socket_close(); + } mtc_agent_clstr_tx_socket_close(); mtc_agent_clstr_rx_socket_close(); mtc_agent_mgmt_tx_socket_close(); @@ -1469,7 +1472,12 @@ void daemon_service_run ( void ) get_iface_macaddr ( mtc_config.mgmnt_iface , my_mac ); dlog ("Mgmt IF mac: %s", my_mac.c_str()); mtcInv.my_pxeboot_if = daemon_mgmnt_iface() ; - if (( mtcInv.my_pxeboot_if != LOOPBACK_IF ) && ( !my_mac.empty() )) + + if ( mtcInv.system_type == SYSTEM_TYPE__AIO__SIMPLEX ) + { + ilog ("Simplex Mode: Pxeboot network not provisioned"); + } + else if (( mtcInv.my_pxeboot_if != LOOPBACK_IF ) && ( !my_mac.empty())) { mtcInv.pxeboot_network_provisioned = true ; mtc_config.pxeboot_iface = daemon_get_iface_master ((char*)mtcInv.my_pxeboot_if.data()); @@ -1593,9 +1601,14 @@ void daemon_service_run ( void ) // service_events socks.push_front (mtc_sock.mtc_event_rx_sock->getFD()); - // mtc_service_inbox - receive sockets from Pxeboot, Mgmt and Clstr network - if ( mtc_sock.pxeboot_rx_socket ) - socks.push_front (mtc_sock.pxeboot_rx_socket); + if ( mtcInv.pxeboot_network_provisioned ) + { + // mtc_service_inbox - receive sockets from Pxeboot, Mgmt and Clstr network + if ( mtc_sock.pxeboot_rx_socket ) + { + socks.push_front (mtc_sock.pxeboot_rx_socket); + } + } socks.push_front (mtc_sock.mtc_agent_mgmt_rx_socket->getFD()); if ( mtcInv.clstr_network_provisioned == true ) { @@ -1769,10 +1782,13 @@ void daemon_service_run ( void ) { FD_SET(mtc_sock.mtc_agent_clstr_rx_socket->getFD(),&mtc_sock.readfds); } - // Listen to the pxeboot rx socket if it is setup - if ( mtc_sock.pxeboot_rx_socket > 0 ) + if ( mtcInv.pxeboot_network_provisioned == true ) { - FD_SET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds); + // Listen to the pxeboot rx socket if it is setup + if ( mtc_sock.pxeboot_rx_socket > 0 ) + { + FD_SET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds); + } } if ( mtce_event.fd ) { @@ -1838,7 +1854,8 @@ void daemon_service_run ( void ) mlog3 ("events handling done"); } - if ( mtc_sock.pxeboot_rx_socket && FD_ISSET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds)) + if (( mtcInv.pxeboot_network_provisioned == true ) && + ( mtc_sock.pxeboot_rx_socket && FD_ISSET(mtc_sock.pxeboot_rx_socket, &mtc_sock.readfds))) { int cnt = 0 ; /* Service up to MAX_RX_MSG_BATCH of messages at once */