Skip to content

Commit

Permalink
[INET]: Move common fields from frag_queues in one place.
Browse files Browse the repository at this point in the history
Introduce the struct inet_frag_queue in include/net/inet_frag.h
file and place there all the common fields from three structs:

 * struct ipq in ipv4/ip_fragment.c
 * struct nf_ct_frag6_queue in nf_conntrack_reasm.c
 * struct frag_queue in ipv6/reassembly.c

After this, replace these fields on appropriate structures with
this structure instance and fix the users to use correct names
i.e. hunks like

-    atomic_dec(&fq->refcnt);
+    atomic_dec(&fq->q.refcnt);

(these occupy most of the patch)

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Oct 15, 2007
1 parent 114342f commit 5ab11c9
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 250 deletions.
21 changes: 21 additions & 0 deletions include/net/inet_frag.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef __NET_FRAG_H__
#define __NET_FRAG_H__

struct inet_frag_queue {
struct hlist_node list;
struct list_head lru_list; /* lru list member */
spinlock_t lock;
atomic_t refcnt;
struct timer_list timer; /* when will this queue expire? */
struct sk_buff *fragments; /* list of received fragments */
ktime_t stamp;
int len; /* total length of orig datagram */
int meat;
__u8 last_in; /* first/last segment arrived? */

#define COMPLETE 4
#define FIRST_IN 2
#define LAST_IN 1
};

#endif
Loading

0 comments on commit 5ab11c9

Please sign in to comment.