linux/net
Eric Dumazet 9088c56095 udp: Improve port randomization
Current UDP port allocation is suboptimal.
We select the shortest chain to chose a port (out of 512)
that will hash in this shortest chain.

First, it can lead to give not so ramdom ports and ease
give attackers more opportunities to break the system.

Second, it can consume a lot of CPU to scan all table
in order to find the shortest chain.

Third, in some pathological cases we can fail to find
a free port even if they are plenty of them.

This patch zap the search for a short chain and only
use one random seed. Problem of getting long chains
should be addressed in another way, since we can
obtain long chains with non random ports.

Based on a report and patch from Vitaly Mayatskikh

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-08 11:44:17 -07:00
..
9p
802
8021q
appletalk
atm
ax25
bluetooth
bridge netfilter: xtables: provide invoked family value to extensions 2008-10-08 11:35:20 +02:00
can
core netns: export netns list 2008-10-08 11:35:06 +02:00
dccp ipv6: added net argument to ICMP6_INC_STATS_BH 2008-10-08 11:14:13 -07:00
decnet
econet
ethernet
ieee80211
ipv4 udp: Improve port randomization 2008-10-08 11:44:17 -07:00
ipv6 tcp: fix length used for checksum in a reset 2008-10-08 11:34:06 -07:00
ipx
irda
iucv
key xfrm: MIGRATE enhancements (draft-ebalard-mext-pfkey-enhanced-migrate) 2008-10-05 13:33:42 -07:00
lapb
llc
mac80211 mac80211: avoid "Wireless Event too big" message for assoc response 2008-10-06 19:37:33 -04:00
netfilter netfilter: xtables: remove bogus mangle table dependency of connmark 2008-10-08 11:35:20 +02:00
netlabel
netlink
netrom
packet
phonet
rfkill rfkill: update LEDs for all state changes 2008-10-06 18:14:57 -04:00
rose
rxrpc
sched pkt_sched: Update qdisc requeue stats in dev_requeue_skb() 2008-10-08 11:36:22 -07:00
sctp ipv6: added net argument to ICMP6_INC_STATS_BH 2008-10-08 11:14:13 -07:00
sunrpc
tipc
unix
wanrouter
wireless wireless: fix typo in Kconfig. 2008-10-06 18:14:56 -04:00
x25
xfrm xfrm: MIGRATE enhancements (draft-ebalard-mext-pfkey-enhanced-migrate) 2008-10-05 13:33:42 -07:00
compat.c
Kconfig
Makefile
nonet.c
socket.c
sysctl_net.c
TUNABLE