dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/net/phonet
Pablo Neira Ayuso 1ce85fe402 netlink: change nlmsg_notify() return value logic
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.

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.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24 23:18:28 -08:00
..
Kconfig Phonet: add CONFIG_PHONET 2008-09-22 20:03:00 -07:00
Makefile Phonet: implement GPRS virtual interface over PEP socket 2008-10-05 11:16:16 -07:00
af_phonet.c net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
datagram.c Phonet: Phonet datagram transport protocol 2008-09-22 20:05:57 -07:00
pep-gprs.c Phonet: fix double free in GPRS outbound packet error path 2009-02-10 17:14:31 -08:00
pep.c Phonet: do not compute unused value 2009-02-10 17:14:50 -08:00
pn_dev.c Phonet: use per-namespace devices list 2009-01-26 21:03:35 -08:00
pn_netlink.c netlink: change nlmsg_notify() return value logic 2009-02-24 23:18:28 -08:00
socket.c Phonet: use atomic for packet TX window 2008-12-17 15:48:31 -08:00
sysctl.c net: Make static 2008-12-10 15:18:31 -08:00