Phoebe Buckheister wrote:
> For some reason, unconnected 802.15.4 dgram sockets ignore the destination
> argument of sendmsg(), while bound sockets use it. Instead, send packets
> to the destination given by the user, and default to the connected
> destination only if no explicit target is given.

We discussed this a bit on IRC. Here's what I think happened and what
happens with your patch. Before:

conn'ed msg_nam action
------- ------- ------------------------------------------
no      no      send to initialization value (= broadcast)
no      yes     idem
yes     no      send to connected address
yes     yes     idem

After your patch:

conn'ed msg_nam action
------- ------- ------------------------------------------
no      no      send to initialization value (= broadcast)
no      yes     send to msg_name
yes     no      send to connected address
yes     yes     send to msg_name

This is certainly more correct. Blurting out a broadcast in the
no/no case isn't nice, though. It would be better to return either
ENOTCONN (POSIX [1]) or (even better, according to GNU libc [2])
EDESTADDRREQ.

POSIX [1] says we may get EISCONN in the yes/yes case and the Linux
man page [3] says we either get EISCONN or the msg_name argument is
ignored. So that also doesn't look quite right yet.

- Werner

[1] http://pubs.opengroup.org/onlinepubs/007904975/
[2] http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
[3] man sendmsg

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to