Skip to contentSkip to conversation

Trouble with nfq_get_timestamp

DISCUSSION Kristian Evensen 2 participants 4 messages Apr 26, 2009 netfilter

lore
Share & tools
lore
#0 lore raw

Hello,

I am currently writing a small user space application where I need the timestamp of the packets. In the callback-function, I use nfq_get_timestamp and provide it with the pointer to a timeval-struct and the nfq_data sent to the callback function. However, the function always returns -1 and failes. The get_id() and so forth works perfectly, so I am wondering if anybody has any hints or knows how to solve this?

I am currently using nfnetlink 0.0.39 and libnetfilter_queue 0.0.16-1, but I have tried the newest version as well with no luck (the reason I chose these are because they are the newest in my packet repo). My kernel is 2.6.28.

Thanks in advance,
Kristian

#1 lore raw

Hi,

Quoted 9 lines · Kristian Evensen

Hello,

I am currently writing a small user space application where I need the timestamp of the packets. In the callback-function, I use nfq_get_timestamp and provide it with the pointer to a timeval-struct and the nfq_data sent to the callback function. However, the function always returns -1 and failes. The get_id() and so forth works perfectly, so I am wondering if anybody has any hints or knows how to solve this?

Are your packet coming from localhost ? It I remember correctly timestamp is only setup for forwarded (or input) packets.

BR,

Signature · 9 lines
Eric Leblond <[email protected]>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/
EdenWall: http://www.edenwall.com/

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Hi,

Quoted 2 lines

Are your packet coming from localhost ? It I remember correctly timestamp is only setup for forwarded (or input) packets.

Sorry, I forgot that parth. The packets are either on their way out from or into the box, so I have tried bout OUTPUT and PREROUTING. I have also tried casting the memory area after the msg_packet_hw-struct and it seems to be zero.

-Kristian