Skip to contentSkip to conversation

libnetfilter_conntrack: Fix getters for big-endian

PATCH Applied Philip Craig 2 participants 2 messages Aug 14, 2007 – Sep 2, 2007 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libnetfilter_conntrack: Fix getters for big-endian

The getters have to point to the right sized types, otherwise they don't work on big-endian.

src/conntrack/api.c +3 -3
Index: libnetfilter_conntrack/src/conntrack/api.c
===================================================================
@@ -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;
 }
 
src/expect/api.c +3 -3
Index: libnetfilter_conntrack/src/expect/api.c
===================================================================
@@ -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;
 }
 
maintainer Applied
#1 lore raw
Quoted 2 lines · Philip Craig

The getters have to point to the right sized types, otherwise they don't work on big-endian.

Applied, thanks Philip. Sorry for the delay, I just arrived from Argentina.

Signature · 2 lines
"Será preciso viajar por los ojos de los idiotas" -- Poeta en Nueva York
-- Federico García Lorca.