[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] Backport netfilter bug fix from 2.6.19.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193059747 -3600
# Node ID 709db80c03c3d7606744a71f48f5186358a5e659
# Parent  ba49878d835958bd464a5853b4a8bddaf10101fb
Backport netfilter bug fix from 2.6.19.
Signed-off-by: Kieran Mansley <kmansley@xxxxxxxxxxxxxx>
---
 include/linux/netfilter_bridge.h |   14 +++++++++-----
 net/bridge/br_netfilter.c        |    4 ++--
 2 files changed, 11 insertions(+), 7 deletions(-)

diff -r ba49878d8359 -r 709db80c03c3 include/linux/netfilter_bridge.h
--- a/include/linux/netfilter_bridge.h  Fri Oct 19 18:08:30 2007 +0100
+++ b/include/linux/netfilter_bridge.h  Mon Oct 22 14:29:07 2007 +0100
@@ -7,6 +7,7 @@
 #include <linux/netfilter.h>
 #if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
 #include <linux/if_ether.h>
+#include <linux/if_vlan.h>
 #endif
 
 /* Bridge Hooks */
@@ -54,16 +55,19 @@ int nf_bridge_maybe_copy_header(struct s
 
        if (skb->nf_bridge) {
                if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
-                       err = skb_cow(skb, 18);
+                       int header_size = ETH_HLEN + VLAN_HLEN;
+
+                       err = skb_cow(skb, header_size);
                        if (err)
                                return err;
-                       memcpy(skb->data - 18, skb->nf_bridge->data, 18);
-                       skb_push(skb, 4);
+                       memcpy(skb->data - header_size, skb->nf_bridge->data,
+                              header_size);
+                       skb_push(skb, VLAN_HLEN);
                } else {
-                       err = skb_cow(skb, 16);
+                       err = skb_cow(skb, ETH_HLEN);
                        if (err)
                                return err;
-                       memcpy(skb->data - 16, skb->nf_bridge->data, 16);
+                       memcpy(skb->data - ETH_HLEN, skb->nf_bridge->data, 
ETH_HLEN);
                }
        }
        return 0;
diff -r ba49878d8359 -r 709db80c03c3 net/bridge/br_netfilter.c
--- a/net/bridge/br_netfilter.c Fri Oct 19 18:08:30 2007 +0100
+++ b/net/bridge/br_netfilter.c Mon Oct 22 14:29:07 2007 +0100
@@ -127,10 +127,10 @@ static inline struct nf_bridge_info *nf_
 
 static inline void nf_bridge_save_header(struct sk_buff *skb)
 {
-        int header_size = 16;
+        int header_size = ETH_HLEN;
 
        if (skb->protocol == htons(ETH_P_8021Q))
-               header_size = 18;
+               header_size += VLAN_HLEN;
 
        memcpy(skb->nf_bridge->data, skb->data - header_size, header_size);
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.