android_kernel_motorola_sm6225/net
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
..
9p net/9p: fid->fid is used uninitialized 2009-01-19 16:20:15 -08:00
802 net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
8021q net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
appletalk net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
atm lec: convert to net_device_ops 2009-01-21 14:02:00 -08:00
ax25 net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
bluetooth bluetooth: driver API update 2009-01-07 17:23:17 -08:00
bridge net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
can net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
core gro: Fix frag_list merging on imprecisely split packets 2009-02-05 21:26:52 -08:00
dcb DCB: fix kfree(skb) 2009-01-04 17:29:21 -08:00
dccp dccp: Debugging functions for feature negotiation 2009-01-21 14:34:05 -08:00
decnet net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
dsa net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
econet net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
ethernet eth: Declare an optimized compare_ether_addr_64bits() function 2008-11-23 23:24:32 -08:00
ipv4 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-02-03 00:15:35 -08:00
ipv6 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-02-03 00:15:35 -08:00
ipx net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
irda net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
iucv s390: remove s390_root_dev_*() 2009-01-06 10:44:34 -08:00
key af_key: initialize xfrm encap_oa 2009-01-25 20:49:14 -08:00
lapb [LAPB] net/lapb/lapb_iface.c: use LIST_HEAD instead of LIST_HEAD_INIT 2008-01-28 14:56:52 -08:00
llc net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
mac80211 mac80211: Cancel the dynamic ps timer in ioctl_siwpower. 2009-01-30 13:38:28 -05:00
netfilter net: Partially allow skb destructors to be used on receive path 2009-02-04 16:55:27 -08:00
netlabel netlabel: Update kernel configuration API 2008-12-31 12:54:11 -05:00
netlink netlink: change return-value logic of netlink_broadcast() 2009-02-05 23:56:36 -08:00
netrom netrom: convert to net_device_ops 2009-01-21 14:02:02 -08:00
packet net: packet socket packet_lookup_frame fix 2009-02-01 01:53:29 -08:00
phonet net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
rfkill net/rfkill/rfkill.c: fix unused rfkill_led_trigger() warning 2009-01-04 17:11:24 -08:00
rose rose: convert to network_device_ops 2009-01-21 14:02:04 -08:00
rxrpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2008-12-28 12:49:40 -08:00
sched pkt_sched: sch_htb: Use workqueue to schedule after too many events. 2009-02-01 01:13:22 -08:00
sctp net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
sunrpc sunrpc: fix rdma dependencies 2009-02-03 15:20:13 -08:00
tipc net/tipc/bcast.h: use ARRAY_SIZE 2009-01-11 00:06:33 -08:00
unix introduce new LSM hooks where vfsmount is available. 2008-12-31 18:07:37 -05:00
wanrouter netdevice wanrouter: Convert directly reference of netdev->priv 2008-11-20 04:26:21 -08:00
wimax netlink: change return-value logic of netlink_broadcast() 2009-02-05 23:56:36 -08:00
wireless Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-02-03 12:41:58 -08:00
x25 net: replace uses of __constant_{endian} 2009-02-01 00:45:17 -08:00
xfrm Revert "xfrm: For 32/64 compatability wrt. xfrm_usersa_info" 2009-01-20 09:49:51 -08:00
compat.c reintroduce accept4 2008-11-19 18:49:57 -08:00
Kconfig Phonet: move to Networking options like other protocol stacks 2009-01-26 21:03:33 -08:00
Makefile wimax: Makefile, Kconfig and docbook linkage for the stack 2009-01-07 10:00:17 -08:00
nonet.c
socket.c [CVE-2009-0029] System call wrappers part 22 2009-01-14 14:15:27 +01:00
sysctl_net.c missing bits of net-namespace / sysctl 2008-07-27 09:45:34 -07:00
TUNABLE