git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag
[linux-2.6.git]
/
net
/
ipv4
/
netfilter
/
ip_nat_proto_gre.c
diff --git
a/net/ipv4/netfilter/ip_nat_proto_gre.c
b/net/ipv4/netfilter/ip_nat_proto_gre.c
index
691f641
..
5691a10
100644
(file)
--- a/
net/ipv4/netfilter/ip_nat_proto_gre.c
+++ b/
net/ipv4/netfilter/ip_nat_proto_gre.c
@@
-36,8
+36,8
@@
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
MODULE_DESCRIPTION("Netfilter NAT protocol helper module for GRE");
#if 0
MODULE_DESCRIPTION("Netfilter NAT protocol helper module for GRE");
#if 0
-#define DEBUGP(format, args...) printk(KERN_DEBUG
"%s:%s: " format, __FILE__,
\
-
__FUNCTION__
, ## args)
+#define DEBUGP(format, args...) printk(KERN_DEBUG
__FILE__ ":" __FUNCTION__
\
+
": " format
, ## args)
#else
#define DEBUGP(x, args...)
#endif
#else
#define DEBUGP(x, args...)
#endif
@@
-68,7
+68,7
@@
gre_unique_tuple(struct ip_conntrack_tuple *tuple,
const struct ip_conntrack *conntrack)
{
u_int32_t min, i, range_size;
const struct ip_conntrack *conntrack)
{
u_int32_t min, i, range_size;
- u_int
16
_t key = 0, *keyptr;
+ u_int
32
_t key = 0, *keyptr;
if (maniptype == IP_NAT_MANIP_SRC)
keyptr = &tuple->src.u.gre.key;
if (maniptype == IP_NAT_MANIP_SRC)
keyptr = &tuple->src.u.gre.key;
@@
-100,18
+100,14
@@
gre_unique_tuple(struct ip_conntrack_tuple *tuple,
/* manipulate a GRE packet according to maniptype */
static int
gre_manip_pkt(struct sk_buff **pskb,
/* manipulate a GRE packet according to maniptype */
static int
gre_manip_pkt(struct sk_buff **pskb,
- unsigned int
ip
hdroff,
- const struct ip_conntrack_
tuple *tuple
,
+ unsigned int hdroff,
+ const struct ip_conntrack_
manip *manip
,
enum ip_nat_manip_type maniptype)
{
struct gre_hdr *greh;
struct gre_hdr_pptp *pgreh;
enum ip_nat_manip_type maniptype)
{
struct gre_hdr *greh;
struct gre_hdr_pptp *pgreh;
- struct iphdr *iph = (struct iphdr *)((*pskb)->data + iphdroff);
- unsigned int hdroff = iphdroff + iph->ihl*4;
- /* pgreh includes two optional 32bit fields which are not required
- * to be there. That's where the magic '8' comes from */
- if (!skb_ip_make_writable(pskb, hdroff + sizeof(*pgreh)-8))
+ if (!skb_ip_make_writable(pskb, hdroff + sizeof(*pgreh)))
return 0;
greh = (void *)(*pskb)->data + hdroff;
return 0;
greh = (void *)(*pskb)->data + hdroff;
@@
-131,15
+127,15
@@
gre_manip_pkt(struct sk_buff **pskb,
/* FIXME: Never tested this code... */
*(gre_csum(greh)) =
ip_nat_cheat_check(~*(gre_key(greh)),
/* FIXME: Never tested this code... */
*(gre_csum(greh)) =
ip_nat_cheat_check(~*(gre_key(greh)),
-
tuple->dst.
u.gre.key,
+
manip->
u.gre.key,
*(gre_csum(greh)));
}
*(gre_csum(greh)));
}
- *(gre_key(greh)) =
tuple->dst.
u.gre.key;
+ *(gre_key(greh)) =
manip->
u.gre.key;
break;
case GRE_VERSION_PPTP:
DEBUGP("call_id -> 0x%04x\n",
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));
+ ntohl(
manip->
u.gre.key));
+ pgreh->call_id = htons(ntohl(
manip->
u.gre.key));
break;
default:
DEBUGP("can't nat unknown GRE version\n");
break;
default:
DEBUGP("can't nat unknown GRE version\n");