patch-2.4.27 linux-2.4.27/net/sctp/chunk.c
Next file: linux-2.4.27/net/sctp/crc32c.c
Previous file: linux-2.4.27/net/sctp/associola.c
Back to the patch index
Back to the overall index
- Lines: 83
- Date:
2004-08-07 16:26:07.090446873 -0700
- Orig file:
linux-2.4.26/net/sctp/chunk.c
- Orig date:
2004-04-14 06:05:41.000000000 -0700
diff -urN linux-2.4.26/net/sctp/chunk.c linux-2.4.27/net/sctp/chunk.c
@@ -1,5 +1,5 @@
/* SCTP kernel reference Implementation
- * Copyright (c) 2003 International Business Machines Corp.
+ * (C) Copyright IBM Corp. 2003, 2004
*
* This file is part of the SCTP kernel reference Implementation
*
@@ -31,6 +31,7 @@
*
* Written or modified by:
* Jon Grimm <jgrimm@us.ibm.com>
+ * Sridhar Samudrala <sri@us.ibm.com>
*
* Any bugs reported given to us we will try to fix... any fixes shared will
* be incorporated into the next SCTP release.
@@ -55,7 +56,8 @@
atomic_set(&msg->refcnt, 1);
msg->send_failed = 0;
msg->send_error = 0;
- msg->can_expire = 0;
+ msg->can_abandon = 0;
+ msg->expires_at = 0;
INIT_LIST_HEAD(&msg->chunks);
}
@@ -185,27 +187,14 @@
/* sinfo_timetolive is in milliseconds */
msg->expires_at = jiffies +
SCTP_MSECS_TO_JIFFIES(sinfo->sinfo_timetolive);
- msg->can_expire = 1;
+ msg->can_abandon = 1;
+ SCTP_DEBUG_PRINTK("%s: msg:%p expires_at: %ld jiffies:%ld\n",
+ __FUNCTION__, msg, msg->expires_at, jiffies);
}
- /* What is a reasonable fragmentation point right now? */
- max = asoc->pmtu;
- if (max < SCTP_MIN_PMTU)
- max = SCTP_MIN_PMTU;
- max -= SCTP_IP_OVERHEAD;
-
- /* Make sure not beyond maximum chunk size. */
- if (max > SCTP_MAX_CHUNK_LEN)
- max = SCTP_MAX_CHUNK_LEN;
+ max = asoc->frag_point;
- /* Subtract out the overhead of a data chunk header. */
- max -= sizeof(struct sctp_data_chunk);
whole = 0;
-
- /* If user has specified smaller fragmentation, make it so. */
- if (sctp_sk(asoc->base.sk)->user_frag)
- max = min_t(int, max, sctp_sk(asoc->base.sk)->user_frag);
-
first_len = max;
/* Encourage Cookie-ECHO bundling. */
@@ -299,14 +288,11 @@
}
/* Check whether this message has expired. */
-int sctp_datamsg_expires(struct sctp_chunk *chunk)
+int sctp_chunk_abandoned(struct sctp_chunk *chunk)
{
struct sctp_datamsg *msg = chunk->msg;
- /* FIXME: When PR-SCTP is supported we can make this
- * check more lenient.
- */
- if (!msg->can_expire)
+ if (!msg->can_abandon)
return 0;
if (time_after(jiffies, msg->expires_at))
@@ -316,7 +302,7 @@
}
/* This chunk (and consequently entire message) has failed in its sending. */
-void sctp_datamsg_fail(struct sctp_chunk *chunk, int error)
+void sctp_chunk_fail(struct sctp_chunk *chunk, int error)
{
chunk->msg->send_failed = 1;
chunk->msg->send_error = error;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)