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:
Guido Casati
2025-05-26 17:05:00 +02:00
parent ad2a8a8991
commit 844986ff92
3 changed files with 25 additions and 11 deletions
+1 -2
View File
@@ -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_*/