Lines Matching full:peer

167 	asoc->peer.rwnd = SCTP_DEFAULT_MAXWINDOW;  in sctp_association_init()
203 INIT_LIST_HEAD(&asoc->peer.transport_addr_list); in sctp_association_init()
216 asoc->peer.sack_needed = 1; in sctp_association_init()
217 asoc->peer.sack_generation = 1; in sctp_association_init()
237 /* Assume that peer would support both address types unless we are in sctp_association_init()
240 asoc->peer.ipv4_address = 1; in sctp_association_init()
242 asoc->peer.ipv6_address = 1; in sctp_association_init()
347 sctp_tsnmap_free(&asoc->peer.tsn_map); in sctp_association_free()
368 /* Free peer's cached cookie. */ in sctp_association_free()
369 kfree(asoc->peer.cookie); in sctp_association_free()
370 kfree(asoc->peer.peer_random); in sctp_association_free()
371 kfree(asoc->peer.peer_chunks); in sctp_association_free()
372 kfree(asoc->peer.peer_hmacs); in sctp_association_free()
375 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_association_free()
382 asoc->peer.transport_count = 0; in sctp_association_free()
421 /* Change the primary destination address for the peer. */
430 if (asoc->peer.primary_path != NULL && in sctp_assoc_set_primary()
431 asoc->peer.primary_path != transport) in sctp_assoc_set_primary()
434 asoc->peer.primary_path = transport; in sctp_assoc_set_primary()
439 memcpy(&asoc->peer.primary_addr, &transport->ipaddr, in sctp_assoc_set_primary()
447 asoc->peer.active_path = transport; in sctp_assoc_set_primary()
482 struct sctp_transport *peer) in sctp_assoc_rm_peer() argument
489 __func__, asoc, &peer->ipaddr.sa); in sctp_assoc_rm_peer()
492 * to the next peer before removing this peer from the list. in sctp_assoc_rm_peer()
494 if (asoc->peer.retran_path == peer) in sctp_assoc_rm_peer()
497 /* Remove this peer from the list. */ in sctp_assoc_rm_peer()
498 list_del_rcu(&peer->transports); in sctp_assoc_rm_peer()
499 /* Remove this peer from the transport hashtable */ in sctp_assoc_rm_peer()
500 sctp_unhash_transport(peer); in sctp_assoc_rm_peer()
503 pos = asoc->peer.transport_addr_list.next; in sctp_assoc_rm_peer()
506 /* Update any entries that match the peer to be deleted. */ in sctp_assoc_rm_peer()
507 if (asoc->peer.primary_path == peer) in sctp_assoc_rm_peer()
509 if (asoc->peer.active_path == peer) in sctp_assoc_rm_peer()
510 asoc->peer.active_path = transport; in sctp_assoc_rm_peer()
511 if (asoc->peer.retran_path == peer) in sctp_assoc_rm_peer()
512 asoc->peer.retran_path = transport; in sctp_assoc_rm_peer()
513 if (asoc->peer.last_data_from == peer) in sctp_assoc_rm_peer()
514 asoc->peer.last_data_from = transport; in sctp_assoc_rm_peer()
517 asoc->strreset_chunk->transport == peer) { in sctp_assoc_rm_peer()
527 if (asoc->init_last_sent_to == peer) in sctp_assoc_rm_peer()
535 if (asoc->shutdown_last_sent_to == peer) in sctp_assoc_rm_peer()
542 asoc->addip_last_asconf->transport == peer) in sctp_assoc_rm_peer()
548 if (!list_empty(&peer->transmitted)) { in sctp_assoc_rm_peer()
549 struct sctp_transport *active = asoc->peer.active_path; in sctp_assoc_rm_peer()
552 list_for_each_entry(ch, &peer->transmitted, in sctp_assoc_rm_peer()
558 list_splice_tail_init(&peer->transmitted, in sctp_assoc_rm_peer()
572 if (ch->transport == peer) in sctp_assoc_rm_peer()
575 asoc->peer.transport_count--; in sctp_assoc_rm_peer()
577 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_REMOVED, 0); in sctp_assoc_rm_peer()
578 sctp_transport_free(peer); in sctp_assoc_rm_peer()
587 struct sctp_transport *peer; in sctp_assoc_add_peer() local
600 if (0 == asoc->peer.port) in sctp_assoc_add_peer()
601 asoc->peer.port = port; in sctp_assoc_add_peer()
604 peer = sctp_assoc_lookup_paddr(asoc, addr); in sctp_assoc_add_peer()
605 if (peer) { in sctp_assoc_add_peer()
610 if (peer->state == SCTP_UNKNOWN) { in sctp_assoc_add_peer()
611 peer->state = SCTP_ACTIVE; in sctp_assoc_add_peer()
613 return peer; in sctp_assoc_add_peer()
616 peer = sctp_transport_new(asoc->base.net, addr, gfp); in sctp_assoc_add_peer()
617 if (!peer) in sctp_assoc_add_peer()
620 sctp_transport_set_owner(peer, asoc); in sctp_assoc_add_peer()
622 /* Initialize the peer's heartbeat interval based on the in sctp_assoc_add_peer()
625 peer->hbinterval = asoc->hbinterval; in sctp_assoc_add_peer()
628 peer->pathmaxrxt = asoc->pathmaxrxt; in sctp_assoc_add_peer()
631 peer->pf_retrans = asoc->pf_retrans; in sctp_assoc_add_peer()
633 peer->ps_retrans = asoc->ps_retrans; in sctp_assoc_add_peer()
635 /* Initialize the peer's SACK delay timeout based on the in sctp_assoc_add_peer()
638 peer->sackdelay = asoc->sackdelay; in sctp_assoc_add_peer()
639 peer->sackfreq = asoc->sackfreq; in sctp_assoc_add_peer()
645 peer->flowlabel = ntohl(info & IPV6_FLOWLABEL_MASK); in sctp_assoc_add_peer()
646 peer->flowlabel |= SCTP_FLOWLABEL_SET_MASK; in sctp_assoc_add_peer()
648 peer->flowlabel = asoc->flowlabel; in sctp_assoc_add_peer()
651 peer->dscp = asoc->dscp; in sctp_assoc_add_peer()
656 peer->param_flags = asoc->param_flags; in sctp_assoc_add_peer()
659 sctp_transport_route(peer, NULL, sp); in sctp_assoc_add_peer()
662 * initialize the association PMTU to the peer's PMTU. in sctp_assoc_add_peer()
664 * peer's PMTU, reset the association PMTU to the new peer's PMTU. in sctp_assoc_add_peer()
667 min_t(int, peer->pathmtu, asoc->pathmtu) : in sctp_assoc_add_peer()
668 peer->pathmtu); in sctp_assoc_add_peer()
670 peer->pmtu_pending = 0; in sctp_assoc_add_peer()
672 /* The asoc->peer.port might not be meaningful yet, but in sctp_assoc_add_peer()
675 sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port, in sctp_assoc_add_peer()
676 asoc->peer.port); in sctp_assoc_add_peer()
688 peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); in sctp_assoc_add_peer()
694 peer->ssthresh = SCTP_DEFAULT_MAXWINDOW; in sctp_assoc_add_peer()
696 peer->partial_bytes_acked = 0; in sctp_assoc_add_peer()
697 peer->flight_size = 0; in sctp_assoc_add_peer()
698 peer->burst_limited = 0; in sctp_assoc_add_peer()
701 peer->rto = asoc->rto_initial; in sctp_assoc_add_peer()
702 sctp_max_rto(asoc, peer); in sctp_assoc_add_peer()
704 /* Set the peer's active state. */ in sctp_assoc_add_peer()
705 peer->state = peer_state; in sctp_assoc_add_peer()
707 /* Add this peer into the transport hashtable */ in sctp_assoc_add_peer()
708 if (sctp_hash_transport(peer)) { in sctp_assoc_add_peer()
709 sctp_transport_free(peer); in sctp_assoc_add_peer()
714 list_add_tail_rcu(&peer->transports, &asoc->peer.transport_addr_list); in sctp_assoc_add_peer()
715 asoc->peer.transport_count++; in sctp_assoc_add_peer()
717 sctp_ulpevent_notify_peer_addr_change(peer, SCTP_ADDR_ADDED, 0); in sctp_assoc_add_peer()
720 if (!asoc->peer.primary_path) { in sctp_assoc_add_peer()
721 sctp_assoc_set_primary(asoc, peer); in sctp_assoc_add_peer()
722 asoc->peer.retran_path = peer; in sctp_assoc_add_peer()
725 if (asoc->peer.active_path == asoc->peer.retran_path && in sctp_assoc_add_peer()
726 peer->state != SCTP_UNCONFIRMED) { in sctp_assoc_add_peer()
727 asoc->peer.retran_path = peer; in sctp_assoc_add_peer()
730 return peer; in sctp_assoc_add_peer()
741 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_assoc_del_peer()
744 /* Do book keeping for removing the peer and free it. */ in sctp_assoc_del_peer()
758 /* Cycle through all transports searching for a peer address. */ in sctp_assoc_lookup_paddr()
760 list_for_each_entry(t, &asoc->peer.transport_addr_list, in sctp_assoc_lookup_paddr()
776 list_for_each_entry_safe(t, temp, &asoc->peer.transport_addr_list, in sctp_assoc_del_nonprimary_peers()
941 active = asoc->peer.active_path; in sctp_assoc_lookup_tsn()
953 list_for_each_entry(transport, &asoc->peer.transport_addr_list, in sctp_assoc_lookup_tsn()
1021 * been sent to the peer during the association setup. It in sctp_assoc_bh_rcv()
1032 asoc->peer.last_data_from = chunk->transport; in sctp_assoc_bh_rcv()
1101 /* Copy in new parameters of peer. */ in sctp_assoc_update()
1103 asoc->peer.rwnd = new->peer.rwnd; in sctp_assoc_update()
1104 asoc->peer.sack_needed = new->peer.sack_needed; in sctp_assoc_update()
1105 asoc->peer.auth_capable = new->peer.auth_capable; in sctp_assoc_update()
1106 asoc->peer.i = new->peer.i; in sctp_assoc_update()
1108 if (!sctp_tsnmap_init(&asoc->peer.tsn_map, SCTP_TSN_MAP_INITIAL, in sctp_assoc_update()
1109 asoc->peer.i.initial_tsn, GFP_ATOMIC)) in sctp_assoc_update()
1112 /* Remove any peer addresses not present in the new association. */ in sctp_assoc_update()
1113 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { in sctp_assoc_update()
1126 * current next_tsn in case data sent to peer in sctp_assoc_update()
1135 * and peer's streams. in sctp_assoc_update()
1152 /* Add any peer addresses from the new association. */ in sctp_assoc_update()
1153 list_for_each_entry(trans, &new->peer.transport_addr_list, in sctp_assoc_update()
1171 /* SCTP-AUTH: Save the peer parameters from the new associations in sctp_assoc_update()
1174 kfree(asoc->peer.peer_random); in sctp_assoc_update()
1175 asoc->peer.peer_random = new->peer.peer_random; in sctp_assoc_update()
1176 new->peer.peer_random = NULL; in sctp_assoc_update()
1178 kfree(asoc->peer.peer_chunks); in sctp_assoc_update()
1179 asoc->peer.peer_chunks = new->peer.peer_chunks; in sctp_assoc_update()
1180 new->peer.peer_chunks = NULL; in sctp_assoc_update()
1182 kfree(asoc->peer.peer_hmacs); in sctp_assoc_update()
1183 asoc->peer.peer_hmacs = new->peer.peer_hmacs; in sctp_assoc_update()
1184 new->peer.peer_hmacs = NULL; in sctp_assoc_update()
1270 struct sctp_transport *trans = asoc->peer.retran_path; in sctp_assoc_update_retran_path()
1274 if (asoc->peer.transport_count == 1) in sctp_assoc_update_retran_path()
1279 if (asoc->peer.active_path == asoc->peer.retran_path && in sctp_assoc_update_retran_path()
1280 asoc->peer.active_path->state == SCTP_ACTIVE) in sctp_assoc_update_retran_path()
1287 if (&trans->transports == &asoc->peer.transport_addr_list) in sctp_assoc_update_retran_path()
1296 if (trans == asoc->peer.retran_path) in sctp_assoc_update_retran_path()
1300 asoc->peer.retran_path = trans_next; in sctp_assoc_update_retran_path()
1303 __func__, asoc, &asoc->peer.retran_path->ipaddr.sa); in sctp_assoc_update_retran_path()
1312 list_for_each_entry(trans, &asoc->peer.transport_addr_list, in sctp_select_active_and_retran_path()
1346 if ((asoc->peer.primary_path->state == SCTP_ACTIVE || in sctp_select_active_and_retran_path()
1347 asoc->peer.primary_path->state == SCTP_UNKNOWN) && in sctp_select_active_and_retran_path()
1348 asoc->peer.primary_path != trans_pri) { in sctp_select_active_and_retran_path()
1350 trans_pri = asoc->peer.primary_path; in sctp_select_active_and_retran_path()
1364 trans_pri = sctp_trans_elect_best(asoc->peer.active_path, trans_pf); in sctp_select_active_and_retran_path()
1369 asoc->peer.active_path = trans_pri; in sctp_select_active_and_retran_path()
1370 asoc->peer.retran_path = trans_sec; in sctp_select_active_and_retran_path()
1382 return asoc->peer.active_path; in sctp_assoc_choose_alter_transport()
1384 if (last_sent_to == asoc->peer.retran_path) in sctp_assoc_choose_alter_transport()
1387 return asoc->peer.retran_path; in sctp_assoc_choose_alter_transport()
1428 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { in sctp_assoc_sync_pmtu()
1441 /* Should we send a SACK to update our peer? */
1511 asoc->peer.sack_needed = 0; in sctp_assoc_rwnd_increase()
1563 * local endpoint and the remote peer.
1577 if (asoc->peer.ipv4_address) in sctp_assoc_set_bind_addr_from_ep()
1579 if (asoc->peer.ipv6_address) in sctp_assoc_set_bind_addr_from_ep()
1675 * the "Peer-Sequence-Number". in sctp_assoc_clean_asconf_ack_cache()
1680 htonl(asoc->peer.addip_serial)) in sctp_assoc_clean_asconf_ack_cache()