blob: c6baa8174389fd64d864100d3133759b797b82bd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * This is a module which is used for queueing IPv4 packets and
3 * communicating with userspace via netlink.
4 *
5 * (C) 2000-2002 James Morris <jmorris@intercode.com.au>
Harald Welte9bb7bc92005-05-30 15:35:26 -07006 * (C) 2003-2005 Netfilter Core Team <coreteam@netfilter.org>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 * 2000-03-27: Simplified code (thanks to Andi Kleen for clues).
13 * 2000-05-20: Fixed notifier problems (following Miguel Freitas' report).
14 * 2000-06-19: Fixed so nfmark is copied to metadata (reported by Sebastian
15 * Zander).
16 * 2000-08-01: Added Nick Williams' MAC support.
17 * 2002-06-25: Code cleanup.
18 * 2005-01-10: Added /proc counter for dropped packets; fixed so
19 * packets aren't delivered to user space if they're going
20 * to be dropped.
Harald Welte9bb7bc92005-05-30 15:35:26 -070021 * 2005-05-26: local_bh_{disable,enable} around nf_reinject (Harald Welte)
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 *
23 */
24#include <linux/module.h>
25#include <linux/skbuff.h>
26#include <linux/init.h>
27#include <linux/ip.h>
28#include <linux/notifier.h>
29#include <linux/netdevice.h>
30#include <linux/netfilter.h>
31#include <linux/netfilter_ipv4/ip_queue.h>
32#include <linux/netfilter_ipv4/ip_tables.h>
33#include <linux/netlink.h>
34#include <linux/spinlock.h>
35#include <linux/sysctl.h>
36#include <linux/proc_fs.h>
37#include <linux/security.h>
38#include <net/sock.h>
39#include <net/route.h>
40
41#define IPQ_QMAX_DEFAULT 1024
42#define IPQ_PROC_FS_NAME "ip_queue"
43#define NET_IPQ_QMAX 2088
44#define NET_IPQ_QMAX_NAME "ip_queue_maxlen"
45
46struct ipq_rt_info {
47 __u8 tos;
48 __u32 daddr;
49 __u32 saddr;
50};
51
52struct ipq_queue_entry {
53 struct list_head list;
54 struct nf_info *info;
55 struct sk_buff *skb;
56 struct ipq_rt_info rt_info;
57};
58
59typedef int (*ipq_cmpfn)(struct ipq_queue_entry *, unsigned long);
60
61static unsigned char copy_mode = IPQ_COPY_NONE;
62static unsigned int queue_maxlen = IPQ_QMAX_DEFAULT;
63static DEFINE_RWLOCK(queue_lock);
64static int peer_pid;
65static unsigned int copy_range;
66static unsigned int queue_total;
67static unsigned int queue_dropped = 0;
68static unsigned int queue_user_dropped = 0;
69static struct sock *ipqnl;
70static LIST_HEAD(queue_list);
71static DECLARE_MUTEX(ipqnl_sem);
72
73static void
74ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)
75{
Harald Welte9bb7bc92005-05-30 15:35:26 -070076 /* TCP input path (and probably other bits) assume to be called
77 * from softirq context, not from syscall, like ipq_issue_verdict is
78 * called. TCP input path deadlocks with locks taken from timer
79 * softirq, e.g. We therefore emulate this by local_bh_disable() */
80
81 local_bh_disable();
Linus Torvalds1da177e2005-04-16 15:20:36 -070082 nf_reinject(entry->skb, entry->info, verdict);
Harald Welte9bb7bc92005-05-30 15:35:26 -070083 local_bh_enable();
84
Linus Torvalds1da177e2005-04-16 15:20:36 -070085 kfree(entry);
86}
87
88static inline void
89__ipq_enqueue_entry(struct ipq_queue_entry *entry)
90{
91 list_add(&entry->list, &queue_list);
92 queue_total++;
93}
94
95/*
96 * Find and return a queued entry matched by cmpfn, or return the last
97 * entry if cmpfn is NULL.
98 */
99static inline struct ipq_queue_entry *
100__ipq_find_entry(ipq_cmpfn cmpfn, unsigned long data)
101{
102 struct list_head *p;
103
104 list_for_each_prev(p, &queue_list) {
105 struct ipq_queue_entry *entry = (struct ipq_queue_entry *)p;
106
107 if (!cmpfn || cmpfn(entry, data))
108 return entry;
109 }
110 return NULL;
111}
112
113static inline void
114__ipq_dequeue_entry(struct ipq_queue_entry *entry)
115{
116 list_del(&entry->list);
117 queue_total--;
118}
119
120static inline struct ipq_queue_entry *
121__ipq_find_dequeue_entry(ipq_cmpfn cmpfn, unsigned long data)
122{
123 struct ipq_queue_entry *entry;
124
125 entry = __ipq_find_entry(cmpfn, data);
126 if (entry == NULL)
127 return NULL;
128
129 __ipq_dequeue_entry(entry);
130 return entry;
131}
132
133
134static inline void
135__ipq_flush(int verdict)
136{
137 struct ipq_queue_entry *entry;
138
139 while ((entry = __ipq_find_dequeue_entry(NULL, 0)))
140 ipq_issue_verdict(entry, verdict);
141}
142
143static inline int
144__ipq_set_mode(unsigned char mode, unsigned int range)
145{
146 int status = 0;
147
148 switch(mode) {
149 case IPQ_COPY_NONE:
150 case IPQ_COPY_META:
151 copy_mode = mode;
152 copy_range = 0;
153 break;
154
155 case IPQ_COPY_PACKET:
156 copy_mode = mode;
157 copy_range = range;
158 if (copy_range > 0xFFFF)
159 copy_range = 0xFFFF;
160 break;
161
162 default:
163 status = -EINVAL;
164
165 }
166 return status;
167}
168
169static inline void
170__ipq_reset(void)
171{
172 peer_pid = 0;
173 net_disable_timestamp();
174 __ipq_set_mode(IPQ_COPY_NONE, 0);
175 __ipq_flush(NF_DROP);
176}
177
178static struct ipq_queue_entry *
179ipq_find_dequeue_entry(ipq_cmpfn cmpfn, unsigned long data)
180{
181 struct ipq_queue_entry *entry;
182
183 write_lock_bh(&queue_lock);
184 entry = __ipq_find_dequeue_entry(cmpfn, data);
185 write_unlock_bh(&queue_lock);
186 return entry;
187}
188
189static void
190ipq_flush(int verdict)
191{
192 write_lock_bh(&queue_lock);
193 __ipq_flush(verdict);
194 write_unlock_bh(&queue_lock);
195}
196
197static struct sk_buff *
198ipq_build_packet_message(struct ipq_queue_entry *entry, int *errp)
199{
200 unsigned char *old_tail;
201 size_t size = 0;
202 size_t data_len = 0;
203 struct sk_buff *skb;
204 struct ipq_packet_msg *pmsg;
205 struct nlmsghdr *nlh;
206
207 read_lock_bh(&queue_lock);
208
209 switch (copy_mode) {
210 case IPQ_COPY_META:
211 case IPQ_COPY_NONE:
212 size = NLMSG_SPACE(sizeof(*pmsg));
213 data_len = 0;
214 break;
215
216 case IPQ_COPY_PACKET:
Patrick McHardy66a79a12005-08-23 10:10:35 -0700217 if (entry->skb->ip_summed == CHECKSUM_HW &&
218 (*errp = skb_checksum_help(entry->skb,
219 entry->info->outdev == NULL))) {
220 read_unlock_bh(&queue_lock);
221 return NULL;
222 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 if (copy_range == 0 || copy_range > entry->skb->len)
224 data_len = entry->skb->len;
225 else
226 data_len = copy_range;
227
228 size = NLMSG_SPACE(sizeof(*pmsg) + data_len);
229 break;
230
231 default:
232 *errp = -EINVAL;
233 read_unlock_bh(&queue_lock);
234 return NULL;
235 }
236
237 read_unlock_bh(&queue_lock);
238
239 skb = alloc_skb(size, GFP_ATOMIC);
240 if (!skb)
241 goto nlmsg_failure;
242
243 old_tail= skb->tail;
244 nlh = NLMSG_PUT(skb, 0, 0, IPQM_PACKET, size - sizeof(*nlh));
245 pmsg = NLMSG_DATA(nlh);
246 memset(pmsg, 0, sizeof(*pmsg));
247
248 pmsg->packet_id = (unsigned long )entry;
249 pmsg->data_len = data_len;
250 pmsg->timestamp_sec = entry->skb->stamp.tv_sec;
251 pmsg->timestamp_usec = entry->skb->stamp.tv_usec;
252 pmsg->mark = entry->skb->nfmark;
253 pmsg->hook = entry->info->hook;
254 pmsg->hw_protocol = entry->skb->protocol;
255
256 if (entry->info->indev)
257 strcpy(pmsg->indev_name, entry->info->indev->name);
258 else
259 pmsg->indev_name[0] = '\0';
260
261 if (entry->info->outdev)
262 strcpy(pmsg->outdev_name, entry->info->outdev->name);
263 else
264 pmsg->outdev_name[0] = '\0';
265
266 if (entry->info->indev && entry->skb->dev) {
267 pmsg->hw_type = entry->skb->dev->type;
268 if (entry->skb->dev->hard_header_parse)
269 pmsg->hw_addrlen =
270 entry->skb->dev->hard_header_parse(entry->skb,
271 pmsg->hw_addr);
272 }
273
274 if (data_len)
275 if (skb_copy_bits(entry->skb, 0, pmsg->payload, data_len))
276 BUG();
277
278 nlh->nlmsg_len = skb->tail - old_tail;
279 return skb;
280
281nlmsg_failure:
282 if (skb)
283 kfree_skb(skb);
284 *errp = -EINVAL;
285 printk(KERN_ERR "ip_queue: error creating packet message\n");
286 return NULL;
287}
288
289static int
290ipq_enqueue_packet(struct sk_buff *skb, struct nf_info *info, void *data)
291{
292 int status = -EINVAL;
293 struct sk_buff *nskb;
294 struct ipq_queue_entry *entry;
295
296 if (copy_mode == IPQ_COPY_NONE)
297 return -EAGAIN;
298
299 entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
300 if (entry == NULL) {
301 printk(KERN_ERR "ip_queue: OOM in ipq_enqueue_packet()\n");
302 return -ENOMEM;
303 }
304
305 entry->info = info;
306 entry->skb = skb;
307
308 if (entry->info->hook == NF_IP_LOCAL_OUT) {
309 struct iphdr *iph = skb->nh.iph;
310
311 entry->rt_info.tos = iph->tos;
312 entry->rt_info.daddr = iph->daddr;
313 entry->rt_info.saddr = iph->saddr;
314 }
315
316 nskb = ipq_build_packet_message(entry, &status);
317 if (nskb == NULL)
318 goto err_out_free;
319
320 write_lock_bh(&queue_lock);
321
322 if (!peer_pid)
323 goto err_out_free_nskb;
324
325 if (queue_total >= queue_maxlen) {
326 queue_dropped++;
327 status = -ENOSPC;
328 if (net_ratelimit())
329 printk (KERN_WARNING "ip_queue: full at %d entries, "
330 "dropping packets(s). Dropped: %d\n", queue_total,
331 queue_dropped);
332 goto err_out_free_nskb;
333 }
334
335 /* netlink_unicast will either free the nskb or attach it to a socket */
336 status = netlink_unicast(ipqnl, nskb, peer_pid, MSG_DONTWAIT);
337 if (status < 0) {
338 queue_user_dropped++;
339 goto err_out_unlock;
340 }
341
342 __ipq_enqueue_entry(entry);
343
344 write_unlock_bh(&queue_lock);
345 return status;
346
347err_out_free_nskb:
348 kfree_skb(nskb);
349
350err_out_unlock:
351 write_unlock_bh(&queue_lock);
352
353err_out_free:
354 kfree(entry);
355 return status;
356}
357
358static int
359ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e)
360{
361 int diff;
362 struct iphdr *user_iph = (struct iphdr *)v->payload;
363
364 if (v->data_len < sizeof(*user_iph))
365 return 0;
366 diff = v->data_len - e->skb->len;
367 if (diff < 0)
368 skb_trim(e->skb, v->data_len);
369 else if (diff > 0) {
370 if (v->data_len > 0xFFFF)
371 return -EINVAL;
372 if (diff > skb_tailroom(e->skb)) {
373 struct sk_buff *newskb;
374
375 newskb = skb_copy_expand(e->skb,
376 skb_headroom(e->skb),
377 diff,
378 GFP_ATOMIC);
379 if (newskb == NULL) {
380 printk(KERN_WARNING "ip_queue: OOM "
381 "in mangle, dropping packet\n");
382 return -ENOMEM;
383 }
384 if (e->skb->sk)
385 skb_set_owner_w(newskb, e->skb->sk);
386 kfree_skb(e->skb);
387 e->skb = newskb;
388 }
389 skb_put(e->skb, diff);
390 }
391 if (!skb_ip_make_writable(&e->skb, v->data_len))
392 return -ENOMEM;
393 memcpy(e->skb->data, v->payload, v->data_len);
Patrick McHardy66a79a12005-08-23 10:10:35 -0700394 e->skb->ip_summed = CHECKSUM_NONE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 e->skb->nfcache |= NFC_ALTERED;
396
397 /*
398 * Extra routing may needed on local out, as the QUEUE target never
399 * returns control to the table.
400 */
401 if (e->info->hook == NF_IP_LOCAL_OUT) {
402 struct iphdr *iph = e->skb->nh.iph;
403
404 if (!(iph->tos == e->rt_info.tos
405 && iph->daddr == e->rt_info.daddr
406 && iph->saddr == e->rt_info.saddr))
407 return ip_route_me_harder(&e->skb);
408 }
409 return 0;
410}
411
412static inline int
413id_cmp(struct ipq_queue_entry *e, unsigned long id)
414{
415 return (id == (unsigned long )e);
416}
417
418static int
419ipq_set_verdict(struct ipq_verdict_msg *vmsg, unsigned int len)
420{
421 struct ipq_queue_entry *entry;
422
423 if (vmsg->value > NF_MAX_VERDICT)
424 return -EINVAL;
425
426 entry = ipq_find_dequeue_entry(id_cmp, vmsg->id);
427 if (entry == NULL)
428 return -ENOENT;
429 else {
430 int verdict = vmsg->value;
431
432 if (vmsg->data_len && vmsg->data_len == len)
433 if (ipq_mangle_ipv4(vmsg, entry) < 0)
434 verdict = NF_DROP;
435
436 ipq_issue_verdict(entry, verdict);
437 return 0;
438 }
439}
440
441static int
442ipq_set_mode(unsigned char mode, unsigned int range)
443{
444 int status;
445
446 write_lock_bh(&queue_lock);
447 status = __ipq_set_mode(mode, range);
448 write_unlock_bh(&queue_lock);
449 return status;
450}
451
452static int
453ipq_receive_peer(struct ipq_peer_msg *pmsg,
454 unsigned char type, unsigned int len)
455{
456 int status = 0;
457
458 if (len < sizeof(*pmsg))
459 return -EINVAL;
460
461 switch (type) {
462 case IPQM_MODE:
463 status = ipq_set_mode(pmsg->msg.mode.value,
464 pmsg->msg.mode.range);
465 break;
466
467 case IPQM_VERDICT:
468 if (pmsg->msg.verdict.value > NF_MAX_VERDICT)
469 status = -EINVAL;
470 else
471 status = ipq_set_verdict(&pmsg->msg.verdict,
472 len - sizeof(*pmsg));
473 break;
474 default:
475 status = -EINVAL;
476 }
477 return status;
478}
479
480static int
481dev_cmp(struct ipq_queue_entry *entry, unsigned long ifindex)
482{
483 if (entry->info->indev)
484 if (entry->info->indev->ifindex == ifindex)
485 return 1;
486
487 if (entry->info->outdev)
488 if (entry->info->outdev->ifindex == ifindex)
489 return 1;
490
491 return 0;
492}
493
494static void
495ipq_dev_drop(int ifindex)
496{
497 struct ipq_queue_entry *entry;
498
499 while ((entry = ipq_find_dequeue_entry(dev_cmp, ifindex)) != NULL)
500 ipq_issue_verdict(entry, NF_DROP);
501}
502
503#define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
504
505static inline void
506ipq_rcv_skb(struct sk_buff *skb)
507{
508 int status, type, pid, flags, nlmsglen, skblen;
509 struct nlmsghdr *nlh;
510
511 skblen = skb->len;
512 if (skblen < sizeof(*nlh))
513 return;
514
515 nlh = (struct nlmsghdr *)skb->data;
516 nlmsglen = nlh->nlmsg_len;
517 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen)
518 return;
519
520 pid = nlh->nlmsg_pid;
521 flags = nlh->nlmsg_flags;
522
523 if(pid <= 0 || !(flags & NLM_F_REQUEST) || flags & NLM_F_MULTI)
524 RCV_SKB_FAIL(-EINVAL);
525
526 if (flags & MSG_TRUNC)
527 RCV_SKB_FAIL(-ECOMM);
528
529 type = nlh->nlmsg_type;
530 if (type < NLMSG_NOOP || type >= IPQM_MAX)
531 RCV_SKB_FAIL(-EINVAL);
532
533 if (type <= IPQM_BASE)
534 return;
535
536 if (security_netlink_recv(skb))
537 RCV_SKB_FAIL(-EPERM);
538
539 write_lock_bh(&queue_lock);
540
541 if (peer_pid) {
542 if (peer_pid != pid) {
543 write_unlock_bh(&queue_lock);
544 RCV_SKB_FAIL(-EBUSY);
545 }
546 } else {
547 net_enable_timestamp();
548 peer_pid = pid;
549 }
550
551 write_unlock_bh(&queue_lock);
552
553 status = ipq_receive_peer(NLMSG_DATA(nlh), type,
554 skblen - NLMSG_LENGTH(0));
555 if (status < 0)
556 RCV_SKB_FAIL(status);
557
558 if (flags & NLM_F_ACK)
559 netlink_ack(skb, nlh, 0);
560 return;
561}
562
563static void
564ipq_rcv_sk(struct sock *sk, int len)
565{
Herbert Xu2a0a6eb2005-05-03 14:55:09 -0700566 struct sk_buff *skb;
567 unsigned int qlen;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568
Herbert Xu2a0a6eb2005-05-03 14:55:09 -0700569 down(&ipqnl_sem);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570
Herbert Xu2a0a6eb2005-05-03 14:55:09 -0700571 for (qlen = skb_queue_len(&sk->sk_receive_queue); qlen; qlen--) {
572 skb = skb_dequeue(&sk->sk_receive_queue);
573 ipq_rcv_skb(skb);
574 kfree_skb(skb);
575 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576
Herbert Xu2a0a6eb2005-05-03 14:55:09 -0700577 up(&ipqnl_sem);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578}
579
580static int
581ipq_rcv_dev_event(struct notifier_block *this,
582 unsigned long event, void *ptr)
583{
584 struct net_device *dev = ptr;
585
586 /* Drop any packets associated with the downed device */
587 if (event == NETDEV_DOWN)
588 ipq_dev_drop(dev->ifindex);
589 return NOTIFY_DONE;
590}
591
592static struct notifier_block ipq_dev_notifier = {
593 .notifier_call = ipq_rcv_dev_event,
594};
595
596static int
597ipq_rcv_nl_event(struct notifier_block *this,
598 unsigned long event, void *ptr)
599{
600 struct netlink_notify *n = ptr;
601
602 if (event == NETLINK_URELEASE &&
603 n->protocol == NETLINK_FIREWALL && n->pid) {
604 write_lock_bh(&queue_lock);
605 if (n->pid == peer_pid)
606 __ipq_reset();
607 write_unlock_bh(&queue_lock);
608 }
609 return NOTIFY_DONE;
610}
611
612static struct notifier_block ipq_nl_notifier = {
613 .notifier_call = ipq_rcv_nl_event,
614};
615
616static struct ctl_table_header *ipq_sysctl_header;
617
618static ctl_table ipq_table[] = {
619 {
620 .ctl_name = NET_IPQ_QMAX,
621 .procname = NET_IPQ_QMAX_NAME,
622 .data = &queue_maxlen,
623 .maxlen = sizeof(queue_maxlen),
624 .mode = 0644,
625 .proc_handler = proc_dointvec
626 },
627 { .ctl_name = 0 }
628};
629
630static ctl_table ipq_dir_table[] = {
631 {
632 .ctl_name = NET_IPV4,
633 .procname = "ipv4",
634 .mode = 0555,
635 .child = ipq_table
636 },
637 { .ctl_name = 0 }
638};
639
640static ctl_table ipq_root_table[] = {
641 {
642 .ctl_name = CTL_NET,
643 .procname = "net",
644 .mode = 0555,
645 .child = ipq_dir_table
646 },
647 { .ctl_name = 0 }
648};
649
650#ifdef CONFIG_PROC_FS
651static int
652ipq_get_info(char *buffer, char **start, off_t offset, int length)
653{
654 int len;
655
656 read_lock_bh(&queue_lock);
657
658 len = sprintf(buffer,
659 "Peer PID : %d\n"
660 "Copy mode : %hu\n"
661 "Copy range : %u\n"
662 "Queue length : %u\n"
663 "Queue max. length : %u\n"
664 "Queue dropped : %u\n"
665 "Netlink dropped : %u\n",
666 peer_pid,
667 copy_mode,
668 copy_range,
669 queue_total,
670 queue_maxlen,
671 queue_dropped,
672 queue_user_dropped);
673
674 read_unlock_bh(&queue_lock);
675
676 *start = buffer + offset;
677 len -= offset;
678 if (len > length)
679 len = length;
680 else if (len < 0)
681 len = 0;
682 return len;
683}
684#endif /* CONFIG_PROC_FS */
685
686static int
687init_or_cleanup(int init)
688{
689 int status = -ENOMEM;
690 struct proc_dir_entry *proc;
691
692 if (!init)
693 goto cleanup;
694
695 netlink_register_notifier(&ipq_nl_notifier);
696 ipqnl = netlink_kernel_create(NETLINK_FIREWALL, ipq_rcv_sk);
697 if (ipqnl == NULL) {
698 printk(KERN_ERR "ip_queue: failed to create netlink socket\n");
699 goto cleanup_netlink_notifier;
700 }
701
702 proc = proc_net_create(IPQ_PROC_FS_NAME, 0, ipq_get_info);
703 if (proc)
704 proc->owner = THIS_MODULE;
705 else {
706 printk(KERN_ERR "ip_queue: failed to create proc entry\n");
707 goto cleanup_ipqnl;
708 }
709
710 register_netdevice_notifier(&ipq_dev_notifier);
711 ipq_sysctl_header = register_sysctl_table(ipq_root_table, 0);
712
713 status = nf_register_queue_handler(PF_INET, ipq_enqueue_packet, NULL);
714 if (status < 0) {
715 printk(KERN_ERR "ip_queue: failed to register queue handler\n");
716 goto cleanup_sysctl;
717 }
718 return status;
719
720cleanup:
721 nf_unregister_queue_handler(PF_INET);
722 synchronize_net();
723 ipq_flush(NF_DROP);
724
725cleanup_sysctl:
726 unregister_sysctl_table(ipq_sysctl_header);
727 unregister_netdevice_notifier(&ipq_dev_notifier);
728 proc_net_remove(IPQ_PROC_FS_NAME);
729
730cleanup_ipqnl:
731 sock_release(ipqnl->sk_socket);
732 down(&ipqnl_sem);
733 up(&ipqnl_sem);
734
735cleanup_netlink_notifier:
736 netlink_unregister_notifier(&ipq_nl_notifier);
737 return status;
738}
739
740static int __init init(void)
741{
742
743 return init_or_cleanup(1);
744}
745
746static void __exit fini(void)
747{
748 init_or_cleanup(0);
749}
750
751MODULE_DESCRIPTION("IPv4 packet queue handler");
752MODULE_AUTHOR("James Morris <jmorris@intercode.com.au>");
753MODULE_LICENSE("GPL");
754
755module_init(init);
756module_exit(fini);