SDAP: close TUN socket to unblock thread and clean interface shutdown
* Close entity->pdusession_sock manually before pthread_join() to unblock sdap_tun_read_thread() * Update tun_destroy() to open a fresh socket for interface management, independent from the data socket * Fix check on success of change_interface_state() in tun_destroy(): is a boolean * Handle ENODEV error when bringing interface down: treat as success if the interface is already gone. * tun_destroy() is now handling INTERFACE_DOWN, so `INTERFACE_DOWN` in `tun_config()` is no longer needed
This commit is contained in:
@@ -84,8 +84,7 @@ int tun_alloc(const char *dev);
|
||||
/*!
|
||||
* \brief This function destroys the TUN interface
|
||||
* \param[in] dev name of the interface
|
||||
* \param[in] fd file descriptor of the allocated interface
|
||||
*/
|
||||
void tun_destroy(const char *dev, int fd);
|
||||
void tun_destroy(const char *dev);
|
||||
|
||||
#endif /*TUN_IF_H_*/
|
||||
|
||||
Reference in New Issue
Block a user