Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforge.net>2011-03-15 05:20:58 +0300
committerJustin Maggard <jmaggard@users.sourceforge.net>2011-03-15 05:20:58 +0300
commit9b80bd977a7292e0af32322eda86eebfe3685abe (patch)
tree332a05257d46240a224511148c76f153e3647b1b
parent227b0f03f0de21de755bb7c1ad8cea9d9dbb194d (diff)
* Ignore SSDP M-SEARCH packets from interfaces not in our list.
-rw-r--r--minissdp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/minissdp.c b/minissdp.c
index 94a5546..72cc201 100644
--- a/minissdp.c
+++ b/minissdp.c
@@ -421,10 +421,6 @@ ProcessSSDPRequest(int s, unsigned short port)
}
else if( st && (st_len > 0) )
{
- DPRINTF(E_INFO, L_SSDP, "SSDP M-SEARCH from %s:%d ST: %.*s, MX: %.*s, MAN: %.*s\n",
- inet_ntoa(sendername.sin_addr),
- ntohs(sendername.sin_port),
- st_len, st, mx_len, mx, man_len, man);
/* find in which sub network the client is */
for(i = 0; i<n_lan_addr; i++)
{
@@ -435,6 +431,16 @@ ProcessSSDPRequest(int s, unsigned short port)
break;
}
}
+ if( i == n_lan_addr )
+ {
+ DPRINTF(E_DEBUG, L_SSDP, "Ignoring SSDP M-SEARCH on other interface [%s]\n",
+ inet_ntoa(sendername.sin_addr));
+ return;
+ }
+ DPRINTF(E_INFO, L_SSDP, "SSDP M-SEARCH from %s:%d ST: %.*s, MX: %.*s, MAN: %.*s\n",
+ inet_ntoa(sendername.sin_addr),
+ ntohs(sendername.sin_port),
+ st_len, st, mx_len, mx, man_len, man);
/* Responds to request with a device as ST header */
for(i = 0; known_service_types[i]; i++)
{