Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d99fa42963a5ae394cf1df9d5bb739eb378a189b
Commit:     d99fa42963a5ae394cf1df9d5bb739eb378a189b
Parent:     00f1c2df2a1c4903f4daa1333bafeb6dcbc9591d
Author:     Wei Yongjun <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 27 11:19:24 2007 +0800
Committer:  Vlad Yasevich <[EMAIL PROTECTED]>
CommitDate: Thu Aug 30 13:52:56 2007 -0400

    SCTP: Use net_ratelimit to suppress error messages print too fast
    
    When multi bundling SHUTDOWN-ACK message is received in ESTAB state,
    this will cause "sctp protocol violation state" message print many times.
    If SHUTDOWN-ACK is bundled 300 times in one packet, message will be
    print 300 times. The same problem also exists when received unexpected
    HEARTBEAT-ACK message which is bundled message times.
    
    This patch used net_ratelimit() to suppress error messages print too fast.
    
    Signed-off-by: Wei Yongjun <[EMAIL PROTECTED]>
    Signed-off-by: Vlad Yasevich <[EMAIL PROTECTED]>
---
 net/sctp/sm_sideeffect.c |    5 +++--
 net/sctp/sm_statefuns.c  |   26 ++++++++++++++------------
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 1907318..8d78900 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -1013,8 +1013,9 @@ static int sctp_side_effects(sctp_event_t event_type, 
sctp_subtype_t subtype,
                break;
 
        case SCTP_DISPOSITION_VIOLATION:
-               printk(KERN_ERR "sctp protocol violation state %d "
-                      "chunkid %d\n", state, subtype.chunk);
+               if (net_ratelimit())
+                       printk(KERN_ERR "sctp protocol violation state %d "
+                              "chunkid %d\n", state, subtype.chunk);
                break;
 
        case SCTP_DISPOSITION_NOT_IMPL:
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 350d476..276e26d 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1032,19 +1032,21 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct 
sctp_endpoint *ep,
        /* This should never happen, but lets log it if so.  */
        if (unlikely(!link)) {
                if (from_addr.sa.sa_family == AF_INET6) {
-                       printk(KERN_WARNING
-                              "%s association %p could not find address "
-                              NIP6_FMT "\n",
-                              __FUNCTION__,
-                              asoc,
-                              NIP6(from_addr.v6.sin6_addr));
+                       if (net_ratelimit())
+                               printk(KERN_WARNING
+                                   "%s association %p could not find address "
+                                   NIP6_FMT "\n",
+                                   __FUNCTION__,
+                                   asoc,
+                                   NIP6(from_addr.v6.sin6_addr));
                } else {
-                       printk(KERN_WARNING
-                              "%s association %p could not find address "
-                              NIPQUAD_FMT "\n",
-                              __FUNCTION__,
-                              asoc,
-                              NIPQUAD(from_addr.v4.sin_addr.s_addr));
+                       if (net_ratelimit())
+                               printk(KERN_WARNING
+                                   "%s association %p could not find address "
+                                   NIPQUAD_FMT "\n",
+                                   __FUNCTION__,
+                                   asoc,
+                                   NIPQUAD(from_addr.v4.sin_addr.s_addr));
                }
                return SCTP_DISPOSITION_DISCARD;
        }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to