diff options
Diffstat (limited to 'net/sctp/input.c')
| -rw-r--r-- | net/sctp/input.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index b24ff2c1aef5..238f1bffa684 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
| @@ -305,18 +305,36 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
| 305 | void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, | 305 | void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, |
| 306 | struct sctp_transport *t, __u32 pmtu) | 306 | struct sctp_transport *t, __u32 pmtu) |
| 307 | { | 307 | { |
| 308 | if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { | 308 | if (sock_owned_by_user(sk) || !t || (t->pathmtu == pmtu)) |
| 309 | printk(KERN_WARNING "%s: Reported pmtu %d too low, " | 309 | return; |
| 310 | "using default minimum of %d\n", __FUNCTION__, pmtu, | ||
| 311 | SCTP_DEFAULT_MINSEGMENT); | ||
| 312 | pmtu = SCTP_DEFAULT_MINSEGMENT; | ||
| 313 | } | ||
| 314 | 310 | ||
| 315 | if (!sock_owned_by_user(sk) && t && (t->pmtu != pmtu)) { | 311 | if (t->param_flags & SPP_PMTUD_ENABLE) { |
| 316 | t->pmtu = pmtu; | 312 | if (unlikely(pmtu < SCTP_DEFAULT_MINSEGMENT)) { |
| 313 | printk(KERN_WARNING "%s: Reported pmtu %d too low, " | ||
| 314 | "using default minimum of %d\n", | ||
| 315 | __FUNCTION__, pmtu, | ||
| 316 | SCTP_DEFAULT_MINSEGMENT); | ||
| 317 | /* Use default minimum segment size and disable | ||
| 318 | * pmtu discovery on this transport. | ||
| 319 | */ | ||
| 320 | t->pathmtu = SCTP_DEFAULT_MINSEGMENT; | ||
| 321 | t->param_flags = (t->param_flags & ~SPP_HB) | | ||
| 322 | SPP_PMTUD_DISABLE; | ||
| 323 | } else { | ||
| 324 | t->pathmtu = pmtu; | ||
| 325 | } | ||
| 326 | |||
| 327 | /* Update association pmtu. */ | ||
| 317 | sctp_assoc_sync_pmtu(asoc); | 328 | sctp_assoc_sync_pmtu(asoc); |
| 318 | sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); | ||
| 319 | } | 329 | } |
| 330 | |||
| 331 | /* Retransmit with the new pmtu setting. | ||
| 332 | * Normally, if PMTU discovery is disabled, an ICMP Fragmentation | ||
| 333 | * Needed will never be sent, but if a message was sent before | ||
| 334 | * PMTU discovery was disabled that was larger than the PMTU, it | ||
| 335 | * would not be fragmented, so it must be re-transmitted fragmented. | ||
| 336 | */ | ||
| 337 | sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); | ||
| 320 | } | 338 | } |
| 321 | 339 | ||
| 322 | /* | 340 | /* |
