summaryrefslogtreecommitdiffstats
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-06-14 13:06:21 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-06-14 13:06:21 -0700
commit559f0a2857f1d1a93c4f398d2775e228fdb8b8ce (patch)
treeab30bcb58b49c17aa40942ebfb446a8e3a26deac /net/sctp/transport.c
parent74235a25c673f80147c1f975304888e8212a14d5 (diff)
parent06ad391919b2078ec2e012f0593014b88e7a6c4e (diff)
downloadop-kernel-dev-559f0a2857f1d1a93c4f398d2775e228fdb8b8ce.zip
op-kernel-dev-559f0a2857f1d1a93c4f398d2775e228fdb8b8ce.tar.gz
Merge master.kernel.org:/pub/scm/linux/kernel/git/vxy/lksctp-dev
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 961df27..5f467c9 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -241,6 +241,45 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
}
+/* this is a complete rip-off from __sk_dst_check
+ * the cookie is always 0 since this is how it's used in the
+ * pmtu code
+ */
+static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
+{
+ struct dst_entry *dst = t->dst;
+
+ if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
+ dst_release(t->dst);
+ t->dst = NULL;
+ return NULL;
+ }
+
+ return dst;
+}
+
+void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
+{
+ struct dst_entry *dst;
+
+ if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
+ printk(KERN_WARNING "%s: Reported pmtu %d too low, "
+ "using default minimum of %d\n",
+ __FUNCTION__, pmtu,
+ SCTP_DEFAULT_MINSEGMENT);
+ /* Use default minimum segment size and disable
+ * pmtu discovery on this transport.
+ */
+ t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
+ } else {
+ t->pathmtu = pmtu;
+ }
+
+ dst = sctp_transport_dst_check(t);
+ if (dst)
+ dst->ops->update_pmtu(dst, pmtu);
+}
+
/* Caches the dst entry and source address for a transport's destination
* address.
*/
OpenPOWER on IntegriCloud