All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xx_nat_proto_gre: gre_key returns wrong pointer
@ 2007-04-19 16:18 Jorge Boncompte [DTI2]
  2007-04-24 12:50 ` Patrick McHardy
  0 siblings, 1 reply; 10+ messages in thread
From: Jorge Boncompte [DTI2] @ 2007-04-19 16:18 UTC (permalink / raw)
  To: netfilter-devel

    Hi,

    While porting some changes of the 2.6.21-rc7 pptp/proto_gre conntrack 
and nat modules to a 2.4.32 kernel I noticed that the gre_key function 
returns a wrong pointer to the GRE key of a version 0 packet. I fixed it the 
way below but I don't know if it is right way. The gre_csum function seems 
to have the same problem. If the problem is real and the solution right I 
can resend with a signed-off line.

---  
linux-2.6.21-rc7.orig/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 
2007-04-19 17:54:26.000000000 +0200
+++ linux-2.6.21-rc7/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h 
2007-04-19 17:55:11.000000000 +0200
@@ -97,8 +97,8 @@
  if (!greh->key)
   return NULL;
  if (greh->csum || greh->routing)
-  return (__be32 *) (greh+sizeof(*greh)+4);
- return (__be32 *) (greh+sizeof(*greh));
+  return (__be32 *) ((void *)greh+sizeof(*greh)+4);
+ return (__be32 *) ((void *)greh+sizeof(*greh));
 }

 /* get pointer ot gre csum, if present */
@@ -106,7 +106,7 @@
 {
  if (!greh->csum)
   return NULL;
- return (__sum16 *) (greh+sizeof(*greh));
+ return (__sum16 *) ((void *)greh+sizeof(*greh));
 }

 #endif /* __KERNEL__ */

    -Jorge

==============================================================
Jorge Boncompte - Ingenieria y Gestion de RED
DTI2 - Desarrollo de la Tecnologia de las Comunicaciones
--------------------------------------------------------------
C/ Abogado Enriquez Barrios, 5   14004 CORDOBA (SPAIN)
Tlf: +34 957 761395 / FAX: +34 957 450380
==============================================================
- Sin pistachos no hay Rock & Roll...
- Without wicker a basket cannot be made.
==============================================================

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-05-02 13:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-19 16:18 [PATCH] xx_nat_proto_gre: gre_key returns wrong pointer Jorge Boncompte [DTI2]
2007-04-24 12:50 ` Patrick McHardy
2007-04-26 17:34   ` Jorge Boncompte [DTI2]
2007-04-27 11:21     ` Patrick McHardy
2007-04-27 11:47       ` [PATCH] xx_nat_proto_gre: do not modify/corrupt GREv0 packets thought NAT Jorge Boncompte [DTI2]
2007-05-02 12:25         ` Patrick McHardy
2007-05-02 13:21           ` Jorge Boncompte [DTI2]
2007-05-02 13:23             ` Patrick McHardy
2007-05-02 13:48               ` Jorge Boncompte [DTI2]
2007-05-02 13:52                 ` Patrick McHardy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.