* Clean up a netlink socket once all communicating with the kernel is finished. * * @param[in] nlsk_fd * The netlink socket file descriptor used for communication. * * @return * 0 on success, -1 otherwise. */
| 93 | * 0 on success, -1 otherwise. |
| 94 | */ |
| 95 | int |
| 96 | tap_nl_final(int nlsk_fd) |
| 97 | { |
| 98 | if (close(nlsk_fd)) { |
| 99 | TAP_LOG(ERR, "Failed to close netlink socket: %s (%d)", |
| 100 | strerror(errno), errno); |
| 101 | return -1; |
| 102 | } |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Send a message to the kernel on the netlink socket. |
no test coverage detected