Skip to content

Commit 07ca189

Browse files
committed
Make code using getifaddrs uncancellable to prevent a "Unexpected error 9 on netlink descriptor" error.
1 parent 93a7aef commit 07ca189

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

rtsp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,6 +2828,8 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
28282828
plist_array_append_item(addresses, plist_new_string(conn->self_ip_string));
28292829
// debug(1,"self ip: \"%s\"", conn->self_ip_string);
28302830

2831+
int oldState;
2832+
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldState);
28312833
struct ifaddrs *addrs, *iap;
28322834
getifaddrs(&addrs);
28332835
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)
28622864
}
28632865
}
28642866
freeifaddrs(addrs);
2867+
pthread_setcancelstate(oldState, NULL);
28652868

28662869
// debug(1,"initial timing peer command: \"%s\".", timing_list_message);
28672870
// ptp_send_control_message_string(timing_list_message);

0 commit comments

Comments
 (0)