lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 21 Jan 2011 11:30:32 -0800
From:	Joe Perches <joe@...ches.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, paulus@...ba.org
Subject: Re: [PATCH 1/4] ppp: Clean up kernel log messages.

On Thu, 2011-01-20 at 23:56 -0800, David Miller wrote:
> Use netdev_*() and pr_*().

Perhaps it's better to standardize on "PPP: " or "ppp: "
for these outputs.

Maybe use pr_fmt(fmt) "ppp: " fmt or add a function like:

void ppp_printk(const char *level, const struct ppp* ppp, const char *fmt, ...)
{
	struct va_list args;
	struct va_format vaf;

	va_start(args, fmt);

	vaf.fmt = fmt;
	vaf.va = &args;
	if (ppp && ppp->dev)
		netdev_printk(level, ppp->dev, "ppp: %pV", &vaf);
	else
		printk("%sppp: %pV", level, &vaf);

	va_end(va);
}
and
#define ppp_err(ppp, fmt, ...) ppp_printk(KERN_ERR, ppp, fmt, ##__VA_ARGS__)
etc...

> diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
> -			printk(KERN_DEBUG "PPPIOCDETACH file->f_count=%ld\n",
> -			       atomic_long_read(&file->f_count));
> +			pr_warn("PPPIOCDETACH file->f_count=%ld\n",
[]
> -		printk(KERN_ERR "PPP: not interface or channel??\n");
> +		pr_err("PPP: not interface or channel??\n");
[]
>  		if (net_ratelimit())
> -			printk(KERN_ERR "ppp: compressor dropped pkt\n");
> +			netdev_err(ppp->dev, "ppp: compressor dropped pkt\n");
[]
> -				printk(KERN_DEBUG "PPP: outbound frame not passed\n");
> +				netdev_printk(KERN_DEBUG, ppp->dev,
> +					      "PPP: outbound frame "
> +					      "not passed\n");
[]
> -				printk(KERN_ERR "ppp: compression required but down - pkt dropped.\n");
> +				netdev_err(ppp->dev,
> +					   "ppp: compression required but "
> +					   "down - pkt dropped.\n");

etc.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ