From: Alexey Dobriyan <adobriyan@gmail.com>
To: Vasiliy Kulikov <segoon@openwall.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Pavel Kankovsky <peak@argo.troja.mff.cuni.cz>,
Solar Designer <solar@openwall.com>,
Kees Cook <kees.cook@canonical.com>,
Dan Rosenberg <dan.j.rosenberg@gmail.com>,
Eugene Teo <eugene@redhat.com>,
Nelson Elhage <nelhage@ksplice.com>,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Pekka Savola <pekkas@netcore.fi>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH] net: ipv4: add IPPROTO_ICMP socket kind
Date: Wed, 13 Apr 2011 13:29:49 +0300 [thread overview]
Message-ID: <BANLkTi=ogJg_uJqsJFpnwnnr6LS+SFT3Vg@mail.gmail.com> (raw)
In-Reply-To: <20110409101514.GA4262@albatros>
On Sat, Apr 9, 2011 at 1:15 PM, Vasiliy Kulikov <segoon@openwall.com> wrote:
> This patch adds IPPROTO_ICMP socket kind.
> + seq_printf(f, "%5d: %08X:%04X %08X:%04X"
> + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n",
> + bucket, src, srcp, dest, destp, sp->sk_state,
> + sk_wmem_alloc_get(sp),
> + sk_rmem_alloc_get(sp),
> + 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
These zeroes can be embedded into format string for slightly faster printing.
> +static const struct file_operations ping_seq_fops = {
> + .owner = THIS_MODULE,
Unnecessary line.
->owner is unused for proc files, this is not documented anywhere, but
it's unused.
> + .open = ping_seq_open,
> + .read = seq_read,
> + .llseek = seq_lseek,
> + .release = seq_release_net,
> +};
> +
> +static const char ping_proc_name[] = "icmp";
Ewww :-)
Does not compiler create only one string?
> +static int ping_proc_register(struct net *net)
> +{
> + struct proc_dir_entry *p;
> + int rc = 0;
> +
> + p = proc_create_data(ping_proc_name, S_IRUGO, net->proc_net,
> + &ping_seq_fops, NULL);
There is proc_net_fops_create().
> + if (!p)
> + rc = -ENOMEM;
> + return rc;
> +}
> @@ -680,6 +747,15 @@ static struct ctl_table ipv4_net_table[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec
> },
> +#ifdef CONFIG_IP_PING
> + {
> + .procname = "ping_group_range",
> + .data = &init_net.ipv4.sysctl_ping_group_range,
> + .maxlen = sizeof(init_net.ipv4.sysctl_ping_group_range),
> + .mode = 0644,
> + .proc_handler = ipv4_ping_group_range,
> + },
> +#endif
> { }
> };
>
> @@ -714,8 +790,22 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
> &net->ipv4.sysctl_icmp_ratemask;
> table[6].data =
> &net->ipv4.sysctl_rt_cache_rebuild_count;
> +#ifdef CONFIG_IP_PING
> + table[7].data =
> + &net->ipv4.sysctl_ping_group_range;
> +#endif
Now I understand it's not related, but next sysctl will have
"table[8].data = ..." line which is off-by-one if CONFIG_IP_PING=n.
next prev parent reply other threads:[~2011-04-13 10:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-09 10:15 [PATCH] net: ipv4: add IPPROTO_ICMP socket kind Vasiliy Kulikov
2011-04-12 5:06 ` Solar Designer
2011-04-12 21:25 ` David Miller
2011-04-13 11:22 ` Vasiliy Kulikov
2011-05-05 11:32 ` Vasiliy Kulikov
2011-05-10 18:09 ` [PATCH v2] " Vasiliy Kulikov
2011-05-10 19:15 ` David Miller
2011-05-10 19:45 ` Vasiliy Kulikov
2011-05-13 20:01 ` [PATCH v3] " Vasiliy Kulikov
2011-05-13 20:08 ` David Miller
2011-05-13 21:30 ` Andi Kleen
[not found] ` <m2wrhuxp8c.fsf-Vw/NltI1exuRpAAqCnN02g@public.gmane.org>
2011-05-13 22:22 ` [PATCH net-next-2.6] net: ipv4: add ping_group_range documentation Eric Dumazet
2011-05-15 8:18 ` [PATCH net-next-2.6] net: ping: dont call udp_ioctl() Eric Dumazet
2011-05-15 21:30 ` Solar Designer
2011-05-15 21:44 ` David Miller
2011-05-16 7:26 ` [PATCH net-next-2.6 v2] " Eric Dumazet
2011-05-16 12:48 ` Vasiliy Kulikov
2011-05-16 15:50 ` David Miller
2011-04-13 10:29 ` Alexey Dobriyan [this message]
2011-04-13 11:32 ` [PATCH] net: ipv4: add IPPROTO_ICMP socket kind Vasiliy Kulikov
2011-04-14 9:16 ` Alexey Dobriyan
2011-05-22 16:01 ` Pavel Kankovsky
2011-05-22 17:46 ` Vasiliy Kulikov
2011-04-14 1:53 ` Simon Horman
-- strict thread matches above, loose matches on Subject: below --
2011-03-18 18:00 Vasiliy Kulikov
2011-03-18 19:47 ` David Miller
2011-03-18 19:59 ` Vasiliy Kulikov
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='BANLkTi=ogJg_uJqsJFpnwnnr6LS+SFT3Vg@mail.gmail.com' \
--to=adobriyan@gmail.com \
--cc=dan.j.rosenberg@gmail.com \
--cc=davem@davemloft.net \
--cc=eugene@redhat.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kees.cook@canonical.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=nelhage@ksplice.com \
--cc=netdev@vger.kernel.org \
--cc=peak@argo.troja.mff.cuni.cz \
--cc=pekkas@netcore.fi \
--cc=segoon@openwall.com \
--cc=solar@openwall.com \
--cc=yoshfuji@linux-ipv6.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).