diff options
author | Justin Maggard <jmaggard@users.sourceforge.net> | 2011-03-15 05:20:58 +0300 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforge.net> | 2011-03-15 05:20:58 +0300 |
commit | 9b80bd977a7292e0af32322eda86eebfe3685abe (patch) | |
tree | 332a05257d46240a224511148c76f153e3647b1b | |
parent | 227b0f03f0de21de755bb7c1ad8cea9d9dbb194d (diff) |
* Ignore SSDP M-SEARCH packets from interfaces not in our list.
-rw-r--r-- | minissdp.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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++) { |