Tracking packets generated from individual socket.

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

 



Hi,

I would like to track the individual packets generated from a socket.
I need the originating socket in order to set  socket specific
transmit options for a network device driver ( transmit power ). I
have tried to get the socket associated with the sk_buff that is put
into dev_hard_start_xmit. The pointer to the sock structure is null.
So i tried to use the mark field in the sk_buff structure. This is to
my surprise also not set even if i mark all packets.

I use the TUN/TAP driver to test this setup and added a printk in
function tun_net_xmit

       printk("TUN TAP packet mark: %d\n", skb->mark);

I mark all packets by using the following iptable rule:

      iptables -t mangle -A OUTPUT -p ip -j MARK --set-mark 3

The TUN/TAP interface is attached to a userspace socket and not to
another peer. (i just open the socket to read data and discard it).
I test operation by opening a telnet connection to an ip address in
the subnet of the TUN/TAP interface.
My suspicion is that the packet mark gets 'eaten' by qdisc, is this
correct or does iptables clean up after itself ?

Am i missing something ?
do i mark the packets correctly ?

Is it even possible to determine the originating socket at the interface level ?

Best regards,

Borgert
--
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