From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Patrick McHardy <kaber@trash.net>,
davem@davemloft.net, netdev@vger.kernel.org,
linux-next@vger.kernel.org, xemul@openvz.org,
adobriyan@gmail.com, Netfilter Development Mailinglist
Subject: Re: [RFC 0/4] netfilter conntrack sysctls pernet support
Date: Tue, 10 Mar 2009 00:08:43 +0300 [thread overview]
Message-ID: <20090309210843.GB18357@localhost> (raw)
In-Reply-To: <20090309190744.GA18357@localhost>
[Cyrill Gorcunov - Mon, Mar 09, 2009 at 10:07:44PM +0300]
...
| >> + sn->sysctl_table[0].data = &sn->sctp_timeouts[SCTP_CONNTRACK_CLOSED];
| >> + sn->sysctl_table[1].data = &sn->sctp_timeouts[SCTP_CONNTRACK_COOKIE_WAIT];
| >> + sn->sysctl_table[2].data = &sn->sctp_timeouts[SCTP_CONNTRACK_COOKIE_ECHOED];
| >> + sn->sysctl_table[3].data = &sn->sctp_timeouts[SCTP_CONNTRACK_ESTABLISHED];
| >> + sn->sysctl_table[4].data = &sn->sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_SENT];
| >> + sn->sysctl_table[5].data = &sn->sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_RECD];
| >> + sn->sysctl_table[6].data = &sn->sctp_timeouts[SCTP_CONNTRACK_SHUTDOWN_ACK_SENT];
| >
| > Please use an iteration to avoid these repetitve overly long lines.
| >
|
| Ah, thanks a lot! Indeed.
|
| - Cyrill -
Patrick, if I make it like that (iterations)
...
BUILD_BUG_ON(ARRAY_SIZE(sctp_compat_sysctl_table) != SCTP_CONNTRACK_MAX);
for (i = 0; i < ARRAY_SIZE(sctp_compat_sysctl_table) - 1; i++)
sn->compat_sysctl_table[i].data = &sn->sctp_timeouts[i + 1];
...
it seems the code become hard to follow. Yes it was long (repetitive) lines
but it was obvious what is set for every table entry and easy to find what
should be changed if SCTP_ enumeration is changed or table entry removed
(for some reason). I could make it shorter in length but remain the same
explicit assignment. How do you think?
- Cyrill -
prev parent reply other threads:[~2009-03-09 21:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-09 18:16 [RFC 0/4] netfilter conntrack sysctls pernet support Cyrill Gorcunov
2009-03-09 18:16 ` [RFC 1/4] net: sysctl_net - use net_eq to compare nets Cyrill Gorcunov
2009-03-09 18:16 ` [RFC 2/4] net: netfilter conntrack - add per-net functionality for DCCP protocol Cyrill Gorcunov
[not found] ` <49B63EA6.2060802@free.fr>
2009-03-10 10:33 ` Daniel Lezcano
2009-03-10 10:59 ` Cyrill Gorcunov
2009-03-10 11:35 ` Pavel Emelyanov
2009-03-10 11:51 ` Cyrill Gorcunov
2009-03-10 11:56 ` Pavel Emelyanov
2009-03-10 12:43 ` Daniel Lezcano
2009-03-10 11:25 ` David Miller
2009-03-10 13:02 ` Daniel Lezcano
2009-03-09 18:16 ` [RFC 3/4] net: netfilter conntrack - add per-net functionality for SCTP protocol Cyrill Gorcunov
2009-03-10 10:21 ` Daniel Lezcano
2009-03-09 18:16 ` [RFC 4/4] net: netfilter conntrack - add per-net functionality for UDPLITE protocol Cyrill Gorcunov
2009-03-09 18:47 ` [RFC 0/4] netfilter conntrack sysctls pernet support Patrick McHardy
2009-03-09 19:07 ` Cyrill Gorcunov
2009-03-09 21:08 ` Cyrill Gorcunov [this message]
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=20090309210843.GB18357@localhost \
--to=gorcunov@gmail.com \
--cc=adobriyan@gmail.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xemul@openvz.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).