Problem receiving UDP broadcast packets.

Grant Edwards invalid at invalid.invalid
Wed Apr 20 10:31:41 EDT 2011


On 2011年04月20日, Dan Stromberg <drsalists at gmail.com> wrote:
> On Tue, Apr 19, 2011 at 6:15 PM, Grant Edwards <invalid at invalid.invalid> wrote:
>>>> Or can you simply use a stupid netmask like /1 that picks up all the
>>> IP ranges? That way, the source-IP check wouldn't fail.
>>>> That would require that the device somehow knows that it's not
>> configured correctly and should change the netmask to /1. ?The device
>> doesn't have any way to know that, and it must respond to the
>> discovery commands both before and after it's properly configured.
>> - Actually, you Might be able to configure your device to have a
> netmask of 0.0.0.0, IP address of 255.255.255.255 and broadcast of
> 255.255.255.255.
> - I've seen something a bit similar used for detecting IP address
> conflicts automatically.
> - A network guru I used to work with told me that you could configure
> a machine with a broadcast of 255.255.255.255 more simply than messing
> around with the netmask, while still achieving the same result for
> general purpose networking.

I'll look into that.
>> I've reread the protocol documentation and noticed that the device has
>> to respond not only to broadcasts to 255.255.255.255 but also to
>> subnet broadcasts send to subnets it's not on. ?That pretty much
>> clinches the requirement to use a raw socket. :/
>> With a netmask of 0.0.0.0, I suspect you will receive all broadcasts
> on the wire, given appropriate listening code.

That might be an option as well, as long as it doesn't disrupt normal
operation of the interface.
-- 
Grant Edwards grant.b.edwards Yow! Remember, in 2039,
 at MOUSSE & PASTA will
 gmail.com be available ONLY by
 prescription!!


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /