From: Thomas Graf <tgraf@suug.ch>
To: Jarno Rajahalme <jrajahalme@nicira.com>
Cc: netdev@vger.kernel.org, dev@openvswitch.org,
netfilter-devel@vger.kernel.org
Subject: Re: [RFC PATCH 5/5] openvswitch: Interface with NAT.
Date: Thu, 22 Oct 2015 01:30:59 +0200 [thread overview]
Message-ID: <20151021233059.GE23554@pox.localdomain> (raw)
In-Reply-To: <FB21AAF8-5C91-41C8-96DC-E5EE0C02CFE4@nicira.com>
On 10/21/15 at 02:04pm, Jarno Rajahalme wrote:
>
> > On Oct 21, 2015, at 3:59 AM, Thomas Graf <tgraf@suug.ch> wrote:
> > Simplify this with an OVS_NAT_ATTR_FLAGS?
>
> The use of separate flag attributes was actually intentional, as it makes the interface easier to understand, and code also easier to read.
OK, either is fine with me.
> >> + &ctinfo);
> >> + if (!ct || nf_ct_is_untracked(ct))
> >> + /* A NAT action may only be performed on tracked packets. */
> >> + return NF_ACCEPT;
> >
> > Braces
> >
>
> Needed due to the comment?
The compiler would be fine but most other places like this seem to
put braces on for this single comment + single statement case.
> >> + if (type > OVS_NAT_ATTR_MAX) {
> >> + OVS_NLERR(log, "Unknown nat attribute (type=%d, max=%d).\n",
> >> + type, OVS_NAT_ATTR_MAX);
> >
> > Formatting
>
> Not readily apparent what you mean here, care to elaborate?
The argument list should be indented up to the (.
> >> +#ifdef CONFIG_NF_NAT_NEEDED
> >> + [OVS_CT_ATTR_NAT] = { .minlen = 0,
> >> + .maxlen = 96 }
> >> +#endif
> >
> > Is the 96 a temporary hack here?
> >
>
> It is not an exact value. It is much better than my temporary hack of 512 was. As trailing garbage is checked for, I???m not sure if this should be very accurately calculated? Maybe it would be better to disable the length checks for this altogether?
I would just drop the maxlen then. The nested content should be
verified separately anyway later on.
> > We should probably bark if user space provides a OVS_CT_ATTR_NAT but the
> > kernel is compiled without support for it.
> >
>
> We do issue -EINVAL and log ???Unknown conntrack attr??? in that case.
Misread then, sorry.
prev parent reply other threads:[~2015-10-21 23:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1445379629-112880-1-git-send-email-jrajahalme@nicira.com>
2015-10-21 8:33 ` [ovs-dev] [RFC PATCH 1/5] netfilter: Remove IP_CT_NEW_REPLY definition Thomas Graf
[not found] ` <20151021083323.GB15539-4EA/1caXOu0mYvmMESoHnA@public.gmane.org>
2015-10-21 20:15 ` Jarno Rajahalme
2015-10-21 23:32 ` [ovs-dev] " Thomas Graf
[not found] ` <1445379629-112880-4-git-send-email-jrajahalme@nicira.com>
2015-10-21 10:41 ` [RFC PATCH 4/5] openvswitch: conntrack netlink API updates Pablo Neira Ayuso
2015-10-21 11:18 ` Thomas Graf
[not found] ` <1445379629-112880-3-git-send-email-jrajahalme@nicira.com>
[not found] ` <1445379629-112880-3-git-send-email-jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2015-10-21 10:44 ` [RFC PATCH 3/5] netfilter: Allow calling into nat helper without skb_dst Pablo Neira Ayuso
2015-10-21 20:44 ` Jarno Rajahalme
[not found] ` <1445379629-112880-2-git-send-email-jrajahalme@nicira.com>
[not found] ` <1445379629-112880-2-git-send-email-jrajahalme-l0M0P4e3n4LQT0dZR+AlfA@public.gmane.org>
2015-10-21 8:50 ` [RFC PATCH 2/5] netfilter: Factor out nf_ct_get_info() Thomas Graf
2015-10-21 10:45 ` Pablo Neira Ayuso
2015-10-21 20:43 ` Jarno Rajahalme
2015-10-21 21:38 ` Jarno Rajahalme
[not found] ` <1445379629-112880-5-git-send-email-jrajahalme@nicira.com>
2015-10-21 10:59 ` [RFC PATCH 5/5] openvswitch: Interface with NAT Thomas Graf
2015-10-21 21:04 ` Jarno Rajahalme
2015-10-21 23:30 ` Thomas Graf [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=20151021233059.GE23554@pox.localdomain \
--to=tgraf@suug.ch \
--cc=dev@openvswitch.org \
--cc=jrajahalme@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@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).