netfilter/queue: generalize nfnl_queue_msg_build_verdict()
Generalize netfilter/queue to allow sending batched verdicts later. Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org> Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
parent
53ac502a2b
commit
34a96ba5c2
1 changed files with 10 additions and 2 deletions
|
@ -163,12 +163,14 @@ errout:
|
|||
|
||||
/** @} */
|
||||
|
||||
struct nl_msg *nfnl_queue_msg_build_verdict(const struct nfnl_queue_msg *msg)
|
||||
static struct nl_msg *
|
||||
__nfnl_queue_msg_build_verdict(const struct nfnl_queue_msg *msg,
|
||||
uint8_t type)
|
||||
{
|
||||
struct nl_msg *nlmsg;
|
||||
struct nfqnl_msg_verdict_hdr verdict;
|
||||
|
||||
nlmsg = nfnlmsg_alloc_simple(NFNL_SUBSYS_QUEUE, NFQNL_MSG_VERDICT, 0,
|
||||
nlmsg = nfnlmsg_alloc_simple(NFNL_SUBSYS_QUEUE, type, 0,
|
||||
nfnl_queue_msg_get_family(msg),
|
||||
nfnl_queue_msg_get_group(msg));
|
||||
if (nlmsg == NULL)
|
||||
|
@ -191,6 +193,12 @@ nla_put_failure:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
struct nl_msg *
|
||||
nfnl_queue_msg_build_verdict(const struct nfnl_queue_msg *msg)
|
||||
{
|
||||
return __nfnl_queue_msg_build_verdict(msg, NFQNL_MSG_VERDICT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message verdict/mark
|
||||
* @arg nlh netlink messsage header
|
||||
|
|
Loading…
Add table
Reference in a new issue