From: Philip Craig <philipc@snapgear.com>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Netfilter Developer Mailing List <netfilter-devel@lists.netfilter.org>
Subject: [PATCH] libnetfilter_conntrack: Fix getters for big-endian
Date: Tue, 14 Aug 2007 17:18:20 +1000 [thread overview]
Message-ID: <46C1573C.7000005@snapgear.com> (raw)
[-- Attachment #1: libnfct-endian.patch --]
[-- Type: text/x-diff, Size: 2255 bytes --]
The getters have to point to the right sized types, otherwise
they don't work on big-endian.
Signed-off-by: Philip Craig <philipc@snapgear.com>
Index: libnetfilter_conntrack/src/conntrack/api.c
===================================================================
--- libnetfilter_conntrack.orig/src/conntrack/api.c 2007-08-14 15:48:07.000000000 +1000
+++ libnetfilter_conntrack/src/conntrack/api.c 2007-08-14 16:00:02.000000000 +1000
@@ -304,7 +304,7 @@
u_int8_t nfct_get_attr_u8(const struct nf_conntrack *ct,
const enum nf_conntrack_attr type)
{
- const int *ret = nfct_get_attr(ct, type);
+ const u_int8_t *ret = nfct_get_attr(ct, type);
return ret == NULL ? 0 : *ret;
}
@@ -320,7 +320,7 @@
u_int16_t nfct_get_attr_u16(const struct nf_conntrack *ct,
const enum nf_conntrack_attr type)
{
- const int *ret = nfct_get_attr(ct, type);
+ const u_int16_t *ret = nfct_get_attr(ct, type);
return ret == NULL ? 0 : *ret;
}
@@ -336,7 +336,7 @@
u_int32_t nfct_get_attr_u32(const struct nf_conntrack *ct,
const enum nf_conntrack_attr type)
{
- const int *ret = nfct_get_attr(ct, type);
+ const u_int32_t *ret = nfct_get_attr(ct, type);
return ret == NULL ? 0 : *ret;
}
Index: libnetfilter_conntrack/src/expect/api.c
===================================================================
--- libnetfilter_conntrack.orig/src/expect/api.c 2007-08-14 15:48:07.000000000 +1000
+++ libnetfilter_conntrack/src/expect/api.c 2007-08-14 16:00:02.000000000 +1000
@@ -264,7 +264,7 @@
u_int8_t nfexp_get_attr_u8(const struct nf_expect *exp,
const enum nf_expect_attr type)
{
- const int *ret = nfexp_get_attr(exp, type);
+ const u_int8_t *ret = nfexp_get_attr(exp, type);
return ret == NULL ? 0 : *ret;
}
@@ -280,7 +280,7 @@
u_int16_t nfexp_get_attr_u16(const struct nf_expect *exp,
const enum nf_expect_attr type)
{
- const int *ret = nfexp_get_attr(exp, type);
+ const u_int16_t *ret = nfexp_get_attr(exp, type);
return ret == NULL ? 0 : *ret;
}
@@ -296,7 +296,7 @@
u_int32_t nfexp_get_attr_u32(const struct nf_expect *exp,
const enum nf_expect_attr type)
{
- const int *ret = nfexp_get_attr(exp, type);
+ const u_int32_t *ret = nfexp_get_attr(exp, type);
return ret == NULL ? 0 : *ret;
}
next reply other threads:[~2007-08-14 7:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 7:18 Philip Craig [this message]
2007-09-02 8:50 ` [PATCH] libnetfilter_conntrack: Fix getters for big-endian Pablo Neira Ayuso
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=46C1573C.7000005@snapgear.com \
--to=philipc@snapgear.com \
--cc=netfilter-devel@lists.netfilter.org \
--cc=pablo@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.