|
|
Re: [PATCH 7/18] netfilter: nfnetlink_log: Move away from NLMSG_PUT(). |
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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux Kernel Discussion] [Ethernet Bridging] [Linux Wireless Networking] [Linux Bluetooth Networking] [Linux Networking Users] [VLAN] [Git] [IETF Annouce] [Linux Assembly] [Security] [Bugtraq] [Photo] [Singles Social Networking] [Yosemite Information] [MIPS Linux] [ARM Linux Kernel] [ARM Linux] [Linux Virtualization] [Linux Security] [Linux IDE] [Linux RAID] [Linux SCSI] [Free Dating]
![]() |
![]() |