Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53471
b: refs/heads/master
c: c2a1910
h: refs/heads/master
i:
  53469: 0799cd2
  53467: 2e5d37b
  53463: 4fef0bc
  53455: 1abd1da
  53439: e74f914
v: v3
  • Loading branch information
Jorge Boncompte authored and David S. Miller committed May 3, 2007
1 parent e6be0d2 commit 41e6b32
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 327850070b019a96853c533c152688546201c286
refs/heads/master: c2a1910b06fed96db77bb358c18c52a1fcf2b7fe
18 changes: 0 additions & 18 deletions trunk/include/linux/netfilter/nf_conntrack_proto_gre.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,6 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
/* delete keymap entries */
void nf_ct_gre_keymap_destroy(struct nf_conn *ct);

/* get pointer to gre key, if present */
static inline __be32 *gre_key(struct gre_hdr *greh)
{
if (!greh->key)
return NULL;
if (greh->csum || greh->routing)
return (__be32 *)(greh+sizeof(*greh)+4);
return (__be32 *)(greh+sizeof(*greh));
}

/* get pointer ot gre csum, if present */
static inline __sum16 *gre_csum(struct gre_hdr *greh)
{
if (!greh->csum)
return NULL;
return (__sum16 *)(greh+sizeof(*greh));
}

extern void nf_ct_gre_keymap_flush(void);
extern void nf_nat_need_gre(void);

Expand Down
20 changes: 8 additions & 12 deletions trunk/net/ipv4/netfilter/nf_nat_proto_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ gre_unique_tuple(struct nf_conntrack_tuple *tuple,
__be16 *keyptr;
unsigned int min, i, range_size;

/* If there is no master conntrack we are not PPTP,
do not change tuples */
if (!conntrack->master)
return 0;

if (maniptype == IP_NAT_MANIP_SRC)
keyptr = &tuple->src.u.gre.key;
else
Expand Down Expand Up @@ -122,18 +127,9 @@ gre_manip_pkt(struct sk_buff **pskb, unsigned int iphdroff,
if (maniptype != IP_NAT_MANIP_DST)
return 1;
switch (greh->version) {
case 0:
if (!greh->key) {
DEBUGP("can't nat GRE w/o key\n");
break;
}
if (greh->csum) {
/* FIXME: Never tested this code... */
nf_proto_csum_replace4(gre_csum(greh), *pskb,
*(gre_key(greh)),
tuple->dst.u.gre.key, 0);
}
*(gre_key(greh)) = tuple->dst.u.gre.key;
case GRE_VERSION_1701:
/* We do not currently NAT any GREv0 packets.
* Try to behave like "nf_nat_proto_unknown" */
break;
case GRE_VERSION_PPTP:
DEBUGP("call_id -> 0x%04x\n", ntohs(tuple->dst.u.gre.key));
Expand Down

0 comments on commit 41e6b32

Please sign in to comment.