Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: Problem receiving UDP broadcast packets. Date: Wed, 20 Apr 2011 22:25:49 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 30 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader1.panix.com 1303338349 4900 64.122.56.22 (20 Apr 2011 22:25:49 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 20 Apr 2011 22:25:49 +0000 (UTC) User-Agent: slrn/pre0.9.9-102 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3755 On 2011-04-19, Grant Edwards wrote: > I'm have problems figuring out how to receive UDP broadcast packets on > Linux. Thanks to everybody for their help with what turned out to have little or nothing to do with Python itself. The main problem was reverse-path filtering (which is enabled by default on Linux). Disabling it allowed me to receive packets sent to 255.255.255.255 regardless of the sender's IP address. Another minor issue that cropped up was that I ended up having to use two sockets: an Rx socket bound to ('',port) and a Tx socket bound to (myip,port). Even though the protocol spec said that subnet broadcasts were used, tracing a few transactions between existing implementations showed that only global broadcasts were used. More testing showed that existing implementations won't respond to subnet broadcasts unless they're already configured to be on the proper subnet. So, receiving subnet broadcasts that don't match an interface turned out to be a wild goose chase. It's all working now... -- Grant Edwards grant.b.edwards Yow! Everywhere I look I at see NEGATIVITY and ASPHALT gmail.com ...