mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 17:46:48 +07:00
netfilter: ipt_ULOG: Move away from NLMSG_PUT().
And use nlmsg_data() while we're here too. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d106352d9f
commit
c2bd4baf41
@ -196,12 +196,15 @@ static void ipt_ulog_packet(unsigned int hooknum,
|
|||||||
|
|
||||||
pr_debug("qlen %d, qthreshold %Zu\n", ub->qlen, loginfo->qthreshold);
|
pr_debug("qlen %d, qthreshold %Zu\n", ub->qlen, loginfo->qthreshold);
|
||||||
|
|
||||||
/* NLMSG_PUT contains a hidden goto nlmsg_failure !!! */
|
nlh = nlmsg_put(ub->skb, 0, ub->qlen, ULOG_NL_EVENT,
|
||||||
nlh = NLMSG_PUT(ub->skb, 0, ub->qlen, ULOG_NL_EVENT,
|
sizeof(*pm)+copy_len, 0);
|
||||||
sizeof(*pm)+copy_len);
|
if (!nlh) {
|
||||||
|
pr_debug("error during nlmsg_put\n");
|
||||||
|
goto out_unlock;
|
||||||
|
}
|
||||||
ub->qlen++;
|
ub->qlen++;
|
||||||
|
|
||||||
pm = NLMSG_DATA(nlh);
|
pm = nlmsg_data(nlh);
|
||||||
|
|
||||||
/* We might not have a timestamp, get one */
|
/* We might not have a timestamp, get one */
|
||||||
if (skb->tstamp.tv64 == 0)
|
if (skb->tstamp.tv64 == 0)
|
||||||
@ -261,13 +264,11 @@ static void ipt_ulog_packet(unsigned int hooknum,
|
|||||||
nlh->nlmsg_type = NLMSG_DONE;
|
nlh->nlmsg_type = NLMSG_DONE;
|
||||||
ulog_send(groupnum);
|
ulog_send(groupnum);
|
||||||
}
|
}
|
||||||
|
out_unlock:
|
||||||
spin_unlock_bh(&ulog_lock);
|
spin_unlock_bh(&ulog_lock);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nlmsg_failure:
|
|
||||||
pr_debug("error during NLMSG_PUT\n");
|
|
||||||
alloc_failure:
|
alloc_failure:
|
||||||
pr_debug("Error building netlink message\n");
|
pr_debug("Error building netlink message\n");
|
||||||
spin_unlock_bh(&ulog_lock);
|
spin_unlock_bh(&ulog_lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user