1 diff -Nru linux-2.6.21.1-orig/drivers/net/Kconfig linux-2.6.21.1/drivers/net/Kconfig
2 --- linux-2.6.21.1-orig/drivers/net/Kconfig 2007-04-27 21:49:26.000000000 +0000
3 +++ linux-2.6.21.1/drivers/net/Kconfig 2007-06-02 21:43:55.000000000 +0000
5 To compile this driver as a module, choose M here: the module
6 will be called eql. If unsure, say N.
9 + tristate "IMQ (intermediate queueing device) support"
10 + depends on NETDEVICES && NETFILTER
12 + The IMQ device(s) is used as placeholder for QoS queueing
13 + disciplines. Every packet entering/leaving the IP stack can be
14 + directed through the IMQ device where it's enqueued/dequeued to the
15 + attached qdisc. This allows you to treat network devices as classes
16 + and distribute bandwidth among them. Iptables is used to specify
17 + through which IMQ device, if any, packets travel.
19 + More information at: http://www.linuximq.net/
21 + To compile this driver as a module, choose M here: the module
22 + will be called imq. If unsure, say N.
25 + prompt "IMQ behavior (PRE/POSTROUTING)"
27 + default IMQ_BEHAVIOR_BA
30 + This settings defines how IMQ behaves in respect to its
31 + hooking in PREROUTING and POSTROUTING.
33 + IMQ can work in any of the following ways:
35 + PREROUTING | POSTROUTING
36 + -----------------|-------------------
37 + #1 After NAT | After NAT
38 + #2 After NAT | Before NAT
39 + #3 Before NAT | After NAT
40 + #4 Before NAT | Before NAT
42 + The default behavior is to hook before NAT on PREROUTING
43 + and after NAT on POSTROUTING (#3).
45 + This settings are specially usefull when trying to use IMQ
46 + to shape NATed clients.
48 + More information can be found at: www.linuximq.net
50 + If not sure leave the default settings alone.
52 +config IMQ_BEHAVIOR_AA
55 + This settings defines how IMQ behaves in respect to its
56 + hooking in PREROUTING and POSTROUTING.
58 + Choosing this option will make IMQ hook like this:
60 + PREROUTING: After NAT
61 + POSTROUTING: After NAT
63 + More information can be found at: www.linuximq.net
65 + If not sure leave the default settings alone.
67 +config IMQ_BEHAVIOR_AB
70 + This settings defines how IMQ behaves in respect to its
71 + hooking in PREROUTING and POSTROUTING.
73 + Choosing this option will make IMQ hook like this:
75 + PREROUTING: After NAT
76 + POSTROUTING: Before NAT
78 + More information can be found at: www.linuximq.net
80 + If not sure leave the default settings alone.
82 +config IMQ_BEHAVIOR_BA
85 + This settings defines how IMQ behaves in respect to its
86 + hooking in PREROUTING and POSTROUTING.
88 + Choosing this option will make IMQ hook like this:
90 + PREROUTING: Before NAT
91 + POSTROUTING: After NAT
93 + More information can be found at: www.linuximq.net
95 + If not sure leave the default settings alone.
97 +config IMQ_BEHAVIOR_BB
100 + This settings defines how IMQ behaves in respect to its
101 + hooking in PREROUTING and POSTROUTING.
103 + Choosing this option will make IMQ hook like this:
105 + PREROUTING: Before NAT
106 + POSTROUTING: Before NAT
108 + More information can be found at: www.linuximq.net
110 + If not sure leave the default settings alone.
116 + int "Number of IMQ devices"
122 + This settings defines how many IMQ devices will be
125 + The default value is 2.
127 + More information can be found at: www.linuximq.net
129 + If not sure leave the default settings alone.
132 tristate "Universal TUN/TAP device driver support"
134 diff -Nru linux-2.6.21.1-orig/drivers/net/Makefile linux-2.6.21.1/drivers/net/Makefile
135 --- linux-2.6.21.1-orig/drivers/net/Makefile 2007-04-27 21:49:26.000000000 +0000
136 +++ linux-2.6.21.1/drivers/net/Makefile 2007-06-02 21:43:55.000000000 +0000
138 obj-$(CONFIG_SLHC) += slhc.o
140 obj-$(CONFIG_DUMMY) += dummy.o
141 +obj-$(CONFIG_IMQ) += imq.o
142 obj-$(CONFIG_IFB) += ifb.o
143 obj-$(CONFIG_DE600) += de600.o
144 obj-$(CONFIG_DE620) += de620.o
145 diff -Nru linux-2.6.21.1-orig/drivers/net/imq.c linux-2.6.21.1/drivers/net/imq.c
146 --- linux-2.6.21.1-orig/drivers/net/imq.c 1970-01-01 00:00:00.000000000 +0000
147 +++ linux-2.6.21.1/drivers/net/imq.c 2007-06-02 21:43:55.000000000 +0000
150 + * Pseudo-driver for the intermediate queue device.
152 + * This program is free software; you can redistribute it and/or
153 + * modify it under the terms of the GNU General Public License
154 + * as published by the Free Software Foundation; either version
155 + * 2 of the License, or (at your option) any later version.
157 + * Authors: Patrick McHardy, <kaber@trash.net>
159 + * The first version was written by Martin Devera, <devik@cdi.cz>
161 + * Credits: Jan Rafaj <imq2t@cedric.vabo.cz>
162 + * - Update patch to 2.4.21
163 + * Sebastian Strollo <sstrollo@nortelnetworks.com>
164 + * - Fix "Dead-loop on netdevice imq"-issue
165 + * Marcel Sebek <sebek64@post.cz>
166 + * - Update to 2.6.2-rc1
168 + * After some time of inactivity there is a group taking care
169 + * of IMQ again: http://www.linuximq.net
172 + * 2004/06/30 - New version of IMQ patch to kernels <=2.6.7 including
173 + * the following changes:
175 + * - Correction of ipv6 support "+"s issue (Hasso Tepper)
176 + * - Correction of imq_init_devs() issue that resulted in
177 + * kernel OOPS unloading IMQ as module (Norbert Buchmuller)
178 + * - Addition of functionality to choose number of IMQ devices
179 + * during kernel config (Andre Correa)
180 + * - Addition of functionality to choose how IMQ hooks on
181 + * PRE and POSTROUTING (after or before NAT) (Andre Correa)
182 + * - Cosmetic corrections (Norbert Buchmuller) (Andre Correa)
185 + * 2005/12/16 - IMQ versions between 2.6.7 and 2.6.13 were
186 + * released with almost no problems. 2.6.14-x was released
187 + * with some important changes: nfcache was removed; After
188 + * some weeks of trouble we figured out that some IMQ fields
189 + * in skb were missing in skbuff.c - skb_clone and copy_skb_header.
190 + * These functions are correctly patched by this new patch version.
192 + * Thanks for all who helped to figure out all the problems with
193 + * 2.6.14.x: Patrick McHardy, Rune Kock, VeNoMouS, Max CtRiX,
194 + * Kevin Shanahan, Richard Lucassen, Valery Dachev (hopefully
195 + * I didn't forget anybody). I apologize again for my lack of time.
197 + * More info at: http://www.linuximq.net/ (Andre Correa)
200 +#include <linux/module.h>
201 +#include <linux/kernel.h>
202 +#include <linux/moduleparam.h>
203 +#include <linux/skbuff.h>
204 +#include <linux/netdevice.h>
205 +#include <linux/rtnetlink.h>
206 +#include <linux/if_arp.h>
207 +#include <linux/netfilter.h>
208 +#include <linux/netfilter_ipv4.h>
209 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
210 + #include <linux/netfilter_ipv6.h>
212 +#include <linux/imq.h>
213 +#include <net/pkt_sched.h>
215 +extern int qdisc_restart1(struct net_device *dev);
217 +static nf_hookfn imq_nf_hook;
219 +static struct nf_hook_ops imq_ingress_ipv4 = {
220 + .hook = imq_nf_hook,
221 + .owner = THIS_MODULE,
223 + .hooknum = NF_IP_PRE_ROUTING,
224 +#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB)
225 + .priority = NF_IP_PRI_MANGLE + 1
227 + .priority = NF_IP_PRI_NAT_DST + 1
231 +static struct nf_hook_ops imq_egress_ipv4 = {
232 + .hook = imq_nf_hook,
233 + .owner = THIS_MODULE,
235 + .hooknum = NF_IP_POST_ROUTING,
236 +#if defined(CONFIG_IMQ_BEHAVIOR_AA) || defined(CONFIG_IMQ_BEHAVIOR_BA)
237 + .priority = NF_IP_PRI_LAST
239 + .priority = NF_IP_PRI_NAT_SRC - 1
243 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
244 +static struct nf_hook_ops imq_ingress_ipv6 = {
245 + .hook = imq_nf_hook,
246 + .owner = THIS_MODULE,
248 + .hooknum = NF_IP6_PRE_ROUTING,
249 +#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB)
250 + .priority = NF_IP6_PRI_MANGLE + 1
252 + .priority = NF_IP6_PRI_NAT_DST + 1
256 +static struct nf_hook_ops imq_egress_ipv6 = {
257 + .hook = imq_nf_hook,
258 + .owner = THIS_MODULE,
260 + .hooknum = NF_IP6_POST_ROUTING,
261 +#if defined(CONFIG_IMQ_BEHAVIOR_AA) || defined(CONFIG_IMQ_BEHAVIOR_BA)
262 + .priority = NF_IP6_PRI_LAST
264 + .priority = NF_IP6_PRI_NAT_SRC - 1
269 +#if defined(CONFIG_IMQ_NUM_DEVS)
270 +static unsigned int numdevs = CONFIG_IMQ_NUM_DEVS;
272 +static unsigned int numdevs = 2;
275 +static struct net_device *imq_devs;
277 +static struct net_device_stats *imq_get_stats(struct net_device *dev)
279 + return (struct net_device_stats *)dev->priv;
282 +/* called for packets kfree'd in qdiscs at places other than enqueue */
283 +static void imq_skb_destructor(struct sk_buff *skb)
285 + struct nf_info *info = skb->nf_info;
289 + dev_put(info->indev);
291 + dev_put(info->outdev);
296 +static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
298 + struct net_device_stats *stats = (struct net_device_stats*) dev->priv;
300 + stats->tx_bytes += skb->len;
301 + stats->tx_packets++;
303 + skb->imq_flags = 0;
304 + skb->destructor = NULL;
306 + dev->trans_start = jiffies;
307 + nf_reinject(skb, skb->nf_info, NF_ACCEPT);
311 +static int imq_nf_queue(struct sk_buff *skb, struct nf_info *info, unsigned queue_num, void *data)
313 + struct net_device *dev;
314 + struct net_device_stats *stats;
315 + struct sk_buff *skb2 = NULL;
317 + unsigned int index = skb->imq_flags&IMQ_F_IFMASK;
320 + if (index > numdevs)
323 + dev = imq_devs + index;
324 + if (!(dev->flags & IFF_UP)) {
325 + skb->imq_flags = 0;
326 + nf_reinject(skb, info, NF_ACCEPT);
329 + dev->last_rx = jiffies;
331 + if (skb->destructor) {
333 + skb = skb_clone(skb, GFP_ATOMIC);
337 + skb->nf_info = info;
339 + stats = (struct net_device_stats *)dev->priv;
340 + stats->rx_bytes+= skb->len;
341 + stats->rx_packets++;
343 + spin_lock_bh(&dev->queue_lock);
346 + q->enqueue(skb_get(skb), q);
347 + if (skb_shared(skb)) {
348 + skb->destructor = imq_skb_destructor;
353 + if (spin_is_locked(&dev->_xmit_lock))
354 + netif_schedule(dev);
356 + while (!netif_queue_stopped(dev) && qdisc_restart1(dev) < 0)
359 + spin_unlock_bh(&dev->queue_lock);
362 + kfree_skb(ret ? skb : skb2);
367 +static struct nf_queue_handler nfqh = {
369 + .outfn = imq_nf_queue,
372 +static unsigned int imq_nf_hook(unsigned int hook, struct sk_buff **pskb,
373 + const struct net_device *indev,
374 + const struct net_device *outdev,
375 + int (*okfn)(struct sk_buff *))
377 + if ((*pskb)->imq_flags & IMQ_F_ENQUEUE)
384 +static int __init imq_init_hooks(void)
388 + err = nf_register_queue_handler(PF_INET, &nfqh);
391 + if ((err = nf_register_hook(&imq_ingress_ipv4)))
393 + if ((err = nf_register_hook(&imq_egress_ipv4)))
395 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
396 + if ((err = nf_register_queue_handler(PF_INET6, &nfqh)))
398 + if ((err = nf_register_hook(&imq_ingress_ipv6)))
400 + if ((err = nf_register_hook(&imq_egress_ipv6)))
406 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
408 + nf_unregister_hook(&imq_ingress_ipv6);
410 + nf_unregister_queue_handler(PF_INET6);
412 + nf_unregister_hook(&imq_egress_ipv6);
415 + nf_unregister_hook(&imq_ingress_ipv4);
417 + nf_unregister_queue_handler(PF_INET);
422 +static void __exit imq_unhook(void)
424 + nf_unregister_hook(&imq_ingress_ipv4);
425 + nf_unregister_hook(&imq_egress_ipv4);
426 + nf_unregister_queue_handler(PF_INET);
427 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
428 + nf_unregister_hook(&imq_ingress_ipv6);
429 + nf_unregister_hook(&imq_egress_ipv6);
430 + nf_unregister_queue_handler(PF_INET6);
434 +static int __init imq_dev_init(struct net_device *dev)
436 + dev->hard_start_xmit = imq_dev_xmit;
437 + dev->type = ARPHRD_VOID;
439 + dev->tx_queue_len = 30;
440 + dev->flags = IFF_NOARP;
441 + dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
442 + if (dev->priv == NULL)
444 + memset(dev->priv, 0, sizeof(struct net_device_stats));
445 + dev->get_stats = imq_get_stats;
450 +static void imq_dev_uninit(struct net_device *dev)
455 +static int __init imq_init_devs(void)
457 + struct net_device *dev;
461 + if (!numdevs || numdevs > IMQ_MAX_DEVS) {
462 + printk(KERN_ERR "IMQ: numdevs has to be betweed 1 and %u\n",
467 + imq_devs = kmalloc(sizeof(struct net_device) * numdevs, GFP_KERNEL);
470 + memset(imq_devs, 0, sizeof(struct net_device) * numdevs);
472 + /* we start counting at zero */
475 + for (i = 0, dev = imq_devs; i <= numdevs; i++, dev++) {
476 + SET_MODULE_OWNER(dev);
477 + strcpy(dev->name, "imq%d");
478 + dev->init = imq_dev_init;
479 + dev->uninit = imq_dev_uninit;
481 + if (register_netdev(dev) < 0)
484 + printk(KERN_INFO "IMQ starting with %u devices...\n", j);
489 + unregister_netdev(--dev);
494 +static void imq_cleanup_devs(void)
497 + struct net_device *dev = imq_devs;
499 + for (i = 0; i <= numdevs; i++)
500 + unregister_netdev(dev++);
505 +static int __init imq_init_module(void)
509 + if ((err = imq_init_devs())) {
510 + printk(KERN_ERR "IMQ: Error trying imq_init_devs()\n");
513 + if ((err = imq_init_hooks())) {
514 + printk(KERN_ERR "IMQ: Error trying imq_init_hooks()\n");
515 + imq_cleanup_devs();
519 + printk(KERN_INFO "IMQ driver loaded successfully.\n");
521 +#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB)
522 + printk(KERN_INFO "\tHooking IMQ before NAT on PREROUTING.\n");
524 + printk(KERN_INFO "\tHooking IMQ after NAT on PREROUTING.\n");
526 +#if defined(CONFIG_IMQ_BEHAVIOR_AB) || defined(CONFIG_IMQ_BEHAVIOR_BB)
527 + printk(KERN_INFO "\tHooking IMQ before NAT on POSTROUTING.\n");
529 + printk(KERN_INFO "\tHooking IMQ after NAT on POSTROUTING.\n");
535 +static void __exit imq_cleanup_module(void)
538 + imq_cleanup_devs();
539 + printk(KERN_INFO "IMQ driver unloaded successfully.\n");
543 +module_init(imq_init_module);
544 +module_exit(imq_cleanup_module);
546 +module_param(numdevs, int, 0);
547 +MODULE_PARM_DESC(numdevs, "number of IMQ devices (how many imq* devices will be created)");
548 +MODULE_AUTHOR("http://www.linuximq.net");
549 +MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
550 +MODULE_LICENSE("GPL");
551 diff -Nru linux-2.6.21.1-orig/include/linux/imq.h linux-2.6.21.1/include/linux/imq.h
552 --- linux-2.6.21.1-orig/include/linux/imq.h 1970-01-01 00:00:00.000000000 +0000
553 +++ linux-2.6.21.1/include/linux/imq.h 2007-06-02 21:43:55.000000000 +0000
558 +#define IMQ_MAX_DEVS 16
560 +#define IMQ_F_IFMASK 0x7f
561 +#define IMQ_F_ENQUEUE 0x80
564 diff -Nru linux-2.6.21.1-orig/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_IMQ.h
565 --- linux-2.6.21.1-orig/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 00:00:00.000000000 +0000
566 +++ linux-2.6.21.1/include/linux/netfilter_ipv4/ipt_IMQ.h 2007-06-02 21:43:55.000000000 +0000
571 +struct ipt_imq_info {
572 + unsigned int todev; /* target imq device */
575 +#endif /* _IPT_IMQ_H */
576 diff -Nru linux-2.6.21.1-orig/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.21.1/include/linux/netfilter_ipv6/ip6t_IMQ.h
577 --- linux-2.6.21.1-orig/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 00:00:00.000000000 +0000
578 +++ linux-2.6.21.1/include/linux/netfilter_ipv6/ip6t_IMQ.h 2007-06-02 21:43:55.000000000 +0000
583 +struct ip6t_imq_info {
584 + unsigned int todev; /* target imq device */
587 +#endif /* _IP6T_IMQ_H */
588 diff -Nru linux-2.6.21.1-orig/include/linux/skbuff.h linux-2.6.21.1/include/linux/skbuff.h
589 --- linux-2.6.21.1-orig/include/linux/skbuff.h 2007-04-27 21:49:26.000000000 +0000
590 +++ linux-2.6.21.1/include/linux/skbuff.h 2007-06-02 21:43:55.000000000 +0000
592 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
593 struct sk_buff *nfct_reasm;
595 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
596 + unsigned char imq_flags;
597 + struct nf_info *nf_info;
599 #ifdef CONFIG_BRIDGE_NETFILTER
600 struct nf_bridge_info *nf_bridge;
602 diff -Nru linux-2.6.21.1-orig/net/ipv4/netfilter/Kconfig linux-2.6.21.1/net/ipv4/netfilter/Kconfig
603 --- linux-2.6.21.1-orig/net/ipv4/netfilter/Kconfig 2007-04-27 21:49:26.000000000 +0000
604 +++ linux-2.6.21.1/net/ipv4/netfilter/Kconfig 2007-06-02 21:43:55.000000000 +0000
607 To compile it as a module, choose M here. If unsure, say N.
609 +config IP_NF_TARGET_IMQ
610 + tristate "IMQ target support"
611 + depends on IP_NF_MANGLE
613 + This option adds a `IMQ' target which is used to specify if and
614 + to which IMQ device packets should get enqueued/dequeued.
616 + For more information visit: http://www.linuximq.net/
618 + To compile it as a module, choose M here. If unsure, say N.
620 config IP_NF_TARGET_TOS
621 tristate "TOS target support"
622 depends on IP_NF_MANGLE
623 diff -Nru linux-2.6.21.1-orig/net/ipv4/netfilter/Makefile linux-2.6.21.1/net/ipv4/netfilter/Makefile
624 --- linux-2.6.21.1-orig/net/ipv4/netfilter/Makefile 2007-04-27 21:49:26.000000000 +0000
625 +++ linux-2.6.21.1/net/ipv4/netfilter/Makefile 2007-06-02 21:43:55.000000000 +0000
627 obj-$(CONFIG_IP_NF_TARGET_REJECT) += ipt_REJECT.o
628 obj-$(CONFIG_IP_NF_TARGET_TOS) += ipt_TOS.o
629 obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
630 +obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
631 obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
632 obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
633 obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o
634 diff -Nru linux-2.6.21.1-orig/net/ipv4/netfilter/ipt_IMQ.c linux-2.6.21.1/net/ipv4/netfilter/ipt_IMQ.c
635 --- linux-2.6.21.1-orig/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 00:00:00.000000000 +0000
636 +++ linux-2.6.21.1/net/ipv4/netfilter/ipt_IMQ.c 2007-06-02 21:44:24.000000000 +0000
639 + * This target marks packets to be enqueued to an imq device
641 +#include <linux/module.h>
642 +#include <linux/skbuff.h>
643 +#include <linux/netfilter_ipv4/ip_tables.h>
644 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
645 +#include <linux/imq.h>
647 +static unsigned int imq_target(struct sk_buff **pskb,
648 + const struct net_device *in,
649 + const struct net_device *out,
650 + unsigned int hooknum,
651 + const struct xt_target *target,
652 + const void *targinfo)
654 + struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
656 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
658 + return XT_CONTINUE;
661 +static int imq_checkentry(const char *tablename,
663 + const struct xt_target *target,
665 + unsigned int hook_mask)
667 + struct ipt_imq_info *mr;
669 + mr = (struct ipt_imq_info*)targinfo;
671 + if (mr->todev > IMQ_MAX_DEVS) {
672 + printk(KERN_WARNING
673 + "IMQ: invalid device specified, highest is %u\n",
681 +static struct xt_target ipt_imq_reg = {
684 + .target = imq_target,
685 + .targetsize = sizeof(struct ipt_imq_info),
686 + .checkentry = imq_checkentry,
691 +static int __init init(void)
693 + return xt_register_target(&ipt_imq_reg);
696 +static void __exit fini(void)
698 + xt_unregister_target(&ipt_imq_reg);
704 +MODULE_AUTHOR("http://www.linuximq.net");
705 +MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
706 +MODULE_LICENSE("GPL");
708 Binary files linux-2.6.21.1-orig/net/ipv6/netfilter/.ip6t_IMQ.swp and linux-2.6.21.1/net/ipv6/netfilter/.ip6t_IMQ.swp differ
709 diff -Nru linux-2.6.21.1-orig/net/ipv6/netfilter/Kconfig linux-2.6.21.1/net/ipv6/netfilter/Kconfig
710 --- linux-2.6.21.1-orig/net/ipv6/netfilter/Kconfig 2007-04-27 21:49:26.000000000 +0000
711 +++ linux-2.6.21.1/net/ipv6/netfilter/Kconfig 2007-06-02 21:43:55.000000000 +0000
714 To compile it as a module, choose M here. If unsure, say N.
716 +config IP6_NF_TARGET_IMQ
717 + tristate "IMQ target support"
718 + depends on IP6_NF_MANGLE
720 + This option adds a `IMQ' target which is used to specify if and
721 + to which imq device packets should get enqueued/dequeued.
723 + To compile it as a module, choose M here. If unsure, say N.
725 config IP6_NF_TARGET_HL
726 tristate 'HL (hoplimit) target support'
727 depends on IP6_NF_MANGLE
728 diff -Nru linux-2.6.21.1-orig/net/ipv6/netfilter/Makefile linux-2.6.21.1/net/ipv6/netfilter/Makefile
729 --- linux-2.6.21.1-orig/net/ipv6/netfilter/Makefile 2007-04-27 21:49:26.000000000 +0000
730 +++ linux-2.6.21.1/net/ipv6/netfilter/Makefile 2007-06-02 21:43:55.000000000 +0000
732 obj-$(CONFIG_IP6_NF_MATCH_OWNER) += ip6t_owner.o
733 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
734 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
735 +obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
736 obj-$(CONFIG_IP6_NF_TARGET_HL) += ip6t_HL.o
737 obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
738 obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
739 diff -Nru linux-2.6.21.1-orig/net/ipv6/netfilter/ip6t_IMQ.c linux-2.6.21.1/net/ipv6/netfilter/ip6t_IMQ.c
740 --- linux-2.6.21.1-orig/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 00:00:00.000000000 +0000
741 +++ linux-2.6.21.1/net/ipv6/netfilter/ip6t_IMQ.c 2007-06-02 21:45:36.000000000 +0000
744 + * This target marks packets to be enqueued to an imq device
746 +#include <linux/module.h>
747 +#include <linux/skbuff.h>
748 +#include <linux/netfilter_ipv6/ip6_tables.h>
749 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
750 +#include <linux/imq.h>
752 +static unsigned int imq_target(struct sk_buff **pskb,
753 + const struct net_device *in,
754 + const struct net_device *out,
755 + unsigned int hooknum,
756 + const struct xt_target *target,
757 + const void *targinfo)
759 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
761 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
763 + return XT_CONTINUE;
766 +static int imq_checkentry(const char *tablename,
768 + const struct xt_target *target,
770 + unsigned int hook_mask)
772 + struct ip6t_imq_info *mr;
774 + mr = (struct ip6t_imq_info*)targinfo;
776 + if (mr->todev > IMQ_MAX_DEVS) {
777 + printk(KERN_WARNING
778 + "IMQ: invalid device specified, highest is %u\n",
786 +static struct xt_target ip6t_imq_reg = {
788 + .family = AF_INET6,
789 + .target = imq_target,
790 + .targetsize = sizeof(struct ip6t_imq_info),
792 + .checkentry = imq_checkentry,
796 +static int __init init(void)
798 + return xt_register_target(&ip6t_imq_reg);
801 +static void __exit fini(void)
803 + xt_unregister_target(&ip6t_imq_reg);
809 +MODULE_AUTHOR("http://www.linuximq.net");
810 +MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information.");
811 +MODULE_LICENSE("GPL");
813 diff -Nru linux-2.6.21.1-orig/net/sched/sch_generic.c linux-2.6.21.1/net/sched/sch_generic.c
814 --- linux-2.6.21.1-orig/net/sched/sch_generic.c 2007-04-27 21:49:26.000000000 +0000
815 +++ linux-2.6.21.1/net/sched/sch_generic.c 2007-06-02 21:43:55.000000000 +0000
818 NOTE: Called under dev->queue_lock with locally disabled BH.
821 static inline int qdisc_restart(struct net_device *dev)
823 struct Qdisc *q = dev->qdisc;
828 +int qdisc_restart1(struct net_device *dev)
830 + return qdisc_restart(dev);
833 void __qdisc_run(struct net_device *dev)
835 if (unlikely(dev->qdisc == &noop_qdisc))
837 EXPORT_SYMBOL(qdisc_reset);
838 EXPORT_SYMBOL(qdisc_lock_tree);
839 EXPORT_SYMBOL(qdisc_unlock_tree);
840 +EXPORT_SYMBOL(qdisc_restart1);