const unsigned int __nocast gfp, 
const gfp_t gfp, 
struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,					   const union sctp_addr *addr,					   const unsigned int __nocast gfp,					   const int peer_state){	struct sctp_transport *peer;	struct sctp_sock *sp;	unsigned short port;	sp = sctp_sk(asoc->base.sk);	/* AF_INET and AF_INET6 share common port field. */	port = addr->v4.sin_port;	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_add_peer:association %p addr: ",				 " port: %d state:%s\n",				 asoc,				 addr,				 addr->v4.sin_port,				 peer_state == SCTP_UNKNOWN?"UNKNOWN":"ACTIVE");	/* Set the port if it has not been set yet.  */	if (0 == asoc->peer.port)		asoc->peer.port = port;	/* Check to see if this is a duplicate. */	peer = sctp_assoc_lookup_paddr(asoc, addr);	if (peer) {		if (peer_state == SCTP_ACTIVE &&		    peer->state == SCTP_UNKNOWN)		     peer->state = SCTP_ACTIVE;		return peer;	}	peer = sctp_transport_new(addr, gfp);	if (!peer)		return NULL;	sctp_transport_set_owner(peer, asoc);	/* Initialize the pmtu of the transport. */	sctp_transport_pmtu(peer);	/* If this is the first transport addr on this association,	 * initialize the association PMTU to the peer's PMTU.	 * If not and the current association PMTU is higher than the new	 * peer's PMTU, reset the association PMTU to the new peer's PMTU.	 */	if (asoc->pmtu)		asoc->pmtu = min_t(int, peer->pmtu, asoc->pmtu);	else		asoc->pmtu = peer->pmtu;	SCTP_DEBUG_PRINTK("sctp_assoc_add_peer:association %p PMTU set to "			  "%d\n", asoc, asoc->pmtu);	asoc->frag_point = sctp_frag_point(sp, asoc->pmtu);	/* The asoc->peer.port might not be meaningful yet, but	 * initialize the packet structure anyway.	 */	sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port,			 asoc->peer.port);	/* 7.2.1 Slow-Start	 *	 * o The initial cwnd before DATA transmission or after a sufficiently	 *   long idle period MUST be set to	 *      min(4*MTU, max(2*MTU, 4380 bytes))	 *	 * o The initial value of ssthresh MAY be arbitrarily high	 *   (for example, implementations MAY use the size of the	 *   receiver advertised window).	 */	peer->cwnd = min(4*asoc->pmtu, max_t(__u32, 2*asoc->pmtu, 4380));	/* At this point, we may not have the receiver's advertised window,	 * so initialize ssthresh to the default value and it will be set	 * later when we process the INIT.	 */	peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;	peer->partial_bytes_acked = 0;	peer->flight_size = 0;	/* By default, enable heartbeat for peer address. */	peer->hb_allowed = 1;	/* Initialize the peer's heartbeat interval based on the	 * sock configured value.	 */	peer->hb_interval = msecs_to_jiffies(sp->paddrparam.spp_hbinterval);	/* Set the path max_retrans.  */	peer->max_retrans = sp->paddrparam.spp_pathmaxrxt;	/* Set the transport's RTO.initial value */	peer->rto = asoc->rto_initial;	/* Set the peer's active state. */	peer->state = peer_state;	/* Attach the remote transport to our asoc.  */	list_add_tail(&peer->transports, &asoc->peer.transport_addr_list);	asoc->peer.transport_count++;	/* If we do not yet have a primary path, set one.  */	if (!asoc->peer.primary_path) {		sctp_assoc_set_primary(asoc, peer);		asoc->peer.retran_path = peer;	}	if (asoc->peer.active_path == asoc->peer.retran_path) {		asoc->peer.retran_path = peer;	}	return peer;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7/associola.c/buggy/net/sctp/associola.c