1 diff -aurN linux-2.4.28-orig/Documentation/Configure.help linux-2.4.28/Documentation/Configure.help
2 --- linux-2.4.28-orig/Documentation/Configure.help 2004-11-17 11:54:20.000000000 +0000
3 +++ linux-2.4.28/Documentation/Configure.help 2004-12-14 11:43:42.000000000 +0000
5 If you want to compile it as a module, say M here and read
6 <file:Documentation/modules.txt>. If unsure, say `N'.
9 +CONFIG_IP_NF_TARGET_IMQ
10 + This option adds a `IMQ' target which is used to specify if and
11 + to which imq device packets should get enqueued/dequeued.
13 + If you want to compile it as a module, say M here and read
14 + <file:Documentation/modules.txt>. If unsure, say `N'.
17 +CONFIG_IP6_NF_TARGET_IMQ
18 + This option adds a `IMQ' target which is used to specify if and
19 + to which imq device packets should get enqueued/dequeued.
21 + If you want to compile it as a module, say M here and read
22 + <file:Documentation/modules.txt>. If unsure, say `N'.
25 CONFIG_IP_NF_TARGET_MARK
26 This option adds a `MARK' target, which allows you to create rules
27 @@ -9799,6 +9815,20 @@
28 say M here and read <file:Documentation/modules.txt>. The module
29 will be called bonding.o.
31 +Intermediate queueing device support
33 + The imq device(s) is used as placeholder for QoS queueing disciplines.
34 + Every packet entering/leaving the ip stack can be directed through
35 + the imq device where it's enqueued/dequeued to the attached qdisc.
36 + This allows you to treat network devices as classes and distribute
37 + bandwidth among them. Iptables is used to specify through which imq
38 + device, if any, packets travel.
40 + If you want to compile this as a module ( = code which ca be
41 + inserted in and removed from the running kernel whenever you want),
42 + say M here and read <file:Documentation/modules.txt>. The module
43 + will be called imq.o
45 SLIP (serial line) support
47 Say Y if you intend to use SLIP or CSLIP (compressed SLIP) to
48 diff -aurN linux-2.4.28-orig/drivers/net/Config.in linux-2.4.28/drivers/net/Config.in
49 --- linux-2.4.28-orig/drivers/net/Config.in 2004-08-07 23:26:04.000000000 +0000
50 +++ linux-2.4.28/drivers/net/Config.in 2004-12-14 11:43:42.000000000 +0000
52 tristate 'Dummy net driver support' CONFIG_DUMMY
53 tristate 'Bonding driver support' CONFIG_BONDING
54 tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
55 +if [ "$CONFIG_NETFILTER" = "y" ]; then
56 + tristate 'IMQ (intermediate queueing device) support' CONFIG_IMQ
58 + comment 'IMQ needs CONFIG_NETFILTER enabled'
60 tristate 'Universal TUN/TAP device driver support' CONFIG_TUN
61 if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
62 tristate 'Ethertap network tap (OBSOLETE)' CONFIG_ETHERTAP
63 diff -aurN linux-2.4.28-orig/drivers/net/Makefile linux-2.4.28/drivers/net/Makefile
64 --- linux-2.4.28-orig/drivers/net/Makefile 2004-08-07 23:26:04.000000000 +0000
65 +++ linux-2.4.28/drivers/net/Makefile 2004-12-14 11:43:42.000000000 +0000
68 obj-$(CONFIG_STRIP) += strip.o
69 obj-$(CONFIG_DUMMY) += dummy.o
70 +obj-$(CONFIG_IMQ) += imq.o
71 obj-$(CONFIG_DE600) += de600.o
72 obj-$(CONFIG_DE620) += de620.o
73 obj-$(CONFIG_AT1500) += lance.o
74 diff -aurN linux-2.4.28-orig/drivers/net/imq.c linux-2.4.28/drivers/net/imq.c
75 --- linux-2.4.28-orig/drivers/net/imq.c 1970-01-01 00:00:00.000000000 +0000
76 +++ linux-2.4.28/drivers/net/imq.c 2004-12-14 11:43:42.000000000 +0000
79 + * Pseudo-driver for the intermediate queue device.
81 + * This program is free software; you can redistribute it and/or
82 + * modify it under the terms of the GNU General Public License
83 + * as published by the Free Software Foundation; either version
84 + * 2 of the License, or (at your option) any later version.
86 + * Authors: Patrick McHardy, <kaber@trash.net>
88 + * The first version was written by Martin Devera, <devik@cdi.cz>
90 + * Credits: Jan Rafaj <imq2t@cedric.vabo.cz>
91 + * - Update patch to 2.4.21
92 + * Sebastian Strollo <sstrollo@nortelnetworks.com>
93 + * - Fix "Dead-loop on netdevice imq"-issue
96 +#include <linux/kernel.h>
97 +#include <linux/module.h>
98 +#include <linux/config.h>
99 +#include <linux/skbuff.h>
100 +#include <linux/netdevice.h>
101 +#include <linux/rtnetlink.h>
102 +#include <linux/if_arp.h>
103 +#include <linux/netfilter.h>
104 +#include <linux/netfilter_ipv4.h>
105 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
106 +#include <linux/netfilter_ipv6.h>
108 +#include <linux/imq.h>
109 +#include <net/pkt_sched.h>
111 +static nf_hookfn imq_nf_hook;
113 +static struct nf_hook_ops imq_ingress_ipv4 = {
118 + NF_IP_PRI_MANGLE + 1
121 +static struct nf_hook_ops imq_egress_ipv4 = {
125 + NF_IP_POST_ROUTING,
129 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
130 +static struct nf_hook_ops imq_ingress_ipv6 = {
134 + NF_IP6_PRE_ROUTING,
135 + NF_IP6_PRI_MANGLE + 1
138 +static struct nf_hook_ops imq_egress_ipv6 = {
142 + NF_IP6_POST_ROUTING,
147 +static unsigned int numdevs = 2;
149 +MODULE_PARM(numdevs, "i");
150 +MODULE_PARM_DESC(numdevs, "number of imq devices");
152 +static struct net_device *imq_devs;
155 +static struct net_device_stats *imq_get_stats(struct net_device *dev)
157 + return (struct net_device_stats *)dev->priv;
160 +/* called for packets kfree'd in qdiscs at places other than enqueue */
161 +static void imq_skb_destructor(struct sk_buff *skb)
163 + struct nf_info *info = skb->nf_info;
167 + dev_put(info->indev);
169 + dev_put(info->outdev);
174 +static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
176 + struct net_device_stats *stats = (struct net_device_stats*) dev->priv;
178 + stats->tx_bytes += skb->len;
179 + stats->tx_packets++;
181 + skb->imq_flags = 0;
182 + skb->destructor = NULL;
184 + dev->trans_start = jiffies;
185 + nf_reinject(skb, skb->nf_info, NF_ACCEPT);
189 +static int imq_nf_queue(struct sk_buff *skb, struct nf_info *info,
192 + struct net_device *dev;
193 + struct net_device_stats *stats;
194 + struct sk_buff *skb2 = NULL;
196 + unsigned int index = skb->imq_flags&IMQ_F_IFMASK;
199 + if (index > numdevs)
202 + dev = imq_devs + index;
203 + if (!(dev->flags & IFF_UP)) {
204 + skb->imq_flags = 0;
205 + nf_reinject(skb, info, NF_ACCEPT);
208 + dev->last_rx = jiffies;
210 + if (skb->destructor) {
212 + skb = skb_clone(skb, GFP_ATOMIC);
216 + skb->nf_info = info;
218 + stats = (struct net_device_stats *)dev->priv;
219 + stats->rx_bytes+= skb->len;
220 + stats->rx_packets++;
222 + spin_lock_bh(&dev->queue_lock);
225 + q->enqueue(skb_get(skb), q);
226 + if (skb_shared(skb)) {
227 + skb->destructor = imq_skb_destructor;
232 + if (spin_is_locked(&dev->xmit_lock))
233 + netif_schedule(dev);
236 + spin_unlock_bh(&dev->queue_lock);
239 + kfree_skb(ret ? skb : skb2);
244 +static unsigned int imq_nf_hook(unsigned int hook, struct sk_buff **pskb,
245 + const struct net_device *indev,
246 + const struct net_device *outdev,
247 + int (*okfn)(struct sk_buff *))
249 + if ((*pskb)->imq_flags & IMQ_F_ENQUEUE)
256 +static int __init imq_init_hooks(void)
260 + if ((err = nf_register_queue_handler(PF_INET, imq_nf_queue, NULL)))
262 + if ((err = nf_register_hook(&imq_ingress_ipv4)))
264 + if ((err = nf_register_hook(&imq_egress_ipv4)))
266 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
267 + if ((err = nf_register_queue_handler(PF_INET6, imq_nf_queue, NULL)))
269 + if ((err = nf_register_hook(&imq_ingress_ipv6)))
271 + if ((err = nf_register_hook(&imq_egress_ipv6)))
277 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
279 + nf_unregister_hook(&imq_ingress_ipv6);
281 + nf_unregister_queue_handler(PF_INET6);
283 + nf_unregister_hook(&imq_egress_ipv4);
286 + nf_unregister_hook(&imq_ingress_ipv4);
288 + nf_unregister_queue_handler(PF_INET);
293 +static void __exit imq_unhook(void)
295 + nf_unregister_hook(&imq_ingress_ipv4);
296 + nf_unregister_hook(&imq_egress_ipv4);
297 + nf_unregister_queue_handler(PF_INET);
298 +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
299 + nf_unregister_hook(&imq_ingress_ipv6);
300 + nf_unregister_hook(&imq_egress_ipv6);
301 + nf_unregister_queue_handler(PF_INET6);
305 +static int __init imq_dev_init(struct net_device *dev)
307 + dev->hard_start_xmit = imq_dev_xmit;
308 + dev->type = ARPHRD_VOID;
310 + dev->tx_queue_len = 30;
311 + dev->flags = IFF_NOARP;
312 + dev->priv = kmalloc(sizeof(struct net_device_stats), GFP_KERNEL);
313 + if (dev->priv == NULL)
315 + memset(dev->priv, 0, sizeof(struct net_device_stats));
316 + dev->get_stats = imq_get_stats;
321 +static void imq_dev_uninit(struct net_device *dev)
326 +static int __init imq_init_devs(void)
328 + struct net_device *dev;
331 + if (!numdevs || numdevs > IMQ_MAX_DEVS) {
332 + printk(KERN_ERR "numdevs has to be betweed 1 and %u\n",
337 + imq_devs = kmalloc(sizeof(struct net_device) * numdevs, GFP_KERNEL);
340 + memset(imq_devs, 0, sizeof(struct net_device) * numdevs);
342 + /* we start counting at zero */
345 + for (i = 0, dev = imq_devs; i <= numdevs; i++, dev++) {
346 + SET_MODULE_OWNER(dev);
347 + strcpy(dev->name, "imq%d");
348 + dev->init = imq_dev_init;
349 + dev->uninit = imq_dev_uninit;
351 + if (register_netdev(dev) < 0)
358 + unregister_netdev(--dev);
363 +static void imq_cleanup_devs(void)
366 + struct net_device *dev = imq_devs;
368 + for (i = 0; i <= numdevs; i++)
369 + unregister_netdev(dev++);
374 +static int __init imq_init_module(void)
378 + if ((err = imq_init_devs()))
380 + if ((err = imq_init_hooks())) {
381 + imq_cleanup_devs();
385 + printk(KERN_INFO "imq driver loaded.\n");
390 +static void __exit imq_cleanup_module(void)
393 + imq_cleanup_devs();
396 +module_init(imq_init_module);
397 +module_exit(imq_cleanup_module);
398 +MODULE_LICENSE("GPL");
399 diff -aurN linux-2.4.28-orig/include/linux/imq.h linux-2.4.28/include/linux/imq.h
400 --- linux-2.4.28-orig/include/linux/imq.h 1970-01-01 00:00:00.000000000 +0000
401 +++ linux-2.4.28/include/linux/imq.h 2004-12-14 11:43:42.000000000 +0000
406 +#define IMQ_MAX_DEVS 16
408 +#define IMQ_F_IFMASK 0x7f
409 +#define IMQ_F_ENQUEUE 0x80
412 diff -aurN linux-2.4.28-orig/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.4.28/include/linux/netfilter_ipv4/ipt_IMQ.h
413 --- linux-2.4.28-orig/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 00:00:00.000000000 +0000
414 +++ linux-2.4.28/include/linux/netfilter_ipv4/ipt_IMQ.h 2004-12-14 11:43:42.000000000 +0000
419 +struct ipt_imq_info {
420 + unsigned int todev; /* target imq device */
423 +#endif /* _IPT_IMQ_H */
424 diff -aurN linux-2.4.28-orig/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.4.28/include/linux/netfilter_ipv6/ip6t_IMQ.h
425 --- linux-2.4.28-orig/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 00:00:00.000000000 +0000
426 +++ linux-2.4.28/include/linux/netfilter_ipv6/ip6t_IMQ.h 2004-12-14 11:43:42.000000000 +0000
431 +struct ip6t_imq_info {
432 + unsigned int todev; /* target imq device */
435 +#endif /* _IP6T_IMQ_H */
436 diff -aurN linux-2.4.28-orig/include/linux/skbuff.h linux-2.4.28/include/linux/skbuff.h
437 --- linux-2.4.28-orig/include/linux/skbuff.h 2004-08-07 23:26:06.000000000 +0000
438 +++ linux-2.4.28/include/linux/skbuff.h 2004-12-14 11:43:42.000000000 +0000
440 struct nf_conntrack *master;
443 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
447 struct sk_buff_head {
448 /* These two members must be first. */
450 unsigned int len; /* Length of actual data */
451 unsigned int data_len;
452 unsigned int csum; /* Checksum */
453 - unsigned char __unused, /* Dead field, may be reused */
454 + unsigned char imq_flags, /* intermediate queueing device */
455 cloned, /* head may be cloned (check refcnt to be sure). */
456 pkt_type, /* Packet class */
457 ip_summed; /* Driver fed us an IP checksum */
459 #ifdef CONFIG_NET_SCHED
460 __u32 tc_index; /* traffic control index */
462 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
463 + struct nf_info *nf_info;
468 diff -aurN linux-2.4.28-orig/net/core/skbuff.c linux-2.4.28/net/core/skbuff.c
469 --- linux-2.4.28-orig/net/core/skbuff.c 2003-08-25 11:44:44.000000000 +0000
470 +++ linux-2.4.28/net/core/skbuff.c 2004-12-14 11:43:42.000000000 +0000
472 /* Set up other state */
475 +#if defined(CONFIG_IMQ) || defined (CONFIG_IMQ_MODULE)
476 + skb->imq_flags = 0;
477 + skb->nf_info = NULL;
481 atomic_set(&skb->users, 1);
483 #ifdef CONFIG_NET_SCHED
486 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
487 + skb->imq_flags = 0;
488 + skb->nf_info = NULL;
492 static void skb_drop_fraglist(struct sk_buff *skb)
494 #ifdef CONFIG_NET_SCHED
497 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
502 atomic_inc(&(skb_shinfo(skb)->dataref));
505 #ifdef CONFIG_NET_SCHED
506 new->tc_index = old->tc_index;
508 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
509 + new->imq_flags=old->imq_flags;
510 + new->nf_info=old->nf_info;
515 diff -aurN linux-2.4.28-orig/net/ipv4/netfilter/Config.in linux-2.4.28/net/ipv4/netfilter/Config.in
516 --- linux-2.4.28-orig/net/ipv4/netfilter/Config.in 2003-08-25 11:44:44.000000000 +0000
517 +++ linux-2.4.28/net/ipv4/netfilter/Config.in 2004-12-14 11:43:43.000000000 +0000
519 dep_tristate ' DSCP target support' CONFIG_IP_NF_TARGET_DSCP $CONFIG_IP_NF_MANGLE
521 dep_tristate ' MARK target support' CONFIG_IP_NF_TARGET_MARK $CONFIG_IP_NF_MANGLE
522 + dep_tristate ' IMQ target support' CONFIG_IP_NF_TARGET_IMQ $CONFIG_IP_NF_MANGLE
524 dep_tristate ' LOG target support' CONFIG_IP_NF_TARGET_LOG $CONFIG_IP_NF_IPTABLES
525 dep_tristate ' ULOG target support' CONFIG_IP_NF_TARGET_ULOG $CONFIG_IP_NF_IPTABLES
526 diff -aurN linux-2.4.28-orig/net/ipv4/netfilter/Makefile linux-2.4.28/net/ipv4/netfilter/Makefile
527 --- linux-2.4.28-orig/net/ipv4/netfilter/Makefile 2003-08-25 11:44:44.000000000 +0000
528 +++ linux-2.4.28/net/ipv4/netfilter/Makefile 2004-12-14 11:43:43.000000000 +0000
530 obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o
531 obj-$(CONFIG_IP_NF_TARGET_DSCP) += ipt_DSCP.o
532 obj-$(CONFIG_IP_NF_TARGET_MARK) += ipt_MARK.o
533 +obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o
534 obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o
535 obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o
536 obj-$(CONFIG_IP_NF_NAT_SNMP_BASIC) += ip_nat_snmp_basic.o
537 diff -aurN linux-2.4.28-orig/net/ipv4/netfilter/ipt_IMQ.c linux-2.4.28/net/ipv4/netfilter/ipt_IMQ.c
538 --- linux-2.4.28-orig/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 00:00:00.000000000 +0000
539 +++ linux-2.4.28/net/ipv4/netfilter/ipt_IMQ.c 2004-12-14 11:43:43.000000000 +0000
541 +/* This target marks packets to be enqueued to an imq device */
542 +#include <linux/module.h>
543 +#include <linux/skbuff.h>
544 +#include <linux/netfilter_ipv4/ip_tables.h>
545 +#include <linux/netfilter_ipv4/ipt_IMQ.h>
546 +#include <linux/imq.h>
548 +static unsigned int imq_target(struct sk_buff **pskb,
549 + unsigned int hooknum,
550 + const struct net_device *in,
551 + const struct net_device *out,
552 + const void *targinfo,
555 + struct ipt_imq_info *mr = (struct ipt_imq_info*)targinfo;
557 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
558 + (*pskb)->nfcache |= NFC_ALTERED;
560 + return IPT_CONTINUE;
563 +static int imq_checkentry(const char *tablename,
564 + const struct ipt_entry *e,
566 + unsigned int targinfosize,
567 + unsigned int hook_mask)
569 + struct ipt_imq_info *mr;
571 + if (targinfosize != IPT_ALIGN(sizeof(struct ipt_imq_info))) {
572 + printk(KERN_WARNING "IMQ: invalid targinfosize\n");
575 + mr = (struct ipt_imq_info*)targinfo;
577 + if (strcmp(tablename, "mangle") != 0) {
578 + printk(KERN_WARNING
579 + "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
584 + if (mr->todev > IMQ_MAX_DEVS) {
585 + printk(KERN_WARNING
586 + "IMQ: invalid device specified, highest is %u\n",
594 +static struct ipt_target ipt_imq_reg = {
603 +static int __init init(void)
605 + if (ipt_register_target(&ipt_imq_reg))
611 +static void __exit fini(void)
613 + ipt_unregister_target(&ipt_imq_reg);
618 +MODULE_LICENSE("GPL");
619 diff -aurN linux-2.4.28-orig/net/ipv6/netfilter/Config.in linux-2.4.28/net/ipv6/netfilter/Config.in
620 --- linux-2.4.28-orig/net/ipv6/netfilter/Config.in 2003-06-13 14:51:39.000000000 +0000
621 +++ linux-2.4.28/net/ipv6/netfilter/Config.in 2004-12-14 11:43:43.000000000 +0000
623 if [ "$CONFIG_IP6_NF_MANGLE" != "n" ]; then
624 # dep_tristate ' TOS target support' CONFIG_IP6_NF_TARGET_TOS $CONFIG_IP_NF_MANGLE
625 dep_tristate ' MARK target support' CONFIG_IP6_NF_TARGET_MARK $CONFIG_IP6_NF_MANGLE
626 + dep_tristate ' IMQ target support' CONFIG_IP6_NF_TARGET_IMQ $CONFIG_IP6_NF_MANGLE
628 #dep_tristate ' LOG target support' CONFIG_IP6_NF_TARGET_LOG $CONFIG_IP6_NF_IPTABLES
630 diff -aurN linux-2.4.28-orig/net/ipv6/netfilter/Makefile linux-2.4.28/net/ipv6/netfilter/Makefile
631 --- linux-2.4.28-orig/net/ipv6/netfilter/Makefile 2003-06-13 14:51:39.000000000 +0000
632 +++ linux-2.4.28/net/ipv6/netfilter/Makefile 2004-12-14 11:43:43.000000000 +0000
634 obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o
635 obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o
636 obj-$(CONFIG_IP6_NF_TARGET_MARK) += ip6t_MARK.o
637 +obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o
638 obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o
639 obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o
640 obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o
641 diff -aurN linux-2.4.28-orig/net/ipv6/netfilter/ip6t_IMQ.c linux-2.4.28/net/ipv6/netfilter/ip6t_IMQ.c
642 --- linux-2.4.28-orig/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 00:00:00.000000000 +0000
643 +++ linux-2.4.28/net/ipv6/netfilter/ip6t_IMQ.c 2004-12-14 11:43:43.000000000 +0000
645 +/* This target marks packets to be enqueued to an imq device */
646 +#include <linux/module.h>
647 +#include <linux/skbuff.h>
648 +#include <linux/netfilter_ipv6/ip6_tables.h>
649 +#include <linux/netfilter_ipv6/ip6t_IMQ.h>
650 +#include <linux/imq.h>
652 +static unsigned int imq_target(struct sk_buff **pskb,
653 + unsigned int hooknum,
654 + const struct net_device *in,
655 + const struct net_device *out,
656 + const void *targinfo,
659 + struct ip6t_imq_info *mr = (struct ip6t_imq_info*)targinfo;
661 + (*pskb)->imq_flags = mr->todev | IMQ_F_ENQUEUE;
662 + (*pskb)->nfcache |= NFC_ALTERED;
664 + return IP6T_CONTINUE;
667 +static int imq_checkentry(const char *tablename,
668 + const struct ip6t_entry *e,
670 + unsigned int targinfosize,
671 + unsigned int hook_mask)
673 + struct ip6t_imq_info *mr;
675 + if (targinfosize != IP6T_ALIGN(sizeof(struct ip6t_imq_info))) {
676 + printk(KERN_WARNING "IMQ: invalid targinfosize\n");
679 + mr = (struct ip6t_imq_info*)targinfo;
681 + if (strcmp(tablename, "mangle") != 0) {
682 + printk(KERN_WARNING
683 + "IMQ: IMQ can only be called from \"mangle\" table, not \"%s\"\n",
688 + if (mr->todev > IMQ_MAX_DEVS) {
689 + printk(KERN_WARNING
690 + "IMQ: invalid device specified, highest is %u\n",
698 +static struct ip6t_target ip6t_imq_reg = {
707 +static int __init init(void)
709 + if (ip6t_register_target(&ip6t_imq_reg))
715 +static void __exit fini(void)
717 + ip6t_unregister_target(&ip6t_imq_reg);
722 +MODULE_LICENSE("GPL");
723 diff -aurN linux-2.4.28-orig/net/sched/sch_generic.c linux-2.4.28/net/sched/sch_generic.c
724 --- linux-2.4.28-orig/net/sched/sch_generic.c 2004-11-17 11:54:22.000000000 +0000
725 +++ linux-2.4.28/net/sched/sch_generic.c 2004-12-14 11:44:27.000000000 +0000
727 #include <linux/skbuff.h>
728 #include <linux/rtnetlink.h>
729 #include <linux/init.h>
730 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
731 +#include <linux/imq.h>
733 #include <linux/list.h>
734 #include <net/sock.h>
735 #include <net/pkt_sched.h>
737 spin_unlock(&dev->queue_lock);
739 if (!netif_queue_stopped(dev)) {
742 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
743 + && !(skb->imq_flags & IMQ_F_ENQUEUE)
746 dev_queue_xmit_nit(skb, dev);
748 if (dev->hard_start_xmit(skb, dev) == 0) {