aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/associola.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/associola.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/associola.c')
-rw-r--r--net/sctp/associola.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 93a4513c85e0..b1ef3bc301a5 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -82,6 +82,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
82 sctp_scope_t scope, 82 sctp_scope_t scope,
83 gfp_t gfp) 83 gfp_t gfp)
84{ 84{
85 struct net *net = sock_net(sk);
85 struct sctp_sock *sp; 86 struct sctp_sock *sp;
86 int i; 87 int i;
87 sctp_paramhdr_t *p; 88 sctp_paramhdr_t *p;
@@ -124,7 +125,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
124 * socket values. 125 * socket values.
125 */ 126 */
126 asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt; 127 asoc->max_retrans = sp->assocparams.sasoc_asocmaxrxt;
127 asoc->pf_retrans = sctp_pf_retrans; 128 asoc->pf_retrans = net->sctp.pf_retrans;
128 129
129 asoc->rto_initial = msecs_to_jiffies(sp->rtoinfo.srto_initial); 130 asoc->rto_initial = msecs_to_jiffies(sp->rtoinfo.srto_initial);
130 asoc->rto_max = msecs_to_jiffies(sp->rtoinfo.srto_max); 131 asoc->rto_max = msecs_to_jiffies(sp->rtoinfo.srto_max);
@@ -175,7 +176,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
175 asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; 176 asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0;
176 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay; 177 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay;
177 asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = 178 asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] =
178 min_t(unsigned long, sp->autoclose, sctp_max_autoclose) * HZ; 179 min_t(unsigned long, sp->autoclose, net->sctp.max_autoclose) * HZ;
179 180
180 /* Initializes the timers */ 181 /* Initializes the timers */
181 for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) 182 for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i)
@@ -281,7 +282,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
281 * and will revert old behavior. 282 * and will revert old behavior.
282 */ 283 */
283 asoc->peer.asconf_capable = 0; 284 asoc->peer.asconf_capable = 0;
284 if (sctp_addip_noauth) 285 if (net->sctp.addip_noauth)
285 asoc->peer.asconf_capable = 1; 286 asoc->peer.asconf_capable = 1;
286 asoc->asconf_addr_del_pending = NULL; 287 asoc->asconf_addr_del_pending = NULL;
287 asoc->src_out_of_asoc_ok = 0; 288 asoc->src_out_of_asoc_ok = 0;
@@ -1418,6 +1419,7 @@ void sctp_assoc_sync_pmtu(struct sock *sk, struct sctp_association *asoc)
1418/* Should we send a SACK to update our peer? */ 1419/* Should we send a SACK to update our peer? */
1419static inline int sctp_peer_needs_update(struct sctp_association *asoc) 1420static inline int sctp_peer_needs_update(struct sctp_association *asoc)
1420{ 1421{
1422 struct net *net = sock_net(asoc->base.sk);
1421 switch (asoc->state) { 1423 switch (asoc->state) {
1422 case SCTP_STATE_ESTABLISHED: 1424 case SCTP_STATE_ESTABLISHED:
1423 case SCTP_STATE_SHUTDOWN_PENDING: 1425 case SCTP_STATE_SHUTDOWN_PENDING:
@@ -1425,7 +1427,7 @@ static inline int sctp_peer_needs_update(struct sctp_association *asoc)
1425 case SCTP_STATE_SHUTDOWN_SENT: 1427 case SCTP_STATE_SHUTDOWN_SENT:
1426 if ((asoc->rwnd > asoc->a_rwnd) && 1428 if ((asoc->rwnd > asoc->a_rwnd) &&
1427 ((asoc->rwnd - asoc->a_rwnd) >= max_t(__u32, 1429 ((asoc->rwnd - asoc->a_rwnd) >= max_t(__u32,
1428 (asoc->base.sk->sk_rcvbuf >> sctp_rwnd_upd_shift), 1430 (asoc->base.sk->sk_rcvbuf >> net->sctp.rwnd_upd_shift),
1429 asoc->pathmtu))) 1431 asoc->pathmtu)))
1430 return 1; 1432 return 1;
1431 break; 1433 break;