1 #include <linux/kernel.h>
2 #include <linux/slab.h>
4 #include <linux/module.h>
7 #include <linux/netfilter.h>
37 lockdep_is_held(&queue_handler_mutex));
62 lockdep_is_held(&queue_handler_mutex));
63 if (old && old != qh) {
82 for (pf = 0; pf <
ARRAY_SIZE(queue_handler); pf++) {
85 lockdep_is_held(&queue_handler_mutex)
99 dev_put(entry->
indev);
102 #ifdef CONFIG_BRIDGE_NETFILTER
103 if (entry->
skb->nf_bridge) {
104 struct nf_bridge_info *nf_bridge = entry->
skb->nf_bridge;
106 if (nf_bridge->physindev)
107 dev_put(nf_bridge->physindev);
108 if (nf_bridge->physoutdev)
109 dev_put(nf_bridge->physoutdev);
113 module_put(entry->
elem->owner);
121 struct nf_hook_ops *
elem,
126 unsigned int queuenum)
130 #ifdef CONFIG_BRIDGE_NETFILTER
134 const struct nf_afinfo *afinfo;
146 afinfo = nf_get_afinfo(pf);
167 if (!try_module_get(entry->
elem->owner)) {
176 #ifdef CONFIG_BRIDGE_NETFILTER
177 if (skb->nf_bridge) {
178 physindev = skb->nf_bridge->physindev;
181 physoutdev = skb->nf_bridge->physoutdev;
183 dev_hold(physoutdev);
187 afinfo->saveroute(skb, entry);
188 status = qh->
outfn(entry, queuenum);
193 nf_queue_entry_release_refs(entry);
206 #ifdef CONFIG_BRIDGE_NETFILTER
223 #define nf_bridge_adjust_skb_data(s) do {} while (0)
224 #define nf_bridge_adjust_segmented_data(s) do {} while (0)
228 struct nf_hook_ops *elem,
233 unsigned int queuenum)
239 if (!skb_is_gso(skb))
240 return __nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
268 err = __nf_queue(segs, elem, pf, hook, indev,
269 outdev, okfn, queuenum);
290 struct nf_hook_ops *elem = entry->
elem;
291 const struct nf_afinfo *afinfo;
296 nf_queue_entry_release_refs(entry);
305 afinfo = nf_get_afinfo(entry->
pf);
306 if (!afinfo || afinfo->reroute(skb, entry) < 0)
326 err = __nf_queue(skb, elem, entry->
pf, entry->
hook,
348 #ifdef CONFIG_PROC_FS
349 static void *seq_start(
struct seq_file *seq, loff_t *
pos)
357 static void *seq_next(
struct seq_file *
s,
void *
v, loff_t *pos)
367 static void seq_stop(
struct seq_file *s,
void *v)
372 static int seq_show(
struct seq_file *s,
void *v)
398 return seq_open(file, &nfqueue_seq_ops);
403 .open = nfqueue_open,
413 #ifdef CONFIG_PROC_FS
414 if (!proc_create(
"nf_queue",
S_IRUGO,
415 proc_net_netfilter, &nfqueue_file_ops))