From 07ca1891da589951380f257e76609f5915a68363 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 13 Apr 2026 16:31:32 +0100 Subject: [PATCH] Make code using getifaddrs uncancellable to prevent a "Unexpected error 9 on netlink descriptor" error. --- rtsp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtsp.c b/rtsp.c index 7da2ffaf..68ad798c 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2828,6 +2828,8 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) plist_array_append_item(addresses, plist_new_string(conn->self_ip_string)); // debug(1,"self ip: \"%s\"", conn->self_ip_string); + int oldState; + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState); struct ifaddrs *addrs, *iap; getifaddrs(&addrs); for (iap = addrs; iap != NULL; iap = iap->ifa_next) { @@ -2862,6 +2864,7 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) } } freeifaddrs(addrs); + pthread_setcancelstate(oldState, NULL); // debug(1,"initial timing peer command: \"%s\".", timing_list_message); // ptp_send_control_message_string(timing_list_message);