gtp: initial random seed for the hash tables
I think it's very hard to deploy any hashbomb attack since the entries are created via netlink, but let's just avoid that someone generates traffic to spend cycles on a busy hashtable chain.
This commit is contained in:
parent
bb8c47d957
commit
268455a2ae
5
gtp.c
5
gtp.c
|
@ -27,9 +27,6 @@
|
|||
#include "gtp.h"
|
||||
#include "gtp_nl.h"
|
||||
|
||||
/* implementation-specific definitions */
|
||||
|
||||
/* FIXME: initialize this !! */
|
||||
static uint32_t gtp_h_initval;
|
||||
|
||||
struct gsn {
|
||||
|
@ -1196,6 +1193,8 @@ static int __init gtp_init(void)
|
|||
{
|
||||
int err;
|
||||
|
||||
get_random_bytes(>p_h_initval, sizeof(gtp_h_initval));
|
||||
|
||||
err = genl_register_family_with_ops(>p_genl_family, gtp_genl_ops);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
Loading…
Reference in New Issue