diff options
author | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-06-02 20:55:59 +0000 |
---|---|---|
committer | Chris Gianelloni <wolf31o2@gentoo.org> | 2008-06-02 20:55:59 +0000 |
commit | 92894ea3735c088cb8d50ec9dc12e741aba59fc4 (patch) | |
tree | d6ce5db63949765261a9fc97781fd3689574e5ba /net-misc | |
parent | fix tests, bug #216478 (diff) | |
download | gentoo-2-92894ea3735c088cb8d50ec9dc12e741aba59fc4.tar.gz gentoo-2-92894ea3735c088cb8d50ec9dc12e741aba59fc4.tar.bz2 gentoo-2-92894ea3735c088cb8d50ec9dc12e741aba59fc4.zip |
Version bump to 4.8.01.0640 for bug #202415. This ebuild has been re-worked to not use the Cisco driver_build.sh shell script and instead uses the Makefile provided to build the module.
(Portage version: 2.1.5.3)
Diffstat (limited to 'net-misc')
4 files changed, 473 insertions, 1 deletions
diff --git a/net-misc/cisco-vpnclient-3des/ChangeLog b/net-misc/cisco-vpnclient-3des/ChangeLog index 813907b6aa00..3043ccbf7505 100644 --- a/net-misc/cisco-vpnclient-3des/ChangeLog +++ b/net-misc/cisco-vpnclient-3des/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-misc/cisco-vpnclient-3des # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-misc/cisco-vpnclient-3des/ChangeLog,v 1.57 2008/02/05 02:37:10 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-misc/cisco-vpnclient-3des/ChangeLog,v 1.58 2008/06/02 20:55:58 wolf31o2 Exp $ + + 02 Jun 2008; Chris Gianelloni <wolf31o2@gentoo.org> + +files/4.8.01.0640-2.6.24.patch, +files/4.8.01.0640-amd64.patch: + Version bump to 4.8.01.0640 for bug #202415. This ebuild has been + re-worked to not use the Cisco driver_build.sh shell script and instead + uses the Makefile provided to build the module. 05 Feb 2008; Chris Gianelloni <wolf31o2@gentoo.org> files/2.6.24.patch: Fixing with the proper patch for 4.8.00 and closing bug #207536. diff --git a/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.01.0640.ebuild b/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.01.0640.ebuild new file mode 100644 index 000000000000..d36f4620440d --- /dev/null +++ b/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.01.0640.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/cisco-vpnclient-3des/cisco-vpnclient-3des-4.8.01.0640.ebuild,v 1.1 2008/06/02 20:55:58 wolf31o2 Exp $ + +inherit eutils linux-mod + +MY_PV=${PV}-k9 +TARBALL="vpnclient-linux-x86_64-${MY_PV}.tar.gz" + +DESCRIPTION="Cisco VPN Client (3DES)" +HOMEPAGE="http://cco.cisco.com/en/US/products/sw/secursw/ps2308/index.html" +#SRC_URI="vpnclient-linux-x86_64-${MY_PV}.tar.gz" +SRC_URI="http://tuxx-home.at/vpn/Linux/${TARBALL}" + +LICENSE="cisco-vpn-client" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" +IUSE="" +RESTRICT="strip" + +S=${WORKDIR}/vpnclient + +VPNDIR="/opt/cisco-vpnclient" +CFGDIR="/etc/${VPNDIR}" +OLDCFG="/etc/CiscoSystemsVPNClient" + +QA_TEXTRELS="${VPNDIR:1}/lib/libvpnapi.so" +QA_EXECSTACK="${VPNDIR:1}/lib/libvpnapi.so + ${VPNDIR:1}/bin/vpnclient + ${VPNDIR:1}/bin/cvpnd + ${VPNDIR:1}/bin/cisco_cert_mgr + ${VPNDIR:1}/bin/ipseclog" + +MODULE_NAMES="cisco_ipsec(CiscoVPN)" +BUILD_TARGETS="clean default" + +#pkg_nofetch() { +# einfo "Please visit:" +# einfo " ${HOMEPAGE}" +# einfo "and download ${A} to ${DISTDIR}" +#} + +src_unpack () { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${PV}-amd64.patch + epatch "${FILESDIR}"/${PV}-2.6.24.patch +} + +src_install() { + linux-mod_src_install +# newinitd ${FILESDIR}/vpnclient.rc vpnclient + + # Binaries + binaries="vpnclient ipseclog cisco_cert_mgr" + exeinto /opt/cisco-vpnclient/bin + exeopts -m0111 + doexe ${binaries} + exeopts -m4111 + doexe cvpnd + # Libraries + insinto /opt/cisco-vpnclient/lib + doins libvpnapi.so + # Includes + insinto /opt/cisco-vpnclient/include + doins vpnapi.h + + # Configuration files/profiles/etc + insinto ${CFGDIR} + doins vpnclient.ini + insinto ${CFGDIR}/Profiles + doins *.pcf + dodir ${CFGDIR}/Certificates + + # Make sure we keep these, even if they're empty. + keepdir ${CFGDIR}/Certificates + keepdir ${CFGDIR}/Profiles + + # Create some symlinks + dodir /usr/bin + for filename in ${binaries} + do + dosym ${VPNDIR}/bin/${filename} /usr/bin/${filename} + done +} + +pkg_postinst() { + linux-mod_pkg_postinst + if [ -e "${OLDCFG}" ] + then + elog "Found an old ${OLDCFG} configuration directory." + elog "Moving ${OLDCFG} files to ${CFGDIR}." + cp -pPR ${OLDCFG}/* ${CFGDIR} && rm -f ${OLDCFG} + fi + if [ -e "/etc/init.d/vpnclient" ] + then + elog "Removing /etc/init.d/vpnclient, which is no longer needed." + rm -f /etc/init.d/vpnclient + fi + runlevels=`rc-update show | grep vpnclient | cut -d\| -f2` + if [ -n "$runlevels" ] + then + elog "Removing 'vpnclient' from all runlevels." + rc-update del vpnclient + fi + elog "You will need to load the cisco_ipsec module before using the Cisco" + elog "VPN Client (vpnclient) application." +} diff --git a/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-2.6.24.patch b/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-2.6.24.patch new file mode 100644 index 000000000000..15402881341e --- /dev/null +++ b/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-2.6.24.patch @@ -0,0 +1,241 @@ +diff -r 469eaa76099e GenDefs.h +--- a/GenDefs.h Mon Apr 28 10:40:53 2008 +0200 ++++ b/GenDefs.h Mon Apr 28 10:47:51 2008 +0200 +@@ -105,6 +105,12 @@ typedef int32 intptr_t; + #define _INTPTR_T_DEFINED + #endif + ++/* uintptr_t has been defined in include/linux/types.h in 2.6.24. ++ * No need to define it here again (will only lead to compile errors) ++ * ++ * by Alexander Griesser <work@tuxx-home.at>, 2008-01-11 ++ */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) + #ifndef _UINTPTR_T_DEFINED + #if defined(_LP64) + #warning 64 bit +@@ -113,6 +119,7 @@ typedef uint32 uintptr_t; + typedef uint32 uintptr_t; + #endif + #define _UINTPTR_T_DEFINED ++#endif + #endif + + +diff -r 469eaa76099e Makefile +--- a/Makefile Mon Apr 28 10:40:53 2008 +0200 ++++ b/Makefile Mon Apr 28 10:47:51 2008 +0200 +@@ -12,7 +12,7 @@ SOURCE_OBJS := linuxcniapi.o frag.o IPSe + SOURCE_OBJS := linuxcniapi.o frag.o IPSecDrvOS_linux.o interceptor.o linuxkernelapi.o + + ifeq ($(SUBARCH),x86_64) +-CFLAGS += -mcmodel=kernel -mno-red-zone ++EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone + NO_SOURCE_OBJS := libdriver64.so + else + NO_SOURCE_OBJS := libdriver.so +diff -r 469eaa76099e interceptor.c +--- a/interceptor.c Mon Apr 28 10:40:53 2008 +0200 ++++ b/interceptor.c Mon Apr 28 10:47:51 2008 +0200 +@@ -28,6 +28,10 @@ + #include <linux/udp.h> + #include <net/protocol.h> + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++#include <net/net_namespace.h> ++#endif ++ + #include "linux_os.h" + + #include "vpn_ioctl_linux.h" +@@ -39,7 +43,7 @@ + + static uint8_t interceptor_eth_addr[] = { 0x00, 0x0b, 0xfc, 0xf8, 0x01, 0x8f }; + +-// packet statistics ++// packet statistics + static unsigned long tx_packets; + static unsigned long tx_dropped; + static unsigned long tx_bytes; +@@ -48,7 +52,13 @@ unsigned long rx_bytes; + unsigned long rx_bytes; + + /*methods of the cipsec network device*/ +-static int interceptor_init(struct net_device *); ++static ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++void ++#else ++int ++#endif ++interceptor_init(struct net_device *); + static struct net_device_stats *interceptor_stats(struct net_device *dev); + static int interceptor_ioctl(struct net_device *dev, struct ifreq *ifr, + int cmd); +@@ -82,12 +92,12 @@ struct packet_type_funcs + { + struct packet_type *pt; + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) +- int (*orig_handler_func) (struct sk_buff *, ++ int (*orig_handler_func) (struct sk_buff *, + struct net_device *, + struct packet_type *, + struct net_device *); + #else +- int (*orig_handler_func) (struct sk_buff *, ++ int (*orig_handler_func) (struct sk_buff *, + struct net_device *, + struct packet_type *); + #endif +@@ -107,16 +117,30 @@ static char interceptor_name[] = LINUX_V + + BINDING Bindings[MAX_INTERFACES]; + ++/* 2.6.24 handles net_devices a little bit different ++ * ++ * by Alexander Griesser <work@tuxx-home.at>, 2008-01-11 ++ */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++static struct net_device* interceptor_dev; ++#else + static struct net_device interceptor_dev = { + .name = interceptor_name, + .init = interceptor_init + }; ++#endif ++ + static struct notifier_block interceptor_notifier = { + .notifier_call = handle_netdev_event, + }; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +-static int ++static ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++void ++#else ++int ++#endif + #else + static int __init + #endif +@@ -133,8 +157,9 @@ interceptor_init(struct net_device *dev) + dev->flags |= IFF_NOARP; + dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); + kernel_memset(dev->broadcast, 0xFF, ETH_ALEN); +- +- return 0; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ++ return 0; ++#endif + } + + static struct net_device_stats * +@@ -270,7 +295,7 @@ add_netdev(struct net_device *dev) + Bindings[i].InjectReceive = original_ip_handler.orig_handler_func; + Bindings[i].pPT = original_ip_handler.pt; + +- rc = 0; ++ rc = 0; + + exit_gracefully: + return rc; +@@ -284,7 +309,7 @@ remove_netdev(struct net_device *dev) + b = getbindingbydev(dev); + + if (b) +- { ++ { + rc = 0; + dev->hard_start_xmit = b->InjectSend; + kernel_memset(b, 0, sizeof(BINDING)); +@@ -326,7 +351,7 @@ handle_vpnup(void) + } + /* find the handler for inbound IP packets by adding a dummy handler + * for that packet type into the kernel. Because the packet handlers +- * are stored in a hash table, we'll be able to pull the original ++ * are stored in a hash table, we'll be able to pull the original + * ip packet handler out of the list that dummy_pt was inserted into.*/ + kernel_memset(&dummy_pt, 0, sizeof(dummy_pt)); + dummy_pt.type = htons(ETH_P_IP); +@@ -363,7 +388,11 @@ handle_vpnup(void) + dp = NULL; + num_target_devices = 0; + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +- for_each_netdev(dp) ++ for_each_netdev( ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ &init_net, ++#endif ++ dp) + #else + for (dp = dev_base; dp != NULL; dp = dp->next) + #endif +@@ -494,7 +523,7 @@ getbindingbydev(struct net_device *dev) + getbindingbydev(struct net_device *dev) + { + int i; +- ++ + for (i=0; i <= MAX_INTERFACES; i++) + { + BINDING *b = &Bindings[i]; +@@ -522,13 +551,13 @@ build_ppp_fake_mac_frag(struct ethhdr *d + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) + static int + recv_ip_packet_handler(struct sk_buff *skb, +- struct net_device *dev, ++ struct net_device *dev, + struct packet_type *type, + struct net_device *orig_dev) + #else + static int + recv_ip_packet_handler(struct sk_buff *skb, +- struct net_device *dev, ++ struct net_device *dev, + struct packet_type *type) + #endif + { +@@ -932,15 +961,29 @@ interceptor_mod_init(void) + + rc = CniPluginLoad(&pcDeviceName, &PCNICallbackTable); + ++/* 2.6.24 needs to allocate each netdevice before registering it, otherwise ++ * the kernel BUG()s. ++ * ++ * by Alexander Griesser <work@tuxx-home.at>, 2008-01-11 ++ */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ if(! (interceptor_dev = alloc_netdev(sizeof(struct net_device), interceptor_name, interceptor_init))) ++ return 0; ++#endif ++ + if (CNI_IS_SUCCESS(rc)) + { + + CNICallbackTable = *PCNICallbackTable; + CniPluginDeviceCreated(); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ if ((status = register_netdev(interceptor_dev)) != 0) ++#else + if ((status = register_netdev(&interceptor_dev)) != 0) ++#endif + { + printk(KERN_INFO "%s: error %d registering device \"%s\".\n", +- LINUX_VPN_IFNAME, status, interceptor_dev.name); ++ LINUX_VPN_IFNAME, status, interceptor_name); + CniPluginUnload(); + + } +@@ -960,7 +1003,11 @@ interceptor_mod_cleanup(void) + cleanup_frag_queue(); + CniPluginUnload(); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) ++ unregister_netdev(interceptor_dev); ++#else + unregister_netdev(&interceptor_dev); ++#endif + unregister_netdevice_notifier(&interceptor_notifier); + + return; diff --git a/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-amd64.patch b/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-amd64.patch new file mode 100644 index 000000000000..015dc7b37311 --- /dev/null +++ b/net-misc/cisco-vpnclient-3des/files/4.8.01.0640-amd64.patch @@ -0,0 +1,116 @@ +diff -u -x '*.ko*' -x '*.o*' vpnclient/frag.c vpnclient_modified/frag.c +--- vpnclient/frag.c 2007-08-22 15:30:31.000000000 -0400 ++++ vpnclient_modified/frag.c 2008-01-11 01:41:19.000000000 -0500 +@@ -22,7 +22,11 @@ + #include "frag.h" + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++#ifdef NET_SKBUFF_DATA_USES_OFFSET ++#define SKB_IPHDR(skb) ((struct iphdr*)(skb->head + skb->network_header)) ++#else + #define SKB_IPHDR(skb) ((struct iphdr*)skb->network_header) ++#endif + #else + #define SKB_IPHDR(skb) skb->nh.iph + #endif +diff -u -x '*.ko*' -x '*.o*' vpnclient/interceptor.c vpnclient_modified/interceptor.c +--- vpnclient/interceptor.c 2007-08-22 15:30:31.000000000 -0400 ++++ vpnclient_modified/interceptor.c 2008-01-11 02:04:01.000000000 -0500 +@@ -636,7 +636,11 @@ + #endif + { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ hard_header_len = skb->data - (skb->head + skb->mac_header); ++ #else + hard_header_len = skb->data - skb->mac_header; ++ #endif + #else + hard_header_len = skb->data - skb->mac.raw; + #endif +@@ -657,7 +661,11 @@ + { + case ETH_HLEN: + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ CniNewFragment(ETH_HLEN, skb->head + skb->mac_header, &MacHdr, CNI_USE_BUFFER); ++ #else + CniNewFragment(ETH_HLEN, skb->mac_header, &MacHdr, CNI_USE_BUFFER); ++ #endif + #else + CniNewFragment(ETH_HLEN, skb->mac.raw, &MacHdr, CNI_USE_BUFFER); + #endif +@@ -667,7 +675,7 @@ + MacHdr = build_ppp_fake_mac_frag(&ppp_dummy_buf); + break; + default: +- printk(KERN_DEBUG "unknown mac header length (%d)\n", hard_header_len); ++ printk(KERN_DEBUG "unknown mac header length (%d) CniNewFragment\n", hard_header_len); + dev_kfree_skb(skb); + skb = NULL; + goto exit_gracefully; +@@ -775,7 +783,12 @@ + #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + reset_inject_status(&pBinding->send_stat); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +- hard_header_len = skb->network_header - skb->data; ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ hard_header_len = ++ (skb->head + skb->network_header) - skb->data; ++ #else ++ hard_header_len = skb->network_header - skb->data; ++ #endif + #else + hard_header_len = skb->nh.raw - skb->data; + #endif +diff -u -x '*.ko*' -x '*.o*' vpnclient/linuxcniapi.c vpnclient_modified/linuxcniapi.c +--- vpnclient/linuxcniapi.c 2007-08-22 15:30:31.000000000 -0400 ++++ vpnclient_modified/linuxcniapi.c 2008-01-11 01:41:19.000000000 -0500 +@@ -338,8 +338,13 @@ + skb->ip_summed = CHECKSUM_UNNECESSARY; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +- skb->network_header = (sk_buff_data_t) skb->data; +- skb->mac_header = (sk_buff_data_t)pMac; ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ skb->network_header = (sk_buff_data_t) (skb->data - skb->head); ++ skb->mac_header = (sk_buff_data_t) (pMac - skb->head); ++ #else ++ skb->network_header = (sk_buff_data_t) skb->data; ++ skb->mac_header = (sk_buff_data_t)pMac; ++ #endif + #else + skb->nh.iph = (struct iphdr *) skb->data; + skb->mac.raw = pMac; +@@ -478,8 +483,13 @@ + skb->dev = pBinding->pDevice; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +- skb->mac_header = (sk_buff_data_t)pMac; +- skb->network_header = (sk_buff_data_t)pIP; ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ skb->mac_header = (sk_buff_data_t)(pMac - skb->head); ++ skb->network_header = (sk_buff_data_t)(pIP - skb->head); ++ #else ++ skb->mac_header = (sk_buff_data_t)pMac; ++ skb->network_header = (sk_buff_data_t)pIP; ++ #endif + #else + skb->mac.raw = pMac; + skb->nh.raw = pIP; +@@ -487,8 +497,13 @@ + + /*ip header length is in 32bit words */ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +- skb->transport_header = (sk_buff_data_t) +- (pIP + (((struct iphdr*)(skb->network_header))->ihl * 4)); ++ #ifdef NET_SKBUFF_DATA_USES_OFFSET ++ skb->transport_header = (sk_buff_data_t) ++ ((pIP + (((struct iphdr*)(skb->head + skb->network_header))->ihl * 4)) - skb->head); ++ #else ++ skb->transport_header = (sk_buff_data_t) ++ (pIP + (((struct iphdr*)(skb->network_header))->ihl * 4)); ++ #endif + #else + skb->h.raw = pIP + (skb->nh.iph->ihl * 4); + #endif |