diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2009-04-16 02:21:02 -0400 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-06-03 09:14:45 -0400 |
commit | 945e5abceef8bdb85d8455e7f9a3cd647dd8b156 (patch) | |
tree | 92f9381837c9c4aa1c4ffcccbeebe80818822d4f /net/sctp | |
parent | a987f762cafb25c0fedf88f15e328edd897210ed (diff) |
sctp: fix the error code when ASCONF is received with invalid address
Use Unresolvable Address error cause instead of Invalid Mandatory
Parameter error cause when process ASCONF chunk with invalid address
since address parameters are not mandatory in the ASCONF chunk.
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 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index c78e31b2e960..61cc6075b0df 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
@@ -2864,19 +2864,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2864 | switch (addr_param->v4.param_hdr.type) { | 2864 | switch (addr_param->v4.param_hdr.type) { |
2865 | case SCTP_PARAM_IPV6_ADDRESS: | 2865 | case SCTP_PARAM_IPV6_ADDRESS: |
2866 | if (!asoc->peer.ipv6_address) | 2866 | if (!asoc->peer.ipv6_address) |
2867 | return SCTP_ERROR_INV_PARAM; | 2867 | return SCTP_ERROR_DNS_FAILED; |
2868 | break; | 2868 | break; |
2869 | case SCTP_PARAM_IPV4_ADDRESS: | 2869 | case SCTP_PARAM_IPV4_ADDRESS: |
2870 | if (!asoc->peer.ipv4_address) | 2870 | if (!asoc->peer.ipv4_address) |
2871 | return SCTP_ERROR_INV_PARAM; | 2871 | return SCTP_ERROR_DNS_FAILED; |
2872 | break; | 2872 | break; |
2873 | default: | 2873 | default: |
2874 | return SCTP_ERROR_INV_PARAM; | 2874 | return SCTP_ERROR_DNS_FAILED; |
2875 | } | 2875 | } |
2876 | 2876 | ||
2877 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); | 2877 | af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); |
2878 | if (unlikely(!af)) | 2878 | if (unlikely(!af)) |
2879 | return SCTP_ERROR_INV_PARAM; | 2879 | return SCTP_ERROR_DNS_FAILED; |
2880 | 2880 | ||
2881 | af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0); | 2881 | af->from_addr_param(&addr, addr_param, htons(asoc->peer.port), 0); |
2882 | 2882 | ||
@@ -2886,7 +2886,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2886 | * make sure we check for that) | 2886 | * make sure we check for that) |
2887 | */ | 2887 | */ |
2888 | if (!af->is_any(&addr) && !af->addr_valid(&addr, NULL, asconf->skb)) | 2888 | if (!af->is_any(&addr) && !af->addr_valid(&addr, NULL, asconf->skb)) |
2889 | return SCTP_ERROR_INV_PARAM; | 2889 | return SCTP_ERROR_DNS_FAILED; |
2890 | 2890 | ||
2891 | switch (asconf_param->param_hdr.type) { | 2891 | switch (asconf_param->param_hdr.type) { |
2892 | case SCTP_PARAM_ADD_IP: | 2892 | case SCTP_PARAM_ADD_IP: |
@@ -2954,7 +2954,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, | |||
2954 | 2954 | ||
2955 | peer = sctp_assoc_lookup_paddr(asoc, &addr); | 2955 | peer = sctp_assoc_lookup_paddr(asoc, &addr); |
2956 | if (!peer) | 2956 | if (!peer) |
2957 | return SCTP_ERROR_INV_PARAM; | 2957 | return SCTP_ERROR_DNS_FAILED; |
2958 | 2958 | ||
2959 | sctp_assoc_set_primary(asoc, peer); | 2959 | sctp_assoc_set_primary(asoc, peer); |
2960 | break; | 2960 | break; |