summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2010-10-25 17:32:23 +0200
committerThomas Graf <tgraf@suug.ch>2010-10-29 01:00:25 +0200
commit897828de325d2f41d3d1008c240f14a572312221 (patch)
tree6fba58d18f40fd213ac6f7e3f09c0d5cfebc5644 /src
parent691905bc5669df4e0c52b9bc5aef64d6fa03a144 (diff)
downloadlibnl-897828de325d2f41d3d1008c240f14a572312221.tar.gz
src/nf-queue: revert nonsensical change
The only part of commit d378220c (src/nf-queue.c: cleanup and improve performance of test program for NF_QUEUE) that actually makes sense is the increase in receive buffer size. Issuing verdicts for IDs not delivered to userspace is a wasted effort since the kernel drops packets itself when netlink message delivery fails. This would actually have been noticed by a return value of -ENOENT if the result of nfnl_queue_msg_send_verdict() would have been checked. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src')
-rw-r--r--src/nf-queue.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/nf-queue.c b/src/nf-queue.c
index 3fb3c11..bd10adf 100644
--- a/src/nf-queue.c
+++ b/src/nf-queue.c
@@ -41,31 +41,7 @@ static void obj_input(struct nl_object *obj, void *arg)
.dp_fd = stdout,
.dp_dump_msgtype = 1,
};
- uint32_t packet_id = nfnl_queue_msg_get_packetid(msg);
- static uint32_t next_packet_id = 0;
- struct nfnl_queue_msg *lost_msg = NULL;
- uint8_t family;
- uint16_t group;
-
- if (packet_id > next_packet_id) {
- printf("Warning: %d Out of order packets. Queue or socket overload \n", packet_id - next_packet_id);
- group = nfnl_queue_msg_get_group(msg);
- family = nfnl_queue_msg_get_family(msg);
- lost_msg = nfnl_queue_msg_alloc();
-
- do {
- nfnl_queue_msg_set_group(lost_msg, group);
- nfnl_queue_msg_set_family(lost_msg, family);
- nfnl_queue_msg_set_packetid(lost_msg, next_packet_id);
- nfnl_queue_msg_set_verdict(lost_msg, NF_ACCEPT);
- nfnl_queue_msg_send_verdict(nf_sock, lost_msg);
- next_packet_id++;
- } while (packet_id > next_packet_id);
-
- nfnl_queue_msg_put(lost_msg);
- }
- next_packet_id = packet_id + 1;
nfnl_queue_msg_set_verdict(msg, NF_ACCEPT);
nl_object_dump(obj, &dp);
nfnl_queue_msg_send_verdict(nf_sock, msg);