netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BK PATCH] 2.4 SCTP updates
@ 2004-04-06 19:09 Sridhar Samudrala
  2004-04-06 20:52 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sridhar Samudrala @ 2004-04-06 19:09 UTC (permalink / raw)
  To: davem; +Cc: netdev, lksctp-developers

Hi Dave

Please do a
	bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work
to get the following updates to SCTP on top of linux 2.4.26-rc2

This includes 2 of the 3 patches i submitted for 2.6.

lib/idr.c is not present in 2.4 and hence i could not remove the use of
address of association as its id and virt_addr_valid(). I guess it should be
OK for now as PAGEALLOC debugging is not available with 2.4.
may be we should backport idr.c to 2.4 or come up with a similar service.

Thanks
Sridhar


# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/04/06 09:28:32-07:00 sri@us.ibm.com
#   [SCTP] Update sctp_ulpevent structure to include assoc pointer and
#   only the receive specific fields of sctp_sndrcvinfo.
#
# net/sctp/ulpqueue.c
# net/sctp/ulpevent.c
# net/sctp/socket.c
# net/sctp/protocol.c
# net/sctp/ipv6.c
# include/net/sctp/ulpevent.h
#
# ChangeSet
#   2004/04/06 07:54:05-07:00 sri@us.ibm.com
#   [SCTP] Fix typo in entry name of the remove_proc_entry() call.
#
# net/sctp/objcnt.c
#
diff -Nru a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
--- a/include/net/sctp/ulpevent.h	Tue Apr  6 11:54:30 2004
+++ b/include/net/sctp/ulpevent.h	Tue Apr  6 11:54:30 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001 International Business Machines, Corp.
  * Copyright (c) 2001 Intel Corp.
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
@@ -54,7 +54,13 @@
  * growing this structure as it is at the maximum limit now.
  */
 struct sctp_ulpevent {
-	struct sctp_sndrcvinfo sndrcvinfo;
+	struct sctp_association *asoc;
+	__u16 stream;
+	__u16 ssn;
+	__u16 flags;
+	__u32 ppid;
+	__u32 tsn;
+	__u32 cumtsn;
 	int msg_flags;
 	int iif;
 };
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/ipv6.c	Tue Apr  6 11:54:30 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2002, 2004
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
- * Copyright (c) 2002-2003 International Business Machines, Corp.
  * Copyright (c) 2002-2003 Intel Corp.
  *
  * This file is part of the SCTP kernel reference Implementation
@@ -703,7 +703,7 @@
 		union sctp_addr *addr;
 		struct sctp_association *asoc;

-		asoc = event->sndrcvinfo.sinfo_assoc_id;
+		asoc = event->asoc;
 		sctp_inet6_msgname(msgname, addrlen);
 		sin6 = (struct sockaddr_in6 *)msgname;
 		sin6->sin6_port = htons(asoc->peer.port);
diff -Nru a/net/sctp/objcnt.c b/net/sctp/objcnt.c
--- a/net/sctp/objcnt.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/objcnt.c	Tue Apr  6 11:54:30 2004
@@ -132,7 +132,7 @@
 /* Cleanup the objcount entry in the proc filesystem.  */
 void sctp_dbg_objcnt_exit(void)
 {
-	remove_proc_entry("sctp_dbg_objcount", proc_net_sctp);
+	remove_proc_entry("sctp_dbg_objcnt", proc_net_sctp);
 }


diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c
--- a/net/sctp/protocol.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/protocol.c	Tue Apr  6 11:54:30 2004
@@ -719,7 +719,7 @@
 	if (msgname) {
 		struct sctp_association *asoc;

-		asoc = event->sndrcvinfo.sinfo_assoc_id;
+		asoc = event->asoc;
 		sctp_inet_msgname(msgname, addr_len);
 		sin = (struct sockaddr_in *)msgname;
 		sinfrom = &asoc->peer.primary_addr.v4;
diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c
--- a/net/sctp/socket.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/socket.c	Tue Apr  6 11:54:30 2004
@@ -1495,8 +1495,7 @@
 		 * rwnd by that amount. If all the data in the skb is read,
 		 * rwnd is updated when the event is freed.
 		 */
-		sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id,
-					 copied);
+		sctp_assoc_rwnd_increase(event->asoc, copied);
 		goto out;
 	} else if ((event->msg_flags & MSG_NOTIFICATION) ||
 		   (event->msg_flags & MSG_EOR))
@@ -4486,7 +4485,7 @@
 	 */
 	sctp_skb_for_each(skb, &oldsk->sk_receive_queue, tmp) {
 		event = sctp_skb2event(skb);
-		if (event->sndrcvinfo.sinfo_assoc_id == assoc) {
+		if (event->asoc == assoc) {
 			__skb_unlink(skb, skb->list);
 			__skb_queue_tail(&newsk->sk_receive_queue, skb);
 		}
@@ -4515,7 +4514,7 @@
 		 */
 		sctp_skb_for_each(skb, &oldsp->pd_lobby, tmp) {
 			event = sctp_skb2event(skb);
-			if (event->sndrcvinfo.sinfo_assoc_id == assoc) {
+			if (event->asoc == assoc) {
 				__skb_unlink(skb, skb->list);
 				__skb_queue_tail(queue, skb);
 			}
diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
--- a/net/sctp/ulpevent.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/ulpevent.c	Tue Apr  6 11:54:30 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001 International Business Machines, Corp.
  * Copyright (c) 2001 Intel Corp.
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
@@ -590,8 +590,7 @@
 						struct sctp_chunk *chunk,
 						int gfp)
 {
-	struct sctp_ulpevent *event;
-	struct sctp_sndrcvinfo *info;
+	struct sctp_ulpevent *event = NULL;
 	struct sk_buff *skb;
 	size_t padding, len;

@@ -624,101 +623,21 @@
 	/* Initialize event with flags 0.  */
 	sctp_ulpevent_init(event, 0);

-	event->iif = sctp_chunk_iif(chunk);
-
 	sctp_ulpevent_receive_data(event, asoc);

-	info = (struct sctp_sndrcvinfo *) &event->sndrcvinfo;
-
-	/* Sockets API Extensions for SCTP
-	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
-	 *
-	 * sinfo_stream: 16 bits (unsigned integer)
-	 *
-	 * For recvmsg() the SCTP stack places the message's stream number in
-	 * this value.
-	 */
-	info->sinfo_stream = ntohs(chunk->subh.data_hdr->stream);
-
-	/* Sockets API Extensions for SCTP
-	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
-	 *
-	 * sinfo_ssn: 16 bits (unsigned integer)
-	 *
-	 * For recvmsg() this value contains the stream sequence number that
-	 * the remote endpoint placed in the DATA chunk.  For fragmented
-	 * messages this is the same number for all deliveries of the message
-	 * (if more than one recvmsg() is needed to read the message).
-	 */
-	info->sinfo_ssn = ntohs(chunk->subh.data_hdr->ssn);
-
-        /* Sockets API Extensions for SCTP
-	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
-	 *
-	 * sinfo_ppid: 32 bits (unsigned integer)
-	 *
-	 * In recvmsg() this value is
-	 * the same information that was passed by the upper layer in the peer
-	 * application.  Please note that byte order issues are NOT accounted
-	 * for and this information is passed opaquely by the SCTP stack from
-	 * one end to the other.
-	 */
-	info->sinfo_ppid = chunk->subh.data_hdr->ppid;
-
-	/* Sockets API Extensions for SCTP
-	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
-	 *
-	 * sinfo_flags: 16 bits (unsigned integer)
-	 *
-	 * This field may contain any of the following flags and is composed of
-	 * a bitwise OR of these values.
-	 *
-	 * recvmsg() flags:
-	 *
-	 * MSG_UNORDERED - This flag is present when the message was sent
-	 *                 non-ordered.
-	 */
+	event->stream = ntohs(chunk->subh.data_hdr->stream);
+	event->ssn = ntohs(chunk->subh.data_hdr->ssn);
+	event->ppid = chunk->subh.data_hdr->ppid;
 	if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) {
-		info->sinfo_flags |= MSG_UNORDERED;
-
-		/* sinfo_cumtsn: 32 bit (unsigned integer)
-		 *
-		 * This field will hold the current cumulative TSN as
-		 * known by the underlying SCTP layer.  Note this field is
-		 * ignored when sending and only valid for a receive
-		 * operation when sinfo_flags are set to MSG_UNORDERED.
-		 */
-		info->sinfo_cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
+		event->flags |= MSG_UNORDERED;
+		event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
 	}
-
-	/* Note:  For reassembly, we need to have the fragmentation bits.
-	 * For now, merge these into the msg_flags, since those bit
-	 * possitions are not used.
-	 */
+	event->tsn = ntohl(chunk->subh.data_hdr->tsn);
 	event->msg_flags |= chunk->chunk_hdr->flags;
-
-	/* With 04 draft, tsn moves into sndrcvinfo. */
-	info->sinfo_tsn = ntohl(chunk->subh.data_hdr->tsn);
-
-	/* Context is not used on receive. */
-	info->sinfo_context = 0;
-
-	/* Sockets API Extensions for SCTP
-	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
-	 *
-	 * sinfo_assoc_id: sizeof (sctp_assoc_t)
-	 *
-	 * The association handle field, sinfo_assoc_id, holds the identifier
-	 * for the association announced in the COMMUNICATION_UP notification.
-	 * All notifications for a given association have the same identifier.
-	 * Ignored for TCP-style sockets.
-	 */
-	info->sinfo_assoc_id = sctp_assoc2id(asoc);
-
-	return event;
+	event->iif = sctp_chunk_iif(chunk);

 fail:
-	return NULL;
+	return event;
 }

 /* Create a partial delivery related event.
@@ -797,11 +716,77 @@
 void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
 				   struct msghdr *msghdr)
 {
-	if (!sctp_ulpevent_is_notification(event)) {
-		put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV,
-			 sizeof(struct sctp_sndrcvinfo),
-			 (void *) &event->sndrcvinfo);
-	}
+	struct sctp_sndrcvinfo sinfo;
+
+	if (sctp_ulpevent_is_notification(event))
+		return;
+
+	/* Sockets API Extensions for SCTP
+ 	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
+ 	 *
+ 	 * sinfo_stream: 16 bits (unsigned integer)
+ 	 *
+ 	 * For recvmsg() the SCTP stack places the message's stream number in
+ 	 * this value.
+ 	*/
+	sinfo.sinfo_stream = event->stream;
+	/* sinfo_ssn: 16 bits (unsigned integer)
+	 *
+	 * For recvmsg() this value contains the stream sequence number that
+	 * the remote endpoint placed in the DATA chunk.  For fragmented
+	 * messages this is the same number for all deliveries of the message
+	 * (if more than one recvmsg() is needed to read the message).
+	 */
+	sinfo.sinfo_ssn = event->ssn;
+	/* sinfo_ppid: 32 bits (unsigned integer)
+	 *
+	 * In recvmsg() this value is
+	 * the same information that was passed by the upper layer in the peer
+	 * application.  Please note that byte order issues are NOT accounted
+	 * for and this information is passed opaquely by the SCTP stack from
+	 * one end to the other.
+	 */
+	sinfo.sinfo_ppid = event->ppid;
+	/* sinfo_flags: 16 bits (unsigned integer)
+	 *
+	 * This field may contain any of the following flags and is composed of
+	 * a bitwise OR of these values.
+	 *
+	 * recvmsg() flags:
+	 *
+	 * MSG_UNORDERED - This flag is present when the message was sent
+	 *                 non-ordered.
+	 */
+	sinfo.sinfo_flags = event->flags;
+	/* sinfo_tsn: 32 bit (unsigned integer)
+	 *
+	 * For the receiving side, this field holds a TSN that was
+	 * assigned to one of the SCTP Data Chunks.
+	 */
+	sinfo.sinfo_tsn = event->tsn;
+	/* sinfo_cumtsn: 32 bit (unsigned integer)
+	 *
+	 * This field will hold the current cumulative TSN as
+	 * known by the underlying SCTP layer.  Note this field is
+	 * ignored when sending and only valid for a receive
+	 * operation when sinfo_flags are set to MSG_UNORDERED.
+	 */
+	sinfo.sinfo_cumtsn = event->cumtsn;
+	/* sinfo_assoc_id: sizeof (sctp_assoc_t)
+	 *
+	 * The association handle field, sinfo_assoc_id, holds the identifier
+	 * for the association announced in the COMMUNICATION_UP notification.
+	 * All notifications for a given association have the same identifier.
+	 * Ignored for one-to-one style sockets.
+	 */
+	sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc);
+
+	/* These fields are not used while receiving. */
+	sinfo.sinfo_context = 0;
+	sinfo.sinfo_timetolive = 0;
+
+	put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV,
+		 sizeof(struct sctp_sndrcvinfo), (void *)&sinfo);
 }

 /* Stub skb destructor.  */
@@ -831,14 +816,14 @@
 	sctp_association_hold((struct sctp_association *)asoc);
 	skb = sctp_event2skb(event);
 	skb->sk = asoc->base.sk;
-	event->sndrcvinfo.sinfo_assoc_id = sctp_assoc2id(asoc);
+	event->asoc = (struct sctp_association *)asoc;
 	skb->destructor = sctp_stub_rfree;
 }

 /* A simple destructor to give up the reference to the association. */
 static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event)
 {
-	sctp_association_put(event->sndrcvinfo.sinfo_assoc_id);
+	sctp_association_put(event->asoc);
 }

 /* Do accounting for bytes received and hold a reference to the association
@@ -880,8 +865,7 @@
 	 */

 	skb = sctp_event2skb(event);
-	sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id,
-				 skb_headlen(skb));
+	sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb));

 	/* Don't forget the fragments. */
 	for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) {
diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
--- a/net/sctp/ulpqueue.c	Tue Apr  6 11:54:30 2004
+++ b/net/sctp/ulpqueue.c	Tue Apr  6 11:54:30 2004
@@ -1,7 +1,7 @@
 /* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2004
  * Copyright (c) 1999-2000 Cisco, Inc.
  * Copyright (c) 1999-2001 Motorola, Inc.
- * Copyright (c) 2001-2003 International Business Machines, Corp.
  * Copyright (c) 2001 Intel Corp.
  * Copyright (c) 2001 Nokia, Inc.
  * Copyright (c) 2001 La Monte H.P. Yarroll
@@ -251,7 +251,7 @@
 	struct sctp_ulpevent *cevent;
 	__u32 tsn, ctsn;

-	tsn = event->sndrcvinfo.sinfo_tsn;
+	tsn = event->tsn;

 	/* See if it belongs at the end. */
 	pos = skb_peek_tail(&ulpq->reasm);
@@ -262,7 +262,7 @@

 	/* Short circuit just dropping it at the end. */
 	cevent = sctp_skb2event(pos);
-	ctsn = cevent->sndrcvinfo.sinfo_tsn;
+	ctsn = cevent->tsn;
 	if (TSN_lt(ctsn, tsn)) {
 		__skb_queue_tail(&ulpq->reasm, sctp_event2skb(event));
 		return;
@@ -271,7 +271,7 @@
 	/* Find the right place in this list. We store them by TSN.  */
 	skb_queue_walk(&ulpq->reasm, pos) {
 		cevent = sctp_skb2event(pos);
-		ctsn = cevent->sndrcvinfo.sinfo_tsn;
+		ctsn = cevent->tsn;

 		if (TSN_lt(tsn, ctsn))
 			break;
@@ -368,7 +368,7 @@
 	 */
 	skb_queue_walk(&ulpq->reasm, pos) {
 		cevent = sctp_skb2event(pos);
-		ctsn = cevent->sndrcvinfo.sinfo_tsn;
+		ctsn = cevent->tsn;

 		switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) {
 		case SCTP_DATA_FIRST_FRAG:
@@ -425,7 +425,7 @@

 	skb_queue_walk(&ulpq->reasm, pos) {
 		cevent = sctp_skb2event(pos);
-		ctsn = cevent->sndrcvinfo.sinfo_tsn;
+		ctsn = cevent->tsn;

 		switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) {
 		case SCTP_DATA_MIDDLE_FRAG:
@@ -486,7 +486,7 @@
 		/* Do not even bother unless this is the next tsn to
 		 * be delivered.
 		 */
-		ctsn = event->sndrcvinfo.sinfo_tsn;
+		ctsn = event->tsn;
 		ctsnap = sctp_tsnmap_get_ctsn(&ulpq->asoc->peer.tsn_map);
 		if (TSN_lte(ctsn, ctsnap))
 			retval = sctp_ulpq_retrieve_partial(ulpq);
@@ -517,7 +517,7 @@

 	skb_queue_walk(&ulpq->reasm, pos) {
 		cevent = sctp_skb2event(pos);
-		ctsn = cevent->sndrcvinfo.sinfo_tsn;
+		ctsn = cevent->tsn;

 		switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) {
 		case SCTP_DATA_FIRST_FRAG:
@@ -563,15 +563,15 @@
 	__u16 sid, csid;
 	__u16 ssn, cssn;

-	sid = event->sndrcvinfo.sinfo_stream;
-	ssn = event->sndrcvinfo.sinfo_ssn;
+	sid = event->stream;
+	ssn = event->ssn;
 	in  = &ulpq->asoc->ssnmap->in;

 	/* We are holding the chunks by stream, by SSN.  */
 	sctp_skb_for_each(pos, &ulpq->lobby, tmp) {
 		cevent = (struct sctp_ulpevent *) pos->cb;
-		csid = cevent->sndrcvinfo.sinfo_stream;
-		cssn = cevent->sndrcvinfo.sinfo_ssn;
+		csid = cevent->stream;
+		cssn = cevent->ssn;

 		/* Have we gone too far?  */
 		if (csid > sid)
@@ -609,12 +609,12 @@
 		return;
 	}

-	sid = event->sndrcvinfo.sinfo_stream;
-	ssn = event->sndrcvinfo.sinfo_ssn;
+	sid = event->stream;
+	ssn = event->ssn;

 	cevent = (struct sctp_ulpevent *) pos->cb;
-	csid = cevent->sndrcvinfo.sinfo_stream;
-	cssn = cevent->sndrcvinfo.sinfo_ssn;
+	csid = cevent->stream;
+	cssn = cevent->ssn;
 	if (sid > csid) {
 		__skb_queue_tail(&ulpq->lobby, sctp_event2skb(event));
 		return;
@@ -630,8 +630,8 @@
 	 */
 	skb_queue_walk(&ulpq->lobby, pos) {
 		cevent = (struct sctp_ulpevent *) pos->cb;
-		csid = cevent->sndrcvinfo.sinfo_stream;
-		cssn = cevent->sndrcvinfo.sinfo_ssn;
+		csid = cevent->stream;
+		cssn = cevent->ssn;

 		if (csid > sid)
 			break;
@@ -656,8 +656,8 @@
 		return event;

 	/* Note: The stream ID must be verified before this routine.  */
-	sid = event->sndrcvinfo.sinfo_stream;
-	ssn = event->sndrcvinfo.sinfo_ssn;
+	sid = event->stream;
+	ssn = event->ssn;
 	in  = &ulpq->asoc->ssnmap->in;

 	/* Is this the expected SSN for this stream ID?  */
@@ -694,7 +694,7 @@
 	while ((skb = __skb_dequeue_tail(&ulpq->lobby))) {
 		freed += skb_headlen(skb);
 		event = sctp_skb2event(skb);
-		tsn = event->sndrcvinfo.sinfo_tsn;
+		tsn = event->tsn;

 		sctp_ulpevent_free(event);
 		sctp_tsnmap_renege(tsnmap, tsn);
@@ -720,7 +720,7 @@
 	while ((skb = __skb_dequeue_tail(&ulpq->reasm))) {
 		freed += skb_headlen(skb);
 		event = sctp_skb2event(skb);
-		tsn = event->sndrcvinfo.sinfo_tsn;
+		tsn = event->tsn;

 		sctp_ulpevent_free(event);
 		sctp_tsnmap_renege(tsnmap, tsn);

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [BK PATCH] 2.4 SCTP updates
@ 2004-08-13  0:24 Sridhar Samudrala
  2004-08-13  1:00 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sridhar Samudrala @ 2004-08-13  0:24 UTC (permalink / raw)
  To: davem; +Cc: netdev, lksctp-developers

Dave,

Please do a
	bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work

to get the following csets to bring 2.4 SCTP in sync with 2.6.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/12 14:15:26-07:00 sri@us.ibm.com
#   [SCTP] Mark chunks as ineligible for fast retransmit after they are
#   retransmitted. Also mark any chunks that could not be fit in the
#   PMTU sized packet as ineligible for fast retransmit.
#
# net/sctp/outqueue.c
#
# ChangeSet
#   2004/08/12 14:14:29-07:00 sri@us.ibm.com
#   [SCTP] Fix missing '+' in the computation of sack chunk size in
#   sctp_sm_pull_sack().
#
# net/sctp/sm_statefuns.c
#
# ChangeSet
#   2004/08/12 14:13:23-07:00 sri@us.ibm.com
#   [SCTP] Fix issues with handling stale cookie error over multihoming
#   associations.
#
# net/sctp/sm_statefuns.c
# net/sctp/sm_sideeffect.c
# include/net/sctp/command.h
#
# ChangeSet
#   2004/08/12 14:12:00-07:00 sri@us.ibm.com
#   [SCTP] Fix data not being delivered to user in SHUTDOWN_SENT state.
#
#   Also cleaned up sctp_sf_eat_data_6_2() and sctp_sf_eat_data_fast_4_4()
#   as they have a lot of common code.
#
# net/sctp/sm_statefuns.c
# net/sctp/associola.c
# include/net/sctp/sm.h
# include/net/sctp/constants.h
#
# ChangeSet
#   2004/08/12 14:08:40-07:00 sri@us.ibm.com
#   [SCTP] Set/Get default SCTP_PEER_ADDR_PARAMS for endpoint when associd
#   and peer address are 0.
#
# net/sctp/socket.c
#
# ChangeSet
#   2004/08/12 12:25:45-07:00 sri@us.ibm.com
#   [SCTP] SPARSE cleanup backported from 2.6
#
# net/sctp/ulpqueue.c
# net/sctp/ulpevent.c
# net/sctp/socket.c
# net/sctp/sm_statefuns.c
# net/sctp/protocol.c
# net/sctp/outqueue.c
# net/sctp/output.c
# net/sctp/inqueue.c
#

Thanks
Sridhar

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [BK PATCH] 2.4 SCTP updates
@ 2004-03-23 20:15 Sridhar Samudrala
  2004-03-24 19:59 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sridhar Samudrala @ 2004-03-23 20:15 UTC (permalink / raw)
  To: davem; +Cc: netdev

Hi Dave,

Please do a
        bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work
to get the following update to SCTP on top of linux 2.4.26-pre5

# This patch includes the following deltas:
#	           ChangeSet	1.1309  -> 1.1311
#	net/sctp/sm_make_chunk.c	1.4     -> 1.5
#	 net/sctp/ulpevent.c	1.4     -> 1.5
#	  net/sctp/Config.in	1.5     -> 1.6
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/03/23	sri@us.ibm.com	1.1310
# [SCTP] Don't do any ppid byte-order conversions as it is opaque to SCTP.
# --------------------------------------------
# 04/03/23	sri@us.ibm.com	1.1311
# [SCTP] Avoid the use of hacking CONFIG_IPV6_SCTP__ option.
# --------------------------------------------
#
diff -Nru a/net/sctp/Config.in b/net/sctp/Config.in
--- a/net/sctp/Config.in	Tue Mar 23 11:54:53 2004
+++ b/net/sctp/Config.in	Tue Mar 23 11:54:53 2004
@@ -4,39 +4,38 @@
 mainmenu_option next_comment
 comment '   SCTP Configuration (EXPERIMENTAL)'

-if [ "$CONFIG_IPV6" != "n" ]; then
-   define_bool CONFIG_IPV6_SCTP__ $CONFIG_IPV6
+if [ "$CONFIG_IPV6" = "n" ]; then
+  tristate '  The SCTP Protocol (EXPERIMENTAL)' CONFIG_IP_SCTP
 else
-   define_bool CONFIG_IPV6_SCTP__ y
+  dep_tristate '  The SCTP Protocol (EXPERIMENTAL)' CONFIG_IP_SCTP $CONFIG_IPV6
 fi

-dep_tristate '  The SCTP Protocol (EXPERIMENTAL)' CONFIG_IP_SCTP $CONFIG_IPV6_SCTP__
 if [ "$CONFIG_IP_SCTP" != "n" ]; then
-   bool '    SCTP: Debug messages' CONFIG_SCTP_DBG_MSG
-   bool '    SCTP: Debug object counts' CONFIG_SCTP_DBG_OBJCNT
-fi
-if [ "$CONFIG_CRYPTO_HMAC" = "n" ]; then
-  choice '    SCTP: Cookie HMAC Algorithm' \
-        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE" HMAC-NONE
-else
-  if [ "$CONFIG_CRYPTO_MD5" = "n" -a "$CONFIG_CRYPTO_SHA1" = "n" ]; then
+  bool '    SCTP: Debug messages' CONFIG_SCTP_DBG_MSG
+  bool '    SCTP: Debug object counts' CONFIG_SCTP_DBG_OBJCNT
+  if [ "$CONFIG_CRYPTO_HMAC" = "n" ]; then
     choice '    SCTP: Cookie HMAC Algorithm' \
-        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE" HMAC-NONE
+      "HMAC-NONE		CONFIG_SCTP_HMAC_NONE" HMAC-NONE
   else
-    if [ "$CONFIG_CRYPTO_MD5" != "n" -a "$CONFIG_CRYPTO_SHA1" != "n" ]; then
+    if [ "$CONFIG_CRYPTO_MD5" = "n" -a "$CONFIG_CRYPTO_SHA1" = "n" ]; then
       choice '    SCTP: Cookie HMAC Algorithm' \
-        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
-         HMAC-SHA1              CONFIG_SCTP_HMAC_SHA1 \
-         HMAC-MD5		CONFIG_SCTP_HMAC_MD5"	HMAC-SHA1
+        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE" HMAC-NONE
     else
-      if [ "$CONFIG_CRYPTO_MD5" != "n" ]; then
-        choice 'SCTP: Cookie HMAC Algorithm' \
-        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
-         HMAC-MD5		CONFIG_SCTP_HMAC_MD5"	HMAC-MD5
+      if [ "$CONFIG_CRYPTO_MD5" != "n" -a "$CONFIG_CRYPTO_SHA1" != "n" ]; then
+        choice '    SCTP: Cookie HMAC Algorithm' \
+          "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
+           HMAC-SHA1              CONFIG_SCTP_HMAC_SHA1 \
+           HMAC-MD5		CONFIG_SCTP_HMAC_MD5"	HMAC-MD5
       else
-        choice 'SCTP: Cookie HMAC Algorithm' \
-        "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
-         HMAC-SHA1		CONFIG_SCTP_HMAC_SHA1"	HMAC-SHA1
+        if [ "$CONFIG_CRYPTO_MD5" != "n" ]; then
+          choice 'SCTP: Cookie HMAC Algorithm' \
+          "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
+           HMAC-MD5		CONFIG_SCTP_HMAC_MD5"	HMAC-MD5
+        else
+          choice 'SCTP: Cookie HMAC Algorithm' \
+          "HMAC-NONE		CONFIG_SCTP_HMAC_NONE \
+           HMAC-SHA1		CONFIG_SCTP_HMAC_SHA1"	HMAC-SHA1
+        fi
       fi
     fi
   fi
diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
--- a/net/sctp/sm_make_chunk.c	Tue Mar 23 11:54:53 2004
+++ b/net/sctp/sm_make_chunk.c	Tue Mar 23 11:54:53 2004
@@ -516,7 +516,7 @@
 	 */
 	dp.tsn = 0;
 	dp.stream = htons(sinfo->sinfo_stream);
-	dp.ppid   = htonl(sinfo->sinfo_ppid);
+	dp.ppid   = sinfo->sinfo_ppid;

 	/* Set the flags for an unordered send.  */
 	if (sinfo->sinfo_flags & MSG_UNORDERED) {
diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
--- a/net/sctp/ulpevent.c	Tue Mar 23 11:54:53 2004
+++ b/net/sctp/ulpevent.c	Tue Mar 23 11:54:53 2004
@@ -663,7 +663,7 @@
 	 * for and this information is passed opaquely by the SCTP stack from
 	 * one end to the other.
 	 */
-	info->sinfo_ppid = ntohl(chunk->subh.data_hdr->ppid);
+	info->sinfo_ppid = chunk->subh.data_hdr->ppid;

 	/* Sockets API Extensions for SCTP
 	 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [BK PATCH] 2.4 SCTP updates.
@ 2004-02-27 20:31 Sridhar Samudrala
  2004-02-27 21:38 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sridhar Samudrala @ 2004-02-27 20:31 UTC (permalink / raw)
  To: davem; +Cc: netdev

Dave,

Thanks for fixing the MSECS_TO_JIFFIES warning.

Here are a few updates to SCTP on top of the latest 2.4 BK tree. It includes
fixes to NIP6 macro compile error, incorrect packed attribute usage and
a bug with sinit_max_init_timeo behavior.

please do a
	bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work

# This patch includes the following deltas:
#	           ChangeSet	1.1327  -> 1.1330
#	net/sctp/sm_statefuns.c	1.4     -> 1.5
#	     net/sctp/ipv6.c	1.5     -> 1.6
#	include/linux/sctp.h	1.4     -> 1.5
#	include/net/sctp/structs.h	1.5     -> 1.6
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/27	sri@us.ibm.com	1.1328
# [SCTP] Fix packed attribute usage.
# --------------------------------------------
# 04/02/27	sri@us.ibm.com	1.1329
# [SCTP] Fix NIP6 macro to take a ptr to struct in6_addr.
# --------------------------------------------
# 04/02/27	sri@us.ibm.com	1.1330
# [SCTP] Fix incorrect INIT process termination with sinit_max_init_timeo.
#
# Currently, sinit_max_init_timeo is treated as the maximum timeout
# value for INIT retransmissions and the INIT process is aborted when
# the timeout reaches this value. But as per the SCTP sockets API draft,
# sinit_max_init_timeo only limits the timeout. The INIT process should
# be aborted only after MAX_INIT_RETRANSMITS.
# --------------------------------------------
#
diff -Nru a/include/linux/sctp.h b/include/linux/sctp.h
--- a/include/linux/sctp.h	Fri Feb 27 12:06:12 2004
+++ b/include/linux/sctp.h	Fri Feb 27 12:06:12 2004
@@ -61,14 +61,14 @@
 	__u16 dest;
 	__u32 vtag;
 	__u32 checksum;
-} sctp_sctphdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_sctphdr_t;

 /* Section 3.2.  Chunk Field Descriptions. */
 typedef struct sctp_chunkhdr {
 	__u8 type;
 	__u8 flags;
 	__u16 length;
-} sctp_chunkhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_chunkhdr_t;


 /* Section 3.2.  Chunk Type Values.
@@ -152,7 +152,7 @@
 typedef struct sctp_paramhdr {
 	__u16 type;
 	__u16 length;
-} sctp_paramhdr_t __attribute((packed));
+} __attribute__((packed)) sctp_paramhdr_t;

 typedef enum {

@@ -202,12 +202,12 @@
 	__u16 ssn;
 	__u32 ppid;
 	__u8  payload[0];
-} sctp_datahdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_datahdr_t;

 typedef struct sctp_data_chunk {
         sctp_chunkhdr_t chunk_hdr;
         sctp_datahdr_t  data_hdr;
-} sctp_data_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_data_chunk_t;

 /* DATA Chuck Specific Flags */
 enum {
@@ -232,48 +232,48 @@
 	__u16 num_inbound_streams;
 	__u32 initial_tsn;
 	__u8  params[0];
-} sctp_inithdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_inithdr_t;

 typedef struct sctp_init_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_inithdr_t init_hdr;
-} sctp_init_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_init_chunk_t;


 /* Section 3.3.2.1. IPv4 Address Parameter (5) */
 typedef struct sctp_ipv4addr_param {
 	sctp_paramhdr_t param_hdr;
 	struct in_addr  addr;
-} sctp_ipv4addr_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ipv4addr_param_t;

 /* Section 3.3.2.1. IPv6 Address Parameter (6) */
 typedef struct sctp_ipv6addr_param {
 	sctp_paramhdr_t param_hdr;
 	struct in6_addr addr;
-} sctp_ipv6addr_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ipv6addr_param_t;

 /* Section 3.3.2.1 Cookie Preservative (9) */
 typedef struct sctp_cookie_preserve_param {
 	sctp_paramhdr_t param_hdr;
 	uint32_t        lifespan_increment;
-} sctp_cookie_preserve_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_cookie_preserve_param_t;

 /* Section 3.3.2.1 Host Name Address (11) */
 typedef struct sctp_hostname_param {
 	sctp_paramhdr_t param_hdr;
 	uint8_t hostname[0];
-} sctp_hostname_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_hostname_param_t;

 /* Section 3.3.2.1 Supported Address Types (12) */
 typedef struct sctp_supported_addrs_param {
 	sctp_paramhdr_t param_hdr;
 	uint16_t types[0];
-} sctp_supported_addrs_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_supported_addrs_param_t;

 /* Appendix A. ECN Capable (32768) */
 typedef struct sctp_ecn_capable_param {
 	sctp_paramhdr_t param_hdr;
-} sctp_ecn_capable_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_ecn_capable_param_t;



@@ -287,13 +287,13 @@
 typedef struct sctp_cookie_param {
 	sctp_paramhdr_t p;
 	__u8 body[0];
-} sctp_cookie_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_cookie_param_t;

 /* Section 3.3.3.1 Unrecognized Parameters (8) */
 typedef struct sctp_unrecognized_param {
 	sctp_paramhdr_t param_hdr;
 	sctp_paramhdr_t unrecognized;
-} sctp_unrecognized_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_unrecognized_param_t;



@@ -308,7 +308,7 @@
 typedef struct sctp_gap_ack_block {
 	__u16 start;
 	__u16 end;
-} sctp_gap_ack_block_t __attribute__((packed));
+} __attribute__((packed)) sctp_gap_ack_block_t;

 typedef uint32_t sctp_dup_tsn_t;

@@ -323,12 +323,12 @@
 	__u16 num_gap_ack_blocks;
 	__u16 num_dup_tsns;
 	sctp_sack_variable_t variable[0];
-} sctp_sackhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_sackhdr_t;

 typedef struct sctp_sack_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_sackhdr_t sack_hdr;
-} sctp_sack_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_sack_chunk_t;


 /* RFC 2960.  Section 3.3.5 Heartbeat Request (HEARTBEAT) (4):
@@ -340,12 +340,12 @@

 typedef struct sctp_heartbeathdr {
 	sctp_paramhdr_t info;
-} sctp_heartbeathdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_heartbeathdr_t;

 typedef struct sctp_heartbeat_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_heartbeathdr_t hb_hdr;
-} sctp_heartbeat_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_heartbeat_chunk_t;


 /* For the abort and shutdown ACK we must carry the init tag in the
@@ -354,7 +354,7 @@
  */
 typedef struct sctp_abort_chunk {
         sctp_chunkhdr_t uh;
-} sctp_abort_chunkt_t __attribute__((packed));
+} __attribute__((packed)) sctp_abort_chunkt_t;


 /* For the graceful shutdown we must carry the tag (in common header)
@@ -362,14 +362,12 @@
  */
 typedef struct sctp_shutdownhdr {
 	__u32 cum_tsn_ack;
-} sctp_shutdownhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_shutdownhdr_t;

 struct sctp_shutdown_chunk_t {
         sctp_chunkhdr_t    chunk_hdr;
         sctp_shutdownhdr_t shutdown_hdr;
-} __attribute__((packed));
-
-
+} __attribute__ ((packed));

 /* RFC 2960.  Section 3.3.10 Operation Error (ERROR) (9) */

@@ -377,12 +375,12 @@
 	__u16 cause;
 	__u16 length;
 	__u8  variable[0];
-} sctp_errhdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_errhdr_t;

 typedef struct sctp_operr_chunk {
         sctp_chunkhdr_t chunk_hdr;
 	sctp_errhdr_t   err_hdr;
-} sctp_operr_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_operr_chunk_t;

 /* RFC 2960 3.3.10 - Operation Error
  *
@@ -460,7 +458,7 @@
 typedef struct sctp_ecne_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_ecnehdr_t ence_hdr;
-} sctp_ecne_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_ecne_chunk_t;

 /* RFC 2960.  Appendix A.  Explicit Congestion Notification.
  *   Congestion Window Reduced (CWR) (13)
@@ -472,7 +470,7 @@
 typedef struct sctp_cwr_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_cwrhdr_t cwr_hdr;
-} sctp_cwr_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_cwr_chunk_t;

 /*
  * ADDIP Section 3.1 New Chunk Types
@@ -513,16 +511,16 @@
 typedef struct sctp_addip_param {
 	sctp_paramhdr_t	param_hdr;
 	__u32		crr_id;
-}sctp_addip_param_t __attribute__((packed));
+} __attribute__((packed)) sctp_addip_param_t;

 typedef struct sctp_addiphdr {
 	__u32	serial;
 	__u8	params[0];
-} sctp_addiphdr_t __attribute__((packed));
+} __attribute__((packed)) sctp_addiphdr_t;

 typedef struct sctp_addip_chunk {
 	sctp_chunkhdr_t chunk_hdr;
 	sctp_addiphdr_t addip_hdr;
-} sctp_addip_chunk_t __attribute__((packed));
+} __attribute__((packed)) sctp_addip_chunk_t;

 #endif /* __LINUX_SCTP_H__ */
diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h
--- a/include/net/sctp/structs.h	Fri Feb 27 12:06:12 2004
+++ b/include/net/sctp/structs.h	Fri Feb 27 12:06:12 2004
@@ -369,7 +369,7 @@
 	struct sctp_paramhdr param_hdr;
 	union sctp_addr daddr;
 	unsigned long sent_at;
-} sctp_sender_hb_info_t __attribute__((packed));
+} __attribute__((packed)) sctp_sender_hb_info_t;

 /*
  *  RFC 2960 1.3.2 Sequenced Delivery within Streams
diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c
--- a/net/sctp/ipv6.c	Fri Feb 27 12:06:12 2004
+++ b/net/sctp/ipv6.c	Fri Feb 27 12:06:12 2004
@@ -82,14 +82,14 @@

 /* FIXME: This macro needs to be moved to a common header file. */
 #define NIP6(addr) \
-	ntohs((addr).s6_addr16[0]), \
-	ntohs((addr).s6_addr16[1]), \
-	ntohs((addr).s6_addr16[2]), \
-	ntohs((addr).s6_addr16[3]), \
-	ntohs((addr).s6_addr16[4]), \
-	ntohs((addr).s6_addr16[5]), \
-	ntohs((addr).s6_addr16[6]), \
-	ntohs((addr).s6_addr16[7])
+	ntohs((addr)->s6_addr16[0]), \
+	ntohs((addr)->s6_addr16[1]), \
+	ntohs((addr)->s6_addr16[2]), \
+	ntohs((addr)->s6_addr16[3]), \
+	ntohs((addr)->s6_addr16[4]), \
+	ntohs((addr)->s6_addr16[5]), \
+	ntohs((addr)->s6_addr16[6]), \
+	ntohs((addr)->s6_addr16[7])

 /* ICMP error handler. */
 void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
@@ -181,13 +181,13 @@
 		struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
 		fl.fl6_dst = rt0->addr;
 	}
-#if 0
+
 	SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, "
 			  "src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
 			  "dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
 			  __FUNCTION__, skb, skb->len,
 			  NIP6(fl.fl6_src), NIP6(fl.fl6_dst));
-#endif
+
 	SCTP_INC_STATS(SctpOutSCTPPacks);

 	return ip6_xmit(sk, skb, &fl, np->opt);
@@ -226,7 +226,7 @@
 		SCTP_DEBUG_PRINTK(
 			"rt6_dst:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
 			"rt6_src:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-			NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr));
+			NIP6(&rt->rt6i_dst.addr), NIP6(&rt->rt6i_src.addr));
 	} else {
 		SCTP_DEBUG_PRINTK("NO ROUTE\n");
 	}
@@ -273,13 +273,13 @@

 	SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p "
 			  "daddr:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ",
-			  __FUNCTION__, asoc, dst, NIP6(daddr->v6.sin6_addr));
+			  __FUNCTION__, asoc, dst, NIP6(&daddr->v6.sin6_addr));

 	if (!asoc) {
 		ipv6_get_saddr(dst, &daddr->v6.sin6_addr,&saddr->v6.sin6_addr);
 		SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: "
 				  "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-				  NIP6(saddr->v6.sin6_addr));
+				  NIP6(&saddr->v6.sin6_addr));
 		return;
 	}

@@ -308,12 +308,12 @@
 		memcpy(saddr, baddr, sizeof(union sctp_addr));
 		SCTP_DEBUG_PRINTK("saddr: "
 				  "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-				  NIP6(saddr->v6.sin6_addr));
+				  NIP6(&saddr->v6.sin6_addr));
 	} else {
 		printk(KERN_ERR "%s: asoc:%p Could not find a valid source "
 		       "address for the "
 		       "dest:%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-		       __FUNCTION__, asoc, NIP6(daddr->v6.sin6_addr));
+		       __FUNCTION__, asoc, NIP6(&daddr->v6.sin6_addr));
 	}

 	sctp_read_unlock(addr_lock);
@@ -678,7 +678,7 @@
 static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
 {
 	seq_printf(seq, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x ",
-		   NIP6(addr->v6.sin6_addr));
+		   NIP6(&addr->v6.sin6_addr));
 }

 /* Initialize a PF_INET6 socket msg_name. */
diff -Nru a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
--- a/net/sctp/sm_statefuns.c	Fri Feb 27 12:06:12 2004
+++ b/net/sctp/sm_statefuns.c	Fri Feb 27 12:06:12 2004
@@ -4272,8 +4272,7 @@

 	SCTP_DEBUG_PRINTK("Timer T1 expired.\n");

-	if ((timeout < asoc->max_init_timeo) &&
-	    (attempts < asoc->max_init_attempts)) {
+	if (attempts < asoc->max_init_attempts) {
 		switch (timer) {
 		case SCTP_EVENT_TIMEOUT_T1_INIT:
 			bp = (struct sctp_bind_addr *) &asoc->base.bind_addr;

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [BK PATCH] 2.4 SCTP updates
@ 2004-02-14  0:07 Sridhar Samudrala
  2004-02-14  5:54 ` David S. Miller
  0 siblings, 1 reply; 13+ messages in thread
From: Sridhar Samudrala @ 2004-02-14  0:07 UTC (permalink / raw)
  To: davem; +Cc: netdev, lksctp-developers

Hi Dave,

Please do a
	bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work
to get the following udpates to SCTP on top fo linux 2.4.25-rc2

These set of csets bring 2.4 in sync with 2.6 lksctp. I tried to keep
2.4 specific changes isolated to the following few files using #defines in
compat.h.
	- include/net/sctp/compat.h
	- include/net/sctp/sctp.h
	- include/net/sctp/structs.h
	- net/sctp/Config.in
	- net/sctp/Makefile
	- net/sctp/endpointola.c
	- net/sctp/input.c
	- net/sctp/inqueue.c
	- net/sctp/ipv6.c
	- net/sctp/objcnt.c
	- net/sctp/proc.c
	- net/sctp/protocol.c
	- net/sctp/socket.c
	- net/sctp/sysctl.c
	- net/sctp/ulpqueue.c
	- net/sctp/chunk.c
The rest of the files are identical to 2.6 sctp files.

I could not find an easy way to do the backport of choice construct to select
HMAC algorithm in 2.6 Kconfig to 2.4 Config.in. I did it in a convoluted
way with multiple choices nested in ifs. It may be possible to do the same in
a much simpler way.

# This patch includes the following deltas:
#	           ChangeSet	1.1308  -> 1.1312
#	 net/sctp/ulpqueue.c	1.1     -> 1.2
#	include/net/sctp/compat.h	1.2     -> 1.3
#	include/linux/sysctl.h	1.40    -> 1.41
#	include/net/sctp/constants.h	1.1     -> 1.2
#	net/sctp/sm_make_chunk.c	1.1     -> 1.2
#	   net/sctp/tsnmap.c	1.1     -> 1.2
#	net/sctp/primitive.c	1.1     -> 1.2
#	   net/sctp/sysctl.c	1.1     -> 1.2
#	     net/sctp/proc.c	1.1     -> 1.2
#	   net/sctp/socket.c	1.2     -> 1.5
#	include/net/sctp/sla1.h	1.1     ->         (deleted)
#	 net/sctp/outqueue.c	1.2     -> 1.3
#	include/net/sctp/sctp.h	1.3     -> 1.4
#	include/net/sctp/sm.h	1.1     -> 1.2
#	   net/sctp/objcnt.c	1.1     -> 1.2
#	   net/sctp/Makefile	1.1     -> 1.2
#	net/sctp/associola.c	1.2     -> 1.3
#	  net/sctp/inqueue.c	1.1     -> 1.2
#	    net/sctp/debug.c	1.1     -> 1.2
#	include/net/sctp/user.h	1.1     -> 1.2
#	net/sctp/sm_statefuns.c	1.1     -> 1.2
#	   net/sctp/output.c	1.1     -> 1.2
#	     net/sctp/sla1.c	1.1     ->         (deleted)
#	     net/sctp/ipv6.c	1.1     -> 1.2
#	net/sctp/transport.c	1.2     -> 1.3
#	 net/sctp/protocol.c	1.1     -> 1.2
#	include/linux/sctp.h	1.1     -> 1.2
#	net/sctp/bind_addr.c	1.1     -> 1.2
#	         MAINTAINERS	1.125   -> 1.126
#	net/sctp/sm_sideeffect.c	1.1     -> 1.2
#	net/sctp/sm_statetable.c	1.1     -> 1.2
#	    net/sctp/input.c	1.1     -> 1.2
#	 net/sctp/ulpevent.c	1.1     -> 1.2
#	include/net/sctp/structs.h	1.2     -> 1.3
#	  net/sctp/adler32.c	1.1     ->         (deleted)
#	include/net/sctp/tsnmap.h	1.1     -> 1.2
#	  net/sctp/Config.in	1.1     -> 1.2
#	include/net/sctp/command.h	1.1     -> 1.2
#	   net/sctp/ssnmap.c	1.1     -> 1.2
#	net/sctp/hashdriver.c	1.1     ->         (deleted)
#	Documentation/Configure.help	1.227   -> 1.228
#	include/net/sctp/ulpevent.h	1.1     -> 1.2
#	net/sctp/endpointola.c	1.1     -> 1.2
#	               (new)	        -> 1.1     net/sctp/chunk.c
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/02/12	sri@us.ibm.com	1.1309
# [SCTP] Sync with 2.6.2 SCTP.
# --------------------------------------------
# 04/02/12	sri@us.ibm.com	1.1310
# [SCTP] Use __get_free_pages() to allocate ssnmap.
#
# This is needed to avoid kmalloc()'s 128K limit when an association is
# initialized with a large no. of streams(more than 65000 inbound +
# outbound streams).
# --------------------------------------------
# 04/02/12	sri@us.ibm.com	1.1311
# [SCTP] Fix SCTP_INITMSG set socket option so that a parameter with 0
#        value will not change its current value.
# --------------------------------------------
# 04/02/13	sri@us.ibm.com	1.1312
# [SCTP] Fix sctp_getladdrs()/sctp_getpaddrs() API so that the port
#        value in the returned addresses is in network byte order.
# --------------------------------------------
#

Thanks
Sridhar

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-08-13  1:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-06 19:09 [BK PATCH] 2.4 SCTP updates Sridhar Samudrala
2004-04-06 20:52 ` David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2004-08-13  0:24 Sridhar Samudrala
2004-08-13  1:00 ` David S. Miller
2004-03-23 20:15 Sridhar Samudrala
2004-03-24 19:59 ` David S. Miller
2004-02-27 20:31 Sridhar Samudrala
2004-02-27 21:38 ` David S. Miller
2004-02-27 21:44   ` Jeff Garzik
2004-02-27 22:52   ` Sridhar Samudrala
2004-02-28 23:49     ` David S. Miller
2004-02-14  0:07 Sridhar Samudrala
2004-02-14  5:54 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).