[netfilter-cvslog] r3727 -
trunk/patch-o-matic-ng/nf_conntrack/linux-2.6/net/netfilter
yasuyuki at netfilter.org
yasuyuki at netfilter.org
Thu Feb 17 18:02:05 CET 2005
Author: yasuyuki at netfilter.org
Date: 2005-02-17 18:02:05 +0100 (Thu, 17 Feb 2005)
New Revision: 3727
Modified:
trunk/patch-o-matic-ng/nf_conntrack/linux-2.6/net/netfilter/nf_conntrack_proto_tcp.c
Log:
- delete unnecessary align enforcement.
- strange packet may have 1 NOP before SACK option. In this case, SACK option
will not be 32bit aligned.
Modified: trunk/patch-o-matic-ng/nf_conntrack/linux-2.6/net/netfilter/nf_conntrack_proto_tcp.c
===================================================================
--- trunk/patch-o-matic-ng/nf_conntrack/linux-2.6/net/netfilter/nf_conntrack_proto_tcp.c 2005-02-17 16:42:19 UTC (rev 3726)
+++ trunk/patch-o-matic-ng/nf_conntrack/linux-2.6/net/netfilter/nf_conntrack_proto_tcp.c 2005-02-17 17:02:05 UTC (rev 3727)
@@ -382,7 +382,7 @@
struct tcphdr *tcph)
{
/* XXX Should I use payload length field in IP/IPv6 header ?
- * - kozakai */
+ * - YK */
return (seq + len - dataoff - tcph->doff*4
+ (tcph->syn ? 1 : 0) + (tcph->fin ? 1 : 0));
}
@@ -457,7 +457,7 @@
{
__u32 tmp;
unsigned char *ptr;
- unsigned char buff[(15 * 4) - sizeof(struct tcphdr)] __attribute__((__aligned__(sizeof(__u32))));
+ unsigned char buff[(15 * 4) - sizeof(struct tcphdr)];
int length = (tcph->doff*4) - sizeof(struct tcphdr);
ptr = skb_header_pointer(skb, dataoff + sizeof(struct tcphdr),
@@ -498,7 +498,9 @@
for (i = 0;
i < (opsize - TCPOLEN_SACK_BASE);
i += TCPOLEN_SACK_PERBLOCK) {
- tmp = ntohl(*((u_int32_t *)(ptr+i)+1));
+ memcpy(&tmp, (__u32 *)(ptr + i) + 1,
+ sizeof(__u32));
+ tmp = ntohl(tmp);
if (after(tmp, *sack))
*sack = tmp;
More information about the netfilter-cvslog
mailing list