]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Fix ClientIP info in metadata 429/head 430/head
authorjneubrand <johannes_n@icloud.com>
Thu, 24 Nov 2016 19:41:51 +0000 (11:41 -0800)
committerjneubrand <johannes_n@icloud.com>
Thu, 24 Nov 2016 19:41:51 +0000 (11:41 -0800)
Metadata was previously reporting server ip as client ip "ssnc-clip".
Fixed by:
- providing remote_ip data instead of ip data for metadata in rtsp.c
- continuing export of ip data under "ssnc-svip" metadata tag

rtsp.c

diff --git a/rtsp.c b/rtsp.c
index feb11c27321ca7facc91ba6af0475fbc7e5130cf..38b07453990358e282c5662d3c9da7e9f0c1570f 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -1954,7 +1954,8 @@ void rtsp_listen_loop(void) {
           inet_ntop(AF_INET, &(sa->sin_addr), remote_ip4, INET_ADDRSTRLEN);
           unsigned short int rport = ntohs(sa->sin_port);
 #ifdef CONFIG_METADATA
-               send_ssnc_metadata('clip', strdup(ip4), strlen(ip4) , 1);
+               send_ssnc_metadata('clip', strdup(remote_ip4), strlen(remote_ip4) , 1);
+               send_ssnc_metadata('svip', strdup(ip4), strlen(ip4) , 1);
 #endif
 
           debug(1,"New RTSP connection from %s:%u to self at %s:%u.",remote_ip4,rport,ip4,tport);
@@ -1973,7 +1974,8 @@ void rtsp_listen_loop(void) {
           inet_ntop(AF_INET6, &(sa6->sin6_addr), remote_ip6, INET6_ADDRSTRLEN);
           u_int16_t rport = ntohs(sa6->sin6_port);
 #ifdef CONFIG_METADATA
-               send_ssnc_metadata('clip', strdup(ip6), strlen(ip6), 1);
+               send_ssnc_metadata('clip', strdup(remote_ip6), strlen(remote_ip6), 1);
+               send_ssnc_metadata('svip', strdup(ip6), strlen(ip6), 1);
 #endif
           debug(1,"New RTSP connection from [%s]:%u to self at [%s]:%u.",remote_ip6,rport,ip6,tport);
         }