Modifying a packet's length using netfilter queue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone. I am new to this list, and I'd like to know if I can make a packet, captured through netfilter queueing, bigger. I have created the following function:

#include <libnfnetlink/libnfnetlink.h>
#include <libnetfilter_queue/libnetfilter_queue.h>

struct nfq_data {
  struct nfattr **data;
};

void nfq_set_payload_length
  (struct nfq_data *nfad, unsigned length)
{
  //.. could be an error here if length + NFA_LENGTH(0) > 0xffff..
  (nfad->data[NFQA_PAYLOAD-1])->nfa_len = (length + NFA_LENGTH(0));
}

In order to be able to modify the length of a captured packet (in NFQNL_COPY_PACKET mode). Everything about the packet will be in order - recalculated checksums etc). Is this an acceptable approach?

KJ--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux