[NETFILTER] PPTP helper: Fix endianness bug in GRE key / CallID NAT
authorHarald Welte <laforge@netfilter.org>
Thu, 3 Nov 2005 12:05:20 +0000 (13:05 +0100)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Sat, 5 Nov 2005 01:19:17 +0000 (23:19 -0200)
This endianness bug slipped through while changing the 'gre.key' field in the
conntrack tuple from 32bit to 16bit.

None of my tests caught the problem, since the linux pptp client always has
'0' as call id / gre key.  Only windows clients actually trigger the bug.

Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
net/ipv4/netfilter/ip_nat_proto_gre.c

index 7c12854016723891b9077711abcf863c9a42d404..f7cad7cf1aec2f48e0633c66dbf541ad25a0a775 100644 (file)
@@ -139,8 +139,8 @@ gre_manip_pkt(struct sk_buff **pskb,
                        break;
                case GRE_VERSION_PPTP:
                        DEBUGP("call_id -> 0x%04x\n", 
-                               ntohl(tuple->dst.u.gre.key));
-                       pgreh->call_id = htons(ntohl(tuple->dst.u.gre.key));
+                               ntohs(tuple->dst.u.gre.key));
+                       pgreh->call_id = tuple->dst.u.gre.key;
                        break;
                default:
                        DEBUGP("can't nat unknown GRE version\n");