lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1322042318-4809-1-git-send-email-zwu.kernel@gmail.com>
Date:	Wed, 23 Nov 2011 17:58:38 +0800
From:	Zhi Yong Wu <zwu.kernel@...il.com>
To:	dev@...nvswitch.org
Cc:	netdev@...r.kernel.org, stefanha@...il.com, aliguori@...ibm.com,
	Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
Subject: [PATCH] datapath: Fix build breakage on kernel 2.6.40

From: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>

Today i played with openvswitch on my workstation with kernel 2.6.40 and found that it break when i built. The issue is introduced by commit ceb176fdb72bb7ce90debc66e1eeb1d25823d30a

Below is the error log.

                 from /home/zwu/work/virt/openvswitch/datapath/linux/genetlink-brcompat.c:10:
/home/zwu/work/virt/openvswitch/datapath/linux/compat/include/linux/skbuff.h:243:20: error: redefinition of ‘skb_reset_mac_len’
include/linux/skbuff.h:1259:20: note: previous definition of ‘skb_reset_mac_len’ was here
make[5]: *** [/home/zwu/work/virt/openvswitch/datapath/linux/genetlink-brcompat.o] Error 1
make[4]: *** [_module_/home/zwu/work/virt/openvswitch/datapath/linux] Error 2
make[4]: Leaving directory `/usr/src/kernels/2.6.40.6-0.fc15.x86_64'
make[3]: *** [default] Error 2
make[3]: Leaving directory `/home/zwu/work/virt/openvswitch/datapath/linux'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/zwu/work/virt/openvswitch/datapath'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zwu/work/virt/openvswitch'
make: *** [all] Error 2

After this patch is applied, i can successfully do one build and be happy to see that multiple VMs can communicate with each other.


Signed-off-by: Zhi Yong Wu <wuzhy@...ux.vnet.ibm.com>
---
 acinclude.m4                                 |    2 ++
 datapath/linux/compat/include/linux/skbuff.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 648132a..32cdf17 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -233,6 +233,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_cow_head])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_transport_header],
                   [OVS_DEFINE([HAVE_SKBUFF_HEADER_HELPERS])])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_mac_len],
+                  [OVS_DEFINE([HAVE_SKB_RESET_MAC_LEN])])
   OVS_GREP_IFELSE([$KSRC/include/linux/icmpv6.h], [icmp6_hdr],
                   [OVS_DEFINE([HAVE_ICMP6_HDR])])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_warn_if_lro],
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index 311bfdb..22ba2e6 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -239,7 +239,7 @@ static inline struct page *skb_frag_page(const skb_frag_t *frag)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
+#ifndef HAVE_SKB_RESET_MAC_LEN
 static inline void skb_reset_mac_len(struct sk_buff *skb)
 {
 	skb->mac_len = skb->network_header - skb->mac_header;
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ