From 187c8099704d4616de9479104ba6560c03f90c39 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Sat, 31 Dec 2011 16:39:13 +0100 Subject: conntrack: fix size of CTA_PROTOINFO_TCP_FLAGS_ORIGINAL in ARM We have to use sizeof(struct nf_ct_tcp_flags) instead of sizeof(u_int16_t) to avoid problems in Intel IXP4xx network processor (ARM big endian). For more information, please see: http://markmail.org/message/afhn66qzyebyf7cs#query:+page:1+mid:7bw756ncuyosv23c+state:results Reported-by: Lutz Jaenicke Signed-off-by: Pablo Neira Ayuso --- src/conntrack/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/conntrack/parse.c') diff --git a/src/conntrack/parse.c b/src/conntrack/parse.c index 416573f..cb2a8dc 100644 --- a/src/conntrack/parse.c +++ b/src/conntrack/parse.c @@ -219,7 +219,7 @@ static void __parse_protoinfo_tcp(const struct nfattr *attr, if (tb[CTA_PROTOINFO_TCP_FLAGS_ORIGINAL-1]) { memcpy(&ct->protoinfo.tcp.flags[0], NFA_DATA(tb[CTA_PROTOINFO_TCP_FLAGS_ORIGINAL-1]), - sizeof(u_int16_t)); + sizeof(struct nf_ct_tcp_flags)); set_bit(ATTR_TCP_FLAGS_ORIG, ct->set); set_bit(ATTR_TCP_MASK_ORIG, ct->set); } @@ -227,7 +227,7 @@ static void __parse_protoinfo_tcp(const struct nfattr *attr, if (tb[CTA_PROTOINFO_TCP_FLAGS_REPLY-1]) { memcpy(&ct->protoinfo.tcp.flags[1], NFA_DATA(tb[CTA_PROTOINFO_TCP_FLAGS_REPLY-1]), - sizeof(u_int16_t)); + sizeof(struct nf_ct_tcp_flags)); set_bit(ATTR_TCP_FLAGS_REPL, ct->set); set_bit(ATTR_TCP_MASK_REPL, ct->set); } -- cgit v1.2.3