diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2012-08-07 03:29:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-15 02:30:37 -0400 |
commit | f53b5b097e58361668b785eff9f7bcd12b4255ec (patch) | |
tree | 099cd45b14f4d259a48bd2b464ad3ed60002d840 /net/sctp | |
parent | 24cb81a6a91288fcba19548944729ea906eb5e2a (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')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 11 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 6 |
2 files changed, 9 insertions, 8 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 | ||
1943 | static int sctp_verify_ext_param(union sctp_params param) | 1943 | static 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 | */ |
2084 | static sctp_ierror_t sctp_verify_param(const struct sctp_association *asoc, | 2084 | static 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. */ |
2201 | int sctp_verify_init(const struct sctp_association *asoc, | 2202 | int 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: |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 19f3bff84193..e17ada47afc4 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -364,7 +364,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net, | |||
364 | 364 | ||
365 | /* Verify the INIT chunk before processing it. */ | 365 | /* Verify the INIT chunk before processing it. */ |
366 | err_chunk = NULL; | 366 | err_chunk = NULL; |
367 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, | 367 | if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type, |
368 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, | 368 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, |
369 | &err_chunk)) { | 369 | &err_chunk)) { |
370 | /* This chunk contains fatal error. It is to be discarded. | 370 | /* 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 | 531 | ||
532 | /* Verify the INIT chunk before processing it. */ | 532 | /* Verify the INIT chunk before processing it. */ |
533 | err_chunk = NULL; | 533 | err_chunk = NULL; |
534 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, | 534 | if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type, |
535 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, | 535 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, |
536 | &err_chunk)) { | 536 | &err_chunk)) { |
537 | 537 | ||
@@ -1429,7 +1429,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( | |||
1429 | 1429 | ||
1430 | /* Verify the INIT chunk before processing it. */ | 1430 | /* Verify the INIT chunk before processing it. */ |
1431 | err_chunk = NULL; | 1431 | err_chunk = NULL; |
1432 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, | 1432 | if (!sctp_verify_init(net, asoc, chunk->chunk_hdr->type, |
1433 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, | 1433 | (sctp_init_chunk_t *)chunk->chunk_hdr, chunk, |
1434 | &err_chunk)) { | 1434 | &err_chunk)) { |
1435 | /* This chunk contains fatal error. It is to be discarded. | 1435 | /* This chunk contains fatal error. It is to be discarded. |