All of lore.kernel.org
 help / color / mirror / Atom feed
From: Werner Almesberger <werner-SEdMjqphH88wryQfseakQg@public.gmane.org>
To: Phoebe Buckheister
	<phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH net-next 4/5] ieee802154: don't ignore "to" argument in unbound dgram sendmsg
Date: Tue, 13 May 2014 17:13:40 -0300	[thread overview]
Message-ID: <20140513201340.GB12817@ws> (raw)
In-Reply-To: <1400001846-5349-5-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>

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

  parent reply	other threads:[~2014-05-13 20:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 17:24 [PATCH net-next 0/5] 802154: some cleanups and fixes Phoebe Buckheister
2014-05-13 17:24 ` [PATCH net-next 1/5] ieee802154: add definitions for link-layer security and header functions Phoebe Buckheister
2014-05-13 17:24 ` [PATCH net-next 2/5] 6lowpan: simplify/fix payload length calculation Phoebe Buckheister
     [not found]   ` <1400001846-5349-3-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2014-05-14  5:27     ` Alexander Aring
     [not found] ` <1400001846-5349-1-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2014-05-13 17:24   ` [PATCH net-next 3/5] ieee802154: change _cb handling slightly Phoebe Buckheister
2014-05-13 19:25     ` [Linux-zigbee-devel] " Werner Almesberger
2014-05-13 17:24   ` [PATCH net-next 4/5] ieee802154: don't ignore "to" argument in unbound dgram sendmsg Phoebe Buckheister
     [not found]     ` <1400001846-5349-5-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2014-05-13 20:13       ` Werner Almesberger [this message]
2014-05-13 20:25         ` [Linux-zigbee-devel] " Phoebe Buckheister
2014-05-13 17:24 ` [PATCH net-next 5/5] mac802154: make mac802154_wpan_open static Phoebe Buckheister

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140513201340.GB12817@ws \
    --to=werner-sedmjqphh88wryqfseakqg@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.