All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Phil Sutter <phil@nwl.cc>
Cc: "Pablo Neira Ayuso" <pablo@netfilter.org>,
	netfilter-devel@vger.kernel.org,
	"Florian Westphal" <fw@strlen.de>,
	"Kadlecsik József" <kadlec@blackhole.kfki.hu>,
	"Eric Garver" <eric@garver.life>
Subject: Re: [PATCH libnftnl] set: Add support for NFTA_SET_SUBKEY attributes
Date: Wed, 20 Nov 2019 13:12:56 +0100	[thread overview]
Message-ID: <20191120131256.4f17cdf1@redhat.com> (raw)
In-Reply-To: <20191120130152.7d4d3ca8@redhat.com>

On Wed, 20 Nov 2019 13:01:52 +0100
Stefano Brivio <sbrivio@redhat.com> wrote:

> On Wed, 20 Nov 2019 12:24:48 +0100
> Phil Sutter <phil@nwl.cc> wrote:
>
> [...]
>
> > > +		if (!*l)
> > > +			break;
> > > +		v = *l;
> > > +		mnl_attr_put_u32(nlh, NFTA_SET_SUBKEY_LEN, htonl(v));    
> > 
> > I guess you're copying the value here because how htonl() is declared,
> > but may it change the input value non-temporarily? I mean, libnftnl is
> > in control over the array so from my point of view it should be OK to
> > directly pass it to htonl().  
> 
> It won't change the input value at all, but that's not the point: I'm
> reading from an array of 8-bit values and attributes are 32 bits. If I
> htonl() directly on the input array, it's going to use 24 bits around
> those 8 bits.

Err, wait, never mind :) I'm just passing the value, not the reference
there -- no need to copy anything of course. I'll drop this copy in v2.

-- 
Stefano


  reply	other threads:[~2019-11-20 12:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  1:07 [PATCH libnftnl] set: Add support for NFTA_SET_SUBKEY attributes Stefano Brivio
2019-11-20 11:24 ` Phil Sutter
2019-11-20 12:01   ` Stefano Brivio
2019-11-20 12:12     ` Stefano Brivio [this message]
2019-11-20 14:13       ` Phil Sutter

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=20191120131256.4f17cdf1@redhat.com \
    --to=sbrivio@redhat.com \
    --cc=eric@garver.life \
    --cc=fw@strlen.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.