X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=net%2Fsctp%2Finput.c;h=ea2192444ce66413261d20ce8ec236279496d141;hb=50b5d6ad63821cea324a5a7a19854d4de1a0a819;hp=2a570184e5a9176c07291eb7ab6f8771c2dd95c0;hpb=6ec82562ffc6f297d0de36d65776cff8e5704867;p=~andy%2Flinux diff --git a/net/sctp/input.c b/net/sctp/input.c index 2a570184e5a..ea2192444ce 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -440,11 +440,25 @@ void sctp_icmp_proto_unreachable(struct sock *sk, { SCTP_DEBUG_PRINTK("%s\n", __func__); - sctp_do_sm(SCTP_EVENT_T_OTHER, - SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), - asoc->state, asoc->ep, asoc, t, - GFP_ATOMIC); + if (sock_owned_by_user(sk)) { + if (timer_pending(&t->proto_unreach_timer)) + return; + else { + if (!mod_timer(&t->proto_unreach_timer, + jiffies + (HZ/20))) + sctp_association_hold(asoc); + } + + } else { + if (timer_pending(&t->proto_unreach_timer) && + del_timer(&t->proto_unreach_timer)) + sctp_association_put(asoc); + sctp_do_sm(SCTP_EVENT_T_OTHER, + SCTP_ST_OTHER(SCTP_EVENT_ICMP_PROTO_UNREACH), + asoc->state, asoc->ep, asoc, t, + GFP_ATOMIC); + } } /* Common lookup code for icmp/icmpv6 error handler. */