]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Limit PTP addresses to configured network interface 1813/head
authorRyan Mounce <ryan@mounce.com.au>
Tue, 27 Feb 2024 11:28:06 +0000 (21:58 +1030)
committerRyan Mounce <ryan@mounce.com.au>
Tue, 27 Feb 2024 11:50:27 +0000 (22:20 +1030)
Otherwise every address on the system is advertised and AirPlay 2
sources will send PTP announce + signalling messages to all of them in
parallel.

rtsp.c

diff --git a/rtsp.c b/rtsp.c
index 3d6c5f48b634f68c5545eb336b6a0326c1111af1..5b9193740b00b395d704d765b829af1f9c462a67 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -3044,7 +3044,8 @@ void handle_setup_2(rtsp_conn_info *conn, rtsp_message *req, rtsp_message *resp)
                 // debug(1, "Interface index %d, name: \"%s\"",if_nametoindex(iap->ifa_name),
                 // iap->ifa_name);
                 if ((iap->ifa_addr) && (iap->ifa_netmask) && (iap->ifa_flags & IFF_UP) &&
-                    ((iap->ifa_flags & IFF_LOOPBACK) == 0)) {
+                    ((iap->ifa_flags & IFF_LOOPBACK) == 0) &&
+                   (config.interface == NULL || (strcmp(config.interface, iap->ifa_name) == 0))) {
                   char buf[INET6_ADDRSTRLEN + 1]; // +1 for a NUL
                   memset(buf, 0, sizeof(buf));
                   if (iap->ifa_addr->sa_family == AF_INET6) {