linux/net
David S. Miller e79ad711a0 [NET]: Zero length write() on socket should not simply return 0.
This fixes kernel bugzilla #5731

It should generate an empty packet for datagram protocols when the
socket is connected, for one.

The check is doubly-wrong because all that a write() can be is a
sendmsg() call with a NULL msg_control and a single entry iovec.  No
special semantics should be assigned to it, therefore the zero length
check should be removed entirely.

This matches the behavior of BSD and several other systems.

Alan Cox notes that SuSv3 says the behavior of a zero length write on
non-files is "unspecified", but that's kind of useless since BSD has
defined this behavior for a quarter century and BSD is essentially
what application folks code to.

Based upon a patch from Stephen Hemminger.

Signed-off-by: David S. Miller <davem@davemloft.net>
2007-09-27 13:52:00 -07:00
..
9p 9p: fix bad error path in conversion routines 2007-08-23 10:25:05 -05:00
802 [SNAP]: Check packet length before reading 2007-08-21 20:58:13 -07:00
8021q [VLAN]: Fix net_device leak. 2007-09-16 16:43:04 -07:00
appletalk
atm [ATM]: Clean up duplicate includes in net/atm/ 2007-08-13 22:52:01 -07:00
ax25 [AX25]: don't free pointers to statically allocated data 2007-08-14 17:24:05 -07:00
bluetooth [BLUETOOTH]: Fix non-COMPAT build of hci_sock.c 2007-09-12 14:10:58 +02:00
bridge [NET] skbuff: Add skb_cow_head 2007-09-16 16:21:16 -07:00
core [PKTGEN]: srcmac fix 2007-09-16 14:52:15 -07:00
dccp [DCCP]: Allocation in atomic context 2007-08-21 20:58:06 -07:00
decnet [DECNET]: Fix interface address listing regression. 2007-09-11 10:45:15 +02:00
econet [ECONET]: remove econet_packet_type on unload 2007-08-14 17:25:20 -07:00
ethernet
ieee80211 [PATCH] softmac: Fix inability to associate with WEP networks 2007-09-21 11:26:33 -04:00
ipv4 [IPV4]: Just increment OutDatagrams once per a datagram. 2007-09-14 17:15:19 -07:00
ipv6 [IPV6]: Fix source address selection. 2007-09-16 14:48:21 -07:00
ipx
irda [IRDA] irda_nl_get_mode: always results in failure 2007-08-21 21:23:39 -07:00
iucv
key [PF_KEY]: Fix ipsec not working in 2.6.23-rc1-git10 2007-08-02 19:42:29 -07:00
lapb
llc
mac80211 [PATCH] mac80211: fix initialisation when built-in 2007-09-25 22:55:45 -07:00
netfilter [NETFILTER]: nfnetlink_log: fix sending of multipart messages 2007-09-20 12:13:52 -07:00
netlabel [NetLabel]: add missing rcu_dereference() calls in the LSM domain mapping hash table 2007-08-07 17:53:10 -07:00
netlink
netrom
packet
rfkill
rose
rxrpc
sched [PKT_SCHED]: Fix 'SFQ qdisc crashes with limit of 2 packets' 2007-09-20 12:14:08 -07:00
sctp fix sctp_del_bind_addr() last argument type 2007-09-26 09:22:04 -07:00
sunrpc rpc: fix garbage in printk in svc_tcp_accept() 2007-09-20 13:15:57 -07:00
tipc [TIPC]: Clean up duplicate includes in net/tipc/ 2007-08-13 22:52:07 -07:00
unix [AF_UNIX]: Make code static. 2007-07-31 02:28:27 -07:00
wanrouter [NET]: Removal of duplicated include net/wanrouter/wanmain.c 2007-08-02 19:42:22 -07:00
wireless [PATCH] cfg80211: fix initialisation if built-in 2007-09-25 22:55:44 -07:00
x25
xfrm [XFRM]: Clean up duplicate includes in net/xfrm/ 2007-08-13 22:52:08 -07:00
Kconfig
Makefile
TUNABLE
compat.c
nonet.c
socket.c [NET]: Zero length write() on socket should not simply return 0. 2007-09-27 13:52:00 -07:00
sysctl_net.c