From: Harald Welte <laforge@netfilter.org>
To: David Miller <davem@davemloft.net>
Cc: Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
Linux Netdev List <netdev@vger.kernel.org>,
linux-kernel@vger.kernel.org, bunk@stusta.de
Subject: [PATCH 2/2] [NETFILTER] remove bogus hand-coded htonll()
Date: Sat, 3 Sep 2005 10:43:15 +0200 [thread overview]
Message-ID: <20050903084315.GD4415@rama.de.gnumonks.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 523 bytes --]
Hi Dave, please apply the appended patch.
I somehow thought I had fixed this quite some time ago. Probably I lost
it with some merge :(
Thanks,
--
- Harald Welte <laforge@netfilter.org> http://netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #1.2: 52-nfnetlink_queue-htonll.patch --]
[-- Type: text/plain, Size: 1685 bytes --]
[NETFILTER] remove bogus hand-coded htonll() from nenetlink_queue
htonll() is nothing else than cpu_to_be64(), so we'd rather call the
latter.
Signed-off-by: Harald Welte <laforge@netfilter.org>
---
commit 0905251a08bf51d5e2d1996c21fcdc5acfbbde13
tree a8072738e54f24b0d4392cf33252594d4a6848e1
parent e8d296c78dff8485c5cd90217b91433185a58871
author Harald Welte <laforge@netfilter.org> Sa, 03 Sep 2005 10:31:19 +0200
committer Harald Welte <laforge@netfilter.org> Sa, 03 Sep 2005 10:31:19 +0200
net/netfilter/nfnetlink_queue.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
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
@@ -76,17 +76,6 @@ typedef int (*nfqnl_cmpfn)(struct nfqnl_
static DEFINE_RWLOCK(instances_lock);
-u_int64_t htonll(u_int64_t in)
-{
- u_int64_t out;
- int i;
-
- for (i = 0; i < sizeof(u_int64_t); i++)
- ((u_int8_t *)&out)[sizeof(u_int64_t)-1] = ((u_int8_t *)&in)[i];
-
- return out;
-}
-
#define INSTANCE_BUCKETS 16
static struct hlist_head instance_table[INSTANCE_BUCKETS];
@@ -497,8 +486,8 @@ nfqnl_build_packet_message(struct nfqnl_
if (entry->skb->tstamp.off_sec) {
struct nfqnl_msg_packet_timestamp ts;
- ts.sec = htonll(skb_tv_base.tv_sec + entry->skb->tstamp.off_sec);
- ts.usec = htonll(skb_tv_base.tv_usec + entry->skb->tstamp.off_usec);
+ ts.sec = cpu_to_be64(skb_tv_base.tv_sec + entry->skb->tstamp.off_sec);
+ ts.usec = cpu_to_be64(skb_tv_base.tv_usec + entry->skb->tstamp.off_usec);
NFA_PUT(skb, NFQA_TIMESTAMP, sizeof(ts), &ts);
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2005-09-03 8:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-03 8:43 Harald Welte [this message]
2005-09-03 16:54 ` [PATCH 2/2] [NETFILTER] remove bogus hand-coded htonll() Jouni Malinen
2005-09-04 4:10 ` Harald Welte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050903084315.GD4415@rama.de.gnumonks.org \
--to=laforge@netfilter.org \
--cc=bunk@stusta.de \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox