Lines Matching full:peer

171 	asoc->peer.rwnd = SCTP_DEFAULT_MAXWINDOW;  in sctp_association_init()
207 INIT_LIST_HEAD(&asoc->peer.transport_addr_list); in sctp_association_init()
220 asoc->peer.sack_needed = 1; in sctp_association_init()
221 asoc->peer.sack_generation = 1; in sctp_association_init()
239 /* Assume that peer would support both address types unless we are in sctp_association_init()
242 asoc->peer.ipv4_address = 1; in sctp_association_init()
244 asoc->peer.ipv6_address = 1; in sctp_association_init()
348 sctp_tsnmap_free(&asoc->peer.tsn_map); in sctp_association_free()
369 /* Free peer's cached cookie. */ in sctp_association_free()
370 kfree(asoc->peer.cookie); in sctp_association_free()
371 kfree(asoc->peer.peer_random); in sctp_association_free()
372 kfree(asoc->peer.peer_chunks); in sctp_association_free()
373 kfree(asoc->peer.peer_hmacs); in sctp_association_free()
376 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_association_free()
383 asoc->peer.transport_count = 0; in sctp_association_free()
422 /* Change the primary destination address for the peer. */
431 if (asoc->peer.primary_path != NULL && in sctp_assoc_set_primary()
432 asoc->peer.primary_path != transport) in sctp_assoc_set_primary()
435 asoc->peer.primary_path = transport; in sctp_assoc_set_primary()
440 memcpy(&asoc->peer.primary_addr, &transport->ipaddr, in sctp_assoc_set_primary()
448 asoc->peer.active_path = transport; in sctp_assoc_set_primary()
483 struct sctp_transport *peer) in sctp_assoc_rm_peer() argument
490 __func__, asoc, &peer->ipaddr.sa); in sctp_assoc_rm_peer()
493 * to the next peer before removing this peer from the list. in sctp_assoc_rm_peer()
495 if (asoc->peer.retran_path == peer) in sctp_assoc_rm_peer()
498 /* Remove this peer from the list. */ in sctp_assoc_rm_peer()
499 list_del_rcu(&peer->transports); in sctp_assoc_rm_peer()
500 /* Remove this peer from the transport hashtable */ in sctp_assoc_rm_peer()
501 sctp_unhash_transport(peer); in sctp_assoc_rm_peer()
504 pos = asoc->peer.transport_addr_list.next; in sctp_assoc_rm_peer()
507 /* Update any entries that match the peer to be deleted. */ in sctp_assoc_rm_peer()
508 if (asoc->peer.primary_path == peer) in sctp_assoc_rm_peer()
510 if (asoc->peer.active_path == peer) in sctp_assoc_rm_peer()
511 asoc->peer.active_path = transport; in sctp_assoc_rm_peer()
512 if (asoc->peer.retran_path == peer) in sctp_assoc_rm_peer()
513 asoc->peer.retran_path = transport; in sctp_assoc_rm_peer()
514 if (asoc->peer.last_data_from == peer) in sctp_assoc_rm_peer()
515 asoc->peer.last_data_from = transport; in sctp_assoc_rm_peer()
518 asoc->strreset_chunk->transport == peer) { in sctp_assoc_rm_peer()
528 if (asoc->init_last_sent_to == peer) in sctp_assoc_rm_peer()
536 if (asoc->shutdown_last_sent_to == peer) in sctp_assoc_rm_peer()
543 asoc->addip_last_asconf->transport == peer) in sctp_assoc_rm_peer()
549 if (!list_empty(&peer->transmitted)) { in sctp_assoc_rm_peer()
550 struct sctp_transport *active = asoc->peer.active_path; in sctp_assoc_rm_peer()
553 list_for_each_entry(ch, &peer->transmitted, in sctp_assoc_rm_peer()
559 list_splice_tail_init(&peer->transmitted, in sctp_assoc_rm_peer()
573 if (ch->transport == peer) in sctp_assoc_rm_peer()
576 asoc->peer.transport_count--; in sctp_assoc_rm_peer()
578 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_REMOVED, 0); in sctp_assoc_rm_peer()
579 sctp_transport_free(peer); in sctp_assoc_rm_peer()
588 struct sctp_transport *peer; in sctp_assoc_add_peer() local
601 if (0 == asoc->peer.port) in sctp_assoc_add_peer()
602 asoc->peer.port = port; in sctp_assoc_add_peer()
605 peer = sctp_assoc_lookup_paddr(asoc, addr); in sctp_assoc_add_peer()
606 if (peer) { in sctp_assoc_add_peer()
611 if (peer->state == SCTP_UNKNOWN) { in sctp_assoc_add_peer()
612 peer->state = SCTP_ACTIVE; in sctp_assoc_add_peer()
614 return peer; in sctp_assoc_add_peer()
617 peer = sctp_transport_new(asoc->base.net, addr, gfp); in sctp_assoc_add_peer()
618 if (!peer) in sctp_assoc_add_peer()
621 sctp_transport_set_owner(peer, asoc); in sctp_assoc_add_peer()
623 /* Initialize the peer's heartbeat interval based on the in sctp_assoc_add_peer()
626 peer->hbinterval = asoc->hbinterval; in sctp_assoc_add_peer()
627 peer->probe_interval = asoc->probe_interval; in sctp_assoc_add_peer()
629 peer->encap_port = asoc->encap_port; in sctp_assoc_add_peer()
632 peer->pathmaxrxt = asoc->pathmaxrxt; in sctp_assoc_add_peer()
635 peer->pf_retrans = asoc->pf_retrans; in sctp_assoc_add_peer()
637 peer->ps_retrans = asoc->ps_retrans; in sctp_assoc_add_peer()
639 /* Initialize the peer's SACK delay timeout based on the in sctp_assoc_add_peer()
642 peer->sackdelay = asoc->sackdelay; in sctp_assoc_add_peer()
643 peer->sackfreq = asoc->sackfreq; in sctp_assoc_add_peer()
649 peer->flowlabel = ntohl(info & IPV6_FLOWLABEL_MASK); in sctp_assoc_add_peer()
650 peer->flowlabel |= SCTP_FLOWLABEL_SET_MASK; in sctp_assoc_add_peer()
652 peer->flowlabel = asoc->flowlabel; in sctp_assoc_add_peer()
655 peer->dscp = asoc->dscp; in sctp_assoc_add_peer()
660 peer->param_flags = asoc->param_flags; in sctp_assoc_add_peer()
663 sctp_transport_route(peer, NULL, sp); in sctp_assoc_add_peer()
666 * initialize the association PMTU to the peer's PMTU. in sctp_assoc_add_peer()
668 * peer's PMTU, reset the association PMTU to the new peer's PMTU. in sctp_assoc_add_peer()
671 min_t(int, peer->pathmtu, asoc->pathmtu) : in sctp_assoc_add_peer()
672 peer->pathmtu); in sctp_assoc_add_peer()
674 peer->pmtu_pending = 0; in sctp_assoc_add_peer()
676 /* The asoc->peer.port might not be meaningful yet, but in sctp_assoc_add_peer()
679 sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port, in sctp_assoc_add_peer()
680 asoc->peer.port); in sctp_assoc_add_peer()
692 peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); in sctp_assoc_add_peer()
698 peer->ssthresh = SCTP_DEFAULT_MAXWINDOW; in sctp_assoc_add_peer()
700 peer->partial_bytes_acked = 0; in sctp_assoc_add_peer()
701 peer->flight_size = 0; in sctp_assoc_add_peer()
702 peer->burst_limited = 0; in sctp_assoc_add_peer()
705 peer->rto = asoc->rto_initial; in sctp_assoc_add_peer()
706 sctp_max_rto(asoc, peer); in sctp_assoc_add_peer()
708 /* Set the peer's active state. */ in sctp_assoc_add_peer()
709 peer->state = peer_state; in sctp_assoc_add_peer()
711 /* Add this peer into the transport hashtable */ in sctp_assoc_add_peer()
712 if (sctp_hash_transport(peer)) { in sctp_assoc_add_peer()
713 sctp_transport_free(peer); in sctp_assoc_add_peer()
717 sctp_transport_pl_reset(peer); in sctp_assoc_add_peer()
720 list_add_tail_rcu(&peer->transports, &asoc->peer.transport_addr_list); in sctp_assoc_add_peer()
721 asoc->peer.transport_count++; in sctp_assoc_add_peer()
723 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_ADDED, 0); in sctp_assoc_add_peer()
726 if (!asoc->peer.primary_path) { in sctp_assoc_add_peer()
727 sctp_assoc_set_primary(asoc, peer); in sctp_assoc_add_peer()
728 asoc->peer.retran_path = peer; in sctp_assoc_add_peer()
731 if (asoc->peer.active_path == asoc->peer.retran_path && in sctp_assoc_add_peer()
732 peer->state != SCTP_UNCONFIRMED) { in sctp_assoc_add_peer()
733 asoc->peer.retran_path = peer; in sctp_assoc_add_peer()
736 return peer; in sctp_assoc_add_peer()
747 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_assoc_del_peer()
750 /* Do book keeping for removing the peer and free it. */ in sctp_assoc_del_peer()
764 /* Cycle through all transports searching for a peer address. */ in sctp_assoc_lookup_paddr()
766 list_for_each_entry(t, &asoc->peer.transport_addr_list, in sctp_assoc_lookup_paddr()
782 list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list, in sctp_assoc_del_nonprimary_peers()
949 active = asoc->peer.active_path; in sctp_assoc_lookup_tsn()
961 list_for_each_entry(transport, &asoc->peer.transport_addr_list, in sctp_assoc_lookup_tsn()
1029 * been sent to the peer during the association setup. It in sctp_assoc_bh_rcv()
1040 asoc->peer.last_data_from = chunk->transport; in sctp_assoc_bh_rcv()
1109 /* Copy in new parameters of peer. */ in sctp_assoc_update()
1111 asoc->peer.rwnd = new->peer.rwnd; in sctp_assoc_update()
1112 asoc->peer.sack_needed = new->peer.sack_needed; in sctp_assoc_update()
1113 asoc->peer.auth_capable = new->peer.auth_capable; in sctp_assoc_update()
1114 asoc->peer.i = new->peer.i; in sctp_assoc_update()
1116 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL, in sctp_assoc_update()
1117 asoc->peer.i.initial_tsn, GFP_ATOMIC)) in sctp_assoc_update()
1120 /* Remove any peer addresses not present in the new association. */ in sctp_assoc_update()
1121 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_assoc_update()
1134 * current next_tsn in case data sent to peer in sctp_assoc_update()
1143 * and peer's streams. in sctp_assoc_update()
1160 /* Add any peer addresses from the new association. */ in sctp_assoc_update()
1161 list_for_each_entry(trans, &new->peer.transport_addr_list, in sctp_assoc_update()
1178 /* SCTP-AUTH: Save the peer parameters from the new associations in sctp_assoc_update()
1181 kfree(asoc->peer.peer_random); in sctp_assoc_update()
1182 asoc->peer.peer_random = new->peer.peer_random; in sctp_assoc_update()
1183 new->peer.peer_random = NULL; in sctp_assoc_update()
1185 kfree(asoc->peer.peer_chunks); in sctp_assoc_update()
1186 asoc->peer.peer_chunks = new->peer.peer_chunks; in sctp_assoc_update()
1187 new->peer.peer_chunks = NULL; in sctp_assoc_update()
1189 kfree(asoc->peer.peer_hmacs); in sctp_assoc_update()
1190 asoc->peer.peer_hmacs = new->peer.peer_hmacs; in sctp_assoc_update()
1191 new->peer.peer_hmacs = NULL; in sctp_assoc_update()
1277 struct sctp_transport *trans = asoc->peer.retran_path; in sctp_assoc_update_retran_path()
1281 if (asoc->peer.transport_count == 1) in sctp_assoc_update_retran_path()
1286 if (asoc->peer.active_path == asoc->peer.retran_path && in sctp_assoc_update_retran_path()
1287 asoc->peer.active_path->state == SCTP_ACTIVE) in sctp_assoc_update_retran_path()
1294 if (&trans->transports == &asoc->peer.transport_addr_list) in sctp_assoc_update_retran_path()
1303 if (trans == asoc->peer.retran_path) in sctp_assoc_update_retran_path()
1307 asoc->peer.retran_path = trans_next; in sctp_assoc_update_retran_path()
1310 __func__, asoc, &asoc->peer.retran_path->ipaddr.sa); in sctp_assoc_update_retran_path()
1319 list_for_each_entry(trans, &asoc->peer.transport_addr_list, in sctp_select_active_and_retran_path()
1353 if ((asoc->peer.primary_path->state == SCTP_ACTIVE || in sctp_select_active_and_retran_path()
1354 asoc->peer.primary_path->state == SCTP_UNKNOWN) && in sctp_select_active_and_retran_path()
1355 asoc->peer.primary_path != trans_pri) { in sctp_select_active_and_retran_path()
1357 trans_pri = asoc->peer.primary_path; in sctp_select_active_and_retran_path()
1371 trans_pri = sctp_trans_elect_best(asoc->peer.active_path, trans_pf); in sctp_select_active_and_retran_path()
1376 asoc->peer.active_path = trans_pri; in sctp_select_active_and_retran_path()
1377 asoc->peer.retran_path = trans_sec; in sctp_select_active_and_retran_path()
1389 return asoc->peer.active_path; in sctp_assoc_choose_alter_transport()
1391 if (last_sent_to == asoc->peer.retran_path) in sctp_assoc_choose_alter_transport()
1394 return asoc->peer.retran_path; in sctp_assoc_choose_alter_transport()
1435 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { in sctp_assoc_sync_pmtu()
1448 /* Should we send a SACK to update our peer? */
1518 asoc->peer.sack_needed = 0; in sctp_assoc_rwnd_increase()
1570 * local endpoint and the remote peer.
1584 if (asoc->peer.ipv4_address) in sctp_assoc_set_bind_addr_from_ep()
1586 if (asoc->peer.ipv6_address) in sctp_assoc_set_bind_addr_from_ep()
1683 * the "Peer-Sequence-Number". in sctp_assoc_clean_asconf_ack_cache()
1688 htonl(asoc->peer.addip_serial)) in sctp_assoc_clean_asconf_ack_cache()