]> granicus.if.org Git - libnl/commitdiff
netfilter/queue: generalize nfnl_queue_msg_build_verdict()
authorHolger Eitzenberger <holger@eitzenberger.org>
Wed, 19 Jun 2013 13:23:14 +0000 (15:23 +0200)
committerThomas Graf <tgraf@suug.ch>
Wed, 26 Jun 2013 23:15:34 +0000 (01:15 +0200)
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>
lib/netfilter/queue_msg.c

index 95d8ad3b7a3d682d95d9915ec9776ab21b0458de..dc92fce667b21c2c1e72dbcd81e358337031e22d 100644 (file)
@@ -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