From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 7/18] netfilter: nfnetlink_log: Move away from NLMSG_PUT().
Date: Tue, 26 Jun 2012 22:23:17 -0700 [thread overview]
Message-ID: <1340774597.16533.35.camel@joe2Laptop> (raw)
In-Reply-To: <20120626.220223.1090653207727010874.davem@davemloft.net>
On Tue, 2012-06-26 at 22:02 -0700, David Miller wrote:
> And use nlmsg_data() while we're here too.
[]
> diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
[]
> @@ -326,18 +326,20 @@ __nfulnl_send(struct nfulnl_instance *inst)
> {
> int status = -1;
>
> - if (inst->qlen > 1)
> - NLMSG_PUT(inst->skb, 0, 0,
> - NLMSG_DONE,
> - sizeof(struct nfgenmsg));
> -
> + if (inst->qlen > 1) {
> + struct nlmsghdr *nlh = nlmsg_put(inst->skb, 0, 0,
> + NLMSG_DONE,
> + sizeof(struct nfgenmsg),
> + 0);
> + if (!nlh)
> + goto out;
> + }
Because nlh isn't used for anything other than a test,
perhaps this is more readable as:
if (inst->qlen > 1 &&
!nlmsg_put(inst->skb, 0, 0, NLMSG_DONE,
sizeof(struct nfgenmsg), 0))
goto out;
next prev parent reply other threads:[~2012-06-27 5:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 5:02 [PATCH 7/18] netfilter: nfnetlink_log: Move away from NLMSG_PUT() David Miller
2012-06-27 5:23 ` Joe Perches [this message]
2012-06-27 16:49 ` Ben Hutchings
2012-06-27 22:06 ` David Miller
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=1340774597.16533.35.camel@joe2Laptop \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=netdev@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).