File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ void loginToGetServerMAC(uint8_t recv_data[]) {
379379 // 初始化服务器MAC地址
380380 memcpy (EthHeader , recv_data + 6 , 6 );
381381 if (auth_8021x_Handler (recv_data ))
382- exit (EXIT_FAILURE ); //这里不需要考虑重拨的问题,正常第一个请求是Identity,不会失败。
382+ exit_with_hook (EXIT_FAILURE ); //这里不需要考虑重拨的问题,正常第一个请求是Identity,不会失败。
383383 return ;
384384 } else {
385385 continue ;
@@ -391,7 +391,7 @@ void loginToGetServerMAC(uint8_t recv_data[]) {
391391 LogWrite (DOT1X , ERROR , "Error! No Response" );
392392 // 确保下线
393393 auth_8021x_Logoff ();
394- exit (EXIT_FAILURE );
394+ exit_with_hook (EXIT_FAILURE );
395395 }
396396
397397 times -- ;
@@ -644,7 +644,7 @@ int auth_8021x_Handler(uint8_t recv_data[]) {
644644 return 1 ;
645645 } else {
646646 LogWrite (DOT1X , ERROR , "Reconnection failed. Server: errtype=0x%02hhx" , errtype );
647- exit (EXIT_FAILURE );
647+ exit_with_hook (EXIT_FAILURE );
648648 }
649649 } else if ((EAP_Code ) recv_data [18 ] == SUCCESS ) {
650650 LogWrite (DOT1X , INF , "Server: Success." );
@@ -669,3 +669,9 @@ int auth_8021x_Handler(uint8_t recv_data[]) {
669669 }
670670 return 0 ;
671671}
672+
673+ void exit_with_hook (int a ) {
674+ if (OfflineHookCmd )
675+ system (OfflineHookCmd );
676+ exit (a );
677+ }
Original file line number Diff line number Diff line change @@ -46,4 +46,4 @@ int Drcom_UDP_Handler(uint8_t *recv_data);
4646void initAuthenticationInfo ();
4747void loginToGetServerMAC (uint8_t recv_data []);
4848void printIfInfo ();
49-
49+ void exit_with_hook ( int a );
You can’t perform that action at this time.
0 commit comments