ipq_set_verdict(3)

ipq_set_verdict3

Issue verdict and optionally modified packet to kernel

Usage

#include <linux/netfilter.h>
#include <libipq.h>

int ipq_set_verdict(const struct ipq_handle *h, ipq_id_t id, unsigned int verdict, size_t data_len, unsigned char *buf);

Overview

The ipq_set_verdict function issues a verdict on a packet previously obtained with ipq_read, specifying the intended disposition of the packet, and optionally supplying a modified version of the payload data.

The h parameter is a context handle which must previously have been returned successfully from a call to ipq_create_handle.

The id parameter is the packet identifier obtained via ipq_get_packet.

The verdict parameter must be one of:

NF_ACCEPT

Accept the packet and continue traversal within the kernel.

NF_DROP

Drop the packet.

NF_QUEUE

Requeue the packet.

NF_STOLEN and NF_REPEAT are kernel-internal constants and should not be used from userspace as their exact side effects have not been investigated.

The data_len parameter is the length of the data pointed to by buf, the optional replacement payload data.

If simply setting a verdict without modifying the payload data, use zero for data_len and NULL for buf.

The application is responsible for recalculating any packet checksums when modifying packets.

Return value

On failure, -1 is returned.
On success, a non-zero positive value is returned.

Errors

On error, a descriptive error message will be available via the ipq_errstr function.

Releases

8 releases since Debian 3.0 (Woody); the text changed 5 times.

  1. 3.0–3.1
  2. 4.0
  3. 5.0
  4. 6.0
  5. 7
  6. 8–Arch

Bugs

None known.

Author

James Morris <[email protected]>

From iptables 1:1.8.13-1 in Arch Linux 2026-11-01. Also shipped by iptables-legacy. Parsed by carta from the page's man source.