From: Jaroslav Kysela Date: Tue, 21 Nov 2017 10:11:50 +0000 (+0100) Subject: SAT>IP server: cleanups for addr/port send to clients (NAT) 2nd X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=00c02cbf9a9e8f34e0f00716eff3cef1390311dc;p=thirdparty%2Ftvheadend.git SAT>IP server: cleanups for addr/port send to clients (NAT) 2nd --- diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index 6672df2a2..e81ffd947 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -325,9 +325,7 @@ rtsp_conn_ip(http_connection_t *hc, char *buf, size_t buflen, int *port) int used_port = rtsp_port; if (rtsp_nat_ip[0] == '\0') - return rtsp_ip; - used_ip = rtsp_ip; - used_port = rtsp_port; + goto end; if (satip_server_conf.satip_nat_name_force || !ip_check_is_local_address(hc->hc_peer, hc->hc_self)) { used_ip = rtsp_nat_ip; @@ -340,7 +338,8 @@ rtsp_conn_ip(http_connection_t *hc, char *buf, size_t buflen, int *port) used_ip = buf; } - *port = used_port; +end: + *port = used_port > 0 ? used_port : 554; return used_ip; }