linux/net/wimax
Pablo Neira Ayuso ff491a7334 netlink: change return-value logic of netlink_broadcast()
Currently, netlink_broadcast() reports errors to the caller if no
messages at all were delivered:

1) If, at least, one message has been delivered correctly, returns 0.
2) Otherwise, if no messages at all were delivered due to skb_clone()
   failure, return -ENOBUFS.
3) Otherwise, if there are no listeners, return -ESRCH.

With this patch, the caller knows if the delivery of any of the
messages to the listeners have failed:

1) If it fails to deliver any message (for whatever reason), return
   -ENOBUFS.
2) Otherwise, if all messages were delivered OK, returns 0.
3) Otherwise, if no listeners, return -ESRCH.

In the current ctnetlink code and in Netfilter in general, we can add
reliable logging and connection tracking event delivery by dropping the
packets whose events were not successfully delivered over Netlink. Of
course, this option would be settable via /proc as this approach reduces
performance (in terms of filtered connections per seconds by a stateful
firewall) but providing reliable logging and event delivery (for
conntrackd) in return.

This patch also changes some clients of netlink_broadcast() that
may report ENOBUFS errors via printk. This error handling is not
of any help. Instead, the userspace daemons that are listening to
those netlink messages should resync themselves with the kernel-side
if they hit ENOBUFS.

BTW, netlink_broadcast() clients include those that call
cn_netlink_send(), nlmsg_multicast() and genlmsg_multicast() since they
internally call netlink_broadcast() and return its error value.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-05 23:56:36 -08:00
..
debug-levels.h
debugfs.c wimax: fix build issue when debugfs is disabled 2009-01-29 17:18:31 -08:00
id-table.c wimax: fix '#ifndef CONFIG_BUG' layout to avoid warning 2009-01-08 11:06:48 -08:00
Kconfig wimax: fix kconfig interactions with rfkill and input layers 2009-01-08 11:07:36 -08:00
Makefile wimax: Makefile, Kconfig and docbook linkage for the stack 2009-01-07 10:00:17 -08:00
op-msg.c netlink: change return-value logic of netlink_broadcast() 2009-02-05 23:56:36 -08:00
op-reset.c wimax: basic API: kernel/user messaging, rfkill and reset 2009-01-07 10:00:17 -08:00
op-rfkill.c wimax: testing for rfkill support should also test for CONFIG_RFKILL_MODULE 2009-01-08 11:08:01 -08:00
stack.c netlink: change return-value logic of netlink_broadcast() 2009-02-05 23:56:36 -08:00
wimax-internal.h