aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/endpointola.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-07 03:29:57 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:32:16 -0400
commite1fc3b14f9a90d9591016749289f2c3d7b35fbf4 (patch)
tree709a6cfe1ac2d7164c9661a8c393a91d83ee6c85 /net/sctp/endpointola.c
parentf53b5b097e58361668b785eff9f7bcd12b4255ec (diff)
sctp: Make sysctl tunables per net
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/endpointola.c')
-rw-r--r--net/sctp/endpointola.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 8315792ef2ba..1859e2bc83d1 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -65,6 +65,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
65 struct sock *sk, 65 struct sock *sk,
66 gfp_t gfp) 66 gfp_t gfp)
67{ 67{
68 struct net *net = sock_net(sk);
68 struct sctp_hmac_algo_param *auth_hmacs = NULL; 69 struct sctp_hmac_algo_param *auth_hmacs = NULL;
69 struct sctp_chunks_param *auth_chunks = NULL; 70 struct sctp_chunks_param *auth_chunks = NULL;
70 struct sctp_shared_key *null_key; 71 struct sctp_shared_key *null_key;
@@ -74,7 +75,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
74 if (!ep->digest) 75 if (!ep->digest)
75 return NULL; 76 return NULL;
76 77
77 if (sctp_auth_enable) { 78 if (net->sctp.auth_enable) {
78 /* Allocate space for HMACS and CHUNKS authentication 79 /* Allocate space for HMACS and CHUNKS authentication
79 * variables. There are arrays that we encode directly 80 * variables. There are arrays that we encode directly
80 * into parameters to make the rest of the operations easier. 81 * into parameters to make the rest of the operations easier.
@@ -106,7 +107,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
106 /* If the Add-IP functionality is enabled, we must 107 /* If the Add-IP functionality is enabled, we must
107 * authenticate, ASCONF and ASCONF-ACK chunks 108 * authenticate, ASCONF and ASCONF-ACK chunks
108 */ 109 */
109 if (sctp_addip_enable) { 110 if (net->sctp.addip_enable) {
110 auth_chunks->chunks[0] = SCTP_CID_ASCONF; 111 auth_chunks->chunks[0] = SCTP_CID_ASCONF;
111 auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK; 112 auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
112 auth_chunks->param_hdr.length = 113 auth_chunks->param_hdr.length =
@@ -140,14 +141,14 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
140 INIT_LIST_HEAD(&ep->asocs); 141 INIT_LIST_HEAD(&ep->asocs);
141 142
142 /* Use SCTP specific send buffer space queues. */ 143 /* Use SCTP specific send buffer space queues. */
143 ep->sndbuf_policy = sctp_sndbuf_policy; 144 ep->sndbuf_policy = net->sctp.sndbuf_policy;
144 145
145 sk->sk_data_ready = sctp_data_ready; 146 sk->sk_data_ready = sctp_data_ready;
146 sk->sk_write_space = sctp_write_space; 147 sk->sk_write_space = sctp_write_space;
147 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); 148 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
148 149
149 /* Get the receive buffer policy for this endpoint */ 150 /* Get the receive buffer policy for this endpoint */
150 ep->rcvbuf_policy = sctp_rcvbuf_policy; 151 ep->rcvbuf_policy = net->sctp.rcvbuf_policy;
151 152
152 /* Initialize the secret key used with cookie. */ 153 /* Initialize the secret key used with cookie. */
153 get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE); 154 get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE);