]> git.pld-linux.org Git - packages/kernel.git/commitdiff
- 2.6.32.7-2; kernel-imq.patch updated to linux-2.6.32-imq-test2.diff
authormguevara <mguevara@pld-linux.org>
Tue, 2 Feb 2010 15:55:02 +0000 (15:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    kernel-imq.patch -> 1.6
    kernel.spec -> 1.750

kernel-imq.patch
kernel.spec

index c8a1a46f0a63d664b2181d2681c9e4b3f64edd5e..17f85c3d8ee7a7cf166ef4a33ffcaf9388fb6280 100644 (file)
@@ -1,7 +1,7 @@
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/drivers/net/imq.c
---- linux-2.6.29.1/drivers/net/imq.c   1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/drivers/net/imq.c       2009-04-20 23:22:18.935017702 +0300
-@@ -0,0 +1,571 @@
+diff -U 5 -Nr linux-2.6.32/drivers/net/imq.c linux-2.6.32-imq/drivers/net/imq.c
+--- linux-2.6.32/drivers/net/imq.c     1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/imq.c 2009-12-11 15:08:01.958734740 +0200
+@@ -0,0 +1,632 @@
 +/*
 + *             Pseudo-driver for the intermediate queue device.
 + *
@@ -74,6 +74,15 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 + *              - Use netdevice feature flags to avoid extra packet handling
 + *                by core networking layer and possibly increase performance.
 + *
++ *             2009/09/26 - (Jussi Kivilinna)
++ *              - Add imq_nf_reinject_lockless to fix deadlock with
++ *                imq_nf_queue/imq_nf_reinject.
++ *
++ *             2009/12/08 - (Jussi Kivilinna)
++ *              - Port to 2.6.32
++ *              - Add check for skb->nf_queue_entry==NULL in imq_dev_xmit()
++ *              - Also add better error checking for skb->nf_queue_entry usage
++ *
 + *           Also, many thanks to pablo Sebastian Greco for making the initial
 + *           patch and to those who helped the testing.
 + *
@@ -171,6 +180,8 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +{
 +      struct nf_queue_entry *entry = skb->nf_queue_entry;
 +
++      skb->nf_queue_entry = NULL;
++
 +      if (entry) {
 +              nf_queue_entry_release_refs(entry);
 +              kfree(entry);
@@ -179,6 +190,25 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +      skb_restore_cb(skb); /* kfree backup */
 +}
 +
++/* locking not needed when called from imq_nf_queue */
++static void imq_nf_reinject_lockless(struct nf_queue_entry *entry,
++                                              unsigned int verdict)
++{
++      int status;
++
++      if (!entry->next_outfn) {
++              nf_reinject(entry, verdict);
++              return;
++      }
++
++      status = entry->next_outfn(entry, entry->next_queuenum);
++      if (status < 0) {
++              nf_queue_entry_release_refs(entry);
++              kfree_skb(entry->skb);
++              kfree(entry);
++      }
++}
++
 +static void imq_nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
 +{
 +      int status;
@@ -203,19 +233,48 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +      rcu_read_unlock();
 +}
 +
-+static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
++static netdev_tx_t imq_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 +{
++      struct nf_queue_entry *entry = skb->nf_queue_entry;
++
++      skb->nf_queue_entry = NULL;
++      dev->trans_start = jiffies;
++
 +      dev->stats.tx_bytes += skb->len;
 +      dev->stats.tx_packets++;
 +
++      if (entry == NULL) {
++              /* We don't know what is going on here.. packet is queued for
++               * imq device, but (probably) not by us.
++               *
++               * If this packet was not send here by imq_nf_queue(), then
++               * skb_save_cb() was not used and skb_free() should not show:
++               *   WARNING: IMQ: kfree_skb: skb->cb_next:..
++               * and/or
++               *   WARNING: IMQ: kfree_skb: skb->nf_queue_entry...
++               *
++               * However if this message is shown, then IMQ is somehow broken
++               * and you should report this to linuximq.net.
++               */
++
++              /* imq_dev_xmit is black hole that eats all packets, report that
++               * we eat this packet happily and increase dropped counters.
++               */
++
++              dev->stats.tx_dropped++;
++              dev_kfree_skb(skb);
++
++              return NETDEV_TX_OK;
++      }
++
++      skb_restore_cb(skb); /* restore skb->cb */
++
 +      skb->imq_flags = 0;
 +      skb->destructor = NULL;
 +
-+      skb_restore_cb(skb); /* restore skb->cb */
++      imq_nf_reinject(entry, NF_ACCEPT);
 +
-+      dev->trans_start = jiffies;
-+      imq_nf_reinject(skb->nf_queue_entry, NF_ACCEPT);
-+      return 0;
++      return NETDEV_TX_OK;
 +}
 +
 +static int imq_nf_queue(struct nf_queue_entry *entry, unsigned queue_num)
@@ -258,7 +317,7 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +
 +      if (unlikely(!(dev->flags & IFF_UP))) {
 +              entry->skb->imq_flags = 0;
-+              imq_nf_reinject(entry, NF_ACCEPT);
++              imq_nf_reinject_lockless(entry, NF_ACCEPT);
 +              retval = 0;
 +              goto out;
 +      }
@@ -316,6 +375,7 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +              goto out;
 +      } else {
 +              skb_restore_cb(skb_shared); /* restore skb->cb */
++              skb->nf_queue_entry = NULL;
 +              /* qdisc dropped packet and decreased skb reference count of
 +               * skb, so we don't really want to and try refree as that would
 +               * actually destroy the skb. */
@@ -379,6 +439,7 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +      dev->features           = NETIF_F_SG | NETIF_F_FRAGLIST |
 +                                NETIF_F_GSO | NETIF_F_HW_CSUM |
 +                                NETIF_F_HIGHDMA;
++      dev->priv_flags         &= ~IFF_XMIT_DST_RELEASE;
 +}
 +
 +static int imq_validate(struct nlattr *tb[], struct nlattr *data[])
@@ -573,10 +634,12 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/imq.c linux-2.6.29.1-imq/dri
 +MODULE_LICENSE("GPL");
 +MODULE_ALIAS_RTNL_LINK("imq");
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Kconfig linux-2.6.29.1-imq/drivers/net/Kconfig
---- linux-2.6.29.1/drivers/net/Kconfig 2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/drivers/net/Kconfig     2009-04-12 22:28:22.372333533 +0300
-@@ -110,6 +110,129 @@
+diff -U 5 -Nr linux-2.6.32/drivers/net/Kconfig linux-2.6.32-imq/drivers/net/Kconfig
+--- linux-2.6.32/drivers/net/Kconfig   2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/Kconfig       2009-12-11 14:16:42.678730699 +0200
+@@ -107,10 +107,133 @@
+         <http://www.tldp.org/docs.html#howto>.
          To compile this driver as a module, choose M here: the module
          will be called eql.  If unsure, say N.
  
@@ -706,10 +769,14 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Kconfig linux-2.6.29.1-imq/d
  config TUN
        tristate "Universal TUN/TAP device driver support"
        select CRC32
-diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Makefile linux-2.6.29.1-imq/drivers/net/Makefile
---- linux-2.6.29.1/drivers/net/Makefile        2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/drivers/net/Makefile    2009-04-12 22:28:22.372333533 +0300
-@@ -150,6 +150,7 @@
+       ---help---
+         TUN/TAP provides packet reception and transmission for user space
+diff -U 5 -Nr linux-2.6.32/drivers/net/Makefile linux-2.6.32-imq/drivers/net/Makefile
+--- linux-2.6.32/drivers/net/Makefile  2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/drivers/net/Makefile      2009-12-11 14:16:42.678730699 +0200
+@@ -163,10 +163,11 @@
+ obj-$(CONFIG_SLHC) += slhc.o
  obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o
  
  obj-$(CONFIG_DUMMY) += dummy.o
@@ -717,9 +784,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/drivers/net/Makefile linux-2.6.29.1-imq/
  obj-$(CONFIG_IFB) += ifb.o
  obj-$(CONFIG_MACVLAN) += macvlan.o
  obj-$(CONFIG_DE600) += de600.o
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/imq.h linux-2.6.29.1-imq/include/linux/imq.h
---- linux-2.6.29.1/include/linux/imq.h 1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/imq.h     2009-04-12 22:28:22.372333533 +0300
+ obj-$(CONFIG_DE620) += de620.o
+ obj-$(CONFIG_LANCE) += lance.o
+diff -U 5 -Nr linux-2.6.32/include/linux/imq.h linux-2.6.32-imq/include/linux/imq.h
+--- linux-2.6.32/include/linux/imq.h   1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/imq.h       2009-12-11 14:16:42.678730699 +0200
 @@ -0,0 +1,13 @@
 +#ifndef _IMQ_H
 +#define _IMQ_H
@@ -734,10 +803,12 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/imq.h linux-2.6.29.1-imq/i
 +
 +#endif /* _IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netdevice.h linux-2.6.29.1-imq/include/linux/netdevice.h
---- linux-2.6.29.1/include/linux/netdevice.h   2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/linux/netdevice.h       2009-04-12 22:28:22.373333509 +0300
-@@ -1071,6 +1071,7 @@
+diff -U 5 -Nr linux-2.6.32/include/linux/netdevice.h linux-2.6.32-imq/include/linux/netdevice.h
+--- linux-2.6.32/include/linux/netdevice.h     2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netdevice.h 2009-12-11 14:16:42.679730960 +0200
+@@ -1112,10 +1112,11 @@
+ extern struct net_device      *__dev_get_by_name(struct net *net, const char *name);
+ extern int            dev_alloc_name(struct net_device *dev, const char *name);
  extern int            dev_open(struct net_device *dev);
  extern int            dev_close(struct net_device *dev);
  extern void           dev_disable_lro(struct net_device *dev);
@@ -745,9 +816,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netdevice.h linux-2.6.29.1
  extern int            dev_queue_xmit(struct sk_buff *skb);
  extern int            register_netdevice(struct net_device *dev);
  extern void           unregister_netdevice(struct net_device *dev);
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter/xt_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter/xt_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter/xt_IMQ.h    1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter/xt_IMQ.h        2009-04-12 22:28:22.373333509 +0300
+ extern void           free_netdev(struct net_device *dev);
+ extern void           synchronize_net(void);
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter/xt_IMQ.h linux-2.6.32-imq/include/linux/netfilter/xt_IMQ.h
+--- linux-2.6.32/include/linux/netfilter/xt_IMQ.h      1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter/xt_IMQ.h  2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,9 @@
 +#ifndef _XT_IMQ_H
 +#define _XT_IMQ_H
@@ -758,9 +831,9 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter/xt_IMQ.h linux-2
 +
 +#endif /* _XT_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter_ipv4/ipt_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter_ipv4/ipt_IMQ.h      1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter_ipv4/ipt_IMQ.h  2009-04-12 22:28:22.373333509 +0300
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter_ipv4/ipt_IMQ.h linux-2.6.32-imq/include/linux/netfilter_ipv4/ipt_IMQ.h
+--- linux-2.6.32/include/linux/netfilter_ipv4/ipt_IMQ.h        1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter_ipv4/ipt_IMQ.h    2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,10 @@
 +#ifndef _IPT_IMQ_H
 +#define _IPT_IMQ_H
@@ -772,9 +845,9 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv4/ipt_IMQ.h l
 +
 +#endif /* _IPT_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.29.1-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
---- linux-2.6.29.1/include/linux/netfilter_ipv6/ip6t_IMQ.h     1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h 2009-04-12 22:28:22.373333509 +0300
+diff -U 5 -Nr linux-2.6.32/include/linux/netfilter_ipv6/ip6t_IMQ.h linux-2.6.32-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h
+--- linux-2.6.32/include/linux/netfilter_ipv6/ip6t_IMQ.h       1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/include/linux/netfilter_ipv6/ip6t_IMQ.h   2009-12-11 14:16:42.679730960 +0200
 @@ -0,0 +1,10 @@
 +#ifndef _IP6T_IMQ_H
 +#define _IP6T_IMQ_H
@@ -786,10 +859,12 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/netfilter_ipv6/ip6t_IMQ.h
 +
 +#endif /* _IP6T_IMQ_H */
 +
-diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-imq/include/linux/skbuff.h
---- linux-2.6.29.1/include/linux/skbuff.h      2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/linux/skbuff.h  2009-04-12 22:28:22.374333398 +0300
-@@ -28,6 +28,9 @@
+diff -U 5 -Nr linux-2.6.32/include/linux/skbuff.h linux-2.6.32-imq/include/linux/skbuff.h
+--- linux-2.6.32/include/linux/skbuff.h        2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/linux/skbuff.h    2009-12-11 14:16:42.680730834 +0200
+@@ -27,10 +27,13 @@
+ #include <linux/textsearch.h>
+ #include <net/checksum.h>
  #include <linux/rcupdate.h>
  #include <linux/dmaengine.h>
  #include <linux/hrtimer.h>
@@ -797,9 +872,13 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-im
 +#include <linux/imq.h>
 +#endif
  
- #define HAVE_ALLOC_SKB                /* For the drivers to know */
- #define HAVE_ALIGNABLE_SKB    /* Ditto 8)                */
-@@ -282,6 +285,9 @@
+ /* Don't change this without changing skb_csum_unnecessary! */
+ #define CHECKSUM_NONE 0
+ #define CHECKSUM_UNNECESSARY 1
+ #define CHECKSUM_COMPLETE 2
+@@ -328,10 +331,13 @@
+        * layer. Please put your private variables there. If you
+        * want to keep them across layers you have to do a skb_clone()
         * first. This is owned by whoever has the skb queued ATM.
         */
        char                    cb[48];
@@ -809,7 +888,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-im
  
        unsigned int            len,
                                data_len;
-@@ -312,6 +318,9 @@
+       __u16                   mac_len,
+                               hdr_len;
+@@ -360,10 +366,13 @@
+       void                    (*destructor)(struct sk_buff *skb);
+ #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        struct nf_conntrack     *nfct;
        struct sk_buff          *nfct_reasm;
  #endif
@@ -819,19 +902,28 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-im
  #ifdef CONFIG_BRIDGE_NETFILTER
        struct nf_bridge_info   *nf_bridge;
  #endif
-@@ -332,6 +341,9 @@
-       __u8                    requeue:1;
+       int                     iif;
+@@ -381,10 +390,14 @@
  #endif
+       kmemcheck_bitfield_end(flags2);
        /* 0/14 bit hole */
 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
 +      __u8                    imq_flags:IMQ_F_BITS;
 +#endif
++
  #ifdef CONFIG_NET_DMA
        dma_cookie_t            dma_cookie;
-@@ -372,6 +384,12 @@
-                         enum dma_data_direction dir);
  #endif
+ #ifdef CONFIG_NETWORK_SECMARK
+       __u32                   secmark;
+@@ -435,10 +448,16 @@
+ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
+ {
+       return (struct rtable *)skb_dst(skb);
+ }
  
 +
 +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
@@ -840,9 +932,13 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-im
 +#endif
 +
  extern void kfree_skb(struct sk_buff *skb);
+ extern void consume_skb(struct sk_buff *skb);
  extern void          __kfree_skb(struct sk_buff *skb);
  extern struct sk_buff *__alloc_skb(unsigned int size,
-@@ -1844,6 +1862,10 @@
+                                  gfp_t priority, int fclone, int node);
+@@ -1970,10 +1989,14 @@
+       nf_conntrack_get(src->nfct);
+       dst->nfctinfo = src->nfctinfo;
        dst->nfct_reasm = src->nfct_reasm;
        nf_conntrack_get_reasm(src->nfct_reasm);
  #endif
@@ -853,10 +949,14 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/linux/skbuff.h linux-2.6.29.1-im
  #ifdef CONFIG_BRIDGE_NETFILTER
        dst->nf_bridge  = src->nf_bridge;
        nf_bridge_get(src->nf_bridge);
-diff -uNr --exclude='*~' linux-2.6.29.1/include/net/netfilter/nf_queue.h linux-2.6.29.1-imq/include/net/netfilter/nf_queue.h
---- linux-2.6.29.1/include/net/netfilter/nf_queue.h    2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/include/net/netfilter/nf_queue.h        2009-04-12 22:28:22.374333398 +0300
-@@ -13,6 +13,12 @@
+ #endif
+ }
+diff -U 5 -Nr linux-2.6.32/include/net/netfilter/nf_queue.h linux-2.6.32-imq/include/net/netfilter/nf_queue.h
+--- linux-2.6.32/include/net/netfilter/nf_queue.h      2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/include/net/netfilter/nf_queue.h  2009-12-11 14:16:42.680730834 +0200
+@@ -11,10 +11,16 @@
+       u_int8_t                pf;
+       unsigned int            hook;
        struct net_device       *indev;
        struct net_device       *outdev;
        int                     (*okfn)(struct sk_buff *);
@@ -869,7 +969,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/net/netfilter/nf_queue.h linux-2
  };
  
  #define nf_queue_entry_reroute(x) ((void *)x + sizeof(struct nf_queue_entry))
-@@ -30,5 +36,11 @@
+ /* Packet queuing */
+@@ -28,7 +34,13 @@
+                                    const struct nf_queue_handler *qh);
+ extern int nf_unregister_queue_handler(u_int8_t pf,
                                       const struct nf_queue_handler *qh);
  extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
  extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
@@ -881,10 +985,12 @@ diff -uNr --exclude='*~' linux-2.6.29.1/include/net/netfilter/nf_queue.h linux-2
 +#endif
  
  #endif /* _NF_QUEUE_H */
-diff -uNr --exclude='*~' linux-2.6.29.1/net/core/dev.c linux-2.6.29.1-imq/net/core/dev.c
---- linux-2.6.29.1/net/core/dev.c      2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/core/dev.c  2009-04-12 22:28:22.375333463 +0300
-@@ -96,6 +96,9 @@
+diff -U 5 -Nr linux-2.6.32/net/core/dev.c linux-2.6.32-imq/net/core/dev.c
+--- linux-2.6.32/net/core/dev.c        2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/core/dev.c    2009-12-11 14:16:42.681731014 +0200
+@@ -94,10 +94,13 @@
+ #include <linux/notifier.h>
+ #include <linux/skbuff.h>
  #include <net/net_namespace.h>
  #include <net/sock.h>
  #include <linux/rtnetlink.h>
@@ -894,9 +1000,13 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/dev.c linux-2.6.29.1-imq/net/co
  #include <linux/proc_fs.h>
  #include <linux/seq_file.h>
  #include <linux/stat.h>
-@@ -1671,7 +1674,11 @@
+ #include <linux/if_bridge.h>
+ #include <linux/if_macvlan.h>
+@@ -1702,11 +1705,15 @@
+ {
+       const struct net_device_ops *ops = dev->netdev_ops;
+       int rc;
  
-       prefetch(&dev->netdev_ops->ndo_start_xmit);
        if (likely(!skb->next)) {
 -              if (!list_empty(&ptype_all))
 +              if (!list_empty(&ptype_all)
@@ -907,9 +1017,13 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/dev.c linux-2.6.29.1-imq/net/co
                        dev_queue_xmit_nit(skb, dev);
  
                if (netif_needs_gso(dev, skb)) {
-@@ -1762,8 +1769,7 @@
+                       if (unlikely(dev_gso_segment(skb)))
+                               goto out_kfree_skb;
+@@ -1787,12 +1794,11 @@
        return (u16) (((u64) hash * dev->real_num_tx_queues) >> 32);
  }
+ EXPORT_SYMBOL(skb_tx_hash);
  
 -static struct netdev_queue *dev_pick_tx(struct net_device *dev,
 -                                      struct sk_buff *skb)
@@ -917,18 +1031,26 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/dev.c linux-2.6.29.1-imq/net/co
  {
        const struct net_device_ops *ops = dev->netdev_ops;
        u16 queue_index = 0;
-@@ -1776,6 +1782,7 @@
+       if (ops->ndo_select_queue)
+@@ -1801,10 +1807,11 @@
+               queue_index = skb_tx_hash(dev, skb);
        skb_set_queue_mapping(skb, queue_index);
        return netdev_get_tx_queue(dev, queue_index);
  }
 +EXPORT_SYMBOL(dev_pick_tx);
  
- /**
-  *    dev_queue_xmit - transmit a buffer
-diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net/core/skbuff.c
---- linux-2.6.29.1/net/core/skbuff.c   2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/core/skbuff.c       2009-04-12 22:28:22.376333314 +0300
-@@ -69,6 +69,9 @@
+ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
+                                struct net_device *dev,
+                                struct netdev_queue *txq)
+ {
+diff -U 5 -Nr linux-2.6.32/net/core/skbuff.c linux-2.6.32-imq/net/core/skbuff.c
+--- linux-2.6.32/net/core/skbuff.c     2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/core/skbuff.c 2009-12-11 15:12:39.294981618 +0200
+@@ -70,10 +70,13 @@
+ #include "kmap_skb.h"
  
  static struct kmem_cache *skbuff_head_cache __read_mostly;
  static struct kmem_cache *skbuff_fclone_cache __read_mostly;
@@ -938,7 +1060,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
  
  static void sock_pipe_buf_release(struct pipe_inode_info *pipe,
                                  struct pipe_buffer *buf)
-@@ -88,6 +91,80 @@
+ {
+       put_page(buf->page);
+@@ -89,10 +92,87 @@
+                              struct pipe_buffer *buf)
+ {
        return 1;
  }
  
@@ -998,17 +1124,20 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
 +}
 +EXPORT_SYMBOL(skb_restore_cb);
 +
-+static void skb_copy_stored_cb(struct sk_buff *new, struct sk_buff *old)
++static void skb_copy_stored_cb(struct sk_buff *new, const struct sk_buff *__old)
 +{
 +      struct skb_cb_table *next;
++      struct sk_buff *old;
 +
-+      if (!old->cb_next) {
-+              new->cb_next = 0;
++      if (!__old->cb_next) {
++              new->cb_next = NULL;
 +              return;
 +      }
 +
 +      spin_lock(&skb_cb_store_lock);
 +
++      old = (struct sk_buff *)__old;
++
 +      next = old->cb_next;
 +      atomic_inc(&next->refcnt);
 +      new->cb_next = next;
@@ -1019,7 +1148,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
  
  /* Pipe buffer operations for a socket. */
  static struct pipe_buf_operations sock_pipe_buf_ops = {
-@@ -381,6 +458,15 @@
+       .can_merge = 0,
+       .map = generic_pipe_buf_map,
+@@ -396,10 +476,30 @@
+ #endif
+       if (skb->destructor) {
                WARN_ON(in_irq());
                skb->destructor(skb);
        }
@@ -1027,15 +1160,30 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
 +      /* This should not happen. When it does, avoid memleak by restoring
 +      the chain of cb-backups. */
 +      while(skb->cb_next != NULL) {
-+              printk(KERN_WARNING "kfree_skb: skb->cb_next: %08x\n",
-+                      skb->cb_next);
++              if (net_ratelimit())
++                      printk(KERN_WARNING "IMQ: kfree_skb: skb->cb_next: "
++                              "%08x\n", (unsigned int)skb->cb_next);
++
 +              skb_restore_cb(skb);
 +      }
++      /* This should not happen either, nf_queue_entry is nullified in
++       * imq_dev_xmit(). If we have non-NULL nf_queue_entry then we are
++       * leaking entry pointers, maybe memory. We don't know if this is
++       * pointer to already freed memory, or should this be freed.
++       * If this happens we need to add refcounting, etc for nf_queue_entry.
++       */
++      if (skb->nf_queue_entry && net_ratelimit())
++              printk(KERN_WARNING
++                              "IMQ: kfree_skb: skb->nf_queue_entry != NULL");
 +#endif
  #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
        nf_conntrack_put(skb->nfct);
        nf_conntrack_put_reasm(skb->nfct_reasm);
-@@ -621,6 +621,9 @@
+ #endif
+ #ifdef CONFIG_BRIDGE_NETFILTER
+@@ -533,10 +633,13 @@
+       skb_dst_set(new, dst_clone(skb_dst(old)));
+ #ifdef CONFIG_XFRM
        new->sp                 = secpath_get(old->sp);
  #endif
        memcpy(new->cb, old->cb, sizeof(old->cb));
@@ -1045,7 +1193,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
        new->csum               = old->csum;
        new->local_df           = old->local_df;
        new->pkt_type           = old->pkt_type;
-@@ -2664,6 +2753,13 @@
+       new->ip_summed          = old->ip_summed;
+       skb_copy_queue_mapping(new, old);
+@@ -2774,10 +2877,17 @@
+                                               (2*sizeof(struct sk_buff)) +
+                                               sizeof(atomic_t),
                                                0,
                                                SLAB_HWCACHE_ALIGN|SLAB_PANIC,
                                                NULL);
@@ -1059,12 +1211,16 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/core/skbuff.c linux-2.6.29.1-imq/net
  }
  
  /**
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/Kconfig linux-2.6.29.1-imq/net/netfilter/Kconfig
---- linux-2.6.29.1/net/netfilter/Kconfig       2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/netfilter/Kconfig   2009-04-12 22:28:22.376333314 +0300
-@@ -357,6 +357,18 @@
+  *    skb_to_sgvec - Fill a scatter-gather list from a socket buffer
+  *    @skb: Socket buffer containing the buffers to be mapped
+diff -U 5 -Nr linux-2.6.32/net/netfilter/Kconfig linux-2.6.32-imq/net/netfilter/Kconfig
+--- linux-2.6.32/net/netfilter/Kconfig 2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/netfilter/Kconfig     2009-12-11 14:16:42.681731014 +0200
+@@ -394,10 +394,22 @@
+           echo netfilter-ssh > /sys/class/leds/<ledname>/trigger
  
-         To compile it as a module, choose M here.  If unsure, say N.
+         For more information on the LEDs available on your system, see
+         Documentation/leds-class.txt
  
 +config NETFILTER_XT_TARGET_IMQ
 +        tristate '"IMQ" target support'
@@ -1081,21 +1237,29 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/Kconfig linux-2.6.29.1-imq
  config NETFILTER_XT_TARGET_MARK
        tristate '"MARK" target support'
        default m if NETFILTER_ADVANCED=n
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/Makefile linux-2.6.29.1-imq/net/netfilter/Makefile
---- linux-2.6.29.1/net/netfilter/Makefile      2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/netfilter/Makefile  2009-04-12 22:28:22.377333406 +0300
-@@ -45,6 +45,7 @@
+       help
+         This option adds a `MARK' target, which allows you to create rules
+diff -U 5 -Nr linux-2.6.32/net/netfilter/Makefile linux-2.6.32-imq/net/netfilter/Makefile
+--- linux-2.6.32/net/netfilter/Makefile        2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/netfilter/Makefile    2009-12-11 14:16:42.681731014 +0200
+@@ -44,10 +44,11 @@
+ obj-$(CONFIG_NETFILTER_XT_TARGET_CLASSIFY) += xt_CLASSIFY.o
+ obj-$(CONFIG_NETFILTER_XT_TARGET_CONNMARK) += xt_CONNMARK.o
+ obj-$(CONFIG_NETFILTER_XT_TARGET_CONNSECMARK) += xt_CONNSECMARK.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_DSCP) += xt_DSCP.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_HL) += xt_HL.o
- obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
 +obj-$(CONFIG_NETFILTER_XT_TARGET_IMQ) += xt_IMQ.o
+ obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_MARK) += xt_MARK.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_NFLOG) += xt_NFLOG.o
  obj-$(CONFIG_NETFILTER_XT_TARGET_NFQUEUE) += xt_NFQUEUE.o
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-imq/net/netfilter/nf_queue.c
---- linux-2.6.29.1/net/netfilter/nf_queue.c    2009-04-02 23:55:27.000000000 +0300
-+++ linux-2.6.29.1-imq/net/netfilter/nf_queue.c        2009-04-12 22:28:22.377333406 +0300
-@@ -20,6 +20,26 @@
+ obj-$(CONFIG_NETFILTER_XT_TARGET_NOTRACK) += xt_NOTRACK.o
+diff -U 5 -Nr linux-2.6.32/net/netfilter/nf_queue.c linux-2.6.32-imq/net/netfilter/nf_queue.c
+--- linux-2.6.32/net/netfilter/nf_queue.c      2009-12-03 05:51:21.000000000 +0200
++++ linux-2.6.32-imq/net/netfilter/nf_queue.c  2009-12-11 14:16:42.681731014 +0200
+@@ -18,10 +18,30 @@
+  */
+ static const struct nf_queue_handler *queue_handler[NFPROTO_NUMPROTO] __read_mostly;
  
  static DEFINE_MUTEX(queue_handler_mutex);
  
@@ -1122,7 +1286,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
  /* return EBUSY when somebody else is registered, return EEXIST if the
   * same handler is registered, return 0 in case of success. */
  int nf_register_queue_handler(u_int8_t pf, const struct nf_queue_handler *qh)
-@@ -80,7 +100,7 @@
+ {
+       int ret;
+@@ -78,11 +98,11 @@
+       synchronize_rcu();
  }
  EXPORT_SYMBOL_GPL(nf_unregister_queue_handlers);
  
@@ -1131,7 +1299,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
  {
        /* Release those devices we held, or Alexey will kill me. */
        if (entry->indev)
-@@ -100,6 +120,7 @@
+               dev_put(entry->indev);
+       if (entry->outdev)
+@@ -98,10 +118,11 @@
+       }
+ #endif
        /* Drop reference to owner of hook which queued us. */
        module_put(entry->elem->owner);
  }
@@ -1139,7 +1311,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
  
  /*
   * Any packet that leaves via this function must come back
-@@ -121,12 +142,26 @@
+  * through nf_reinject().
+  */
+@@ -119,16 +140,30 @@
+       struct net_device *physindev;
+       struct net_device *physoutdev;
  #endif
        const struct nf_afinfo *afinfo;
        const struct nf_queue_handler *qh;
@@ -1166,7 +1342,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
                goto err_unlock;
  
        afinfo = nf_get_afinfo(pf);
-@@ -145,6 +180,10 @@
+       if (!afinfo)
+               goto err_unlock;
+@@ -143,10 +178,14 @@
+               .pf     = pf,
+               .hook   = hook,
                .indev  = indev,
                .outdev = outdev,
                .okfn   = okfn,
@@ -1177,7 +1357,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
        };
  
        /* If it's going away, ignore hook. */
-@@ -170,8 +209,19 @@
+       if (!try_module_get(entry->elem->owner)) {
+               rcu_read_unlock();
+@@ -168,12 +207,23 @@
+               if (physoutdev)
+                       dev_hold(physoutdev);
        }
  #endif
        afinfo->saveroute(skb, entry);
@@ -1197,9 +1381,11 @@ diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/nf_queue.c linux-2.6.29.1-
        rcu_read_unlock();
  
        if (status < 0) {
-diff -uNr --exclude='*~' linux-2.6.29.1/net/netfilter/xt_IMQ.c linux-2.6.29.1-imq/net/netfilter/xt_IMQ.c
---- linux-2.6.29.1/net/netfilter/xt_IMQ.c      1970-01-01 02:00:00.000000000 +0200
-+++ linux-2.6.29.1-imq/net/netfilter/xt_IMQ.c  2009-04-12 23:07:10.900088430 +0300
+               nf_queue_entry_release_refs(entry);
+               goto err;
+diff -U 5 -Nr linux-2.6.32/net/netfilter/xt_IMQ.c linux-2.6.32-imq/net/netfilter/xt_IMQ.c
+--- linux-2.6.32/net/netfilter/xt_IMQ.c        1970-01-01 02:00:00.000000000 +0200
++++ linux-2.6.32-imq/net/netfilter/xt_IMQ.c    2009-12-11 14:16:42.681731014 +0200
 @@ -0,0 +1,73 @@
 +/*
 + * This target marks packets to be enqueued to an imq device
index 58cb2d84b41cc840121e465885627d10953b5d17..b3fac7598f0c5279607a1e220e53842f57fe2b8f 100644 (file)
 
 %define                basever         2.6.32
 %define                postver         .7
-%define                rel             1
+%define                rel             2
 
 %define                _enable_debug_packages                  0
 
@@ -233,7 +233,7 @@ Patch41:    kernel-ipvs-nfct.patch
 # http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
 Patch49:       kernel-zph.patch
 
-# based on http://www.linuximq.net/patchs/linux-2.6.29.1-imq-test2.diff
+# http://www.linuximq.net/patchs/linux-2.6.32-imq-test2.diff
 Patch50:       kernel-imq.patch
 
 # http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.28.patch.bz2
This page took 1.514988 seconds and 4 git commands to generate.