]> git.baikalelectronics.ru Git - kernel.git/commit
net: bind() fix error return on wrong address family
authorMarcus Meissner <meissner@novell.com>
Mon, 4 Jul 2011 01:30:29 +0000 (01:30 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2011 04:37:41 +0000 (21:37 -0700)
commit043446a8e9dc279d34b19ff4b861c5778e60d29b
treedea71c512c96728337724c8dbc012f74abb7ba27
parent7f088092d3c9cc064b2975e1ddddd8abbcc9261a
net: bind() fix error return on wrong address family

Hi,

Reinhard Max also pointed out that the error should EAFNOSUPPORT according
to POSIX.

The Linux manpages have it as EINVAL, some other OSes (Minix, HPUX, perhaps BSD) use
EAFNOSUPPORT. Windows uses WSAEFAULT according to MSDN.

Other protocols error values in their af bind() methods in current mainline git as far
as a brief look shows:
EAFNOSUPPORT: atm, appletalk, l2tp, llc, phonet, rxrpc
EINVAL: ax25, bluetooth, decnet, econet, ieee802154, iucv, netlink, netrom, packet, rds, rose, unix, x25,
No check?: can/raw, ipv6/raw, irda, l2tp/l2tp_ip

Ciao, Marcus

Signed-off-by: Marcus Meissner <meissner@suse.de>
Cc: Reinhard Max <max@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/af_inet.c
net/ipv6/af_inet6.c