mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
[TCP/DCCP]: Randomize port selection
This patch randomizes the port selected on bind() for connections to help with possible security attacks. It should also be faster in most cases because there is no need for a global lock. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
parent
6151b31c96
commit
6df716340d
6 changed files with 10 additions and 56 deletions
|
@ -93,8 +93,6 @@ struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
|
|||
.lhash_lock = RW_LOCK_UNLOCKED,
|
||||
.lhash_users = ATOMIC_INIT(0),
|
||||
.lhash_wait = __WAIT_QUEUE_HEAD_INITIALIZER(tcp_hashinfo.lhash_wait),
|
||||
.portalloc_lock = SPIN_LOCK_UNLOCKED,
|
||||
.port_rover = 1024 - 1,
|
||||
};
|
||||
|
||||
static int tcp_v4_get_port(struct sock *sk, unsigned short snum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue