__u16 flags, unsigned int __nocast gfp) 
__u16 flags, gfp_t gfp) 
struct sctp_ulpevent *sctp_ulpevent_make_remote_error(	const struct sctp_association *asoc, struct sctp_chunk *chunk,	__u16 flags, unsigned int __nocast gfp){	struct sctp_ulpevent *event;	struct sctp_remote_error *sre;	struct sk_buff *skb;	sctp_errhdr_t *ch;	__u16 cause;	int elen;	ch = (sctp_errhdr_t *)(chunk->skb->data);	cause = ch->cause;	elen = WORD_ROUND(ntohs(ch->length)) - sizeof(sctp_errhdr_t);	/* Pull off the ERROR header.  */	skb_pull(chunk->skb, sizeof(sctp_errhdr_t));	/* Copy the skb to a new skb with room for us to prepend	 * notification with.	 */	skb = skb_copy_expand(chunk->skb, sizeof(struct sctp_remote_error),			      0, gfp);	/* Pull off the rest of the cause TLV from the chunk.  */	skb_pull(chunk->skb, elen);	if (!skb)		goto fail;	/* Embed the event fields inside the cloned skb.  */	event = sctp_skb2event(skb);	sctp_ulpevent_init(event, MSG_NOTIFICATION);	sre = (struct sctp_remote_error *)		skb_push(skb, sizeof(struct sctp_remote_error));	/* Trim the buffer to the right length.  */	skb_trim(skb, sizeof(struct sctp_remote_error) + elen);	/* Socket Extensions for SCTP	 * 5.3.1.3 SCTP_REMOTE_ERROR	 *	 * sre_type:	 *   It should be SCTP_REMOTE_ERROR.	 */	sre->sre_type = SCTP_REMOTE_ERROR;	/*	 * Socket Extensions for SCTP	 * 5.3.1.3 SCTP_REMOTE_ERROR	 *	 * sre_flags: 16 bits (unsigned integer)	 *   Currently unused.	 */	sre->sre_flags = 0;	/* Socket Extensions for SCTP	 * 5.3.1.3 SCTP_REMOTE_ERROR	 *	 * sre_length: sizeof (__u32)	 *	 * This field is the total length of the notification data,	 * including the notification header.	 */	sre->sre_length = skb->len;	/* Socket Extensions for SCTP	 * 5.3.1.3 SCTP_REMOTE_ERROR	 *	 * sre_error: 16 bits (unsigned integer)	 * This value represents one of the Operational Error causes defined in	 * the SCTP specification, in network byte order.	 */	sre->sre_error = cause;	/* Socket Extensions for SCTP	 * 5.3.1.3 SCTP_REMOTE_ERROR	 *	 * sre_assoc_id: sizeof (sctp_assoc_t)	 *	 * The association id field, holds the identifier for the association.	 * All notifications for a given association have the same association	 * identifier.  For TCP style socket, this field is ignored.	 */	sctp_ulpevent_set_owner(event, asoc);	sre->sre_assoc_id = sctp_assoc2id(asoc);	return event;fail:	return NULL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/dd0fc66fb33cd610bc1a5db8a5e232d34879b4d7/ulpevent.c/buggy/net/sctp/ulpevent.c