aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-08-07 03:29:08 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-15 02:30:37 -0400
commitf53b5b097e58361668b785eff9f7bcd12b4255ec (patch)
tree099cd45b14f4d259a48bd2b464ad3ed60002d840 /net/sctp/sm_make_chunk.c
parent24cb81a6a91288fcba19548944729ea906eb5e2a (diff)
sctp: Push struct net down into sctp_verify_ext_param
Add struct net as a parameter to sctp_verify_param so it can be passed to sctp_verify_ext_param where struct net will be needed when the sctp tunables become per net tunables. Add struct net as a parameter to sctp_verify_init so struct net can be passed to sctp_verify_param. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index fb12835e95c2..a4b096f85a68 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1940,7 +1940,7 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
1940 return 0; 1940 return 0;
1941} 1941}
1942 1942
1943static int sctp_verify_ext_param(union sctp_params param) 1943static int sctp_verify_ext_param(struct net *net, union sctp_params param)
1944{ 1944{
1945 __u16 num_ext = ntohs(param.p->length) - sizeof(sctp_paramhdr_t); 1945 __u16 num_ext = ntohs(param.p->length) - sizeof(sctp_paramhdr_t);
1946 int have_auth = 0; 1946 int have_auth = 0;
@@ -2081,7 +2081,8 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
2081 * SCTP_IERROR_ERROR - stop processing, trigger an ERROR 2081 * SCTP_IERROR_ERROR - stop processing, trigger an ERROR
2082 * SCTP_IERROR_NO_ERROR - continue with the chunk 2082 * SCTP_IERROR_NO_ERROR - continue with the chunk
2083 */ 2083 */
2084static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc, 2084static sctp_ierror_t sctp_verify_param(struct net *net,
2085 const struct sctp_association *asoc,
2085 union sctp_params param, 2086 union sctp_params param,
2086 sctp_cid_t cid, 2087 sctp_cid_t cid,
2087 struct sctp_chunk *chunk, 2088 struct sctp_chunk *chunk,
@@ -2110,7 +2111,7 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
2110 break; 2111 break;
2111 2112
2112 case SCTP_PARAM_SUPPORTED_EXT: 2113 case SCTP_PARAM_SUPPORTED_EXT:
2113 if (!sctp_verify_ext_param(param)) 2114 if (!sctp_verify_ext_param(net, param))
2114 return SCTP_IERROR_ABORT; 2115 return SCTP_IERROR_ABORT;
2115 break; 2116 break;
2116 2117
@@ -2198,7 +2199,7 @@ fallthrough:
2198} 2199}
2199 2200
2200/* Verify the INIT packet before we process it. */ 2201/* Verify the INIT packet before we process it. */
2201int sctp_verify_init(const struct sctp_association *asoc, 2202int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
2202 sctp_cid_t cid, 2203 sctp_cid_t cid,
2203 sctp_init_chunk_t *peer_init, 2204 sctp_init_chunk_t *peer_init,
2204 struct sctp_chunk *chunk, 2205 struct sctp_chunk *chunk,
@@ -2245,7 +2246,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
2245 /* Verify all the variable length parameters */ 2246 /* Verify all the variable length parameters */
2246 sctp_walk_params(param, peer_init, init_hdr.params) { 2247 sctp_walk_params(param, peer_init, init_hdr.params) {
2247 2248
2248 result = sctp_verify_param(asoc, param, cid, chunk, errp); 2249 result = sctp_verify_param(net, asoc, param, cid, chunk, errp);
2249 switch (result) { 2250 switch (result) {
2250 case SCTP_IERROR_ABORT: 2251 case SCTP_IERROR_ABORT:
2251 case SCTP_IERROR_NOMEM: 2252 case SCTP_IERROR_NOMEM: