aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/sm_make_chunk.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 81b606424e12..bbc7107c86cf 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2418,7 +2418,8 @@ static int sctp_process_param(struct sctp_association *asoc,
2418 break; 2418 break;
2419 2419
2420 case SCTP_PARAM_IPV6_ADDRESS: 2420 case SCTP_PARAM_IPV6_ADDRESS:
2421 asoc->peer.ipv6_address = 1; 2421 if (PF_INET6 == asoc->base.sk->sk_family)
2422 asoc->peer.ipv6_address = 1;
2422 break; 2423 break;
2423 2424
2424 case SCTP_PARAM_HOST_NAME_ADDRESS: 2425 case SCTP_PARAM_HOST_NAME_ADDRESS:
@@ -2829,6 +2830,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2829 addr_param = (union sctp_addr_param *) 2830 addr_param = (union sctp_addr_param *)
2830 ((void *)asconf_param + sizeof(sctp_addip_param_t)); 2831 ((void *)asconf_param + sizeof(sctp_addip_param_t));
2831 2832
2833 switch (addr_param->v4.param_hdr.type) {
2834 case SCTP_PARAM_IPV6_ADDRESS:
2835 if (!asoc->peer.ipv6_address)
2836 return SCTP_ERROR_INV_PARAM;
2837 break;
2838 case SCTP_PARAM_IPV4_ADDRESS:
2839 if (!asoc->peer.ipv4_address)
2840 return SCTP_ERROR_INV_PARAM;
2841 break;
2842 default:
2843 return SCTP_ERROR_INV_PARAM;
2844 }
2845
2832 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); 2846 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
2833 if (unlikely(!af)) 2847 if (unlikely(!af))
2834 return SCTP_ERROR_INV_PARAM; 2848 return SCTP_ERROR_INV_PARAM;