Review Request 118870: LanLinkProvider: Bind the UDP server socket to Any, not Broadcast.

Raphael Kubo da Costa rakuco at FreeBSD.org
Mon Jun 23 13:07:16 UTC 2014



> On June 23, 2014, 3:47 p.m., Aleix Pol Gonzalez wrote:
> > But we're listening to broadcast addresses, the current code looks good. Maybe it would make sense to get an ifdef for the moment?

The point is that we shouldn't listen to the broadcast address, but rather to INADDR_ANY -- it's the sender side that is supposed to send its packets to the broadcast address. As far as I can see in Linux's ip(7), it just happens that "INADDR_BROADCAST (255.255.255.255) means any host and has the same effect on bind as INADDR_ANY for historical reasons". I'm not very familiar with these low-level differences, but from what I understand it just does not make much sense to bind() to INADDR_BROADCAST.


- Raphael


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118870/#review60793
-----------------------------------------------------------


On June 22, 2014, 4:44 p.m., Raphael Kubo da Costa wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118870/
> -----------------------------------------------------------
> 
> (Updated June 22, 2014, 4:44 p.m.)
> 
> 
> Review request for kdeconnect and Albert Vaca Cintora.
> 
> 
> Bugs: 324769
>     http://bugs.kde.org/show_bug.cgi?id=324769
> 
> 
> Repository: kdeconnect-kde
> 
> 
> Description
> -------
> 
> Trying to bind a UDP socket to 255.255.255.255 fails with EADDRNOTAVAIL at least on FreeBSD.
> 
> The sender side on Android should send its message in broadcast mode (as it already does), but the receiver side should bind to INADDR_ANY, not INADDR_BROADCAST.
> 
> 
> Diffs
> -----
> 
>   core/backends/lan/lanlinkprovider.cpp 2369dc4487c17a99215047c767dbe8232ded1d92 
> 
> Diff: https://git.reviewboard.kde.org/r/118870/diff/
> 
> 
> Testing
> -------
> 
> kdeconnectd no longer crashes on startup and I can pair my device on FreeBSD.
> 
> 
> Thanks,
> 
> Raphael Kubo da Costa
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20140623/93266b4e/attachment.html>


More information about the KDEConnect mailing list