netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] netlink: change nlmsg_notify() return value logic
Date: Wed, 25 Feb 2009 06:35:57 +0100	[thread overview]
Message-ID: <49A4D8BD.4090701@trash.net> (raw)
In-Reply-To: <20090225025502.4716.3568.stgit@Decadence>

Pablo Neira Ayuso wrote:
> This patch changes the return value of nlmsg_notify() as follows:
> 
> If NETLINK_BROADCAST_ERROR is set by any of the listeners and
> an error in the delivery happened, return the broadcast error;
> else if there are no listeners apart from the socket that
> requested a change with the echo flag, return the result of the
> unicast notification. Thus, with this patch, the unicast
> notification is handled in the same way of a broadcast listener
> that has set the NETLINK_BROADCAST_ERROR socket flag.

Seems reasonable.

> This patch is useful in case that the caller of nlmsg_notify()
> wants to know the result of the delivery of a netlink notification
> (including the broadcast delivery) and take any action in case
> that the delivery failed. For example, ctnetlink can drop packets
> if the event delivery failed to provide reliable logging and
> state-synchronization at the cost of dropping packets.
> 
> This patch also modifies the rtnetlink code to ignore the return
> value of rtnl_notify() in all callers. The function rtnl_notify()
> (before this patch) returned the error of the unicast notification
> which makes rtnl_set_sk_err() reports errors to all listeners. This
> is not of any help since the origin of the change (the socket that
> requested the echoing) notices the ENOBUFS error if the notification
> fails and should resync itself.

Also makes sense.

Acked-by: Patrick McHardy <kaber@trash.net>

  reply	other threads:[~2009-02-25  5:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25  2:55 [PATCH] netlink: change nlmsg_notify() return value logic Pablo Neira Ayuso
2009-02-25  5:35 ` Patrick McHardy [this message]
2009-02-25  7:18   ` David Miller

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=49A4D8BD.4090701@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).