Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12333 closed Patch - Bug Fix (fixed)

SSDP (uPNP) requests ignored

Reported by: tcawlfield@… Owned by: dblain
Priority: minor Milestone: 0.27.5
Component: MythTV - UPnP Version: 0.27.4
Severity: medium Keywords: uPNP SSDP
Cc: Ticket locked: no


I am running a system with mythtv 0.27.4. Also on my LAN are two DirecTV satellite boxes and a PS3 which I use as a uPNP client. The DirecTV boxes send a spew of IGMP reports, one of which is from a spoofed IP address that's outside my LAN subnet. This triggers the "SSDP Reflection attempt" protection in patch 52cb0b5.

After that, all subsequent uPNP queries are ignored until I restart mythbackend. Specifically for me, this meant my PS3 would not recognize the mythtv server.

I tried patching ssdp.cpp with the latest patches, d20c163 and 02e92a2, and this caused all uPNP queries to be ignored (but a quieter logfile). But the last of these all but disables the previous protection patch. The only remaining effect was to move the assigments of:

QHostAddress  peerAddress = pSocket->peerAddress();
quint16       peerPort    = pSocket->peerPort   ();

outside of a loop over individual packets. I played with this a bit, putting the assignment back inside the packet loop, and came up with a solution that enables the protection code but does not disable future SSDP responses. I'm no expert with mythtv code, but what I have seems basically reasonable and appears to work well.

Attachments (1)

ssdp.patch (4.0 KB) - added by tcawlfield@… 6 years ago.
patch against libs/libmythupnp/ssdp.cpp, v 0.27.4

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by tcawlfield@…

Attachment: ssdp.patch added

patch against libs/libmythupnp/ssdp.cpp, v 0.27.4

comment:1 Changed 6 years ago by stuartm

That commit was reverted over a week ago. Have you tried upgrading to the latest -fixes?

comment:2 in reply to:  1 Changed 6 years ago by tcawlfield@…

Replying to stuartm:

That commit was reverted over a week ago. Have you tried upgrading to the latest -fixes?

Yes, I tried mythtv built with ssdp.cpp patched to the most recent commit 02e92a2. This no longer reported "SSDP Reflection attempt" messages, but it also failed to respond to any SSDP discovery requests. I tried two uPnP clients (PS3 and an Android app) without success. They do not see the mythtv box.

Commit 02e92a2 mostly reverts 52cb0b5, but still leaves the code (quoted in the original ticket) out of place, and still causes this uPnP regression on my system.

I might be seeing a bug that requires other network elements to trigger, specifically a class of satellite box that sends out bursts of SSDP announcements every minute. It's possible that this triggers the bug by putting multiple packets in the socket buffer at the time SSDP::ProcessData?() is called.

comment:3 Changed 6 years ago by Stuart Morgan <smorgan@…>

Resolution: fixed
Status: newclosed

In 40506c2ba7d81fa8e65bf8bb783c998ffe65c7af/mythtv:

SSDP: Missed changes when reverting [52cb0b5]

Fixes #12333

(cherry picked from commit 3461b407b0dd0f4188108395709eb129ec32e652)

comment:4 Changed 6 years ago by Karl Egly

Milestone: unknown0.27.5
Note: See TracTickets for help on using tickets.