aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-06-07 13:47:03 -0400
committerVladislav Yasevich <vxy@hera.kernel.org>2007-06-13 16:44:42 -0400
commitc910b47e1811b3f8b184108c48de3d7af3e2999b (patch)
tree76ca90239b074a13137217d3732f79fe83a2500b /net/sctp/transport.c
parentfe979ac169970b3d12facd6565766735862395c5 (diff)
[SCTP] Update pmtu handling to be similar to tcp
Introduce new function sctp_transport_update_pmtu that updates the transports and destination caches view of the path mtu. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Acked-by: Sridhar Samudrala <sri@us.ibm.com>
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 961df275d5b9..e14c271cf28b 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -241,6 +241,47 @@ void sctp_transport_pmtu(struct sctp_transport *transport)
241 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 241 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
242} 242}
243 243
244/* this is a complete rip-off from __sk_dst_check
245 * the cookie is always 0 since this is how it's used in the
246 * pmtu code
247 */
248static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
249{
250 struct dst_entry *dst = t->dst;
251
252 if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
253 dst_release(t->dst);
254 t->dst = NULL;
255 return NULL;
256 }
257
258 return dst;
259}
260
261void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
262{
263 struct dst_entry *dst;
264
265 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
266 printk(KERN_WARNING "%s: Reported pmtu %d too low, "
267 "using default minimum of %d\n",
268 __FUNCTION__, pmtu,
269 SCTP_DEFAULT_MINSEGMENT);
270 /* Use default minimum segment size and disable
271 * pmtu discovery on this transport.
272 */
273 t->pathmtu = SCTP_DEFAULT_MINSEGMENT;
274 t->param_flags = (t->param_flags & ~SPP_PMTUD) |
275 SPP_PMTUD_DISABLE;
276 } else {
277 t->pathmtu = pmtu;
278 }
279
280 dst = sctp_transport_dst_check(t);
281 if (dst)
282 dst->ops->update_pmtu(dst, pmtu);
283}
284
244/* Caches the dst entry and source address for a transport's destination 285/* Caches the dst entry and source address for a transport's destination
245 * address. 286 * address.
246 */ 287 */