aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b8e0f72b319f..ee907ea7eed1 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2414,7 +2414,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2414 union sctp_addr addr; 2414 union sctp_addr addr;
2415 struct list_head *pos; 2415 struct list_head *pos;
2416 union sctp_addr_param *addr_param; 2416 union sctp_addr_param *addr_param;
2417 2417 union sctp_addr tmp, tmp_addr;
2418
2418 addr_param = (union sctp_addr_param *) 2419 addr_param = (union sctp_addr_param *)
2419 ((void *)asconf_param + sizeof(sctp_addip_param_t)); 2420 ((void *)asconf_param + sizeof(sctp_addip_param_t));
2420 2421
@@ -2423,6 +2424,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2423 return SCTP_ERROR_INV_PARAM; 2424 return SCTP_ERROR_INV_PARAM;
2424 2425
2425 af->from_addr_param(&addr, addr_param, asoc->peer.port, 0); 2426 af->from_addr_param(&addr, addr_param, asoc->peer.port, 0);
2427 flip_to_n(&tmp_addr, &addr);
2426 switch (asconf_param->param_hdr.type) { 2428 switch (asconf_param->param_hdr.type) {
2427 case SCTP_PARAM_ADD_IP: 2429 case SCTP_PARAM_ADD_IP:
2428 /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address 2430 /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address
@@ -2457,7 +2459,8 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2457 * an Error Cause TLV set to the new error code 'Request to 2459 * an Error Cause TLV set to the new error code 'Request to
2458 * Delete Source IP Address' 2460 * Delete Source IP Address'
2459 */ 2461 */
2460 if (sctp_cmp_addr_exact(sctp_source(asconf), &addr)) 2462 flip_to_n(&tmp, sctp_source(asconf));
2463 if (sctp_cmp_addr_exact(&tmp, &tmp_addr))
2461 return SCTP_ERROR_DEL_SRC_IP; 2464 return SCTP_ERROR_DEL_SRC_IP;
2462 2465
2463 sctp_assoc_del_peer(asoc, &addr); 2466 sctp_assoc_del_peer(asoc, &addr);
@@ -2581,6 +2584,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2581 struct sctp_transport *transport; 2584 struct sctp_transport *transport;
2582 struct sctp_sockaddr_entry *saddr; 2585 struct sctp_sockaddr_entry *saddr;
2583 int retval = 0; 2586 int retval = 0;
2587 union sctp_addr tmp;
2584 2588
2585 addr_param = (union sctp_addr_param *) 2589 addr_param = (union sctp_addr_param *)
2586 ((void *)asconf_param + sizeof(sctp_addip_param_t)); 2590 ((void *)asconf_param + sizeof(sctp_addip_param_t));
@@ -2588,6 +2592,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2588 /* We have checked the packet before, so we do not check again. */ 2592 /* We have checked the packet before, so we do not check again. */
2589 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); 2593 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
2590 af->from_addr_param(&addr, addr_param, bp->port, 0); 2594 af->from_addr_param(&addr, addr_param, bp->port, 0);
2595 flip_to_n(&tmp, &addr);
2591 2596
2592 switch (asconf_param->param_hdr.type) { 2597 switch (asconf_param->param_hdr.type) {
2593 case SCTP_PARAM_ADD_IP: 2598 case SCTP_PARAM_ADD_IP:
@@ -2595,7 +2600,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2595 sctp_write_lock(&asoc->base.addr_lock); 2600 sctp_write_lock(&asoc->base.addr_lock);
2596 list_for_each(pos, &bp->address_list) { 2601 list_for_each(pos, &bp->address_list) {
2597 saddr = list_entry(pos, struct sctp_sockaddr_entry, list); 2602 saddr = list_entry(pos, struct sctp_sockaddr_entry, list);
2598 if (sctp_cmp_addr_exact(&saddr->a_h, &addr)) 2603 if (sctp_cmp_addr_exact(&saddr->a, &tmp))
2599 saddr->use_as_src = 1; 2604 saddr->use_as_src = 1;
2600 } 2605 }
2601 sctp_write_unlock(&asoc->base.addr_lock); 2606 sctp_write_unlock(&asoc->base.addr_lock);