]> Pileus Git - ~andy/linux/blobdiff - net/ipv4/sysctl_net_ipv4.c
tcp: switch tcp_fastopen key generation to net_get_random_once
[~andy/linux] / net / ipv4 / sysctl_net_ipv4.c
index c08f096d46b5ec83f379e84e6a5bd32e0088c22f..4b161d5aba0b4123e027015a31c6214d501cee4a 100644 (file)
@@ -274,6 +274,11 @@ static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
                        ret = -EINVAL;
                        goto bad_key;
                }
+               /* Generate a dummy secret but don't publish it. This
+                * is needed so we don't regenerate a new key on the
+                * first invocation of tcp_fastopen_cookie_gen
+                */
+               tcp_fastopen_init_key_once(false);
                tcp_fastopen_reset_cipher(user_key, TCP_FASTOPEN_KEY_LENGTH);
        }