Commit f53b5b09 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by David S. Miller

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: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24cb81a6
...@@ -1410,9 +1410,9 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *, ...@@ -1410,9 +1410,9 @@ struct sctp_endpoint *sctp_endpoint_is_match(struct sctp_endpoint *,
int sctp_has_association(struct net *net, const union sctp_addr *laddr, int sctp_has_association(struct net *net, const union sctp_addr *laddr,
const union sctp_addr *paddr); const union sctp_addr *paddr);
int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
sctp_init_chunk_t *peer_init, struct sctp_chunk *chunk, sctp_cid_t, sctp_init_chunk_t *peer_init,
struct sctp_chunk **err_chunk); struct sctp_chunk *chunk, struct sctp_chunk **err_chunk);
int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk, int sctp_process_init(struct sctp_association *, struct sctp_chunk *chunk,
const union sctp_addr *peer, const union sctp_addr *peer,
sctp_init_chunk_t *init, gfp_t gfp); sctp_init_chunk_t *init, gfp_t gfp);
......
...@@ -1940,7 +1940,7 @@ static int sctp_process_hn_param(const struct sctp_association *asoc, ...@@ -1940,7 +1940,7 @@ static int sctp_process_hn_param(const struct sctp_association *asoc,
return 0; return 0;
} }
static int sctp_verify_ext_param(union sctp_params param) static int sctp_verify_ext_param(struct net *net, union sctp_params param)
{ {
__u16 num_ext = ntohs(param.p->length) - sizeof(sctp_paramhdr_t); __u16 num_ext = ntohs(param.p->length) - sizeof(sctp_paramhdr_t);
int have_auth = 0; int have_auth = 0;
...@@ -2081,7 +2081,8 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, ...@@ -2081,7 +2081,8 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
* SCTP_IERROR_ERROR - stop processing, trigger an ERROR * SCTP_IERROR_ERROR - stop processing, trigger an ERROR
* SCTP_IERROR_NO_ERROR - continue with the chunk * SCTP_IERROR_NO_ERROR - continue with the chunk
*/ */
static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc, static sctp_ierror_t sctp_verify_param(struct net *net,
const struct sctp_association *asoc,
union sctp_params param, union sctp_params param,
sctp_cid_t cid, sctp_cid_t cid,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
...@@ -2110,7 +2111,7 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc, ...@@ -2110,7 +2111,7 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
break; break;
case SCTP_PARAM_SUPPORTED_EXT: case SCTP_PARAM_SUPPORTED_EXT:
if (!sctp_verify_ext_param(param)) if (!sctp_verify_ext_param(net, param))
return SCTP_IERROR_ABORT; return SCTP_IERROR_ABORT;
break; break;
...@@ -2198,7 +2199,7 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc, ...@@ -2198,7 +2199,7 @@ static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc,
} }
/* Verify the INIT packet before we process it. */ /* Verify the INIT packet before we process it. */
int sctp_verify_init(const struct sctp_association *asoc, int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
sctp_cid_t cid, sctp_cid_t cid,
sctp_init_chunk_t *peer_init, sctp_init_chunk_t *peer_init,
struct sctp_chunk *chunk, struct sctp_chunk *chunk,
...@@ -2245,7 +2246,7 @@ int sctp_verify_init(const struct sctp_association *asoc, ...@@ -2245,7 +2246,7 @@ int sctp_verify_init(const struct sctp_association *asoc,
/* Verify all the variable length parameters */ /* Verify all the variable length parameters */
sctp_walk_params(param, peer_init, init_hdr.params) { sctp_walk_params(param, peer_init, init_hdr.params) {
result = sctp_verify_param(asoc, param, cid, chunk, errp); result = sctp_verify_param(net, asoc, param, cid, chunk, errp);
switch (result) { switch (result) {
case SCTP_IERROR_ABORT: case SCTP_IERROR_ABORT:
case SCTP_IERROR_NOMEM: case SCTP_IERROR_NOMEM:
......
...@@ -364,7 +364,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net, ...@@ -364,7 +364,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net,
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
/* This chunk contains fatal error. It is to be discarded. /* This chunk contains fatal error. It is to be discarded.
...@@ -531,7 +531,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, ...@@ -531,7 +531,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net,
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
...@@ -1429,7 +1429,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( ...@@ -1429,7 +1429,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
/* Verify the INIT chunk before processing it. */ /* Verify the INIT chunk before processing it. */
err_chunk = NULL; err_chunk = NULL;
if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type,
(sctp_init_chunk_t *)chunk->chunk_hdr, chunk, (sctp_init_chunk_t *)chunk->chunk_hdr, chunk,
&err_chunk)) { &err_chunk)) {
/* This chunk contains fatal error. It is to be discarded. /* This chunk contains fatal error. It is to be discarded.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment