mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	[NETFILTER]: nf_conntrack_expect: kill unique ID
Similar to the conntrack ID, the per-expectation ID is not needed anymore, kill it. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									7f85f91472
								
							
						
					
					
						commit
						3583240249
					
				
					 3 changed files with 3 additions and 8 deletions
				
			
		| 
						 | 
					@ -38,9 +38,6 @@ struct nf_conntrack_expect
 | 
				
			||||||
	/* Usage count. */
 | 
						/* Usage count. */
 | 
				
			||||||
	atomic_t use;
 | 
						atomic_t use;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Unique ID */
 | 
					 | 
				
			||||||
	unsigned int id;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Flags */
 | 
						/* Flags */
 | 
				
			||||||
	unsigned int flags;
 | 
						unsigned int flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,6 @@ static int nf_ct_expect_hash_rnd_initted __read_mostly;
 | 
				
			||||||
static int nf_ct_expect_vmalloc;
 | 
					static int nf_ct_expect_vmalloc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct kmem_cache *nf_ct_expect_cachep __read_mostly;
 | 
					static struct kmem_cache *nf_ct_expect_cachep __read_mostly;
 | 
				
			||||||
static unsigned int nf_ct_expect_next_id;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* nf_conntrack_expect helper functions */
 | 
					/* nf_conntrack_expect helper functions */
 | 
				
			||||||
void nf_ct_unlink_expect(struct nf_conntrack_expect *exp)
 | 
					void nf_ct_unlink_expect(struct nf_conntrack_expect *exp)
 | 
				
			||||||
| 
						 | 
					@ -302,7 +301,6 @@ static void nf_ct_expect_insert(struct nf_conntrack_expect *exp)
 | 
				
			||||||
	exp->timeout.expires = jiffies + master_help->helper->timeout * HZ;
 | 
						exp->timeout.expires = jiffies + master_help->helper->timeout * HZ;
 | 
				
			||||||
	add_timer(&exp->timeout);
 | 
						add_timer(&exp->timeout);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	exp->id = ++nf_ct_expect_next_id;
 | 
					 | 
				
			||||||
	atomic_inc(&exp->use);
 | 
						atomic_inc(&exp->use);
 | 
				
			||||||
	NF_CT_STAT_INC(expect_create);
 | 
						NF_CT_STAT_INC(expect_create);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1160,7 +1160,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb,
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct nf_conn *master = exp->master;
 | 
						struct nf_conn *master = exp->master;
 | 
				
			||||||
	__be32 timeout = htonl((exp->timeout.expires - jiffies) / HZ);
 | 
						__be32 timeout = htonl((exp->timeout.expires - jiffies) / HZ);
 | 
				
			||||||
	__be32 id = htonl(exp->id);
 | 
						__be32 id = htonl((unsigned long)exp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ctnetlink_exp_dump_tuple(skb, &exp->tuple, CTA_EXPECT_TUPLE) < 0)
 | 
						if (ctnetlink_exp_dump_tuple(skb, &exp->tuple, CTA_EXPECT_TUPLE) < 0)
 | 
				
			||||||
		goto nla_put_failure;
 | 
							goto nla_put_failure;
 | 
				
			||||||
| 
						 | 
					@ -1346,7 +1346,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (cda[CTA_EXPECT_ID]) {
 | 
						if (cda[CTA_EXPECT_ID]) {
 | 
				
			||||||
		__be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]);
 | 
							__be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]);
 | 
				
			||||||
		if (exp->id != ntohl(id)) {
 | 
							if (ntohl(id) != (u32)(unsigned long)exp) {
 | 
				
			||||||
			nf_ct_expect_put(exp);
 | 
								nf_ct_expect_put(exp);
 | 
				
			||||||
			return -ENOENT;
 | 
								return -ENOENT;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					@ -1400,7 +1400,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (cda[CTA_EXPECT_ID]) {
 | 
							if (cda[CTA_EXPECT_ID]) {
 | 
				
			||||||
			__be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]);
 | 
								__be32 id = *(__be32 *)nla_data(cda[CTA_EXPECT_ID]);
 | 
				
			||||||
			if (exp->id != ntohl(id)) {
 | 
								if (ntohl(id) != (u32)(unsigned long)exp) {
 | 
				
			||||||
				nf_ct_expect_put(exp);
 | 
									nf_ct_expect_put(exp);
 | 
				
			||||||
				return -ENOENT;
 | 
									return -ENOENT;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue