From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Wed, 3 Aug 2022 11:53:06 +0000 (+0100) Subject: Ensure player's IP is first in the perer list. Will be duplicated but that's okay. X-Git-Tag: 4.1-rc1~24^2~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bc480b3fc82ae64bf6b7658c2f4b9cac9caa9be;p=thirdparty%2Fshairport-sync.git Ensure player's IP is first in the perer list. Will be duplicated but that's okay. --- diff --git a/rtsp.c b/rtsp.c index 076a20d7..767e2804 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2439,6 +2439,12 @@ void handle_setpeers(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp char timing_list_message[4096]; timing_list_message[0] = 'T'; timing_list_message[1] = 0; + + // ensure the client itself is first -- it's okay if it's duplicated later + strncat(timing_list_message, " ", + sizeof(timing_list_message) - 1 - strlen(timing_list_message)); + strncat(timing_list_message, (const char *)&conn->client_ip_string, + sizeof(timing_list_message) - 1 - strlen(timing_list_message)); plist_t addresses_array = NULL; plist_from_memory(req->content, req->contentlength, &addresses_array); @@ -2802,6 +2808,13 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp) timing_list_message[0] = 'T'; timing_list_message[1] = 0; + // ensure the client itself is first -- it's okay if it's duplicated later + strncat(timing_list_message, " ", + sizeof(timing_list_message) - 1 - strlen(timing_list_message)); + strncat(timing_list_message, (const char *)&conn->client_ip_string, + sizeof(timing_list_message) - 1 - strlen(timing_list_message)); + + plist_t timing_peer_info = plist_dict_get_item(messagePlist, "timingPeerInfo"); if (timing_peer_info) { // first, get the incoming plist.