diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-06-16 02:48:24 -0400 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-09-04 18:20:54 -0400 |
commit | 44e65c1ef1e771b32c82546ebfba910137aa8871 (patch) | |
tree | 57065e871b6d61abee61ce97238e71420d7d98df /net/sctp | |
parent | 425e0f685230986511b1fdf80340e2f28b214c5d (diff) |
sctp: check the unrecognized ASCONF parameter before access it
This patch fix to check the unrecognized ASCONF parameter before
access it.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index b7acc9ca793a..3d867ce0e5ec 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -2861,6 +2861,11 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2861 | addr_param = (union sctp_addr_param *) | 2861 | addr_param = (union sctp_addr_param *) |
2862 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); | 2862 | ((void *)asconf_param + sizeof(sctp_addip_param_t)); |
2863 | 2863 | ||
2864 | if (asconf_param->param_hdr.type != SCTP_PARAM_ADD_IP && | ||
2865 | asconf_param->param_hdr.type != SCTP_PARAM_DEL_IP && | ||
2866 | asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY) | ||
2867 | return SCTP_ERROR_UNKNOWN_PARAM; | ||
2868 | |||
2864 | switch (addr_param->v4.param_hdr.type) { | 2869 | switch (addr_param->v4.param_hdr.type) { |
2865 | case SCTP_PARAM_IPV6_ADDRESS: | 2870 | case SCTP_PARAM_IPV6_ADDRESS: |
2866 | if (!asoc->peer.ipv6_address) | 2871 | if (!asoc->peer.ipv6_address) |
@@ -2958,9 +2963,6 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2958 | 2963 | ||
2959 | sctp_assoc_set_primary(asoc, peer); | 2964 | sctp_assoc_set_primary(asoc, peer); |
2960 | break; | 2965 | break; |
2961 | default: | ||
2962 | return SCTP_ERROR_UNKNOWN_PARAM; | ||
2963 | break; | ||
2964 | } | 2966 | } |
2965 | 2967 | ||
2966 | return SCTP_ERROR_NO_ERROR; | 2968 | return SCTP_ERROR_NO_ERROR; |