diff --git a/net/netfilter/core.c b/net/netfilter/core.c index ef4e76e5aef9..6c53221a1922 100644 --- a/net/netfilter/core.c +++ b/net/netfilter/core.c @@ -59,8 +59,10 @@ static struct nf_hook_entries *allocate_hook_entries_size(u16 num) return NULL; e = kvzalloc(alloc, GFP_KERNEL_ACCOUNT); - if (e) + if (e) { + printk("%p, %d, %s\n", e, num, __func__); e->num_hook_entries = num; + } return e; } @@ -151,6 +153,7 @@ nf_hook_entries_grow(const struct nf_hook_entries *old, continue; } + printk("%p, %s\n", orig_ops[i], __func__); if (inserted || reg->priority > orig_ops[i]->priority) { new_ops[nhooks] = (void *)orig_ops[i]; new->hooks[nhooks] = old->hooks[i]; @@ -279,6 +282,14 @@ static struct nf_hook_entries __rcu ** nf_hook_entry_head(struct net *net, int pf, unsigned int hooknum, struct net_device *dev) { + printk("%d, %d, %d, %d, %d, %d, %d, %d, %s\n", pf, + ARRAY_SIZE(net->nf.hooks_arp), + ARRAY_SIZE(net->nf.hooks_bridge), + NF_INET_INGRESS, + ARRAY_SIZE(net->nf.hooks_ipv4), + ARRAY_SIZE(net->nf.hooks_ipv6), + NF_NETDEV_EGRESS, + hooknum, __func__); switch (pf) { case NFPROTO_NETDEV: break; @@ -473,10 +484,13 @@ static bool nf_remove_net_hook(struct nf_hook_entries *old, struct nf_hook_ops **orig_ops; unsigned int i; + printk("%d, %p, %p, %d, %s\n", IS_ERR(old), old, unreg, old->num_hook_entries, __func__); orig_ops = nf_hook_entries_get_hook_ops(old); for (i = 0; i < old->num_hook_entries; i++) { - if (orig_ops[i] != unreg) + if (orig_ops[i] != unreg) { + printk("%p, %d, %s\n", orig_ops[i], i, __func__); continue; + } WRITE_ONCE(old->hooks[i].hook, accept_all); WRITE_ONCE(orig_ops[i], (void *)&dummy_ops); return true;