ipt_XOR fails to compile in gcc4
PATCH 1/1 ipt_XOR fails to compile in gcc4
As reported by Pawe³ Sikora, the attached fix is required by GCC 4 due to elimination of lvalue in assignments.
Resolves bugzilla #264
Phil
XOR/linux-2.6/net/ipv4/netfilter/ipt_XOR.c +2 -2
@@ -40,7 +40,7 @@ tcph = (struct tcphdr *) ((*pskb)->data + iph->ihl*4 );for (i=0 , j=0 ; i<(ntohs (iph->tot_len) - iph->ihl*4 - tcph->doff*4 ); ) {for (k=0 ; k<=info->block_size; k++) { - (char ) (*pskb)->data[ iph->ihl*4 + tcph->doff*4 + i ] ^= + (*pskb)->data[ iph->ihl*4 + tcph->doff*4 + i ] ^= info->key[j]; i++; }
@@ -52,7 +52,7 @@ udph = (struct udphdr *) ((*pskb)->data + iph->ihl*4 );for (i=0 , j=0 ; i<(ntohs (udph->len)-8 ); ) {for (k=0 ; k<=info->block_size; k++) { - (char ) (*pskb)->data[ iph->ihl*4 +sizeof (struct udphdr ) + i ] ^= + (*pskb)->data[ iph->ihl*4 +sizeof (struct udphdr ) + i ] ^= info->key[j]; i++; }
Harald Welte
AppliedQuoted 2 lines · Phil Oester
As reported by Pawe³ Sikora, the attached fix is required by GCC 4 due to elimination of lvalue in assignments.
thanks, applied.
Signature · 5 lines
- Harald Welte <[email protected]> http://www.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