void *arg);
void (*destructor)(struct inet_frag_queue *);
void (*skb_free)(struct sk_buff *);
- int (*equal)(struct inet_frag_queue *q1,
- struct inet_frag_queue *q2);
int (*match)(struct inet_frag_queue *q,
void *arg);
void (*frag_expire)(unsigned long data);
}
struct inet_frag_queue;
-int ip6_frag_equal(struct inet_frag_queue *q1, struct inet_frag_queue *q2);
struct ip6_create_arg {
__be32 id;
EXPORT_SYMBOL(inet_frag_evictor);
static struct inet_frag_queue *inet_frag_intern(struct inet_frag_queue *qp_in,
- struct inet_frags *f, unsigned int hash)
+ struct inet_frags *f, unsigned int hash, void *arg)
{
struct inet_frag_queue *qp;
#ifdef CONFIG_SMP
* promoted read lock to write lock.
*/
hlist_for_each_entry(qp, n, &f->hash[hash], list) {
- if (f->equal(qp, qp_in)) {
+ if (f->match(qp, arg)) {
atomic_inc(&qp->refcnt);
write_unlock(&f->lock);
qp_in->last_in |= COMPLETE;
if (q == NULL)
return NULL;
- return inet_frag_intern(q, f, hash);
+ return inet_frag_intern(q, f, hash, arg);
}
struct inet_frag_queue *inet_frag_find(struct inet_frags *f, void *key,
return ipqhashfn(ipq->id, ipq->saddr, ipq->daddr, ipq->protocol);
}
-static int ip4_frag_equal(struct inet_frag_queue *q1,
- struct inet_frag_queue *q2)
-{
- struct ipq *qp1, *qp2;
-
- qp1 = container_of(q1, struct ipq, q);
- qp2 = container_of(q2, struct ipq, q);
- return (qp1->id == qp2->id &&
- qp1->saddr == qp2->saddr &&
- qp1->daddr == qp2->daddr &&
- qp1->protocol == qp2->protocol &&
- qp1->user == qp2->user);
-}
-
static int ip4_frag_match(struct inet_frag_queue *q, void *a)
{
struct ipq *qp;
ip4_frags.destructor = ip4_frag_free;
ip4_frags.skb_free = NULL;
ip4_frags.qsize = sizeof(struct ipq);
- ip4_frags.equal = ip4_frag_equal;
ip4_frags.match = ip4_frag_match;
ip4_frags.frag_expire = ip_expire;
inet_frags_init(&ip4_frags);
nf_frags.skb_free = nf_skb_free;
nf_frags.qsize = sizeof(struct nf_ct_frag6_queue);
nf_frags.match = ip6_frag_match;
- nf_frags.equal = ip6_frag_equal;
nf_frags.frag_expire = nf_ct_frag6_expire;
inet_frags_init(&nf_frags);
return ip6qhashfn(fq->id, &fq->saddr, &fq->daddr);
}
-int ip6_frag_equal(struct inet_frag_queue *q1, struct inet_frag_queue *q2)
-{
- struct frag_queue *fq1, *fq2;
-
- fq1 = container_of(q1, struct frag_queue, q);
- fq2 = container_of(q2, struct frag_queue, q);
- return (fq1->id == fq2->id &&
- ipv6_addr_equal(&fq2->saddr, &fq1->saddr) &&
- ipv6_addr_equal(&fq2->daddr, &fq1->daddr));
-}
-EXPORT_SYMBOL(ip6_frag_equal);
-
int ip6_frag_match(struct inet_frag_queue *q, void *a)
{
struct frag_queue *fq;
ip6_frags.skb_free = NULL;
ip6_frags.qsize = sizeof(struct frag_queue);
ip6_frags.match = ip6_frag_match;
- ip6_frags.equal = ip6_frag_equal;
ip6_frags.frag_expire = ip6_frag_expire;
inet_frags_init(&ip6_frags);
}