Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7546
b: refs/heads/master
c: 2248bcf
h: refs/heads/master
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Sep 6, 2005
1 parent f5a70b8 commit 433db84
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 5 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: 9261c9b042547d01eeb206cf0e21ce72832245ec
refs/heads/master: 2248bcfcd8fb622ec88b8587d0c1f139635ffd2e
5 changes: 5 additions & 0 deletions trunk/include/linux/netfilter_ipv4/ip_conntrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ struct ip_conntrack_expect
/* Unique ID */
unsigned int id;

/* Flags */
unsigned int flags;

#ifdef CONFIG_IP_NF_NAT_NEEDED
/* This is the original per-proto part, used to map the
* expected connection the way the recipient expects. */
Expand All @@ -272,6 +275,8 @@ struct ip_conntrack_expect
#endif
};

#define IP_CT_EXPECT_PERMANENT 0x1

static inline struct ip_conntrack *
tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_amanda.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static int help(struct sk_buff **pskb,
}

exp->expectfn = NULL;
exp->flags = 0;

exp->tuple.src.ip = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.ip;
exp->tuple.src.u.tcp.port = 0;
Expand Down
12 changes: 8 additions & 4 deletions trunk/net/ipv4/netfilter/ip_conntrack_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,14 @@ find_expectation(const struct ip_conntrack_tuple *tuple)
master ct never got confirmed, we'd hold a reference to it
and weird things would happen to future packets). */
if (ip_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask)
&& is_confirmed(i->master)
&& del_timer(&i->timeout)) {
unlink_expect(i);
return i;
&& is_confirmed(i->master)) {
if (i->flags & IP_CT_EXPECT_PERMANENT) {
atomic_inc(&i->use);
return i;
} else if (del_timer(&i->timeout)) {
unlink_expect(i);
return i;
}
}
}
return NULL;
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ static int help(struct sk_buff **pskb,
{ 0xFFFFFFFF, { .tcp = { 0xFFFF } }, 0xFF }});

exp->expectfn = NULL;
exp->flags = 0;

/* Now, NAT might want to mangle the packet, and register the
* (possibly changed) expectation itself. */
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_irc.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ static int help(struct sk_buff **pskb,
{ { 0, { 0 } },
{ 0xFFFFFFFF, { .tcp = { 0xFFFF } }, 0xFF }});
exp->expectfn = NULL;
exp->flags = 0;
if (ip_nat_irc_hook)
ret = ip_nat_irc_hook(pskb, ctinfo,
addr_beg_p - ib_ptr,
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,7 @@ ctnetlink_create_expect(struct nfattr *cda[])
}

exp->expectfn = NULL;
exp->flags = 0;
exp->master = ct;
memcpy(&exp->tuple, &tuple, sizeof(struct ip_conntrack_tuple));
memcpy(&exp->mask, &mask, sizeof(struct ip_conntrack_tuple));
Expand Down
1 change: 1 addition & 0 deletions trunk/net/ipv4/netfilter/ip_conntrack_tftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ static int tftp_help(struct sk_buff **pskb,
exp->mask.dst.u.udp.port = 0xffff;
exp->mask.dst.protonum = 0xff;
exp->expectfn = NULL;
exp->flags = 0;

DEBUGP("expect: ");
DUMP_TUPLE(&exp->tuple);
Expand Down

0 comments on commit 433db84

Please sign in to comment.