linux-ppp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Domsch <Matt_Domsch@dell.com>
To: linux-ppp@vger.kernel.org
Subject: Re: [pptp-devel] Re: ppp_mppe status for 2.6.x kernels
Date: Wed, 13 Oct 2004 16:41:35 +0000	[thread overview]
Message-ID: <20041013164135.GA29936@lists.us.dell.com> (raw)
In-Reply-To: <20041012220528.GA7876@lists.us.dell.com>

On Wed, Oct 13, 2004 at 02:47:16PM +0400, Michael Tokarev wrote:
> >+                       printk(KERN_ERR "ppp: compression required but 
> >down - pkt dropped.\n");
>
> Please don't do that -- don't flood syslog.  See how similar
> things are done in other net/ code (eg, using net_ratelimit()).

Good point.  I've added net_ratelimit()s to the printks that my patch
touches.  There are a few others in ppp_generic.c which might benefit
from the same treatment, but I'd rather not do those in conjunction
with the changes necessary for ppp_mppe inclusion.

How's this look?

-- 
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

=== drivers/net/ppp_generic.c 1.50 vs edited ==--- 1.50/drivers/net/ppp_generic.c	2004-10-12 11:10:48 -05:00
+++ edited/drivers/net/ppp_generic.c	2004-10-13 09:36:22 -05:00
@@ -1017,7 +1017,8 @@
 	int compressor_skb_size = ppp->dev->mtu + ppp->xcomp->comp_skb_extra_space + PPP_HDRLEN;
 	new_skb = alloc_skb(new_skb_size, GFP_ATOMIC);
 	if (!new_skb) {
-		printk(KERN_ERR "PPP: no memory (comp pkt)\n");
+		if (net_ratelimit())
+			printk(KERN_ERR "PPP: no memory (comp pkt)\n");
 		return NULL;
 	}
 	if (ppp->dev->hard_header_len > PPP_HDRLEN)
@@ -1046,7 +1047,8 @@
 		 * the compress_proto because MPPE and MPPC share
 		 * the same number.
 		 */
-		printk(KERN_ERR "ppp: compressor dropped pkt\n");
+		if (net_ratelimit())
+			printk(KERN_ERR "ppp: compressor dropped pkt\n");
 		kfree_skb(new_skb);
 		new_skb = NULL;
 	}
@@ -1140,7 +1142,8 @@
 	if ((ppp->xstate & SC_COMP_RUN) && ppp->xc_state != 0
 	    && proto != PPP_LCP && proto != PPP_CCP) {
 		if (!(ppp->flags & SC_CCP_UP) && ppp->xcomp->must_compress) {
-			printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
+			if (net_ratelimit())
+				printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
 			goto drop;
 		}
 		skb = pad_compress_skb(ppp, skb);

  parent reply	other threads:[~2004-10-13 16:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-12 22:05 ppp_mppe status for 2.6.x kernels Matt Domsch
2004-10-13  2:49 ` [pptp-devel] " Matt Domsch
2004-10-13 10:47 ` Michael Tokarev
2004-10-13 16:41 ` Matt Domsch [this message]
2004-10-14  4:39 ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041013164135.GA29936@lists.us.dell.com \
    --to=matt_domsch@dell.com \
    --cc=linux-ppp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).