diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-02-12 00:15:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-12 16:05:11 -0500 |
commit | 570617e79c3ab31ce426efe9024af84efca862eb (patch) | |
tree | 7bafb469fa57e9fe475ae720ba83e24a1467d233 /net/sctp/endpointola.c | |
parent | 0790bbb68f9d483348c1d65381f3dd92602bfd05 (diff) |
net: sctp: remove unused multiple cookie keys
Vlad says: The whole multiple cookie keys code is completely unused
and has been all this time. Noone uses anything other then the
secret_key[0] since there is no changeover support anywhere.
Thus, for now clean up its left-over fragments.
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/endpointola.c')
-rw-r--r-- | net/sctp/endpointola.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c index 1a9c5fb77310..73aad3d16a45 100644 --- a/net/sctp/endpointola.c +++ b/net/sctp/endpointola.c | |||
@@ -151,9 +151,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, | |||
151 | ep->rcvbuf_policy = net->sctp.rcvbuf_policy; | 151 | ep->rcvbuf_policy = net->sctp.rcvbuf_policy; |
152 | 152 | ||
153 | /* Initialize the secret key used with cookie. */ | 153 | /* Initialize the secret key used with cookie. */ |
154 | get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE); | 154 | get_random_bytes(ep->secret_key, sizeof(ep->secret_key)); |
155 | ep->last_key = ep->current_key = 0; | ||
156 | ep->key_changed_at = jiffies; | ||
157 | 155 | ||
158 | /* SCTP-AUTH extensions*/ | 156 | /* SCTP-AUTH extensions*/ |
159 | INIT_LIST_HEAD(&ep->endpoint_shared_keys); | 157 | INIT_LIST_HEAD(&ep->endpoint_shared_keys); |
@@ -249,8 +247,6 @@ void sctp_endpoint_free(struct sctp_endpoint *ep) | |||
249 | /* Final destructor for endpoint. */ | 247 | /* Final destructor for endpoint. */ |
250 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | 248 | static void sctp_endpoint_destroy(struct sctp_endpoint *ep) |
251 | { | 249 | { |
252 | int i; | ||
253 | |||
254 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); | 250 | SCTP_ASSERT(ep->base.dead, "Endpoint is not dead", return); |
255 | 251 | ||
256 | /* Free up the HMAC transform. */ | 252 | /* Free up the HMAC transform. */ |
@@ -273,8 +269,7 @@ static void sctp_endpoint_destroy(struct sctp_endpoint *ep) | |||
273 | sctp_inq_free(&ep->base.inqueue); | 269 | sctp_inq_free(&ep->base.inqueue); |
274 | sctp_bind_addr_free(&ep->base.bind_addr); | 270 | sctp_bind_addr_free(&ep->base.bind_addr); |
275 | 271 | ||
276 | for (i = 0; i < SCTP_HOW_MANY_SECRETS; ++i) | 272 | memset(ep->secret_key, 0, sizeof(ep->secret_key)); |
277 | memset(&ep->secret_key[i], 0, SCTP_SECRET_SIZE); | ||
278 | 273 | ||
279 | /* Remove and free the port */ | 274 | /* Remove and free the port */ |
280 | if (sctp_sk(ep->base.sk)->bind_hash) | 275 | if (sctp_sk(ep->base.sk)->bind_hash) |