aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 132046cb82fc..394c57ca2f54 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -48,6 +48,8 @@
48 * be incorporated into the next SCTP release. 48 * be incorporated into the next SCTP release.
49 */ 49 */
50 50
51#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
52
51#include <linux/slab.h> 53#include <linux/slab.h>
52#include <linux/types.h> 54#include <linux/types.h>
53#include <linux/random.h> 55#include <linux/random.h>
@@ -209,15 +211,17 @@ void sctp_transport_set_owner(struct sctp_transport *transport,
209} 211}
210 212
211/* Initialize the pmtu of a transport. */ 213/* Initialize the pmtu of a transport. */
212void sctp_transport_pmtu(struct sctp_transport *transport) 214void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
213{ 215{
214 struct dst_entry *dst; 216 /* If we don't have a fresh route, look one up */
215 217 if (!transport->dst || transport->dst->obsolete > 1) {
216 dst = transport->af_specific->get_dst(NULL, &transport->ipaddr, NULL); 218 dst_release(transport->dst);
219 transport->af_specific->get_dst(transport, &transport->saddr,
220 &transport->fl, sk);
221 }
217 222
218 if (dst) { 223 if (transport->dst) {
219 transport->pathmtu = dst_mtu(dst); 224 transport->pathmtu = dst_mtu(transport->dst);
220 dst_release(dst);
221 } else 225 } else
222 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
223} 227}
@@ -244,10 +248,9 @@ void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
244 struct dst_entry *dst; 248 struct dst_entry *dst;
245 249
246 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { 250 if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) {
247 printk(KERN_WARNING "%s: Reported pmtu %d too low, " 251 pr_warn("%s: Reported pmtu %d too low, using default minimum of %d\n",
248 "using default minimum of %d\n", 252 __func__, pmtu,
249 __func__, pmtu, 253 SCTP_DEFAULT_MINSEGMENT);
250 SCTP_DEFAULT_MINSEGMENT);
251 /* Use default minimum segment size and disable 254 /* Use default minimum segment size and disable
252 * pmtu discovery on this transport. 255 * pmtu discovery on this transport.
253 */ 256 */
@@ -269,22 +272,19 @@ void sctp_transport_route(struct sctp_transport *transport,
269{ 272{
270 struct sctp_association *asoc = transport->asoc; 273 struct sctp_association *asoc = transport->asoc;
271 struct sctp_af *af = transport->af_specific; 274 struct sctp_af *af = transport->af_specific;
272 union sctp_addr *daddr = &transport->ipaddr;
273 struct dst_entry *dst;
274 275
275 dst = af->get_dst(asoc, daddr, saddr); 276 af->get_dst(transport, saddr, &transport->fl, sctp_opt2sk(opt));
276 277
277 if (saddr) 278 if (saddr)
278 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr)); 279 memcpy(&transport->saddr, saddr, sizeof(union sctp_addr));
279 else 280 else
280 af->get_saddr(opt, asoc, dst, daddr, &transport->saddr); 281 af->get_saddr(opt, transport, &transport->fl);
281 282
282 transport->dst = dst;
283 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) { 283 if ((transport->param_flags & SPP_PMTUD_DISABLE) && transport->pathmtu) {
284 return; 284 return;
285 } 285 }
286 if (dst) { 286 if (transport->dst) {
287 transport->pathmtu = dst_mtu(dst); 287 transport->pathmtu = dst_mtu(transport->dst);
288 288
289 /* Initialize sk->sk_rcv_saddr, if the transport is the 289 /* Initialize sk->sk_rcv_saddr, if the transport is the
290 * association's active path for getsockname(). 290 * association's active path for getsockname().