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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Oct 2007 08:30:43 -0700
From:	Stephen Hemminger <shemminger@...ux-foundation.org>
To:	Alexey Dobriyan <adobriyan@...ru>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] Convert /proc/net/ipv6_route to seq_file interface

On Tue, 30 Oct 2007 16:11:47 +0300
Alexey Dobriyan <adobriyan@...ru> wrote:
>  
> +static const struct file_operations ipv6_route_proc_fops = {
> +	.open		= ipv6_route_open,
> +	.read		= seq_read,
> +	.llseek		= seq_lseek,
> +	.release	= single_release,
> +};
> +

This needs
	.owner		= THIS_MODULE,


>
>  static int rt6_stats_seq_show(struct seq_file *seq, void *v)
>  {
>  	seq_printf(seq, "%04x %04x %04x %04x %04x %04x %04x\n",
> @@ -2499,9 +2477,11 @@ void __init ip6_route_init(void)
>  
>  	fib6_init();
>  #ifdef 	CONFIG_PROC_FS
> -	p = proc_net_create(&init_net, "ipv6_route", 0, rt6_proc_info);
> -	if (p)
> +	p = create_proc_entry("ipv6_route", 0, init_net.proc_net);
> +	if (p) {
>  		p->owner = THIS_MODULE;
> +		p->proc_fops = &ipv6_route_proc_fops;
> +	}
>  
>  	proc_net_fops_create(&init_net, "rt6_stats", S_IRUGO, &rt6_stats_seq_fops);
>  #endif
> 

Use proc_net_fops_create()
	proc_net_fops_create(&init_net, "ipv6_route", S_IRUGO, &ipv6_route_proc_fops)


You can get rid of #ifdef since proc_net_fops_create stub does correct thing
if PROC_FS is not configured.


-- 
Stephen Hemminger <shemminger@...ux-foundation.org>
-
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