···437437extern void xt_table_entry_swap_rcu(struct xt_table_info *old,438438 struct xt_table_info *new);439439440440+/*441441+ * This helper is performance critical and must be inlined442442+ */443443+static inline unsigned long ifname_compare_aligned(const char *_a,444444+ const char *_b,445445+ const char *_mask)446446+{447447+ const unsigned long *a = (const unsigned long *)_a;448448+ const unsigned long *b = (const unsigned long *)_b;449449+ const unsigned long *mask = (const unsigned long *)_mask;450450+ unsigned long ret;451451+452452+ ret = (a[0] ^ b[0]) & mask[0];453453+ if (IFNAMSIZ > sizeof(unsigned long))454454+ ret |= (a[1] ^ b[1]) & mask[1];455455+ if (IFNAMSIZ > 2 * sizeof(unsigned long))456456+ ret |= (a[2] ^ b[2]) & mask[2];457457+ if (IFNAMSIZ > 3 * sizeof(unsigned long))458458+ ret |= (a[3] ^ b[3]) & mask[3];459459+ BUILD_BUG_ON(IFNAMSIZ > 4 * sizeof(unsigned long));460460+ return ret;461461+}462462+440463#ifdef CONFIG_COMPAT441464#include <net/compat.h>442465
+8-6
include/net/netfilter/nf_conntrack.h
···9191#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>9292#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>93939494-struct nf_conn9595-{9494+struct nf_conn {9695 /* Usage count in here is 1 for hash table/destruct timer, 1 per skb,9796 plus 1 for any connection(s) we are `master' for */9897 struct nf_conntrack ct_general;···125126#ifdef CONFIG_NET_NS126127 struct net *ct_net;127128#endif128128- struct rcu_head rcu;129129};130130131131static inline struct nf_conn *···188190extern int nf_ct_l3proto_try_module_get(unsigned short l3proto);189191extern void nf_ct_l3proto_module_put(unsigned short l3proto);190192191191-extern struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced);192192-extern void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced,193193- unsigned int size);193193+/*194194+ * Allocate a hashtable of hlist_head (if nulls == 0),195195+ * or hlist_nulls_head (if nulls == 1)196196+ */197197+extern void *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced, int nulls);198198+199199+extern void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size);194200195201extern struct nf_conntrack_tuple_hash *196202__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple);
···5353 int (*tuple_to_nlattr)(struct sk_buff *skb,5454 const struct nf_conntrack_tuple *t);55555656+ /*5757+ * Calculate size of tuple nlattr5858+ */5959+ int (*nlattr_tuple_size)(void);6060+5661 int (*nlattr_to_tuple)(struct nlattr *tb[],5762 struct nf_conntrack_tuple *t);5863 const struct nla_policy *nla_policy;6464+6565+ size_t nla_size;59666067#ifdef CONFIG_SYSCTL6168 struct ctl_table_header *ctl_table_header;
+7
include/net/netfilter/nf_conntrack_l4proto.h
···6464 /* convert protoinfo to nfnetink attributes */6565 int (*to_nlattr)(struct sk_buff *skb, struct nlattr *nla,6666 const struct nf_conn *ct);6767+ /* Calculate protoinfo nlattr size */6868+ int (*nlattr_size)(void);67696870 /* convert nfnetlink attributes to protoinfo */6971 int (*from_nlattr)(struct nlattr *tb[], struct nf_conn *ct);70727173 int (*tuple_to_nlattr)(struct sk_buff *skb,7274 const struct nf_conntrack_tuple *t);7575+ /* Calculate tuple nlattr size */7676+ int (*nlattr_tuple_size)(void);7377 int (*nlattr_to_tuple)(struct nlattr *tb[],7478 struct nf_conntrack_tuple *t);7579 const struct nla_policy *nla_policy;8080+8181+ size_t nla_size;76827783#ifdef CONFIG_SYSCTL7884 struct ctl_table_header **ctl_table_header;···113107 const struct nf_conntrack_tuple *tuple);114108extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],115109 struct nf_conntrack_tuple *t);110110+extern int nf_ct_port_nlattr_tuple_size(void);116111extern const struct nla_policy nf_ct_port_nla_policy[];117112118113#ifdef CONFIG_SYSCTL
+3-3
include/net/netfilter/nf_conntrack_tuple.h
···12121313#include <linux/netfilter/x_tables.h>1414#include <linux/netfilter/nf_conntrack_tuple_common.h>1515+#include <linux/list_nulls.h>15161617/* A `tuple' is a structure containing the information to uniquely1718 identify a connection. ie. if two packets have the same tuple, they···147146 ((enum ip_conntrack_dir)(h)->tuple.dst.dir)148147149148/* Connections have two entries in the hash table: one for each way */150150-struct nf_conntrack_tuple_hash151151-{152152- struct hlist_node hnode;149149+struct nf_conntrack_tuple_hash {150150+ struct hlist_nulls_node hnnode;153151 struct nf_conntrack_tuple tuple;154152};155153
+1
include/net/netlink.h
···230230extern int nla_parse(struct nlattr *tb[], int maxtype,231231 struct nlattr *head, int len,232232 const struct nla_policy *policy);233233+extern int nla_policy_len(const struct nla_policy *, int);233234extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);234235extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,235236 size_t dstsize);
···133133}134134135135/**136136+ * nla_policy_len - Determin the max. length of a policy137137+ * @policy: policy to use138138+ * @n: number of policies139139+ *140140+ * Determines the max. length of the policy. It is currently used141141+ * to allocated Netlink buffers roughly the size of the actual142142+ * message.143143+ *144144+ * Returns 0 on success or a negative error code.145145+ */146146+int147147+nla_policy_len(const struct nla_policy *p, int n)148148+{149149+ int i, len = 0;150150+151151+ for (i = 0; i < n; i++) {152152+ if (p->len)153153+ len += nla_total_size(p->len);154154+ else if (nla_attr_minlen[p->type])155155+ len += nla_total_size(nla_attr_minlen[p->type]);156156+ }157157+158158+ return len;159159+}160160+161161+/**136162 * nla_parse - Parse a stream of attributes into a tb buffer137163 * @tb: destination array with maxtype+1 elements138164 * @maxtype: maximum attribute type to be expected···493467#endif494468495469EXPORT_SYMBOL(nla_validate);470470+EXPORT_SYMBOL(nla_policy_len);496471EXPORT_SYMBOL(nla_parse);497472EXPORT_SYMBOL(nla_find);498473EXPORT_SYMBOL(nla_strlcpy);
+4-14
net/ipv4/netfilter/arp_tables.c
···8181static unsigned long ifname_compare(const char *_a, const char *_b, const char *_mask)8282{8383#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS8484- const unsigned long *a = (const unsigned long *)_a;8585- const unsigned long *b = (const unsigned long *)_b;8686- const unsigned long *mask = (const unsigned long *)_mask;8787- unsigned long ret;8888-8989- ret = (a[0] ^ b[0]) & mask[0];9090- if (IFNAMSIZ > sizeof(unsigned long))9191- ret |= (a[1] ^ b[1]) & mask[1];9292- if (IFNAMSIZ > 2 * sizeof(unsigned long))9393- ret |= (a[2] ^ b[2]) & mask[2];9494- if (IFNAMSIZ > 3 * sizeof(unsigned long))9595- ret |= (a[3] ^ b[3]) & mask[3];9696- BUILD_BUG_ON(IFNAMSIZ > 4 * sizeof(unsigned long));8484+ unsigned long ret = ifname_compare_aligned(_a, _b, _mask);9785#else9886 unsigned long ret = 0;9987 const u16 *a = (const u16 *)_a;···392404 && unconditional(&e->arp)) || visited) {393405 unsigned int oldpos, size;394406395395- if (t->verdict < -NF_MAX_VERDICT - 1) {407407+ if ((strcmp(t->target.u.user.name,408408+ ARPT_STANDARD_TARGET) == 0) &&409409+ t->verdict < -NF_MAX_VERDICT - 1) {396410 duprintf("mark_source_chains: bad "397411 "negative verdict (%i)\n",398412 t->verdict);
+5-22
net/ipv4/netfilter/ip_tables.c
···74747575 Hence the start of any table is given by get_table() below. */76767777-static unsigned long ifname_compare(const char *_a, const char *_b,7878- const unsigned char *_mask)7979-{8080- const unsigned long *a = (const unsigned long *)_a;8181- const unsigned long *b = (const unsigned long *)_b;8282- const unsigned long *mask = (const unsigned long *)_mask;8383- unsigned long ret;8484-8585- ret = (a[0] ^ b[0]) & mask[0];8686- if (IFNAMSIZ > sizeof(unsigned long))8787- ret |= (a[1] ^ b[1]) & mask[1];8888- if (IFNAMSIZ > 2 * sizeof(unsigned long))8989- ret |= (a[2] ^ b[2]) & mask[2];9090- if (IFNAMSIZ > 3 * sizeof(unsigned long))9191- ret |= (a[3] ^ b[3]) & mask[3];9292- BUILD_BUG_ON(IFNAMSIZ > 4 * sizeof(unsigned long));9393- return ret;9494-}9595-9677/* Returns whether matches rule or not. */9778/* Performance critical - called for every packet */9879static inline bool···102121 return false;103122 }104123105105- ret = ifname_compare(indev, ipinfo->iniface, ipinfo->iniface_mask);124124+ ret = ifname_compare_aligned(indev, ipinfo->iniface, ipinfo->iniface_mask);106125107126 if (FWINV(ret != 0, IPT_INV_VIA_IN)) {108127 dprintf("VIA in mismatch (%s vs %s).%s\n",···111130 return false;112131 }113132114114- ret = ifname_compare(outdev, ipinfo->outiface, ipinfo->outiface_mask);133133+ ret = ifname_compare_aligned(outdev, ipinfo->outiface, ipinfo->outiface_mask);115134116135 if (FWINV(ret != 0, IPT_INV_VIA_OUT)) {117136 dprintf("VIA out mismatch (%s vs %s).%s\n",···488507 && unconditional(&e->ip)) || visited) {489508 unsigned int oldpos, size;490509491491- if (t->verdict < -NF_MAX_VERDICT - 1) {510510+ if ((strcmp(t->target.u.user.name,511511+ IPT_STANDARD_TARGET) == 0) &&512512+ t->verdict < -NF_MAX_VERDICT - 1) {492513 duprintf("mark_source_chains: bad "493514 "negative verdict (%i)\n",494515 t->verdict);
···374374375375config NETFILTER_XT_TARGET_LED376376 tristate '"LED" target support'377377- depends on LEDS_CLASS377377+ depends on LEDS_CLASS && LED_TRIGGERS378378 depends on NETFILTER_ADVANCED379379 help380380 This option adds a `LED' target, which allows you to blink LEDs in
+76-53
net/netfilter/nf_conntrack_core.c
···2929#include <linux/netdevice.h>3030#include <linux/socket.h>3131#include <linux/mm.h>3232+#include <linux/rculist_nulls.h>32333334#include <net/netfilter/nf_conntrack.h>3435#include <net/netfilter/nf_conntrack_l3proto.h>···164163clean_from_lists(struct nf_conn *ct)165164{166165 pr_debug("clean_from_lists(%p)\n", ct);167167- hlist_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode);168168- hlist_del_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnode);166166+ hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode);167167+ hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode);169168170169 /* Destroy all pending expectations */171170 nf_ct_remove_expectations(ct);···205204206205 /* We overload first tuple to link into unconfirmed list. */207206 if (!nf_ct_is_confirmed(ct)) {208208- BUG_ON(hlist_unhashed(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode));209209- hlist_del(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode);207207+ BUG_ON(hlist_nulls_unhashed(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode));208208+ hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode);210209 }211210212211 NF_CT_STAT_INC(net, delete);···243242 nf_ct_put(ct);244243}245244245245+/*246246+ * Warning :247247+ * - Caller must take a reference on returned object248248+ * and recheck nf_ct_tuple_equal(tuple, &h->tuple)249249+ * OR250250+ * - Caller must lock nf_conntrack_lock before calling this function251251+ */246252struct nf_conntrack_tuple_hash *247253__nf_conntrack_find(struct net *net, const struct nf_conntrack_tuple *tuple)248254{249255 struct nf_conntrack_tuple_hash *h;250250- struct hlist_node *n;256256+ struct hlist_nulls_node *n;251257 unsigned int hash = hash_conntrack(tuple);252258253259 /* Disable BHs the entire time since we normally need to disable them254260 * at least once for the stats anyway.255261 */256262 local_bh_disable();257257- hlist_for_each_entry_rcu(h, n, &net->ct.hash[hash], hnode) {263263+begin:264264+ hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[hash], hnnode) {258265 if (nf_ct_tuple_equal(tuple, &h->tuple)) {259266 NF_CT_STAT_INC(net, found);260267 local_bh_enable();···270261 }271262 NF_CT_STAT_INC(net, searched);272263 }264264+ /*265265+ * if the nulls value we got at the end of this lookup is266266+ * not the expected one, we must restart lookup.267267+ * We probably met an item that was moved to another chain.268268+ */269269+ if (get_nulls_value(n) != hash)270270+ goto begin;273271 local_bh_enable();274272275273 return NULL;···291275 struct nf_conn *ct;292276293277 rcu_read_lock();278278+begin:294279 h = __nf_conntrack_find(net, tuple);295280 if (h) {296281 ct = nf_ct_tuplehash_to_ctrack(h);297282 if (unlikely(!atomic_inc_not_zero(&ct->ct_general.use)))298283 h = NULL;284284+ else {285285+ if (unlikely(!nf_ct_tuple_equal(tuple, &h->tuple))) {286286+ nf_ct_put(ct);287287+ goto begin;288288+ }289289+ }299290 }300291 rcu_read_unlock();301292···316293{317294 struct net *net = nf_ct_net(ct);318295319319- hlist_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode,296296+ hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,320297 &net->ct.hash[hash]);321321- hlist_add_head_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnode,298298+ hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode,322299 &net->ct.hash[repl_hash]);323300}324301···341318 struct nf_conntrack_tuple_hash *h;342319 struct nf_conn *ct;343320 struct nf_conn_help *help;344344- struct hlist_node *n;321321+ struct hlist_nulls_node *n;345322 enum ip_conntrack_info ctinfo;346323 struct net *net;347324···373350 /* See if there's one in the list already, including reverse:374351 NAT could have grabbed it without realizing, since we're375352 not in the hash. If there is, we lost race. */376376- hlist_for_each_entry(h, n, &net->ct.hash[hash], hnode)353353+ hlist_nulls_for_each_entry(h, n, &net->ct.hash[hash], hnnode)377354 if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple,378355 &h->tuple))379356 goto out;380380- hlist_for_each_entry(h, n, &net->ct.hash[repl_hash], hnode)357357+ hlist_nulls_for_each_entry(h, n, &net->ct.hash[repl_hash], hnnode)381358 if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple,382359 &h->tuple))383360 goto out;384361385362 /* Remove from unconfirmed list */386386- hlist_del(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode);363363+ hlist_nulls_del_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode);387364388365 __nf_conntrack_hash_insert(ct, hash, repl_hash);389366 /* Timer relative to confirmation time, not original···422399{423400 struct net *net = nf_ct_net(ignored_conntrack);424401 struct nf_conntrack_tuple_hash *h;425425- struct hlist_node *n;402402+ struct hlist_nulls_node *n;426403 unsigned int hash = hash_conntrack(tuple);427404428405 /* Disable BHs the entire time since we need to disable them at429406 * least once for the stats anyway.430407 */431408 rcu_read_lock_bh();432432- hlist_for_each_entry_rcu(h, n, &net->ct.hash[hash], hnode) {409409+ hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[hash], hnnode) {433410 if (nf_ct_tuplehash_to_ctrack(h) != ignored_conntrack &&434411 nf_ct_tuple_equal(tuple, &h->tuple)) {435412 NF_CT_STAT_INC(net, found);···453430 /* Use oldest entry, which is roughly LRU */454431 struct nf_conntrack_tuple_hash *h;455432 struct nf_conn *ct = NULL, *tmp;456456- struct hlist_node *n;433433+ struct hlist_nulls_node *n;457434 unsigned int i, cnt = 0;458435 int dropped = 0;459436460437 rcu_read_lock();461438 for (i = 0; i < nf_conntrack_htable_size; i++) {462462- hlist_for_each_entry_rcu(h, n, &net->ct.hash[hash],463463- hnode) {439439+ hlist_nulls_for_each_entry_rcu(h, n, &net->ct.hash[hash],440440+ hnnode) {464441 tmp = nf_ct_tuplehash_to_ctrack(h);465442 if (!test_bit(IPS_ASSURED_BIT, &tmp->status))466443 ct = tmp;···531508#ifdef CONFIG_NET_NS532509 ct->ct_net = net;533510#endif534534- INIT_RCU_HEAD(&ct->rcu);535511536512 return ct;537513}538514EXPORT_SYMBOL_GPL(nf_conntrack_alloc);539539-540540-static void nf_conntrack_free_rcu(struct rcu_head *head)541541-{542542- struct nf_conn *ct = container_of(head, struct nf_conn, rcu);543543-544544- nf_ct_ext_free(ct);545545- kmem_cache_free(nf_conntrack_cachep, ct);546546-}547515548516void nf_conntrack_free(struct nf_conn *ct)549517{···542528543529 nf_ct_ext_destroy(ct);544530 atomic_dec(&net->ct.count);545545- call_rcu(&ct->rcu, nf_conntrack_free_rcu);531531+ nf_ct_ext_free(ct);532532+ kmem_cache_free(nf_conntrack_cachep, ct);546533}547534EXPORT_SYMBOL_GPL(nf_conntrack_free);548535···609594 }610595611596 /* Overload tuple linked list to put us in unconfirmed list. */612612- hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode,597597+ hlist_nulls_add_head_rcu(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnnode,613598 &net->ct.unconfirmed);614599615600 spin_unlock_bh(&nf_conntrack_lock);···921906 return 0;922907}923908EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_to_tuple);909909+910910+int nf_ct_port_nlattr_tuple_size(void)911911+{912912+ return nla_policy_len(nf_ct_port_nla_policy, CTA_PROTO_MAX + 1);913913+}914914+EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_tuple_size);924915#endif925916926917/* Used by ipt_REJECT and ip6t_REJECT. */···955934{956935 struct nf_conntrack_tuple_hash *h;957936 struct nf_conn *ct;958958- struct hlist_node *n;937937+ struct hlist_nulls_node *n;959938960939 spin_lock_bh(&nf_conntrack_lock);961940 for (; *bucket < nf_conntrack_htable_size; (*bucket)++) {962962- hlist_for_each_entry(h, n, &net->ct.hash[*bucket], hnode) {941941+ hlist_nulls_for_each_entry(h, n, &net->ct.hash[*bucket], hnnode) {963942 ct = nf_ct_tuplehash_to_ctrack(h);964943 if (iter(ct, data))965944 goto found;966945 }967946 }968968- hlist_for_each_entry(h, n, &net->ct.unconfirmed, hnode) {947947+ hlist_nulls_for_each_entry(h, n, &net->ct.unconfirmed, hnnode) {969948 ct = nf_ct_tuplehash_to_ctrack(h);970949 if (iter(ct, data))971950 set_bit(IPS_DYING_BIT, &ct->status);···1013992 return 1;1014993}101599410161016-void nf_ct_free_hashtable(struct hlist_head *hash, int vmalloced, unsigned int size)995995+void nf_ct_free_hashtable(void *hash, int vmalloced, unsigned int size)1017996{1018997 if (vmalloced)1019998 vfree(hash);···10811060 }10821061}1083106210841084-struct hlist_head *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced)10631063+void *nf_ct_alloc_hashtable(unsigned int *sizep, int *vmalloced, int nulls)10851064{10861086- struct hlist_head *hash;10871087- unsigned int size, i;10651065+ struct hlist_nulls_head *hash;10661066+ unsigned int nr_slots, i;10671067+ size_t sz;1088106810891069 *vmalloced = 0;1090107010911091- size = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_head));10921092- hash = (void*)__get_free_pages(GFP_KERNEL|__GFP_NOWARN,10931093- get_order(sizeof(struct hlist_head)10941094- * size));10711071+ BUILD_BUG_ON(sizeof(struct hlist_nulls_head) != sizeof(struct hlist_head));10721072+ nr_slots = *sizep = roundup(*sizep, PAGE_SIZE / sizeof(struct hlist_nulls_head));10731073+ sz = nr_slots * sizeof(struct hlist_nulls_head);10741074+ hash = (void *)__get_free_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO,10751075+ get_order(sz));10951076 if (!hash) {10961077 *vmalloced = 1;10971078 printk(KERN_WARNING "nf_conntrack: falling back to vmalloc.\n");10981098- hash = vmalloc(sizeof(struct hlist_head) * size);10791079+ hash = __vmalloc(sz, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);10991080 }1100108111011101- if (hash)11021102- for (i = 0; i < size; i++)11031103- INIT_HLIST_HEAD(&hash[i]);10821082+ if (hash && nulls)10831083+ for (i = 0; i < nr_slots; i++)10841084+ INIT_HLIST_NULLS_HEAD(&hash[i], i);1104108511051086 return hash;11061087}···11131090 int i, bucket, vmalloced, old_vmalloced;11141091 unsigned int hashsize, old_size;11151092 int rnd;11161116- struct hlist_head *hash, *old_hash;10931093+ struct hlist_nulls_head *hash, *old_hash;11171094 struct nf_conntrack_tuple_hash *h;1118109511191096 /* On boot, we can set this without any fancy locking. */···11241101 if (!hashsize)11251102 return -EINVAL;1126110311271127- hash = nf_ct_alloc_hashtable(&hashsize, &vmalloced);11041104+ hash = nf_ct_alloc_hashtable(&hashsize, &vmalloced, 1);11281105 if (!hash)11291106 return -ENOMEM;11301107···11391116 */11401117 spin_lock_bh(&nf_conntrack_lock);11411118 for (i = 0; i < nf_conntrack_htable_size; i++) {11421142- while (!hlist_empty(&init_net.ct.hash[i])) {11431143- h = hlist_entry(init_net.ct.hash[i].first,11441144- struct nf_conntrack_tuple_hash, hnode);11451145- hlist_del_rcu(&h->hnode);11191119+ while (!hlist_nulls_empty(&init_net.ct.hash[i])) {11201120+ h = hlist_nulls_entry(init_net.ct.hash[i].first,11211121+ struct nf_conntrack_tuple_hash, hnnode);11221122+ hlist_nulls_del_rcu(&h->hnnode);11461123 bucket = __hash_conntrack(&h->tuple, hashsize, rnd);11471147- hlist_add_head(&h->hnode, &hash[bucket]);11241124+ hlist_nulls_add_head_rcu(&h->hnnode, &hash[bucket]);11481125 }11491126 }11501127 old_size = nf_conntrack_htable_size;···1195117211961173 nf_conntrack_cachep = kmem_cache_create("nf_conntrack",11971174 sizeof(struct nf_conn),11981198- 0, 0, NULL);11751175+ 0, SLAB_DESTROY_BY_RCU, NULL);11991176 if (!nf_conntrack_cachep) {12001177 printk(KERN_ERR "Unable to create nf_conn slab cache\n");12011178 ret = -ENOMEM;···12251202 int ret;1226120312271204 atomic_set(&net->ct.count, 0);12281228- INIT_HLIST_HEAD(&net->ct.unconfirmed);12051205+ INIT_HLIST_NULLS_HEAD(&net->ct.unconfirmed, 0);12291206 net->ct.stat = alloc_percpu(struct ip_conntrack_stat);12301207 if (!net->ct.stat) {12311208 ret = -ENOMEM;···12351212 if (ret < 0)12361213 goto err_ecache;12371214 net->ct.hash = nf_ct_alloc_hashtable(&nf_conntrack_htable_size,12381238- &net->ct.hash_vmalloc);12151215+ &net->ct.hash_vmalloc, 1);12391216 if (!net->ct.hash) {12401217 ret = -ENOMEM;12411218 printk(KERN_ERR "Unable to create nf_conntrack_hash\n");