send packet received by nflog

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

 



Hi,
I try to hack a simple demo program to forward each packet received by nflog.
I'm creating two rules:
Â/sbin/ebtables --table broute --append BROUTING -i eth0 --nflog-group
5 --jump DROP
/sbin/ebtables --table broute --append BROUTING --jump DROP

Then I run a listener on group 5.
In order to send the packet I need the hw header and the payload.
I can get them like this:
nflog_get_msg_packet_hwhdr(nfa)
payload_len = nflog_get_payload(nfa, &payload);

To send I use write:
write(rawsock, pkt, pkt_len)

The problem is that the hardware header and the payload are not one
after the other in the memory, so I need to concatenate them to new
buffer.
This seems non intuitive for me, so I'm asking here.

There are 6 bytes between the hw header and the payload in the memory.
Those 6 bytes in between look like this in hex:
0000 2000 0900

Is it possible to concatenate two buffers to send as one packet?
Sending those two buffers one after the other looks like two packets
and not one.

Thanks,
Kfir
--
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