bugzilla-daemon at netfilter.org
2016-May-12 12:09 UTC
[Bug 1066] New: nfq_get_timestamp() not setting timeval struc
https://bugzilla.netfilter.org/show_bug.cgi?id=1066
Bug ID: 1066
Summary: nfq_get_timestamp() not setting timeval struc
Product: libnetfilter_queue
Version: unspecified
Hardware: x86_64
OS: Ubuntu
Status: NEW
Severity: normal
Priority: P5
Component: libnetfilter_queue
Assignee: netfilter-buglog at lists.netfilter.org
Reporter: emacsuser123 at gmail.com
Hi.
I'm developing an application that makes use of NFQUEUE functionality.
When using Ubuntu with recent kernels (4.4 and onwards), I'm having trouble
trying to get the packet timestamp by means of nfq_get_timestamp.
It seems that it does nothing with the timeval struct passed as an input
parameter. So, I always get 0 on both tv_sec and tv_usec fields.
If I use older kernels (3.3, for instance), I have no problem at all. The
timeval struct is filled in successfully and I get the proper timestamp from
the kernel.
I have also tried to set the queue socket options to SO_TIMESTAMP explicitly,
just in case. The call to setsockopt goes smoothly, but it seems that
nfq_get_timestamp is not taking that into account.
I'm not sure what else could be done here, to be honest.
Any ideas?
Thanks a lot.
-Bob
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20160512/bd687934/attachment.html>
bugzilla-daemon at netfilter.org
2016-May-12 12:28 UTC
[Bug 1066] nfq_get_timestamp() not setting timeval struc
https://bugzilla.netfilter.org/show_bug.cgi?id=1066
Florian Westphal <fw at strlen.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |fw at strlen.de
Assignee|netfilter-buglog at lists.netf |fw at strlen.de
|ilter.org |
--- Comment #1 from Florian Westphal <fw at strlen.de> ---
(In reply to emacsuser123 from comment #0)> Hi.
>
> I'm developing an application that makes use of NFQUEUE functionality.
>
> When using Ubuntu with recent kernels (4.4 and onwards), I'm having
trouble
> trying to get the packet timestamp by means of nfq_get_timestamp.
> It seems that it does nothing with the timeval struct passed as an input
> parameter. So, I always get 0 on both tv_sec and tv_usec fields.
>
> If I use older kernels (3.3, for instance), I have no problem at all. The
> timeval struct is filled in successfully and I get the proper timestamp
from
> the kernel.
>
> I have also tried to set the queue socket options to SO_TIMESTAMP
> explicitly, just in case. The call to setsockopt goes smoothly, but it
seems
> that nfq_get_timestamp is not taking that into account.
>
> I'm not sure what else could be done here, to be honest.
>
> Any ideas?
>
> Thanks a lot.
> -Bob
Kernel bug, this should fix it:
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
--- a/net/netfilter/nfnetlink_queue.c
+++ b/net/netfilter/nfnetlink_queue.c
@@ -557,7 +557,7 @@ nfqnl_build_packet_message(struct net *net, struct
nfqnl_instance *queue,
if (entskb->tstamp.tv64) {
struct nfqnl_msg_packet_timestamp ts;
- struct timespec64 kts = ktime_to_timespec64(skb->tstamp);
+ struct timespec64 kts = ktime_to_timespec64(entskb->tstamp);
ts.sec = cpu_to_be64(kts.tv_sec);
ts.usec = cpu_to_be64(kts.tv_nsec / NSEC_PER_USEC);
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20160512/7a1910ac/attachment.html>
bugzilla-daemon at netfilter.org
2016-May-12 22:01 UTC
[Bug 1066] nfq_get_timestamp() not setting timeval struc
https://bugzilla.netfilter.org/show_bug.cgi?id=1066
Florian Westphal <fw at strlen.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20160512/3028728d/attachment.html>
bugzilla-daemon at netfilter.org
2016-Sep-12 12:50 UTC
[Bug 1066] nfq_get_timestamp() not setting timeval struc
https://bugzilla.netfilter.org/show_bug.cgi?id=1066 --- Comment #2 from emacsuser123 at gmail.com --- (In reply to Florian Westphal from comment #1)> (In reply to emacsuser123 from comment #0) > > Hi. > > > > I'm developing an application that makes use of NFQUEUE functionality. > > > > When using Ubuntu with recent kernels (4.4 and onwards), I'm having trouble > > trying to get the packet timestamp by means of nfq_get_timestamp. > > It seems that it does nothing with the timeval struct passed as an input > > parameter. So, I always get 0 on both tv_sec and tv_usec fields. > > > > If I use older kernels (3.3, for instance), I have no problem at all. The > > timeval struct is filled in successfully and I get the proper timestamp from > > the kernel. > > > > I have also tried to set the queue socket options to SO_TIMESTAMP > > explicitly, just in case. The call to setsockopt goes smoothly, but it seems > > that nfq_get_timestamp is not taking that into account. > > > > I'm not sure what else could be done here, to be honest. > > > > Any ideas? > > > > Thanks a lot. > > -Bob > > Kernel bug, this should fix it: > > diff --git a/net/netfilter/nfnetlink_queue.c > b/net/netfilter/nfnetlink_queue.c > --- a/net/netfilter/nfnetlink_queue.c > +++ b/net/netfilter/nfnetlink_queue.c > @@ -557,7 +557,7 @@ nfqnl_build_packet_message(struct net *net, struct > nfqnl_instance *queue, > > if (entskb->tstamp.tv64) { > struct nfqnl_msg_packet_timestamp ts; > - struct timespec64 kts = ktime_to_timespec64(skb->tstamp); > + struct timespec64 kts = ktime_to_timespec64(entskb->tstamp); > > ts.sec = cpu_to_be64(kts.tv_sec); > ts.usec = cpu_to_be64(kts.tv_nsec / NSEC_PER_USEC);Hi. Do you happen to know which official kernel stable release 4.x will include this fix? I've downloaded the latest one, v.4.4.20, and the fix is not there. Thanks. -- You are receiving this mail because: You are watching all bug changes. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20160912/1cdfe858/attachment.html>
Maybe Matching Threads
- [Bug 1742] New: using nfqueue breaks SCTP connection (tracking)
- [Flac-users] is there a way to read the length of a song from the command line?
- [Bug 846] New: ./nfqnl_test usage ! no activity shown
- traffic distribution not happening in centos 6.5
- Non-linear skbs apparently prevent NFQUEUE from working properly