diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-08 22:51:41 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-08 22:51:41 +0200 |
commit | 1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e (patch) | |
tree | a21a5fc103bb3bd65ecd85ed22be5228fc54e447 /meta-networking | |
download | meta-openembedded-1219bf8a90a7bf8cd3a5363551ef635d51e8fc8e.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking')
350 files changed, 17977 insertions, 0 deletions
diff --git a/meta-networking/COPYING.MIT b/meta-networking/COPYING.MIT new file mode 100644 index 000000000..fb950dc69 --- /dev/null +++ b/meta-networking/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/meta-networking/MAINTAINERS b/meta-networking/MAINTAINERS new file mode 100644 index 000000000..82f9dcc32 --- /dev/null +++ b/meta-networking/MAINTAINERS | |||
@@ -0,0 +1,37 @@ | |||
1 | This file contains a list of maintainers for the meta-networking layer. | ||
2 | |||
3 | Please submit any patches against meta-networking to the OpenEmbedded | ||
4 | development mailing list (openembedded-devel@lists.openembedded.org) with | ||
5 | '[meta-networking][dizzy]' in the subject. | ||
6 | |||
7 | When sending single patches, please use something like: | ||
8 | |||
9 | git send-email -1 -M \ | ||
10 | --to openembedded-devel@lists.openembedded.org \ | ||
11 | --subject-prefix=meta-networking][dizzy][PATCH | ||
12 | |||
13 | You may also contact the maintainers directly. | ||
14 | |||
15 | Descriptions of section entries: | ||
16 | |||
17 | M: Mail patches to: FullName <address@domain> | ||
18 | F: Files and directories with wildcard patterns. | ||
19 | A trailing slash includes all files and subdirectory files. | ||
20 | F: recipes-devtools/ all files in and below recipes-devtools | ||
21 | F: recipes-selinux/* all files in recipes-selinux, but not below | ||
22 | One pattern per line. Multiple F: lines acceptable. | ||
23 | |||
24 | Please keep this list in alphabetical order. | ||
25 | |||
26 | Maintainers List (try to look for most precise areas first) | ||
27 | |||
28 | Dizzy branch maintainers: | ||
29 | Otavio Salvador <otavio@ossystems.com.br> | ||
30 | Armin Kuster <akuster808@gmail.com> | ||
31 | |||
32 | Prefix email subject with: [dizzy] | ||
33 | |||
34 | COMMON | ||
35 | M: Joe MacDonald <joe_macdonald@mentor.com> | ||
36 | F: conf | ||
37 | F: recipes-* | ||
diff --git a/meta-networking/README b/meta-networking/README new file mode 100644 index 000000000..383a0281a --- /dev/null +++ b/meta-networking/README | |||
@@ -0,0 +1,40 @@ | |||
1 | meta-networking | ||
2 | =============== | ||
3 | |||
4 | This layer is intended to be a central point for networking-related | ||
5 | packages and configuration. It should be useful directly on top of | ||
6 | oe-core and compliments meta-openembedded. It should be primarily useful | ||
7 | to the following groups: | ||
8 | |||
9 | - Anyone building a small networking device (eg. a home router / | ||
10 | bridge / switch). | ||
11 | |||
12 | - Anyone wanting to add network services to their device (eg. | ||
13 | anything that might benefit from a small ftp/tftp server) | ||
14 | |||
15 | Dependencies | ||
16 | ------------ | ||
17 | |||
18 | This layer depends on: | ||
19 | |||
20 | URI: git://github.com/openembedded/openembedded-core.git | ||
21 | branch: dizzy | ||
22 | revision: HEAD | ||
23 | |||
24 | For some recipes, the meta-oe layer is required: | ||
25 | |||
26 | URI: git://github.com/openembedded/meta-openembedded.git | ||
27 | subdirectory: meta-oe | ||
28 | branch: dizzy | ||
29 | revision: HEAD | ||
30 | |||
31 | URI: git://github.com/openembedded/meta-openembedded.git | ||
32 | subdirectory: meta-python | ||
33 | branch: dizzy | ||
34 | revision: HEAD | ||
35 | |||
36 | Maintenance | ||
37 | ----------- | ||
38 | |||
39 | Please see the MAINTAINERS file for information on contacting the | ||
40 | maintainers of this layer, as well as instructions for submitting patches. | ||
diff --git a/meta-networking/conf/layer.conf b/meta-networking/conf/layer.conf new file mode 100644 index 000000000..d99d738be --- /dev/null +++ b/meta-networking/conf/layer.conf | |||
@@ -0,0 +1,20 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # We have a packages directory, add to BBFILES | ||
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
6 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "networking-layer" | ||
9 | BBFILE_PATTERN_networking-layer := "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_networking-layer = "5" | ||
11 | |||
12 | # This should only be incremented on significant changes that will | ||
13 | # cause compatibility issues with other layers | ||
14 | LAYERVERSION_networking-layer = "1" | ||
15 | |||
16 | LAYERDEPENDS_networking-layer = "core" | ||
17 | LAYERDEPENDS_networking-layer = "openembedded-layer" | ||
18 | LAYERDEPENDS_networking-layer = "meta-python" | ||
19 | |||
20 | LICENSE_PATH += "${LAYERDIR}/licenses" | ||
diff --git a/meta-networking/licenses/DMTF b/meta-networking/licenses/DMTF new file mode 100644 index 000000000..54a28120e --- /dev/null +++ b/meta-networking/licenses/DMTF | |||
@@ -0,0 +1,34 @@ | |||
1 | // Copyright 1998-2008 Distributed Management Task Force, Inc. (DMTF). | ||
2 | // All rights reserved. | ||
3 | // DMTF is a not-for-profit association of industry members dedicated | ||
4 | // to promoting enterprise and systems management and interoperability. | ||
5 | // DMTF specifications and documents may be reproduced by | ||
6 | // members and non-members, provided that correct attribution is given. | ||
7 | // As DMTF specifications may be revised from time to time, | ||
8 | // the particular version and release date should always be noted. | ||
9 | // | ||
10 | // Implementation of certain elements of this standard or proposed | ||
11 | // standard may be subject to third party patent rights, including | ||
12 | // provisional patent rights (herein "patent rights"). DMTF makes | ||
13 | // no representations to users of the standard as to the existence | ||
14 | // of such rights, and is not responsible to recognize, disclose, or | ||
15 | // identify any or all such third party patent right, owners or | ||
16 | // claimants, nor for any incomplete or inaccurate identification or | ||
17 | // disclosure of such rights, owners or claimants. DMTF shall have no | ||
18 | // liability to any party, in any manner or circumstance, under any | ||
19 | // legal theory whatsoever, for failure to recognize, disclose, or | ||
20 | // identify any such third party patent rights, or for such party's | ||
21 | // reliance on the standard or incorporation thereof in its product, | ||
22 | // protocols or testing procedures. DMTF shall have no liability to | ||
23 | // any party implementing such standard, whether such implementation | ||
24 | // is foreseeable or not, nor to any patent owner or claimant, and shall | ||
25 | // have no liability or responsibility for costs or losses incurred if | ||
26 | // a standard is withdrawn or modified after publication, and shall be | ||
27 | // indemnified and held harmless by any party implementing the | ||
28 | // standard from any and all claims of infringement by a patent owner | ||
29 | // for such implementations. | ||
30 | // | ||
31 | // For information about patents held by third-parties which have | ||
32 | // notified the DMTF that, in their opinion, such patent may relate to | ||
33 | // or impact implementations of DMTF standards, visit | ||
34 | // http://www.dmtf.org/about/policies/disclosures.php. | ||
diff --git a/meta-networking/licenses/netperf b/meta-networking/licenses/netperf new file mode 100644 index 000000000..3f3ceb2fc --- /dev/null +++ b/meta-networking/licenses/netperf | |||
@@ -0,0 +1,43 @@ | |||
1 | |||
2 | |||
3 | Copyright (C) 1993 Hewlett-Packard Company | ||
4 | ALL RIGHTS RESERVED. | ||
5 | |||
6 | The enclosed software and documentation includes copyrighted works | ||
7 | of Hewlett-Packard Co. For as long as you comply with the following | ||
8 | limitations, you are hereby authorized to (i) use, reproduce, and | ||
9 | modify the software and documentation, and to (ii) distribute the | ||
10 | software and documentation, including modifications, for | ||
11 | non-commercial purposes only. | ||
12 | |||
13 | 1. The enclosed software and documentation is made available at no | ||
14 | charge in order to advance the general development of | ||
15 | high-performance networking products. | ||
16 | |||
17 | 2. You may not delete any copyright notices contained in the | ||
18 | software or documentation. All hard copies, and copies in | ||
19 | source code or object code form, of the software or | ||
20 | documentation (including modifications) must contain at least | ||
21 | one of the copyright notices. | ||
22 | |||
23 | 3. The enclosed software and documentation has not been subjected | ||
24 | to testing and quality control and is not a Hewlett-Packard Co. | ||
25 | product. At a future time, Hewlett-Packard Co. may or may not | ||
26 | offer a version of the software and documentation as a product. | ||
27 | |||
28 | 4. THE SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS". | ||
29 | HEWLETT-PACKARD COMPANY DOES NOT WARRANT THAT THE USE, | ||
30 | REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR | ||
31 | DOCUMENTATION WILL NOT INFRINGE A THIRD PARTY'S INTELLECTUAL | ||
32 | PROPERTY RIGHTS. HP DOES NOT WARRANT THAT THE SOFTWARE OR | ||
33 | DOCUMENTATION IS ERROR FREE. HP DISCLAIMS ALL WARRANTIES, | ||
34 | EXPRESS AND IMPLIED, WITH REGARD TO THE SOFTWARE AND THE | ||
35 | DOCUMENTATION. HP SPECIFICALLY DISCLAIMS ALL WARRANTIES OF | ||
36 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
37 | |||
38 | 5. HEWLETT-PACKARD COMPANY WILL NOT IN ANY EVENT BE LIABLE FOR ANY | ||
39 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES | ||
40 | (INCLUDING LOST PROFITS) RELATED TO ANY USE, REPRODUCTION, | ||
41 | MODIFICATION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION. | ||
42 | |||
43 | |||
diff --git a/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb b/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb new file mode 100644 index 000000000..0bb899860 --- /dev/null +++ b/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb | |||
@@ -0,0 +1,38 @@ | |||
1 | SUMMARY = "Wireless Central Regulatory Domain Agent" | ||
2 | HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA" | ||
3 | |||
4 | LICENSE = "ISC" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c" | ||
6 | |||
7 | |||
8 | DEPENDS = "python-m2crypto-native python-native libgcrypt libnl" | ||
9 | |||
10 | SRC_URI = "http://wireless.kernel.org/download/crda/${BP}.tar.bz2;name=crda \ | ||
11 | http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/2013.01.11-regulatory.bin;name=bin \ | ||
12 | " | ||
13 | SRC_URI[crda.md5sum] = "29579185e06a75675507527243d28e5c" | ||
14 | SRC_URI[crda.sha256sum] = "aa8a7fe92f0765986c421a5b6768a185375ac210393df0605ee132f6754825f0" | ||
15 | SRC_URI[bin.md5sum] = "e0c8a5ca63fb8bf803213f9a0c90b50b" | ||
16 | SRC_URI[bin.sha256sum] = "b1ee0b20c123c612dfdb6851ab42c01666f66fb583e0e590942f19bb54cf84be" | ||
17 | |||
18 | inherit python-dir pythonnative | ||
19 | # Recursive make problem | ||
20 | EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D}" | ||
21 | |||
22 | do_compile() { | ||
23 | oe_runmake all_noverify | ||
24 | } | ||
25 | |||
26 | do_install() { | ||
27 | oe_runmake SBINDIR=${sbindir}/ install | ||
28 | |||
29 | install -d ${D}${libdir}/crda/ | ||
30 | |||
31 | install -m 0644 ${WORKDIR}/2013.01.11-regulatory.bin ${D}${libdir}/crda/regulatory.bin | ||
32 | } | ||
33 | |||
34 | |||
35 | RDEPENDS_${PN} = "udev" | ||
36 | FILES_${PN} += "${libdir}crda/regulatory.bin \ | ||
37 | ${base_libdir}/udev/rules.d/85-regulatory.rules \ | ||
38 | " | ||
diff --git a/meta-networking/recipes-connectivity/cyassl/cyassl_3.1.0.bb b/meta-networking/recipes-connectivity/cyassl/cyassl_3.1.0.bb new file mode 100644 index 000000000..e3edab6f1 --- /dev/null +++ b/meta-networking/recipes-connectivity/cyassl/cyassl_3.1.0.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "CyaSSL Embedded SSL Library" | ||
2 | DESCRIPTION = "CyaSSL is a lightweight SSL library written in C and \ | ||
3 | optimized for embedded and RTOS environments. It can be \ | ||
4 | Up to 20 times smaller than OpenSSL while still supporting \ | ||
5 | a full TLS 1.2 client and server." | ||
6 | HOMEPAGE = "http://www.yassl.com/yaSSL/Products-cyassl.html" | ||
7 | BUGTRACKER = "http://github.com/cyassl/cyassl/issues" | ||
8 | SECTION = "libs/network" | ||
9 | LICENSE = "GPLv2" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
11 | |||
12 | SRC_URI = "http://www.yassl.com/${BP}.zip" | ||
13 | |||
14 | SRC_URI[md5sum] = "72477eb50697e759d309c49cb1aef18a" | ||
15 | SRC_URI[sha256sum] = "85a79009d2a7468910dfb1e4b975e0b00a42c695f4f1a2adc16d2507b5d0b03e" | ||
16 | |||
17 | inherit autotools | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/fix-disable-ipv6.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/fix-disable-ipv6.patch new file mode 100644 index 000000000..bd3ae476b --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/fix-disable-ipv6.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Upstream: http://www.mail-archive.com/bug-inetutils@gnu.org/msg02103.html | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | diff -ur inetutils-1.8.orig/ping/ping_common.h inetutils-1.8/ping/ping_common.h | ||
6 | --- inetutils-1.8.orig/ping/ping_common.h 2010-05-15 20:55:47.000000000 +0930 | ||
7 | +++ inetutils-1.8/ping/ping_common.h 2010-12-01 12:19:08.000000000 +1030 | ||
8 | @@ -17,10 +17,14 @@ | ||
9 | You should have received a copy of the GNU General Public License | ||
10 | along with this program. If not, see `http://www.gnu.org/licenses/'. */ | ||
11 | |||
12 | +#include <config.h> | ||
13 | + | ||
14 | #include <netinet/in_systm.h> | ||
15 | #include <netinet/in.h> | ||
16 | #include <netinet/ip.h> | ||
17 | +#ifdef HAVE_IPV6 | ||
18 | #include <netinet/icmp6.h> | ||
19 | +#endif | ||
20 | #include <icmp.h> | ||
21 | #include <error.h> | ||
22 | #include <progname.h> | ||
23 | @@ -66,13 +70,19 @@ | ||
24 | (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\ | ||
25 | } while (0) | ||
26 | |||
27 | +#ifdef HAVE_IPV6 | ||
28 | /* Not sure about this step*/ | ||
29 | #define _PING_BUFLEN(p, USE_IPV6) ((USE_IPV6)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \ | ||
30 | ((p)->ping_datalen + sizeof (icmphdr_t))) | ||
31 | +#else | ||
32 | +#define _PING_BUFLEN(p, USE_IPV6) ((p)->ping_datalen + sizeof (icmphdr_t)) | ||
33 | +#endif | ||
34 | |||
35 | +#ifdef HAVE_IPV6 | ||
36 | typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest, | ||
37 | struct sockaddr_in6 * from, struct icmp6_hdr * icmp, | ||
38 | int datalen); | ||
39 | +#endif | ||
40 | |||
41 | typedef int (*ping_efp) (int code, | ||
42 | void *closure, | ||
43 | @@ -81,13 +91,17 @@ | ||
44 | struct ip * ip, icmphdr_t * icmp, int datalen); | ||
45 | |||
46 | union event { | ||
47 | +#ifdef HAVE_IPV6 | ||
48 | ping_efp6 handler6; | ||
49 | +#endif | ||
50 | ping_efp handler; | ||
51 | }; | ||
52 | |||
53 | union ping_address { | ||
54 | struct sockaddr_in ping_sockaddr; | ||
55 | +#ifdef HAVE_IPV6 | ||
56 | struct sockaddr_in6 ping_sockaddr6; | ||
57 | +#endif | ||
58 | }; | ||
59 | |||
60 | typedef struct ping_data PING; | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch new file mode 100644 index 000000000..3da4e9f55 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 552a7d64ad4a7188a9b7cd89933ae7caf7ebfe90 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Frysinger <vapier at gentoo.org> | ||
3 | Date: Thu, 18 Nov 2010 16:59:14 -0500 | ||
4 | Subject: [PATCH gnulib] printf-parse: pull in features.h for __GLIBC__ | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Mike Frysinger <vapier at gentoo.org> | ||
9 | --- | ||
10 | lib/printf-parse.h | 3 +++ | ||
11 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/lib/printf-parse.h b/lib/printf-parse.h | ||
14 | index 67a4a2a..3bd6152 100644 | ||
15 | --- a/lib/printf-parse.h | ||
16 | +++ b/lib/printf-parse.h | ||
17 | @@ -25,6 +25,9 @@ | ||
18 | |||
19 | #include "printf-args.h" | ||
20 | |||
21 | +#ifdef HAVE_FEATURES_H | ||
22 | +# include <features.h> /* for __GLIBC__ */ | ||
23 | +#endif | ||
24 | |||
25 | /* Flags */ | ||
26 | #define FLAG_GROUP 1 /* ' flag */ | ||
27 | -- | ||
28 | 1.7.3.2 | ||
29 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0003-wchar.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0003-wchar.patch new file mode 100644 index 000000000..b13bb9229 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.8-0003-wchar.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | --- inetutils-1.8/lib/wchar.in.h | ||
4 | +++ inetutils-1.8/lib/wchar.in.h | ||
5 | @@ -70,6 +70,9 @@ | ||
6 | /* The include_next requires a split double-inclusion guard. */ | ||
7 | #if @HAVE_WCHAR_H@ | ||
8 | # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ | ||
9 | +#else | ||
10 | +# include <stddef.h> | ||
11 | +# define MB_CUR_MAX 1 | ||
12 | #endif | ||
13 | |||
14 | #undef _GL_ALREADY_INCLUDING_WCHAR_H | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.9-PATH_PROCNET_DEV.patch new file mode 100644 index 000000000..2592989a9 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/inetutils-1.9-PATH_PROCNET_DEV.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | inetutils: define PATH_PROCNET_DEV if not already defined | ||
2 | |||
3 | this prevents the following compilation error : | ||
4 | system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function) | ||
5 | |||
6 | this patch comes from : | ||
7 | http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/ | ||
8 | |||
9 | Upstream-Status: Inappropriate [not author] | ||
10 | |||
11 | Signed-of-by: Eric Bénard <eric@eukrea.com> | ||
12 | --- | ||
13 | diff -Naur inetutils-1.9.orig/ifconfig/system/linux.c inetutils-1.9/ifconfig/system/linux.c | ||
14 | --- inetutils-1.9.orig/ifconfig/system/linux.c 2012-01-04 16:31:36.000000000 -0500 | ||
15 | +++ inetutils-1.9/ifconfig/system/linux.c 2012-01-04 16:40:53.000000000 -0500 | ||
16 | @@ -49,6 +49,10 @@ | ||
17 | #include "../ifconfig.h" | ||
18 | |||
19 | |||
20 | +#ifndef PATH_PROCNET_DEV | ||
21 | + #define PATH_PROCNET_DEV "/proc/net/dev" | ||
22 | +#endif | ||
23 | + | ||
24 | /* ARPHRD stuff. */ | ||
25 | |||
26 | static void | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rexec.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rexec.xinetd.inetutils new file mode 100644 index 000000000..80aed36ff --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rexec.xinetd.inetutils | |||
@@ -0,0 +1,20 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Rexecd is the server for the rexec program. The server provides remote | ||
4 | # execution facilities with authentication based on user names and | ||
5 | # passwords. | ||
6 | # | ||
7 | service exec | ||
8 | { | ||
9 | socket_type = stream | ||
10 | protocol = tcp | ||
11 | flags = NAMEINARGS | ||
12 | wait = no | ||
13 | user = root | ||
14 | group = root | ||
15 | log_on_success += USERID | ||
16 | log_on_failure += USERID | ||
17 | server = /usr/bin/tcpd | ||
18 | server_args = /usr/sbin/in.rexecd | ||
19 | disable = yes | ||
20 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rlogin.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rlogin.xinetd.inetutils new file mode 100644 index 000000000..00dbf935b --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rlogin.xinetd.inetutils | |||
@@ -0,0 +1,23 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Rlogind is a server for the rlogin program. The server provides remote | ||
4 | # execution with authentication based on privileged port numbers from trusted | ||
5 | # host | ||
6 | # | ||
7 | service login | ||
8 | { | ||
9 | socket_type = stream | ||
10 | protocol = tcp | ||
11 | flags = NAMEINARGS | ||
12 | wait = no | ||
13 | user = root | ||
14 | group = root | ||
15 | log_on_success += USERID | ||
16 | log_on_failure += USERID | ||
17 | server = /usr/bin/tcpd | ||
18 | server_args = /usr/sbin/in.rlogind -a | ||
19 | disable = yes | ||
20 | } | ||
21 | |||
22 | |||
23 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rsh.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rsh.xinetd.inetutils new file mode 100644 index 000000000..ad59b6207 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/rsh.xinetd.inetutils | |||
@@ -0,0 +1,21 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # The rshd server is a server for the rcmd(3) routine and, | ||
4 | # consequently, for the rsh(1) program. The server provides | ||
5 | # remote execution facilities with authentication based on | ||
6 | # privileged port numbers from trusted hosts. | ||
7 | # | ||
8 | service shell | ||
9 | { | ||
10 | socket_type = stream | ||
11 | protocol = tcp | ||
12 | flags = NAMEINARGS | ||
13 | wait = no | ||
14 | user = root | ||
15 | group = root | ||
16 | log_on_success += USERID | ||
17 | log_on_failure += USERID | ||
18 | server = /usr/bin/tcpd | ||
19 | server_args = /usr/sbin/in.rshd -aL | ||
20 | disable = yes | ||
21 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/telnet.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/telnet.xinetd.inetutils new file mode 100644 index 000000000..2a2a12e3a --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/telnet.xinetd.inetutils | |||
@@ -0,0 +1,13 @@ | |||
1 | # default: on | ||
2 | # description: The telnet server serves telnet sessions; it uses \ | ||
3 | # unencrypted username/password pairs for authentication. | ||
4 | service telnet | ||
5 | { | ||
6 | disable = no | ||
7 | flags = REUSE | ||
8 | socket_type = stream | ||
9 | wait = no | ||
10 | user = root | ||
11 | server = /usr/sbin/in.telnetd | ||
12 | log_on_failure += USERID | ||
13 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/tftpd.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/tftpd.xinetd.inetutils new file mode 100644 index 000000000..f54916339 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/tftpd.xinetd.inetutils | |||
@@ -0,0 +1,19 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Tftpd is a server which supports the Internet Trivial File Transfer | ||
4 | # Pro-tocol (RFC 783). The TFTP server operates at the port indicated | ||
5 | # in the tftp service description; see services(5). | ||
6 | # | ||
7 | service tftp | ||
8 | { | ||
9 | disable = yes | ||
10 | socket_type = dgram | ||
11 | protocol = udp | ||
12 | flags = IPv6 | ||
13 | wait = yes | ||
14 | user = root | ||
15 | group = root | ||
16 | server = /usr/sbin/in.tftpd | ||
17 | server_args = /tftpboot | ||
18 | } | ||
19 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/version.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/version.patch new file mode 100644 index 000000000..1caa2d39d --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.2/version.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | remove m4_esyscmd function | ||
4 | |||
5 | Signed-off-by: Chunrong Guo <b40290@freescale.com> | ||
6 | --- inetutils-1.9.1/configure.ac 2012-01-06 22:05:05.000000000 +0800 | ||
7 | +++ inetutils-1.9.1/configure.ac 2012-11-12 14:01:11.732957019 +0800 | ||
8 | @@ -20,8 +20,7 @@ | ||
9 | |||
10 | AC_PREREQ(2.59) | ||
11 | |||
12 | -AC_INIT([GNU inetutils], | ||
13 | - m4_esyscmd([build-aux/git-version-gen .tarball-version 's/inetutils-/v/;s/_/./g']), | ||
14 | +AC_INIT([GNU inetutils],[1.9.2], | ||
15 | [bug-inetutils@gnu.org]) | ||
16 | |||
17 | AC_CONFIG_SRCDIR([src/inetd.c]) | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.2.bb b/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.2.bb new file mode 100644 index 000000000..e46133efb --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.2.bb | |||
@@ -0,0 +1,170 @@ | |||
1 | DESCRIPTION = "The GNU inetutils are a collection of common \ | ||
2 | networking utilities and servers including ftp, ftpd, rcp, \ | ||
3 | rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \ | ||
4 | talkd, telnet, telnetd, tftp, tftpd, and uucpd." | ||
5 | SECTION = "libs" | ||
6 | DEPENDS = "ncurses netbase readline" | ||
7 | LICENSE = "GPLv3" | ||
8 | |||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7" | ||
10 | |||
11 | SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \ | ||
12 | file://version.patch \ | ||
13 | file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \ | ||
14 | file://inetutils-1.8-0003-wchar.patch \ | ||
15 | file://rexec.xinetd.inetutils \ | ||
16 | file://rlogin.xinetd.inetutils \ | ||
17 | file://rsh.xinetd.inetutils \ | ||
18 | file://telnet.xinetd.inetutils \ | ||
19 | file://tftpd.xinetd.inetutils \ | ||
20 | file://inetutils-1.9-PATH_PROCNET_DEV.patch \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[md5sum] = "aa1a9a132259db83e66c1f3265065ba2" | ||
24 | SRC_URI[sha256sum] = "0423ea40a160cd4630f817e247df5c08ecc625378d2bb56a0509117a36a89913" | ||
25 | |||
26 | inherit autotools gettext update-alternatives texinfo | ||
27 | |||
28 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}" | ||
29 | noipv6="${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6 gl_cv_socket_ipv6=no', d)}" | ||
30 | |||
31 | PACKAGECONFIG ??= "ftp uucpd" | ||
32 | PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline" | ||
33 | PACKAGECONFIG[uucpd] = "--enable-uucpd,--disable-uucpd,readline" | ||
34 | |||
35 | EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \ | ||
36 | ${noipv6} \ | ||
37 | inetutils_cv_path_login=${base_bindir}/login \ | ||
38 | --with-libreadline-prefix=${STAGING_LIBDIR} \ | ||
39 | --enable-rpath=no \ | ||
40 | " | ||
41 | |||
42 | do_configure_prepend () { | ||
43 | export HELP2MAN='true' | ||
44 | cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath | ||
45 | rm -f ${S}/glob/configure* | ||
46 | } | ||
47 | |||
48 | do_install_append () { | ||
49 | install -m 0755 -d ${D}${base_bindir} | ||
50 | install -m 0755 -d ${D}${base_sbindir} | ||
51 | install -m 0755 -d ${D}${sbindir} | ||
52 | install -m 0755 -d ${D}${sysconfdir}/xinetd.d | ||
53 | mv ${D}${bindir}/ping ${D}${base_bindir}/ | ||
54 | mv ${D}${bindir}/ping6 ${D}${base_bindir}/ | ||
55 | mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/ | ||
56 | mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/ | ||
57 | mv ${D}${bindir}/hostname ${D}${base_bindir}/ | ||
58 | mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd | ||
59 | mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd | ||
60 | mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd | ||
61 | mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind | ||
62 | mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd | ||
63 | mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd | ||
64 | mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd | ||
65 | mv ${D}${libexecdir}/* ${D}${bindir}/ | ||
66 | cp ${WORKDIR}/rexec.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rexec | ||
67 | cp ${WORKDIR}/rlogin.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rlogin | ||
68 | cp ${WORKDIR}/rsh.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rsh | ||
69 | cp ${WORKDIR}/telnet.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/telnet | ||
70 | cp ${WORKDIR}/tftpd.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/tftpd | ||
71 | rm -rf ${D}${libexecdir}/ | ||
72 | # remove usr/lib if empty | ||
73 | rmdir ${D}${libdir} | ||
74 | } | ||
75 | |||
76 | PACKAGES =+ "${PN}-ping ${PN}-ping6 ${PN}-hostname ${PN}-ifconfig \ | ||
77 | ${PN}-tftp ${PN}-logger ${PN}-traceroute ${PN}-syslogd \ | ||
78 | ${PN}-ftp ${PN}-ftpd ${PN}-tftpd ${PN}-telnet ${PN}-telnetd ${PN}-inetd \ | ||
79 | ${PN}-rsh ${PN}-rshd" | ||
80 | |||
81 | # The packages tftpd, telnetd and rshd conflict with the ones | ||
82 | # provided by netkit, so add the corresponding -dbg packages | ||
83 | # for them to avoid the confliction between the dbg package | ||
84 | # of inetutils and netkit. | ||
85 | PACKAGES += "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg" | ||
86 | |||
87 | ALTERNATIVE_PRIORITY = "80" | ||
88 | ALTERNATIVE_${PN} = "talk whois" | ||
89 | ALTERNATIVE_LINK_NAME[talkd] = "${sbindir}/in.talkd" | ||
90 | ALTERNATIVE_LINK_NAME[uucpd] = "${sbindir}/in.uucpd" | ||
91 | |||
92 | ALTERNATIVE_${PN}-logger = "logger" | ||
93 | ALTERNATIVE_${PN}-syslogd = "syslogd" | ||
94 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" | ||
95 | |||
96 | ALTERNATIVE_${PN}-ftp = "ftp" | ||
97 | ALTERNATIVE_${PN}-ftpd = "ftpd" | ||
98 | ALTERNATIVE_${PN}-tftp = "tftp" | ||
99 | ALTERNATIVE_${PN}-tftpd = "tftpd" | ||
100 | ALTERNATIVE_LINK_NAME[tftpd] = "${bindir}/tftpd" | ||
101 | ALTERNATIVE_TARGET[tftpd] = "${sbindir}/in.tftpd" | ||
102 | |||
103 | ALTERNATIVE_${PN}-telnet = "telnet" | ||
104 | ALTERNATIVE_${PN}-telnetd = "telnetd" | ||
105 | ALTERNATIVE_LINK_NAME[telnetd] = "${bindir}/telnetd" | ||
106 | ALTERNATIVE_TARGET[telnetd] = "${sbindir}/in.telnetd" | ||
107 | |||
108 | ALTERNATIVE_${PN}-rsh = "rcp rexec rlogin rsh" | ||
109 | ALTERNATIVE_${PN}-rshd = "rshd rexecd rlogind" | ||
110 | ALTERNATIVE_LINK_NAME[rshd] = "${bindir}/rshd" | ||
111 | ALTERNATIVE_TARGET[rshd] = "${sbindir}/in.rshd" | ||
112 | ALTERNATIVE_LINK_NAME[rexecd] = "${bindir}/rexecd" | ||
113 | ALTERNATIVE_TARGET[rexecd] = "${sbindir}/in.rexecd" | ||
114 | ALTERNATIVE_LINK_NAME[rlogind] = "${bindir}/rlogind" | ||
115 | ALTERNATIVE_TARGET[rlogind] = "${sbindir}/in.rlogind" | ||
116 | |||
117 | ALTERNATIVE_${PN}-inetd= "inetd" | ||
118 | ALTERNATIVE_${PN}-traceroute = "traceroute" | ||
119 | |||
120 | ALTERNATIVE_${PN}-hostname = "hostname" | ||
121 | ALTERNATIVE_LINK_NAME[hostname] = "${base_bindir}/hostname" | ||
122 | |||
123 | ALTERNATIVE_${PN}-ifconfig = "ifconfig" | ||
124 | ALTERNATIVE_LINK_NAME[ifconfig] = "${base_sbindir}/ifconfig" | ||
125 | |||
126 | ALTERNATIVE_${PN}-ping = "ping" | ||
127 | ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping" | ||
128 | |||
129 | ALTERNATIVE_${PN}-ping6 = "ping6" | ||
130 | ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6" | ||
131 | |||
132 | |||
133 | FILES_${PN}-ping = "${base_bindir}/ping.${BPN}" | ||
134 | FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}" | ||
135 | FILES_${PN}-hostname = "${base_bindir}/hostname.${BPN}" | ||
136 | FILES_${PN}-ifconfig = "${base_sbindir}/ifconfig.${BPN}" | ||
137 | FILES_${PN}-traceroute = "${bindir}/traceroute.${BPN}" | ||
138 | FILES_${PN}-logger = "${bindir}/logger.${BPN}" | ||
139 | FILES_${PN}-syslogd = "${base_sbindir}/syslogd.${BPN}" | ||
140 | FILES_${PN}-ftp = "${bindir}/ftp.${BPN}" | ||
141 | |||
142 | FILES_${PN}-tftp = "${bindir}/tftp.${BPN}" | ||
143 | FILES_${PN}-telnet = "${bindir}/telnet.${BPN}" | ||
144 | FILES_${PN}-rsh = "${bindir}/rsh.${BPN} ${bindir}/rlogin.${BPN} ${bindir}/rexec.${BPN} ${bindir}/rcp.${BPN}" | ||
145 | |||
146 | FILES_${PN}-rshd = "${sbindir}/in.rshd ${sbindir}/in.rlogind ${sbindir}/in.rexecd \ | ||
147 | ${sysconfdir}/xinetd.d/rsh ${sysconfdir}/xinetd.d/rlogin ${sysconfdir}/xinetd.d/rexec" | ||
148 | FILES_${PN}-rshd-dbg = "${sbindir}/.debug/in.rshd ${sbindir}/.debug/in.rlogind ${sbindir}/.debug/in.rexecd" | ||
149 | RDEPENDS_${PN}-rshd += "xinetd tcp-wrappers" | ||
150 | RCONFLICTS_${PN}-rshd += "netkit-rshd" | ||
151 | RPROVIDES_${PN}-rshd = "rshd" | ||
152 | |||
153 | FILES_${PN}-ftpd = "${bindir}/ftpd.${BPN}" | ||
154 | FILES_${PN}-ftpd-dbg = "${bindir}/.debug/ftpd.${BPN}" | ||
155 | RDEPENDS_${PN}-ftpd += "xinetd" | ||
156 | |||
157 | FILES_${PN}-tftpd = "${sbindir}/in.tftpd ${sysconfdir}/xinetd.d/tftpd" | ||
158 | FILES_${PN}-tftpd-dbg = "${sbindir}/.debug/in.tftpd" | ||
159 | RCONFLICTS_${PN}-tftpd += "netkit-tftpd" | ||
160 | RDEPENDS_${PN}-tftpd += "xinetd" | ||
161 | |||
162 | FILES_${PN}-telnetd = "${sbindir}/in.telnetd ${sysconfdir}/xinetd.d/telnet" | ||
163 | FILES_${PN}-telnetd-dbg = "${sbindir}/.debug/in.telnetd" | ||
164 | RCONFLICTS_${PN}-telnetd += "netkit-telnetd" | ||
165 | RPROVIDES_${PN}-telnetd = "telnetd" | ||
166 | RDEPENDS_${PN}-telnetd += "xinetd" | ||
167 | |||
168 | FILES_${PN}-inetd = "${bindir}/inetd.${BPN}" | ||
169 | |||
170 | RDEPENDS_${PN} = "xinetd" | ||
diff --git a/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb new file mode 100644 index 000000000..47525061e --- /dev/null +++ b/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "dumb networking library" | ||
2 | HOMEPAGE = "http://code.google.com/p/libdnet/" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9" | ||
5 | |||
6 | SRC_URI = "http://libdnet.googlecode.com/files/libdnet-${PV}.tgz" | ||
7 | |||
8 | SRC_URI[md5sum] = "9253ef6de1b5e28e9c9a62b882e44cc9" | ||
9 | SRC_URI[sha256sum] = "83b33039787cf99990e977cef7f18a5d5e7aaffc4505548a83d31bd3515eb026" | ||
10 | |||
11 | inherit autotools | ||
12 | |||
13 | acpaths = "-I ./config/" | ||
14 | |||
diff --git a/meta-networking/recipes-connectivity/polarssl/polarssl_1.3.8.bb b/meta-networking/recipes-connectivity/polarssl/polarssl_1.3.8.bb new file mode 100644 index 000000000..7a496b7c5 --- /dev/null +++ b/meta-networking/recipes-connectivity/polarssl/polarssl_1.3.8.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "Lightweight crypto and SSL/TLS library" | ||
2 | DESCRIPTION = "PolarSSL is a lean open source crypto library \ | ||
3 | for providing SSL and TLS support in your programs. It offers \ | ||
4 | an intuitive API and documented header files, so you can actually \ | ||
5 | understand what the code does. It features: \ | ||
6 | \ | ||
7 | - Symmetric algorithms, like AES, Blowfish, Triple-DES, DES, ARC4, \ | ||
8 | Camellia and XTEA \ | ||
9 | - Hash algorithms, like SHA-1, SHA-2, RIPEMD-160 and MD5 \ | ||
10 | - Entropy pool and random generators, like CTR-DRBG and HMAC-DRBG \ | ||
11 | - Public key algorithms, like RSA, Elliptic Curves, Diffie-Hellman, \ | ||
12 | ECDSA and ECDH \ | ||
13 | - SSL v3 and TLS 1.0, 1.1 and 1.2 \ | ||
14 | - Abstraction layers for ciphers, hashes, public key operations, \ | ||
15 | platform abstraction and threading \ | ||
16 | " | ||
17 | |||
18 | HOMEPAGE = "https://polarssl.org" | ||
19 | BUGTRACKER = "https://github.com/polarssl/polarssl/issues" | ||
20 | |||
21 | LICENSE = "GPLv2" | ||
22 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" | ||
23 | |||
24 | SECTION = "net" | ||
25 | |||
26 | SRC_URI = "https://polarssl.org/download/polarssl-${PV}-gpl.tgz" | ||
27 | |||
28 | SRC_URI[md5sum] = "d1a2b4f21727e888f143414d2e3144e6" | ||
29 | SRC_URI[sha256sum] = "318171db41335cacbb5b0047c94f1faf91442ab70a223b5223436703c9406ff1" | ||
30 | |||
31 | DEPENDS = "openssl" | ||
32 | RDEPENDS_${PN} += "libcrypto" | ||
33 | EXTRA_OECMAKE = "-DUSE_SHARED_POLARSSL_LIBRARY=on" | ||
34 | |||
35 | inherit cmake | ||
diff --git a/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch b/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch new file mode 100644 index 000000000..f25a02cd8 --- /dev/null +++ b/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 9a9137c3df5309ac359737d6ebd67fb4ff5f3cf2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Mon, 24 Nov 2014 22:05:18 -0500 | ||
4 | Subject: [PATCH] sethdlc: fix host contamination | ||
5 | |||
6 | Clean INCLUDES to fix the host contamination errors: | ||
7 | |||
8 | In file included from /usr/src/linux/include/linux/posix_types.h:47:0, | ||
9 | from /usr/src/linux/include/linux/types.h:17, | ||
10 | from /usr/src/linux/include/linux/if.h:22, | ||
11 | from sethdlc.c:23: | ||
12 | /usr/src/linux/include/asm-generic/posix_types.h:91:3: \ | ||
13 | error: conflicting types for '__kernel_fsid_t' | ||
14 | } __kernel_fsid_t; | ||
15 | ^ | ||
16 | .../tmp/sysroots/qemumips/usr/include/asm/posix_types.h:26:3: \ | ||
17 | note: previous declaration of '__kernel_fsid_t' was here | ||
18 | } __kernel_fsid_t; | ||
19 | ^ | ||
20 | |||
21 | Upstream-Status: Pending | ||
22 | |||
23 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
24 | --- | ||
25 | Makefile | 2 +- | ||
26 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
27 | |||
28 | diff --git a/Makefile b/Makefile | ||
29 | index 0492f2b..97dec22 100644 | ||
30 | --- a/Makefile | ||
31 | +++ b/Makefile | ||
32 | @@ -1,6 +1,6 @@ | ||
33 | CC = gcc | ||
34 | CFLAGS = -O2 -Wall -W -Wno-long-long -pipe | ||
35 | -INCLUDES = -I/usr/src/linux/include -I/usr/src/linux-2.6/include | ||
36 | +INCLUDES = | ||
37 | |||
38 | all: sethdlc | ||
39 | |||
40 | -- | ||
41 | 1.7.9.5 | ||
42 | |||
diff --git a/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb b/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb new file mode 100644 index 000000000..5e8d9d9bf --- /dev/null +++ b/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | DESCRIPTION = "set Linux HDLC packet radio modem driver port information" | ||
2 | HOMEPAGE = "https://www.kernel.org/pub/linux/utils/net/hdlc" | ||
3 | LICENSE = "GPLv2 & GPLv2+ " | ||
4 | LIC_FILES_CHKSUM = "file://sethdlc.c;endline=10;md5=90f936879e9f8b755a138aeb348782eb" | ||
5 | |||
6 | |||
7 | SRC_URI = "https://www.kernel.org/pub/linux/utils/net/hdlc/${BPN}-1.18.tar.gz \ | ||
8 | file://sethdlc-fix-host-contamination.patch \ | ||
9 | " | ||
10 | SRC_URI[md5sum] = "9016878156a5eadb06c0bae71cc5c9ab" | ||
11 | SRC_URI[sha256sum] = "21b1e2e1cb0e288b0ec8fcfd9fed449914e0f8e6fc273706bd5b3d4f6ab6b04e" | ||
12 | |||
13 | |||
14 | S = "${WORKDIR}/${BPN}-1.18" | ||
15 | |||
16 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
17 | DEPENDS = "virtual/kernel" | ||
18 | |||
19 | EXTRA_OEMAKE="CROSS_COMPILE=${TARGET_PREFIX} CC='${CC} ${LDFLAGS}' \ | ||
20 | KERNEL_DIR=${STAGING_KERNEL_DIR} " | ||
21 | |||
22 | do_compile_prepend () { | ||
23 | oe_runmake clean | ||
24 | } | ||
25 | |||
26 | |||
27 | do_install() { | ||
28 | install -d ${D}/${bindir} | ||
29 | install sethdlc ${D}/${bindir}/ | ||
30 | } | ||
31 | |||
32 | FILES_${PN} += "${bindir}/sethdlc" | ||
diff --git a/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch b/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch new file mode 100644 index 000000000..54c2a9521 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 4d7ebe3ed6cee72bc7db98bd408d22c10ef5dd82 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Wed, 20 Nov 2013 16:06:07 -0500 | ||
4 | Subject: [PATCH] libpcap: search sysroot for headers | ||
5 | |||
6 | Configure hard-coded host header paths when building with libpcap. Point | ||
7 | the search path at the sysroot instead. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
12 | --- | ||
13 | configure.in | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/configure.in b/configure.in | ||
17 | index e52bb6c..8ded35d 100644 | ||
18 | --- a/configure.in | ||
19 | +++ b/configure.in | ||
20 | @@ -78,7 +78,7 @@ case "$host" in | ||
21 | linux="yes" | ||
22 | AC_DEFINE([LINUX],[1],[Define if Linux]) | ||
23 | AC_SUBST(extra_incl) | ||
24 | - extra_incl="-I/usr/include/pcap" | ||
25 | + extra_incl="-I=/usr/include/pcap" | ||
26 | ;; | ||
27 | *-hpux10*|*-hpux11*) | ||
28 | AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11]) | ||
29 | -- | ||
30 | 1.7.10.4 | ||
31 | |||
diff --git a/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch b/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch new file mode 100644 index 000000000..39e5c9c03 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | Upstream-Status:Inappropriate [embedded specific] | ||
2 | |||
3 | fix the below error: | ||
4 | checking for dap address space id... configure: | ||
5 | configure: error: cannot run test program while cross compiling | ||
6 | |||
7 | |||
8 | Signed-off-by: Chunrong Guo <B40290@freescale.com> | ||
9 | |||
10 | --- a/configure.in 2013-08-23 00:06:37.239361932 -0500 | ||
11 | +++ b/configure.in 2013-08-23 00:07:32.860266534 -0500 | ||
12 | @@ -679,23 +679,23 @@ | ||
13 | |||
14 | AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta]) | ||
15 | |||
16 | -AC_MSG_CHECKING([for daq address space ID]) | ||
17 | -AC_RUN_IFELSE( | ||
18 | -[AC_LANG_PROGRAM( | ||
19 | -[[ | ||
20 | -#include <daq.h> | ||
21 | -]], | ||
22 | -[[ | ||
23 | - DAQ_PktHdr_t hdr; | ||
24 | - hdr.address_space_id = 0; | ||
25 | -]])], | ||
26 | -[have_daq_address_space_id="yes"], | ||
27 | -[have_daq_address_space_id="no"]) | ||
28 | -AC_MSG_RESULT($have_daq_address_space_id) | ||
29 | -if test "x$have_daq_address_space_id" = "xyes"; then | ||
30 | - AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], | ||
31 | - [DAQ version supports address space ID in header.]) | ||
32 | -fi | ||
33 | +#AC_MSG_CHECKING([for daq address space ID]) | ||
34 | +#AC_RUN_IFELSE( | ||
35 | +#[AC_LANG_PROGRAM( | ||
36 | +#[[ | ||
37 | +##include <daq.h> | ||
38 | +#]], | ||
39 | +#[[ | ||
40 | +# DAQ_PktHdr_t hdr; | ||
41 | +# hdr.address_space_id = 0; | ||
42 | +#]])], | ||
43 | +have_daq_address_space_id="yes" | ||
44 | +#[have_daq_address_space_id="no"]) | ||
45 | +#AC_MSG_RESULT($have_daq_address_space_id) | ||
46 | +#if test "x$have_daq_address_space_id" = "xyes"; then | ||
47 | +# AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], | ||
48 | +# [DAQ version supports address space ID in header.]) | ||
49 | +#fi | ||
50 | |||
51 | # any sparc platform has to have this one defined. | ||
52 | AC_MSG_CHECKING(for sparc) | ||
diff --git a/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch b/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch new file mode 100644 index 000000000..9dafe6345 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | fix the below error: | ||
4 | checking for INADDR_NONE... configure: | ||
5 | configure: error: cannot run test program while cross compiling | ||
6 | |||
7 | Signed-off-by: Chunrong Guo <B40290@freescale.com> | ||
8 | |||
9 | |||
10 | --- a/configure.in 2013-08-21 03:56:17.197414789 -0500 | ||
11 | +++ b/configure.in 2013-08-21 23:19:05.298553560 -0500 | ||
12 | @@ -281,25 +281,7 @@ | ||
13 | AC_CHECK_TYPES([boolean]) | ||
14 | |||
15 | # In case INADDR_NONE is not defined (like on Solaris) | ||
16 | -have_inaddr_none="no" | ||
17 | -AC_MSG_CHECKING([for INADDR_NONE]) | ||
18 | -AC_RUN_IFELSE( | ||
19 | -[AC_LANG_PROGRAM( | ||
20 | -[[ | ||
21 | -#include <sys/types.h> | ||
22 | -#include <netinet/in.h> | ||
23 | -#include <arpa/inet.h> | ||
24 | -]], | ||
25 | -[[ | ||
26 | - if (inet_addr("10,5,2") == INADDR_NONE); | ||
27 | - return 0; | ||
28 | -]])], | ||
29 | -[have_inaddr_none="yes"], | ||
30 | -[have_inaddr_none="no"]) | ||
31 | -AC_MSG_RESULT($have_inaddr_none) | ||
32 | -if test "x$have_inaddr_none" = "xno"; then | ||
33 | - AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition]) | ||
34 | -fi | ||
35 | +have_inaddr_none="yes" | ||
36 | |||
37 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
38 | #include <stdio.h> | ||
39 | @@ -397,21 +379,21 @@ | ||
40 | fi | ||
41 | fi | ||
42 | |||
43 | -AC_MSG_CHECKING([for pcap_lex_destroy]) | ||
44 | -AC_RUN_IFELSE( | ||
45 | -[AC_LANG_PROGRAM( | ||
46 | -[[ | ||
47 | -#include <pcap.h> | ||
48 | -]], | ||
49 | -[[ | ||
50 | - pcap_lex_destroy(); | ||
51 | -]])], | ||
52 | -[have_pcap_lex_destroy="yes"], | ||
53 | -[have_pcap_lex_destroy="no"]) | ||
54 | -AC_MSG_RESULT($have_pcap_lex_destroy) | ||
55 | -if test "x$have_pcap_lex_destroy" = "xyes"; then | ||
56 | - AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) | ||
57 | -fi | ||
58 | +#AC_MSG_CHECKING([for pcap_lex_destroy]) | ||
59 | +#AC_RUN_IFELSE( | ||
60 | +#[AC_LANG_PROGRAM( | ||
61 | +#[[ | ||
62 | +##include <pcap.h> | ||
63 | +#]], | ||
64 | +#[[ | ||
65 | +# pcap_lex_destroy(); | ||
66 | +#]])], | ||
67 | +have_pcap_lex_destroy="yes" | ||
68 | +#[have_pcap_lex_destroy="no"]) | ||
69 | +#AC_MSG_RESULT($have_pcap_lex_destroy) | ||
70 | +#if test "x$have_pcap_lex_destroy" = "xyes"; then | ||
71 | +# AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) | ||
72 | +#fi | ||
73 | |||
74 | AC_MSG_CHECKING([for pcap_lib_version]) | ||
75 | AC_LINK_IFELSE( | ||
diff --git a/meta-networking/recipes-connectivity/snort/snort/not-hardcoded-libdir.patch b/meta-networking/recipes-connectivity/snort/snort/not-hardcoded-libdir.patch new file mode 100644 index 000000000..075ec138b --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/not-hardcoded-libdir.patch | |||
@@ -0,0 +1,279 @@ | |||
1 | [PATCH] do not hardcoded libdir | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | libdir is hardcoded to ${exec_prefix}/lib, but we want it to support multilib | ||
6 | |||
7 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
8 | --- | ||
9 | src/dynamic-examples/dynamic-preprocessor/Makefile.am | 2 +- | ||
10 | src/dynamic-examples/dynamic-rule/Makefile.am | 2 +- | ||
11 | src/dynamic-plugins/sf_engine/Makefile.am | 2 +- | ||
12 | src/dynamic-preprocessors/dcerpc2/Makefile.am | 2 +- | ||
13 | src/dynamic-preprocessors/dnp3/Makefile.am | 2 +- | ||
14 | src/dynamic-preprocessors/dns/Makefile.am | 2 +- | ||
15 | src/dynamic-preprocessors/file/Makefile.am | 2 +- | ||
16 | src/dynamic-preprocessors/ftptelnet/Makefile.am | 2 +- | ||
17 | src/dynamic-preprocessors/gtp/Makefile.am | 2 +- | ||
18 | src/dynamic-preprocessors/imap/Makefile.am | 2 +- | ||
19 | src/dynamic-preprocessors/modbus/Makefile.am | 2 +- | ||
20 | src/dynamic-preprocessors/pop/Makefile.am | 2 +- | ||
21 | src/dynamic-preprocessors/reputation/Makefile.am | 2 +- | ||
22 | src/dynamic-preprocessors/rzb_saac/Makefile.am | 2 +- | ||
23 | src/dynamic-preprocessors/sdf/Makefile.am | 2 +- | ||
24 | src/dynamic-preprocessors/sip/Makefile.am | 2 +- | ||
25 | src/dynamic-preprocessors/smtp/Makefile.am | 2 +- | ||
26 | src/dynamic-preprocessors/ssh/Makefile.am | 2 +- | ||
27 | src/dynamic-preprocessors/ssl/Makefile.am | 2 +- | ||
28 | 19 files changed, 19 insertions(+), 19 deletions(-) | ||
29 | |||
30 | diff --git a/src/dynamic-examples/dynamic-preprocessor/Makefile.am b/src/dynamic-examples/dynamic-preprocessor/Makefile.am | ||
31 | index 255755e..1cafead 100644 | ||
32 | --- a/src/dynamic-examples/dynamic-preprocessor/Makefile.am | ||
33 | +++ b/src/dynamic-examples/dynamic-preprocessor/Makefile.am | ||
34 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
35 | |||
36 | INCLUDES = -I../include | ||
37 | |||
38 | -noinst_libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
39 | +noinst_libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
40 | |||
41 | noinst_lib_LTLIBRARIES = lib_sfdynamic_preprocessor_example.la | ||
42 | |||
43 | diff --git a/src/dynamic-examples/dynamic-rule/Makefile.am b/src/dynamic-examples/dynamic-rule/Makefile.am | ||
44 | index e5338d2..82eb212 100644 | ||
45 | --- a/src/dynamic-examples/dynamic-rule/Makefile.am | ||
46 | +++ b/src/dynamic-examples/dynamic-rule/Makefile.am | ||
47 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
48 | |||
49 | INCLUDES = -I../include | ||
50 | |||
51 | -noinst_libdir = ${exec_prefix}/lib/snort_dynamicrules | ||
52 | +noinst_libdir = ${exec_prefix}${base_libdir}/snort_dynamicrules | ||
53 | |||
54 | noinst_lib_LTLIBRARIES = lib_sfdynamic_example_rule.la | ||
55 | |||
56 | diff --git a/src/dynamic-plugins/sf_engine/Makefile.am b/src/dynamic-plugins/sf_engine/Makefile.am | ||
57 | index d6a6200..3d270c3 100644 | ||
58 | --- a/src/dynamic-plugins/sf_engine/Makefile.am | ||
59 | +++ b/src/dynamic-plugins/sf_engine/Makefile.am | ||
60 | @@ -5,7 +5,7 @@ INCLUDES = @INCLUDES@ | ||
61 | |||
62 | lib_LTLIBRARIES = libsf_engine.la | ||
63 | |||
64 | -libdir = ${exec_prefix}/lib/snort_dynamicengine | ||
65 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicengine | ||
66 | |||
67 | libsf_engine_la_LDFLAGS = -export-dynamic -module @XCCFLAGS@ | ||
68 | |||
69 | diff --git a/src/dynamic-preprocessors/dcerpc2/Makefile.am b/src/dynamic-preprocessors/dcerpc2/Makefile.am | ||
70 | index 9843073..8a0caa5 100644 | ||
71 | --- a/src/dynamic-preprocessors/dcerpc2/Makefile.am | ||
72 | +++ b/src/dynamic-preprocessors/dcerpc2/Makefile.am | ||
73 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
74 | |||
75 | INCLUDES = -I../include -I${srcdir}/../libs -I$(srcdir)/includes | ||
76 | |||
77 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
78 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
79 | |||
80 | lib_LTLIBRARIES = libsf_dce2_preproc.la | ||
81 | |||
82 | diff --git a/src/dynamic-preprocessors/dnp3/Makefile.am b/src/dynamic-preprocessors/dnp3/Makefile.am | ||
83 | index 1358862..18e2178 100644 | ||
84 | --- a/src/dynamic-preprocessors/dnp3/Makefile.am | ||
85 | +++ b/src/dynamic-preprocessors/dnp3/Makefile.am | ||
86 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
87 | |||
88 | INCLUDES = -I../include -I${srcdir}/../libs | ||
89 | |||
90 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
91 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
92 | |||
93 | lib_LTLIBRARIES = libsf_dnp3_preproc.la | ||
94 | |||
95 | diff --git a/src/dynamic-preprocessors/dns/Makefile.am b/src/dynamic-preprocessors/dns/Makefile.am | ||
96 | index f22d90e..49d2f55 100644 | ||
97 | --- a/src/dynamic-preprocessors/dns/Makefile.am | ||
98 | +++ b/src/dynamic-preprocessors/dns/Makefile.am | ||
99 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
100 | |||
101 | INCLUDES = -I../include -I${srcdir}/../libs | ||
102 | |||
103 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
104 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
105 | |||
106 | lib_LTLIBRARIES = libsf_dns_preproc.la | ||
107 | |||
108 | diff --git a/src/dynamic-preprocessors/file/Makefile.am b/src/dynamic-preprocessors/file/Makefile.am | ||
109 | index d71c0fd..834f7ac 100644 | ||
110 | --- a/src/dynamic-preprocessors/file/Makefile.am | ||
111 | +++ b/src/dynamic-preprocessors/file/Makefile.am | ||
112 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
113 | |||
114 | INCLUDES = -I../include -I${srcdir}/../libs -I./include | ||
115 | |||
116 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
117 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
118 | |||
119 | lib_LTLIBRARIES = libsf_file_preproc.la | ||
120 | |||
121 | diff --git a/src/dynamic-preprocessors/ftptelnet/Makefile.am b/src/dynamic-preprocessors/ftptelnet/Makefile.am | ||
122 | index fe73835..3457231 100644 | ||
123 | --- a/src/dynamic-preprocessors/ftptelnet/Makefile.am | ||
124 | +++ b/src/dynamic-preprocessors/ftptelnet/Makefile.am | ||
125 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
126 | |||
127 | INCLUDES = -I../include -I${srcdir}/../libs -I$(srcdir)/includes | ||
128 | |||
129 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
130 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
131 | |||
132 | lib_LTLIBRARIES = libsf_ftptelnet_preproc.la | ||
133 | |||
134 | diff --git a/src/dynamic-preprocessors/gtp/Makefile.am b/src/dynamic-preprocessors/gtp/Makefile.am | ||
135 | index 51c961a..d7fb9b2 100644 | ||
136 | --- a/src/dynamic-preprocessors/gtp/Makefile.am | ||
137 | +++ b/src/dynamic-preprocessors/gtp/Makefile.am | ||
138 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
139 | |||
140 | INCLUDES = -I../include -I${srcdir}/../libs -I$(srcdir)/includes | ||
141 | |||
142 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
143 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
144 | |||
145 | lib_LTLIBRARIES = libsf_gtp_preproc.la | ||
146 | |||
147 | diff --git a/src/dynamic-preprocessors/imap/Makefile.am b/src/dynamic-preprocessors/imap/Makefile.am | ||
148 | index 533e43d..9efcbc4 100644 | ||
149 | --- a/src/dynamic-preprocessors/imap/Makefile.am | ||
150 | +++ b/src/dynamic-preprocessors/imap/Makefile.am | ||
151 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
152 | |||
153 | INCLUDES = -I../include -I${srcdir}/../libs | ||
154 | |||
155 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
156 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
157 | |||
158 | lib_LTLIBRARIES = libsf_imap_preproc.la | ||
159 | |||
160 | diff --git a/src/dynamic-preprocessors/modbus/Makefile.am b/src/dynamic-preprocessors/modbus/Makefile.am | ||
161 | index 05fc63e..e4f1415 100644 | ||
162 | --- a/src/dynamic-preprocessors/modbus/Makefile.am | ||
163 | +++ b/src/dynamic-preprocessors/modbus/Makefile.am | ||
164 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
165 | |||
166 | INCLUDES = -I../include -I${srcdir}/../libs | ||
167 | |||
168 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
169 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
170 | |||
171 | lib_LTLIBRARIES = libsf_modbus_preproc.la | ||
172 | |||
173 | diff --git a/src/dynamic-preprocessors/pop/Makefile.am b/src/dynamic-preprocessors/pop/Makefile.am | ||
174 | index d4b07b3..1345bc6 100644 | ||
175 | --- a/src/dynamic-preprocessors/pop/Makefile.am | ||
176 | +++ b/src/dynamic-preprocessors/pop/Makefile.am | ||
177 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
178 | |||
179 | INCLUDES = -I../include -I${srcdir}/../libs | ||
180 | |||
181 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
182 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
183 | |||
184 | lib_LTLIBRARIES = libsf_pop_preproc.la | ||
185 | |||
186 | diff --git a/src/dynamic-preprocessors/reputation/Makefile.am b/src/dynamic-preprocessors/reputation/Makefile.am | ||
187 | index 4e16142..14ba0cb 100644 | ||
188 | --- a/src/dynamic-preprocessors/reputation/Makefile.am | ||
189 | +++ b/src/dynamic-preprocessors/reputation/Makefile.am | ||
190 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
191 | |||
192 | INCLUDES = -I../include -I${srcdir}/../libs -I$(srcdir)/includes | ||
193 | |||
194 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
195 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
196 | |||
197 | lib_LTLIBRARIES = libsf_reputation_preproc.la | ||
198 | |||
199 | diff --git a/src/dynamic-preprocessors/rzb_saac/Makefile.am b/src/dynamic-preprocessors/rzb_saac/Makefile.am | ||
200 | index f0b0912..6ebe04e 100644 | ||
201 | --- a/src/dynamic-preprocessors/rzb_saac/Makefile.am | ||
202 | +++ b/src/dynamic-preprocessors/rzb_saac/Makefile.am | ||
203 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
204 | |||
205 | INCLUDES = -I../include -I${srcdir}/../libs | ||
206 | |||
207 | -pkglibdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
208 | +pkglibdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
209 | |||
210 | pkglib_LTLIBRARIES = sf_rzb_saac_preproc.la | ||
211 | |||
212 | diff --git a/src/dynamic-preprocessors/sdf/Makefile.am b/src/dynamic-preprocessors/sdf/Makefile.am | ||
213 | index 97b416e..04b5ce5 100644 | ||
214 | --- a/src/dynamic-preprocessors/sdf/Makefile.am | ||
215 | +++ b/src/dynamic-preprocessors/sdf/Makefile.am | ||
216 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
217 | |||
218 | INCLUDES = -I../include -I${srcdir}/../libs | ||
219 | |||
220 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
221 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
222 | |||
223 | lib_LTLIBRARIES = libsf_sdf_preproc.la | ||
224 | |||
225 | diff --git a/src/dynamic-preprocessors/sip/Makefile.am b/src/dynamic-preprocessors/sip/Makefile.am | ||
226 | index 67ac1e1..b4f360f 100644 | ||
227 | --- a/src/dynamic-preprocessors/sip/Makefile.am | ||
228 | +++ b/src/dynamic-preprocessors/sip/Makefile.am | ||
229 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
230 | |||
231 | INCLUDES = -I../include -I${srcdir}/../libs -I$(srcdir)/includes | ||
232 | |||
233 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
234 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
235 | |||
236 | lib_LTLIBRARIES = libsf_sip_preproc.la | ||
237 | |||
238 | diff --git a/src/dynamic-preprocessors/smtp/Makefile.am b/src/dynamic-preprocessors/smtp/Makefile.am | ||
239 | index 3b5893f..96750df 100644 | ||
240 | --- a/src/dynamic-preprocessors/smtp/Makefile.am | ||
241 | +++ b/src/dynamic-preprocessors/smtp/Makefile.am | ||
242 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
243 | |||
244 | INCLUDES = -I../include -I${srcdir}/../libs | ||
245 | |||
246 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
247 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
248 | |||
249 | lib_LTLIBRARIES = libsf_smtp_preproc.la | ||
250 | |||
251 | diff --git a/src/dynamic-preprocessors/ssh/Makefile.am b/src/dynamic-preprocessors/ssh/Makefile.am | ||
252 | index 0eab645..5ae9b80 100644 | ||
253 | --- a/src/dynamic-preprocessors/ssh/Makefile.am | ||
254 | +++ b/src/dynamic-preprocessors/ssh/Makefile.am | ||
255 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
256 | |||
257 | INCLUDES = -I../include -I${srcdir}/../libs | ||
258 | |||
259 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
260 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
261 | |||
262 | lib_LTLIBRARIES = libsf_ssh_preproc.la | ||
263 | |||
264 | diff --git a/src/dynamic-preprocessors/ssl/Makefile.am b/src/dynamic-preprocessors/ssl/Makefile.am | ||
265 | index 4ac2943..8d3abe3 100644 | ||
266 | --- a/src/dynamic-preprocessors/ssl/Makefile.am | ||
267 | +++ b/src/dynamic-preprocessors/ssl/Makefile.am | ||
268 | @@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS=foreign no-dependencies | ||
269 | |||
270 | INCLUDES = -I../include -I${srcdir}/../libs | ||
271 | |||
272 | -libdir = ${exec_prefix}/lib/snort_dynamicpreprocessor | ||
273 | +libdir = ${exec_prefix}${base_libdir}/snort_dynamicpreprocessor | ||
274 | |||
275 | lib_LTLIBRARIES = libsf_ssl_preproc.la | ||
276 | |||
277 | -- | ||
278 | 1.9.1 | ||
279 | |||
diff --git a/meta-networking/recipes-connectivity/snort/snort/snort.init b/meta-networking/recipes-connectivity/snort/snort/snort.init new file mode 100644 index 000000000..d8a00c43f --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort/snort.init | |||
@@ -0,0 +1,109 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Snort Startup Script modified for OpenEmbedded | ||
4 | # | ||
5 | |||
6 | # Script variables | ||
7 | |||
8 | LAN_INTERFACE="$2" | ||
9 | RETURN_VAL=0 | ||
10 | BINARY=/usr/bin/snort | ||
11 | PATH=/bin:/usr/bin | ||
12 | PID=/var/run/snort_${LAN_INTERFACE}_ids.pid | ||
13 | DEL_PID=$PID | ||
14 | LOGDIR="/var/log/snort" | ||
15 | DATE=`/bin/date +%Y%m%d` | ||
16 | CONFIG_FILE=/etc/snort/snort.conf | ||
17 | PROG=snort | ||
18 | USER=root | ||
19 | GROUP=root | ||
20 | |||
21 | if [ ! -x "$BINARY" ]; then | ||
22 | echo "ERROR: $BINARY not found." | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | if [ ! -r "$CONFIG_FILE" ]; then | ||
27 | echo "ERROR: $CONFIG_FILE not found." | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | start() | ||
32 | { | ||
33 | |||
34 | [ -n "$LAN_INTERFACE" ] || return 0 | ||
35 | # Check if log diratory is present. Otherwise, create it. | ||
36 | if [ ! -d $LOGDIR/$DATE ]; then | ||
37 | mkdir -d $LOGDIR/$DATE | ||
38 | /bin/chown -R $USER:$USER $LOGDIR/$DATE | ||
39 | /bin/chmod -R 700 $LOGDIR/$DATE | ||
40 | fi | ||
41 | |||
42 | /bin/echo "Starting $PROG: " | ||
43 | # Snort parameters | ||
44 | # -D Run Snort in background (daemon) mode | ||
45 | # -i <if> Listen on interface <if> | ||
46 | # -u <uname> Run snort uid as <uname> user (or uid) | ||
47 | # -g <gname> Run snort uid as <gname> group (or gid) | ||
48 | # -c Load configuration file | ||
49 | # -N Turn off logging (alerts still work) (removed to enable logging) :) | ||
50 | # -l Log to directory | ||
51 | # -t Chroots process to directory after initialization | ||
52 | # -R <id> Include 'id' in snort_intf<id>.pid file name | ||
53 | |||
54 | $BINARY -D -i $LAN_INTERFACE -u $USER -g $GROUP -c $CONFIG_FILE -l $LOGDIR/$DATE -t $LOGDIR/$DATE -R _ids | ||
55 | /bin/echo "$PROG startup complete." | ||
56 | return $RETURN_VAL | ||
57 | } | ||
58 | |||
59 | stop() | ||
60 | { | ||
61 | if [ -s $PID ]; then | ||
62 | /bin/echo "Stopping $PROG with PID `cat $PID`: " | ||
63 | kill -TERM `cat $PID` 2>/dev/null | ||
64 | RETURN_VAL=$? | ||
65 | /bin/echo "$PROG shutdown complete." | ||
66 | [ -e $DEL_PID ] && rm -f $DEL_PID | ||
67 | [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck | ||
68 | else | ||
69 | /bin/echo "ERROR: PID in $PID file not found." | ||
70 | RETURN_VAL=1 | ||
71 | fi | ||
72 | return $RETURN_VAL | ||
73 | } | ||
74 | |||
75 | status() { | ||
76 | if [ -s $PID ]; then | ||
77 | echo "$PROG is running as pid `cat $PID`:" | ||
78 | else | ||
79 | echo "$PROG is not running." | ||
80 | fi | ||
81 | } | ||
82 | |||
83 | restart() | ||
84 | { | ||
85 | stop | ||
86 | start | ||
87 | RETURN_VAL=$? | ||
88 | return $RETURN_VAL | ||
89 | } | ||
90 | |||
91 | case "$1" in | ||
92 | start) | ||
93 | start | ||
94 | ;; | ||
95 | stop) | ||
96 | stop | ||
97 | ;; | ||
98 | status) | ||
99 | status | ||
100 | ;; | ||
101 | restart|reload) | ||
102 | restart | ||
103 | ;; | ||
104 | *) | ||
105 | /bin/echo "Usage: $0 {start|stop|status|restart|reload}" | ||
106 | RETURN_VAL=1 | ||
107 | esac | ||
108 | |||
109 | exit $RETURN_VAL | ||
diff --git a/meta-networking/recipes-connectivity/snort/snort_2.9.6.0.bb b/meta-networking/recipes-connectivity/snort/snort_2.9.6.0.bb new file mode 100644 index 000000000..8f5175e79 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort_2.9.6.0.bb | |||
@@ -0,0 +1,80 @@ | |||
1 | DESCRIPTION = "snort - a free lightweight network intrusion detection system for UNIX and Windows." | ||
2 | HOMEPAGE = "http://www.snort.org/" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5" | ||
5 | |||
6 | DEPENDS = "libpcap libpcre daq libdnet util-linux" | ||
7 | |||
8 | |||
9 | SRC_URI = " ${GENTOO_MIRROR}/${BP}.tar.gz;name=tarball \ | ||
10 | file://snort.init \ | ||
11 | file://disable-inaddr-none.patch \ | ||
12 | file://disable-dap-address-space-id.patch \ | ||
13 | file://0001-libpcap-search-sysroot-for-headers.patch \ | ||
14 | file://not-hardcoded-libdir.patch \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[tarball.md5sum] = "18111f6de3989ca89add36077a7c2659" | ||
18 | SRC_URI[tarball.sha256sum] = "3cc6c8a9b52f4c863a5736a73b4012aff340b50b5e002771b04d4877f47cd19e" | ||
19 | |||
20 | inherit autotools gettext update-rc.d pkgconfig | ||
21 | |||
22 | INITSCRIPT_NAME = "snort" | ||
23 | INITSCRIPT_PARAMS = "defaults" | ||
24 | |||
25 | EXTRA_OECONF = " \ | ||
26 | --enable-gre \ | ||
27 | --enable-linux-smp-stats \ | ||
28 | --enable-reload \ | ||
29 | --enable-reload-error-restart \ | ||
30 | --enable-targetbased \ | ||
31 | --disable-static-daq \ | ||
32 | --with-dnet-includes=${STAGING_INCDIR} \ | ||
33 | --with-dnet-libraries=${STAGING_LIBDIR} \ | ||
34 | " | ||
35 | |||
36 | # if you want to disable it, you need to patch configure.in first | ||
37 | # AC_CHECK_HEADERS([openssl/sha.h],, SHA_H="no") | ||
38 | # is called even with --without-openssl-includes | ||
39 | PACKAGECONFIG ?= "openssl" | ||
40 | PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl," | ||
41 | |||
42 | do_install_append() { | ||
43 | install -d ${D}/${sysconfdir}/snort/rules | ||
44 | install -d ${D}/${sysconfdir}/snort/preproc_rules | ||
45 | install -d ${D}${sysconfdir}/init.d | ||
46 | for i in map config conf dtd; do | ||
47 | cp ${S}/etc/*.$i ${D}/${sysconfdir}/snort/ | ||
48 | done | ||
49 | cp ${S}/preproc_rules/*.rules ${D}/${sysconfdir}/snort/preproc_rules/ | ||
50 | install -m 755 ${WORKDIR}/snort.init ${D}/${sysconfdir}/init.d/snort | ||
51 | mkdir -p ${D}/${localstatedir}/log/snort | ||
52 | install -d ${D}/var/log/snort | ||
53 | } | ||
54 | |||
55 | FILES_${PN} += " \ | ||
56 | ${libdir}/snort_dynamicengine/*.so.* \ | ||
57 | ${libdir}/snort_dynamicpreprocessor/*.so.* \ | ||
58 | ${libdir}/snort_dynamicrules/*.so.* \ | ||
59 | " | ||
60 | FILES_${PN}-dbg += " \ | ||
61 | ${libdir}/snort_dynamicengine/.debug \ | ||
62 | ${libdir}/snort_dynamicpreprocessor/.debug \ | ||
63 | ${libdir}/snort_dynamicrules/.debug \ | ||
64 | " | ||
65 | FILES_${PN}-staticdev += " \ | ||
66 | ${libdir}/snort_dynamicengine/*.a \ | ||
67 | ${libdir}/snort_dynamicpreprocessor/*.a \ | ||
68 | ${libdir}/snort_dynamicrules/*.a \ | ||
69 | ${libdir}/snort/dynamic_preproc/*.a \ | ||
70 | ${libdir}/snort/dynamic_output/*.a \ | ||
71 | " | ||
72 | FILES_${PN}-dev += " \ | ||
73 | ${libdir}/snort_dynamicengine/*.la \ | ||
74 | ${libdir}/snort_dynamicpreprocessor/*.la \ | ||
75 | ${libdir}/snort_dynamicrules/*.la \ | ||
76 | ${libdir}/snort_dynamicengine/*.so \ | ||
77 | ${libdir}/snort_dynamicpreprocessor/*.so \ | ||
78 | ${libdir}/snort_dynamicrules/*.so \ | ||
79 | ${prefix}/src/snort_dynamicsrc \ | ||
80 | " | ||
diff --git a/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb b/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb new file mode 100644 index 000000000..2c4f1577e --- /dev/null +++ b/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "VLAN provides vconfig utility" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://vconfig.c;md5=293ef69c4e88434d37a5ee577a5288cb" | ||
4 | |||
5 | SRC_URI = "http://${BPN}.sourcearchive.com/downloads/${PV}-3ubuntu9/${BPN}_${PV}.orig.tar.gz" | ||
6 | |||
7 | SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394" | ||
8 | SRC_URI[sha256sum] = "3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca" | ||
9 | |||
10 | S = "${WORKDIR}/${BPN}" | ||
11 | |||
12 | # comment out MakeInclude in Makefile which sets build environment | ||
13 | do_configure_append () { | ||
14 | sed -i 's/^ include/#^include/' ${S}/Makefile | ||
15 | } | ||
16 | |||
17 | # ignore strip to avoid yocto errors in stripping | ||
18 | do_compile () { | ||
19 | oe_runmake PLATFORM=ARM 'STRIP=echo' all | ||
20 | } | ||
21 | |||
22 | do_install () { | ||
23 | install -d ${D}/${exec_prefix}/bin | ||
24 | cp ${S}/vconfig ${D}/${exec_prefix}/bin | ||
25 | } | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf b/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf new file mode 100644 index 000000000..48b15eca6 --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf | |||
@@ -0,0 +1,19 @@ | |||
1 | # Comment out the options you need. | ||
2 | # Verify your config with "vpnc --print-config". | ||
3 | # You might also try "vpnc --long-help" or look into the documentation. | ||
4 | |||
5 | # Needed (you will be prompted if this is missing): | ||
6 | #IPSec gateway 10.1.2.3 | ||
7 | #IPSec ID YOURPEERSID | ||
8 | #IPSec secret YOURPEERSSECRET | ||
9 | #Xauth username YOURUSERNAME | ||
10 | #Xauth password YOURPASSWORD | ||
11 | |||
12 | # Optional: | ||
13 | #UDP Encapsulate | ||
14 | #UDP Encapsulation Port 10000 | ||
15 | #Noninteractive | ||
16 | #No Detach | ||
17 | #Debug 99 | ||
18 | #Interface name tun0 | ||
19 | #Script /etc/vpnc/vpnc-script | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/long-help b/meta-networking/recipes-connectivity/vpnc/vpnc/long-help new file mode 100644 index 000000000..fbec25414 --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/long-help | |||
@@ -0,0 +1,168 @@ | |||
1 | Usage: vpnc [--version] [--print-config] [--help] [--long-help] [options] [config files] | ||
2 | |||
3 | Options: | ||
4 | --gateway <ip/hostname> | ||
5 | IP/name of your IPSec gateway | ||
6 | conf-variable: IPSec gateway <ip/hostname> | ||
7 | |||
8 | --id <ASCII string> | ||
9 | your group name | ||
10 | conf-variable: IPSec ID <ASCII string> | ||
11 | |||
12 | (configfile only option) | ||
13 | your group password (cleartext) | ||
14 | conf-variable: IPSec secret <ASCII string> | ||
15 | |||
16 | (configfile only option) | ||
17 | your group password (obfuscated) | ||
18 | conf-variable: IPSec obfuscated secret <hex string> | ||
19 | |||
20 | --username <ASCII string> | ||
21 | your username | ||
22 | conf-variable: Xauth username <ASCII string> | ||
23 | |||
24 | (configfile only option) | ||
25 | your password (cleartext) | ||
26 | conf-variable: Xauth password <ASCII string> | ||
27 | |||
28 | (configfile only option) | ||
29 | your password (obfuscated) | ||
30 | conf-variable: Xauth obfuscated password <hex string> | ||
31 | |||
32 | --domain <ASCII string> | ||
33 | (NT-) Domain name for authentication | ||
34 | conf-variable: Domain <ASCII string> | ||
35 | |||
36 | --xauth-inter | ||
37 | enable interactive extended authentication (for challenge response auth) | ||
38 | conf-variable: Xauth interactive | ||
39 | |||
40 | --vendor <cisco/netscreen> | ||
41 | vendor of your IPSec gateway | ||
42 | Default: cisco | ||
43 | conf-variable: Vendor <cisco/netscreen> | ||
44 | |||
45 | --natt-mode <natt/none/force-natt/cisco-udp> | ||
46 | Which NAT-Traversal Method to use: | ||
47 | * natt -- NAT-T as defined in RFC3947 | ||
48 | * none -- disable use of any NAT-T method | ||
49 | * force-natt -- always use NAT-T encapsulation even | ||
50 | without presence of a NAT device | ||
51 | (useful if the OS captures all ESP traffic) | ||
52 | * cisco-udp -- Cisco proprietary UDP encapsulation, commonly over Port 10000 | ||
53 | Note: cisco-tcp encapsulation is not yet supported | ||
54 | Default: natt | ||
55 | conf-variable: NAT Traversal Mode <natt/none/force-natt/cisco-udp> | ||
56 | |||
57 | --script <command> | ||
58 | command is executed using system() to configure the interface, | ||
59 | routing and so on. Device name, IP, etc. are passed using enviroment | ||
60 | variables, see README. This script is executed right after ISAKMP is | ||
61 | done, but before tunneling is enabled. It is called when vpnc | ||
62 | terminates, too | ||
63 | Default: /etc/vpnc/vpnc-script | ||
64 | conf-variable: Script <command> | ||
65 | |||
66 | --dh <dh1/dh2/dh5> | ||
67 | name of the IKE DH Group | ||
68 | Default: dh2 | ||
69 | conf-variable: IKE DH Group <dh1/dh2/dh5> | ||
70 | |||
71 | --pfs <nopfs/dh1/dh2/dh5/server> | ||
72 | Diffie-Hellman group to use for PFS | ||
73 | Default: server | ||
74 | conf-variable: Perfect Forward Secrecy <nopfs/dh1/dh2/dh5/server> | ||
75 | |||
76 | --enable-1des | ||
77 | enables weak single DES encryption | ||
78 | conf-variable: Enable Single DES | ||
79 | |||
80 | --enable-no-encryption | ||
81 | enables using no encryption for data traffic (key exchanged must be encrypted) | ||
82 | conf-variable: Enable no encryption | ||
83 | |||
84 | --application-version <ASCII string> | ||
85 | Application Version to report. Note: Default string is generated at runtime. | ||
86 | Default: Cisco Systems VPN Client 0.5.3-394:Linux | ||
87 | conf-variable: Application version <ASCII string> | ||
88 | |||
89 | --ifname <ASCII string> | ||
90 | visible name of the TUN/TAP interface | ||
91 | conf-variable: Interface name <ASCII string> | ||
92 | |||
93 | --ifmode <tun/tap> | ||
94 | mode of TUN/TAP interface: | ||
95 | * tun: virtual point to point interface (default) | ||
96 | * tap: virtual ethernet interface | ||
97 | Default: tun | ||
98 | conf-variable: Interface mode <tun/tap> | ||
99 | |||
100 | --debug <0/1/2/3/99> | ||
101 | Show verbose debug messages | ||
102 | * 0: Do not print debug information. | ||
103 | * 1: Print minimal debug information. | ||
104 | * 2: Show statemachine and packet/payload type information. | ||
105 | * 3: Dump everything exluding authentication data. | ||
106 | * 99: Dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS). | ||
107 | conf-variable: Debug <0/1/2/3/99> | ||
108 | |||
109 | --no-detach | ||
110 | Don't detach from the console after login | ||
111 | conf-variable: No Detach | ||
112 | |||
113 | --pid-file <filename> | ||
114 | store the pid of background process in <filename> | ||
115 | Default: /var/run/vpnc/pid | ||
116 | conf-variable: Pidfile <filename> | ||
117 | |||
118 | --local-addr <ip/hostname> | ||
119 | local IP to use for ISAKMP / ESP / ... (0.0.0.0 == automatically assign) | ||
120 | Default: 0.0.0.0 | ||
121 | conf-variable: Local Addr <ip/hostname> | ||
122 | |||
123 | --local-port <0-65535> | ||
124 | local ISAKMP port number to use (0 == use random port) | ||
125 | Default: 500 | ||
126 | conf-variable: Local Port <0-65535> | ||
127 | |||
128 | --udp-port <0-65535> | ||
129 | Local UDP port number to use (0 == use random port). | ||
130 | This is only relevant if cisco-udp nat-traversal is used. | ||
131 | This is the _local_ port, the remote udp port is discovered automatically. | ||
132 | It is especially not the cisco-tcp port. | ||
133 | Default: 10000 | ||
134 | conf-variable: Cisco UDP Encapsulation Port <0-65535> | ||
135 | |||
136 | --dpd-idle <0,10-86400> | ||
137 | Send DPD packet after not receiving anything for <idle> seconds. | ||
138 | Use 0 to disable DPD completely (both ways). | ||
139 | Default: 300 | ||
140 | conf-variable: DPD idle timeout (our side) <0,10-86400> | ||
141 | |||
142 | --non-inter | ||
143 | Don't ask anything, exit on missing options | ||
144 | conf-variable: Noninteractive | ||
145 | |||
146 | --auth-mode <psk/cert/hybrid> | ||
147 | Authentication mode: | ||
148 | * psk: pre-shared key (default) | ||
149 | * cert: server + client certificate (not implemented yet) | ||
150 | * hybrid: server certificate + xauth (if built with openssl support) | ||
151 | Default: psk | ||
152 | conf-variable: IKE Authmode <psk/cert/hybrid> | ||
153 | |||
154 | --ca-file <filename> | ||
155 | filename and path to the CA-PEM-File | ||
156 | conf-variable: CA-File <filename> | ||
157 | |||
158 | --ca-dir <directory> | ||
159 | path of the trusted CA-Directory | ||
160 | Default: /etc/ssl/certs | ||
161 | conf-variable: CA-Dir <directory> | ||
162 | |||
163 | --target-network <target network/netmask> | ||
164 | Target network in dotted decimal or CIDR notation | ||
165 | Default: 0.0.0.0/0.0.0.0 | ||
166 | conf-variable: IPSEC target network <target network/netmask> | ||
167 | |||
168 | Report bugs to vpnc@unix-ag.uni-kl.de | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch b/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch new file mode 100644 index 000000000..f394e6abd --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- vpnc-0.5.1/makeman.pl.old 2008-03-16 02:17:59.000000000 -0500 | ||
2 | +++ vpnc-0.5.1/makeman.pl 2008-03-16 02:29:34.000000000 -0500 | ||
3 | @@ -29,7 +29,7 @@ my $vpnc = './vpnc'; | ||
4 | # indenting lists (those originally starting with an asterisk). I hope | ||
5 | # this pays off when converting the manpage to HTML or such. | ||
6 | |||
7 | -open my $LONGHELP, '-|', "$vpnc --long-help"; | ||
8 | +open my $LONGHELP, '-|', "cat ../long-help"; | ||
9 | my $vpnc_options = ''; | ||
10 | my $relative_indent = 0; | ||
11 | my $indent_needed = 0; | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch b/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch new file mode 100644 index 000000000..3de65ec35 --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | --- a/Makefile~ 2009-01-20 18:44:30.000000000 +0100 | ||
2 | +++ b/Makefile 2009-01-20 18:44:30.000000000 +0100 | ||
3 | @@ -119,21 +119,21 @@ | ||
4 | else \ | ||
5 | install vpnc-script $(DESTDIR)$(ETCDIR); \ | ||
6 | fi | ||
7 | - install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf | ||
8 | - install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR) | ||
9 | - install -m755 pcf2vpnc $(DESTDIR)$(BINDIR) | ||
10 | - install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8 | ||
11 | - install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1 | ||
12 | - install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1 | ||
13 | - install -m644 COPYING $(DESTDIR)$(DOCDIR) | ||
14 | + install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf | ||
15 | + install -m 755 vpnc-disconnect $(DESTDIR)$(SBINDIR) | ||
16 | + install -m 755 pcf2vpnc $(DESTDIR)$(BINDIR) | ||
17 | + install -m 644 vpnc.8 $(DESTDIR)$(MANDIR)/man8 | ||
18 | + install -m 644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1 | ||
19 | + install -m 644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1 | ||
20 | + install -m 644 COPYING $(DESTDIR)$(DOCDIR) | ||
21 | |||
22 | install : install-common | ||
23 | - install -m755 vpnc $(DESTDIR)$(SBINDIR) | ||
24 | - install -m755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
25 | + install -m 755 vpnc $(DESTDIR)$(SBINDIR) | ||
26 | + install -m 755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
27 | |||
28 | install-strip : install-common | ||
29 | - install -s -m755 vpnc $(DESTDIR)$(SBINDIR) | ||
30 | - install -s -m755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
31 | + install -s -m 755 vpnc $(DESTDIR)$(SBINDIR) | ||
32 | + install -s -m 755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
33 | |||
34 | uninstall : | ||
35 | rm -f $(DESTDIR)$(SBINDIR)/vpnc \ | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb b/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb new file mode 100644 index 000000000..986416ade --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | SUMMARY = "A client for the Cisco3000 VPN Concentrator" | ||
2 | HOMEPAGE = "http://www.unix-ag.uni-kl.de/~massar/vpnc/" | ||
3 | AUTHOR = "Maurice Massar vpnc@unix-ag.uni-kl.de" | ||
4 | SECTION = "console/network" | ||
5 | PRIORITY = "optional" | ||
6 | LICENSE = "GPL-2.0+" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=173b74cb8ac640a9992c03f3bce22a33" | ||
8 | DEPENDS = "libgcrypt" | ||
9 | |||
10 | CFLAGS_append = ' -DVERSION=\\"${PV}\\"' | ||
11 | LDFLAGS_append = " -lgcrypt -lgpg-error" | ||
12 | |||
13 | do_install () { | ||
14 | sed -i s:m600:m\ 600:g Makefile | ||
15 | oe_runmake 'DESTDIR=${D}' 'PREFIX=/usr' install | ||
16 | rm -f ${D}${sysconfdir}/vpnc/vpnc.conf #This file is useless | ||
17 | install ${WORKDIR}/default.conf ${D}${sysconfdir}/vpnc/default.conf | ||
18 | } | ||
19 | |||
20 | CONFFILES_${PN} = "${sysconfdir}/vpnc/default.conf" | ||
21 | RDEPENDS_${PN} = "kernel-module-tun perl-module-io-file" | ||
22 | |||
23 | SRC_URI = "http://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-${PV}.tar.gz \ | ||
24 | file://makeman.patch \ | ||
25 | file://vpnc-install.patch \ | ||
26 | file://long-help \ | ||
27 | file://default.conf" | ||
28 | |||
29 | SRC_URI[md5sum] = "4378f9551d5b077e1770bbe09995afb3" | ||
30 | SRC_URI[sha256sum] = "46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884" | ||
diff --git a/meta-networking/recipes-daemons/atftp/atftp/atftpd.service b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service new file mode 100644 index 000000000..480bc702e --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Advanced TFTP Server | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | ExecStart=/usr/sbin/atftpd --daemon --port 69 | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/atftp/atftp_git.bb b/meta-networking/recipes-daemons/atftp/atftp_git.bb new file mode 100644 index 000000000..ee84f7725 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp_git.bb | |||
@@ -0,0 +1,61 @@ | |||
1 | SUMMARY = "Advanced TFTP server and client" | ||
2 | SECTION = "network" | ||
3 | HOMEPAGE = "http://packages.debian.org/atftp" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | PV = "0.7.1+git${SRCPV}" | ||
7 | PR = "r3" | ||
8 | |||
9 | SRCREV = "be3291a18c069ae23a124ffdc56d64a5ff0bbec7" | ||
10 | |||
11 | SRC_URI = "git://git.code.sf.net/p/atftp/code \ | ||
12 | file://atftpd-0.7_circumvent_tftp_size_restrictions.patch \ | ||
13 | file://atftpd-0.7_unprotected_assignments_crash.patch \ | ||
14 | file://atftpd.init \ | ||
15 | file://atftpd.service \ | ||
16 | file://atftp-0.7-sorcerers_apprentice.patch \ | ||
17 | " | ||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit autotools update-rc.d useradd systemd | ||
21 | |||
22 | PACKAGECONFIG ??= "tcp-wrappers" | ||
23 | PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre" | ||
24 | PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" | ||
25 | PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline" | ||
26 | |||
27 | INITSCRIPT_PACKAGES = "${PN}d" | ||
28 | INITSCRIPT_NAME_${PN}d = "atftpd" | ||
29 | INITSCRIPT_PARAMS_${PN}d = "defaults 80" | ||
30 | |||
31 | USERADD_PACKAGES = "${PN}d" | ||
32 | USERADD_PARAM_${PN}d = "--system --no-create-home --shell /bin/false \ | ||
33 | --user-group nobody" | ||
34 | |||
35 | do_install_append() { | ||
36 | install -d ${D}${sysconfdir}/init.d | ||
37 | install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd | ||
38 | |||
39 | install -d ${D}/srv/tftp | ||
40 | |||
41 | rm ${D}${sbindir}/in.tftpd | ||
42 | |||
43 | install -d ${D}${systemd_unitdir}/system | ||
44 | install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system | ||
45 | } | ||
46 | |||
47 | PACKAGES =+ "${PN}d" | ||
48 | |||
49 | FILES_${PN} = "${bindir}/*" | ||
50 | |||
51 | FILES_${PN}d = "${sbindir}/* \ | ||
52 | ${sysconfdir} \ | ||
53 | /srv/tftp \ | ||
54 | ${systemd_unitdir}/system/atftpd.service \ | ||
55 | " | ||
56 | |||
57 | SYSTEMD_PACKAGES = "${PN}d" | ||
58 | SYSTEMD_SERVICE_${PN}d = "atftpd.service" | ||
59 | RPROVIDES_${PN}d += "${PN}d-systemd" | ||
60 | RREPLACES_${PN}d += "${PN}d-systemd" | ||
61 | RCONFLICTS_${PN}d += "${PN}d-systemd" | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch new file mode 100644 index 000000000..fc64291cd --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | atftp exhibits the well known "Sorcerer's Apprentice Syndrome"(SAS) problem. | ||
2 | According to RFC 1350, the fix to SAS is quite simple: further copies of the | ||
3 | acknowledgment for a particular data block would be ignored. | ||
4 | |||
5 | Patch originally from OpenSUSE: | ||
6 | https://build.opensuse.org/package/view_file?file=atftp-0.7-sorcerers_apprentice.patch&package=atftp.539&project=openSUSE%3A12.1%3AUpdate&rev=84569792975e00573d7df597d2a6e895 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
11 | Index: atftp-0.7/tftp_file.c | ||
12 | =================================================================== | ||
13 | --- atftp-0.7.orig/tftp_file.c 2011-11-22 15:12:53.792744083 +0100 | ||
14 | +++ atftp-0.7/tftp_file.c 2011-11-22 15:13:51.706421893 +0100 | ||
15 | @@ -605,6 +605,7 @@ | ||
16 | int timeout_state = state; /* what state should we go on when timeout */ | ||
17 | int result; | ||
18 | long block_number = 0; | ||
19 | + long last_requested_block = -1; | ||
20 | long last_block = -1; | ||
21 | int data_size; /* size of data received */ | ||
22 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
23 | @@ -765,6 +766,17 @@ | ||
24 | connected = 1; | ||
25 | } | ||
26 | block_number = ntohs(tftphdr->th_block); | ||
27 | + | ||
28 | + if (last_requested_block >= block_number) | ||
29 | + { | ||
30 | + if (data->trace) | ||
31 | + fprintf(stderr, "received duplicated ACK <block: %ld >= %ld>\n", | ||
32 | + last_requested_block, block_number); | ||
33 | + break; | ||
34 | + } | ||
35 | + else | ||
36 | + last_requested_block = block_number; | ||
37 | + | ||
38 | if (data->trace) | ||
39 | fprintf(stderr, "received ACK <block: %ld>\n", | ||
40 | block_number); | ||
41 | Index: atftp-0.7/tftpd_file.c | ||
42 | =================================================================== | ||
43 | --- atftp-0.7.orig/tftpd_file.c 2011-11-22 15:12:53.793744112 +0100 | ||
44 | +++ atftp-0.7/tftpd_file.c 2011-11-22 15:15:04.617534260 +0100 | ||
45 | @@ -403,6 +403,7 @@ | ||
46 | int timeout_state = state; | ||
47 | int result; | ||
48 | long block_number = 0; | ||
49 | + long last_requested_block = -1; | ||
50 | long last_block = -1; | ||
51 | int block_loops = 0; | ||
52 | int data_size; | ||
53 | @@ -859,6 +860,32 @@ | ||
54 | { | ||
55 | logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
56 | } | ||
57 | + | ||
58 | + /* check whether the block request isn't already fulfilled */ | ||
59 | + | ||
60 | + /* multicast, block numbers could contain gaps */ | ||
61 | + if (multicast) { | ||
62 | + if (last_requested_block >= block_number) | ||
63 | + { | ||
64 | + if (data->trace) | ||
65 | + logger(LOG_DEBUG, "received duplicated ACK <block: %d >= %d>", last_requested_block, block_number); | ||
66 | + break; | ||
67 | + } | ||
68 | + else | ||
69 | + last_requested_block = block_number; | ||
70 | + /* unicast, blocks should be requested one after another */ | ||
71 | + } else { | ||
72 | + if (last_requested_block + 1 != block_number && last_requested_block != -1) | ||
73 | + { | ||
74 | + if (data->trace) | ||
75 | + logger(LOG_DEBUG, "received out of order ACK <block: %d != %d>", last_requested_block + 1, block_number); | ||
76 | + break; | ||
77 | + } | ||
78 | + else | ||
79 | + last_requested_block = block_number; | ||
80 | + } | ||
81 | + | ||
82 | + | ||
83 | if (ntohs(tftphdr->th_block) == 65535) | ||
84 | { | ||
85 | block_loops++; | ||
86 | @@ -958,6 +985,8 @@ | ||
87 | /* nedd to send an oack to that client */ | ||
88 | state = S_SEND_OACK; | ||
89 | fseek(fp, 0, SEEK_SET); | ||
90 | + /* reset the last block received counter */ | ||
91 | + last_requested_block = -1; | ||
92 | } | ||
93 | else | ||
94 | { | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch new file mode 100644 index 000000000..280b570b2 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | Fate #303031: Circumvent TFTP size restrictions in atftpd | ||
2 | The size of a single image file that can be transferred with TFTP is limited to | ||
3 | 2^(2*8) *BLOCKSIZE (as per RFC 1350 there are only two bytes for the block | ||
4 | counter). This is problematic for one of our customers who needs to transfer | ||
5 | 100+ MB Windows images using a TFTP client (NT bootloader) which has a | ||
6 | hardwared BLOCKSIZE setting of 1432). | ||
7 | |||
8 | block rollover | ||
9 | http://www.compuphase.com/tftp.htm | ||
10 | |||
11 | Patch originally from OpenSUSE: | ||
12 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Index: git/tftp_def.h | ||
17 | =================================================================== | ||
18 | --- git.orig/tftp_def.h 2012-11-19 16:28:50.221027144 -0800 | ||
19 | +++ git/tftp_def.h 2012-11-20 17:40:54.391206979 -0800 | ||
20 | @@ -32,6 +32,7 @@ | ||
21 | #define TIMEOUT 5 /* Client timeout */ | ||
22 | #define S_TIMEOUT 5 /* Server timout. */ | ||
23 | #define NB_OF_RETRY 5 | ||
24 | +#define MAXBLOCKS 1000000 /* maximum number of blocks in a download */ | ||
25 | |||
26 | /* definition to use tftp_options structure */ | ||
27 | #define OPT_FILENAME 0 | ||
28 | Index: git/tftp_file.c | ||
29 | =================================================================== | ||
30 | --- git.orig/tftp_file.c 2012-11-19 16:28:50.221027144 -0800 | ||
31 | +++ git/tftp_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
32 | @@ -622,8 +622,8 @@ | ||
33 | int state = S_SEND_REQ; /* current state in the state machine */ | ||
34 | int timeout_state = state; /* what state should we go on when timeout */ | ||
35 | int result; | ||
36 | - int block_number = 0; | ||
37 | - int last_block = -1; | ||
38 | + long block_number = 0; | ||
39 | + long last_block = -1; | ||
40 | int data_size; /* size of data received */ | ||
41 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
42 | struct sockaddr_storage sa; /* a copy of data.sa_peer */ | ||
43 | @@ -637,8 +637,8 @@ | ||
44 | int convert = 0; /* if true, do netascii convertion */ | ||
45 | char string[MAXLEN]; | ||
46 | |||
47 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
48 | - int prev_file_pos = 0; | ||
49 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
50 | + long prev_file_pos = 0; | ||
51 | int temp = 0; | ||
52 | |||
53 | data->file_size = 0; | ||
54 | @@ -745,7 +745,7 @@ | ||
55 | data_size, data->data_buffer); | ||
56 | data->file_size += data_size; | ||
57 | if (data->trace) | ||
58 | - fprintf(stderr, "sent DATA <block: %d, size: %d>\n", | ||
59 | + fprintf(stderr, "sent DATA <block: %ld, size: %d>\n", | ||
60 | block_number + 1, data_size - 4); | ||
61 | state = S_WAIT_PACKET; | ||
62 | break; | ||
63 | @@ -785,7 +785,7 @@ | ||
64 | } | ||
65 | block_number = ntohs(tftphdr->th_block); | ||
66 | if (data->trace) | ||
67 | - fprintf(stderr, "received ACK <block: %d>\n", | ||
68 | + fprintf(stderr, "received ACK <block: %ld>\n", | ||
69 | block_number); | ||
70 | if ((last_block != -1) && (block_number > last_block)) | ||
71 | { | ||
72 | Index: git/tftp_io.c | ||
73 | =================================================================== | ||
74 | --- git.orig/tftp_io.c 2012-11-19 16:28:50.221027144 -0800 | ||
75 | +++ git/tftp_io.c 2012-11-19 16:28:51.201027167 -0800 | ||
76 | @@ -350,8 +350,8 @@ | ||
77 | /* | ||
78 | * Read from file and do netascii conversion if needed | ||
79 | */ | ||
80 | -int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
81 | - int convert, int *prev_block_number, int *prev_file_pos, int *temp) | ||
82 | +int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, long block_number, | ||
83 | + int convert, long *prev_block_number, long *prev_file_pos, int *temp) | ||
84 | { | ||
85 | int i; | ||
86 | int c; | ||
87 | Index: git/tftp_io.h | ||
88 | =================================================================== | ||
89 | --- git.orig/tftp_io.h 2012-11-19 16:28:50.221027144 -0800 | ||
90 | +++ git/tftp_io.h 2012-11-19 16:28:51.201027167 -0800 | ||
91 | @@ -52,8 +52,8 @@ | ||
92 | int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa, | ||
93 | struct sockaddr_storage *from, struct sockaddr_storage *to, | ||
94 | int timeout, int *size, char *data); | ||
95 | -int tftp_file_read(FILE *fp, char *buffer, int buffer_size, int block_number, int convert, | ||
96 | - int *prev_block_number, int *prev_file_pos, int *temp); | ||
97 | +int tftp_file_read(FILE *fp, char *buffer, int buffer_size, long block_number, int convert, | ||
98 | + long *prev_block_number, long *prev_file_pos, int *temp); | ||
99 | int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
100 | int data_size, int convert, int *prev_block_number, int *temp); | ||
101 | #endif | ||
102 | Index: git/tftpd_file.c | ||
103 | =================================================================== | ||
104 | --- git.orig/tftpd_file.c 2012-11-19 16:28:50.225027144 -0800 | ||
105 | +++ git/tftpd_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
106 | @@ -407,8 +407,9 @@ | ||
107 | int state = S_BEGIN; | ||
108 | int timeout_state = state; | ||
109 | int result; | ||
110 | - int block_number = 0; | ||
111 | - int last_block = -1; | ||
112 | + long block_number = 0; | ||
113 | + long last_block = -1; | ||
114 | + int block_loops = 0; | ||
115 | int data_size; | ||
116 | struct sockaddr_storage *sa = &data->client_info->client; | ||
117 | struct sockaddr_storage from; | ||
118 | @@ -431,8 +432,8 @@ | ||
119 | struct client_info *client_old = NULL; | ||
120 | struct tftp_opt options[OPT_NUMBER]; | ||
121 | |||
122 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
123 | - int prev_file_pos = 0; | ||
124 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
125 | + long prev_file_pos = 0; | ||
126 | int temp = 0; | ||
127 | |||
128 | /* look for mode option */ | ||
129 | @@ -565,11 +566,12 @@ | ||
130 | logger(LOG_INFO, "blksize option -> %d", result); | ||
131 | } | ||
132 | |||
133 | - /* Verify that the file can be sent in 2^16 block of BLKSIZE octets */ | ||
134 | - if ((file_stat.st_size / (data->data_buffer_size - 4)) > 65535) | ||
135 | + /* Verify that the file can be sent in MAXBLOCKS blocks of BLKSIZE octets */ | ||
136 | + if ((file_stat.st_size / (data->data_buffer_size - 4)) > MAXBLOCKS) | ||
137 | { | ||
138 | tftp_send_error(sockfd, sa, EUNDEF, data->data_buffer, data->data_buffer_size); | ||
139 | - logger(LOG_NOTICE, "Requested file to big, increase BLKSIZE"); | ||
140 | + logger(LOG_NOTICE, "Requested file too big, increase BLKSIZE"); | ||
141 | + logger(LOG_NOTICE, "Only %d blocks of %d bytes can be served.", MAXBLOCKS, data->data_buffer_size); | ||
142 | if (data->trace) | ||
143 | logger(LOG_DEBUG, "sent ERROR <code: %d, msg: %s>", EUNDEF, | ||
144 | tftp_errmsg[EUNDEF]); | ||
145 | @@ -880,10 +882,15 @@ | ||
146 | } | ||
147 | /* The ACK is from the current client */ | ||
148 | number_of_timeout = 0; | ||
149 | - block_number = ntohs(tftphdr->th_block); | ||
150 | + block_number = (block_loops * 65536) + ntohs(tftphdr->th_block); | ||
151 | if (data->trace) | ||
152 | - logger(LOG_DEBUG, "received ACK <block: %d>", | ||
153 | - block_number); | ||
154 | + { | ||
155 | + logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
156 | + } | ||
157 | + if (ntohs(tftphdr->th_block) == 65535) | ||
158 | + { | ||
159 | + block_loops++; | ||
160 | + }; | ||
161 | if ((last_block != -1) && (block_number > last_block)) | ||
162 | { | ||
163 | state = S_END; | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch new file mode 100644 index 000000000..28fba6cf5 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | Avoid assigning thread data outside of mutex lock | ||
2 | |||
3 | Patch originally from OpenSUSE: | ||
4 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: git/tftpd_list.c | ||
9 | =================================================================== | ||
10 | --- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700 | ||
11 | +++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700 | ||
12 | @@ -49,11 +49,11 @@ | ||
13 | */ | ||
14 | int tftpd_list_add(struct thread_data *new) | ||
15 | { | ||
16 | - struct thread_data *current = thread_data; | ||
17 | + struct thread_data *current; | ||
18 | int ret; | ||
19 | |||
20 | pthread_mutex_lock(&thread_list_mutex); | ||
21 | - | ||
22 | + current = thread_data; | ||
23 | number_of_thread++; | ||
24 | |||
25 | ret = number_of_thread; | ||
26 | @@ -81,11 +81,13 @@ | ||
27 | */ | ||
28 | int tftpd_list_remove(struct thread_data *old) | ||
29 | { | ||
30 | - struct thread_data *current = thread_data; | ||
31 | + struct thread_data *current; | ||
32 | int ret; | ||
33 | |||
34 | pthread_mutex_lock(&thread_list_mutex); | ||
35 | |||
36 | + current = thread_data; | ||
37 | + | ||
38 | number_of_thread--; | ||
39 | ret = number_of_thread; | ||
40 | |||
41 | @@ -137,23 +139,26 @@ | ||
42 | struct thread_data *data, | ||
43 | struct client_info *client) | ||
44 | { | ||
45 | - struct thread_data *current = thread_data; /* head of the list */ | ||
46 | - struct tftp_opt *tftp_options = data->tftp_options; | ||
47 | + struct thread_data *current; /* head of the list */ | ||
48 | + struct tftp_opt *tftp_options; | ||
49 | struct client_info *tmp; | ||
50 | char options[MAXLEN]; | ||
51 | char string[MAXLEN]; | ||
52 | char *index; | ||
53 | int len; | ||
54 | |||
55 | + /* lock the whole list before walking it */ | ||
56 | + pthread_mutex_lock(&thread_list_mutex); | ||
57 | + | ||
58 | *thread = NULL; | ||
59 | |||
60 | + current = thread_data; | ||
61 | + tftp_options = data->tftp_options; | ||
62 | + | ||
63 | opt_request_to_string(tftp_options, options, MAXLEN); | ||
64 | index = strstr(options, "multicast"); | ||
65 | len = (int)index - (int)options; | ||
66 | |||
67 | - /* lock the whole list before walking it */ | ||
68 | - pthread_mutex_lock(&thread_list_mutex); | ||
69 | - | ||
70 | while (current) | ||
71 | { | ||
72 | if (current != data) | ||
73 | @@ -214,9 +219,10 @@ | ||
74 | void tftpd_clientlist_remove(struct thread_data *thread, | ||
75 | struct client_info *client) | ||
76 | { | ||
77 | - struct client_info *tmp = thread->client_info; | ||
78 | + struct client_info *tmp; | ||
79 | |||
80 | pthread_mutex_lock(&thread->client_mutex); | ||
81 | + tmp = thread->client_info; | ||
82 | while ((tmp->next != client) && (tmp->next != NULL)) | ||
83 | tmp = tmp->next; | ||
84 | if (tmp->next == NULL) | ||
85 | @@ -231,9 +237,11 @@ | ||
86 | void tftpd_clientlist_free(struct thread_data *thread) | ||
87 | { | ||
88 | struct client_info *tmp; | ||
89 | - struct client_info *head = thread->client_info; | ||
90 | + struct client_info *head; | ||
91 | |||
92 | pthread_mutex_lock(&thread->client_mutex); | ||
93 | + head = thread->client_info; | ||
94 | + | ||
95 | while (head) | ||
96 | { | ||
97 | tmp = head; | ||
98 | @@ -250,9 +258,10 @@ | ||
99 | struct client_info *client, | ||
100 | struct sockaddr_storage *sock) | ||
101 | { | ||
102 | - struct client_info *head = thread->client_info; | ||
103 | + struct client_info *head; | ||
104 | |||
105 | pthread_mutex_lock(&thread->client_mutex); | ||
106 | + head = thread->client_info; | ||
107 | |||
108 | if (client) | ||
109 | { | ||
110 | @@ -334,10 +343,10 @@ | ||
111 | |||
112 | void tftpd_list_kill_threads(void) | ||
113 | { | ||
114 | - struct thread_data *current = thread_data; /* head of list */ | ||
115 | + struct thread_data *current; /* head of list */ | ||
116 | |||
117 | pthread_mutex_lock(&thread_list_mutex); | ||
118 | - | ||
119 | + current = thread_data; | ||
120 | |||
121 | while (current != NULL) | ||
122 | { | ||
123 | Index: git/tftpd_mcast.c | ||
124 | =================================================================== | ||
125 | --- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700 | ||
126 | +++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700 | ||
127 | @@ -51,9 +51,11 @@ | ||
128 | */ | ||
129 | int tftpd_mcast_get_tid(char **addr, short *port) | ||
130 | { | ||
131 | - struct tid *current = tid_list; | ||
132 | + struct tid *current; | ||
133 | |||
134 | pthread_mutex_lock(&mcast_tid_list); | ||
135 | + current = tid_list; | ||
136 | + | ||
137 | /* walk the list for a free tid */ | ||
138 | while (current != NULL) | ||
139 | { | ||
140 | @@ -74,9 +76,11 @@ | ||
141 | |||
142 | int tftpd_mcast_free_tid(char *addr, short port) | ||
143 | { | ||
144 | - struct tid *current = tid_list; | ||
145 | + struct tid *current; | ||
146 | |||
147 | pthread_mutex_lock(&mcast_tid_list); | ||
148 | + current = tid_list; | ||
149 | + | ||
150 | while (current != NULL) | ||
151 | { | ||
152 | if ((current->used == 1) && (current->port == port) && | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd.init b/meta-networking/recipes-daemons/atftp/files/atftpd.init new file mode 100644 index 000000000..161d97aca --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd.init | |||
@@ -0,0 +1,37 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/atftpd and type | ||
5 | # > update-rc.d atftpd defaults 60 | ||
6 | # | ||
7 | |||
8 | |||
9 | test -f /usr/sbin/atftpd || exit 0 | ||
10 | |||
11 | test -d /srv/tftp || mkdir -p /srv/tftp | ||
12 | |||
13 | case "$1" in | ||
14 | start) | ||
15 | echo -n "Starting tftp daemon: atftpd" | ||
16 | start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69 | ||
17 | echo "." | ||
18 | ;; | ||
19 | stop) | ||
20 | echo -n "Stopping tftp daemon: atftpd" | ||
21 | start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd | ||
22 | echo "." | ||
23 | ;; | ||
24 | reload|force-reload) | ||
25 | start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd | ||
26 | ;; | ||
27 | restart) | ||
28 | $0 stop | ||
29 | sleep 1 | ||
30 | $0 start | ||
31 | ;; | ||
32 | *) | ||
33 | echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}" | ||
34 | exit 1 | ||
35 | esac | ||
36 | |||
37 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch new file mode 100644 index 000000000..742f25de1 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 40971911d653bf53de295d7462c643e4073916b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Fri, 1 Nov 2013 12:47:18 -0400 | ||
4 | Subject: [PATCH] systemd: allow --with-systemd to take a path arg | ||
5 | |||
6 | If building for a cross-compile environment with systemd it is convenient | ||
7 | to be able to specify a systemd path for the target that may not be the | ||
8 | same as that on the host. | ||
9 | |||
10 | Upstream-status: Submitted [http://www.spinics.net/lists/autofs/msg00740.html] | ||
11 | |||
12 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
13 | --- | ||
14 | aclocal.m4 | 10 ++++++++-- | ||
15 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
18 | index 3e6f223..105e3e9 100644 | ||
19 | --- a/aclocal.m4 | ||
20 | +++ b/aclocal.m4 | ||
21 | @@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory | ||
22 | dnl -------------------------------------------------------------------------- | ||
23 | AC_DEFUN([AF_WITH_SYSTEMD], | ||
24 | [AC_ARG_WITH(systemd, | ||
25 | -[ --with-systemd install systemd unit file if systemd unit directory | ||
26 | - is found on system], | ||
27 | +[ --with-systemd@<:@=systemddir@:>@ install systemd unit file. If 'yes' | ||
28 | + probe the system for unit directory. | ||
29 | + If a path is specified, assume that | ||
30 | + is a valid install path.], | ||
31 | [if test "$withval" = yes; then | ||
32 | if test -z "$systemddir"; then | ||
33 | AC_MSG_CHECKING([location of the systemd unit files directory]) | ||
34 | @@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD], | ||
35 | else | ||
36 | AC_MSG_RESULT(not found) | ||
37 | fi | ||
38 | +else | ||
39 | + if test "$withval" != no; then | ||
40 | + systemddir=$withval | ||
41 | + fi | ||
42 | fi]) | ||
43 | ]) | ||
44 | |||
45 | -- | ||
46 | 1.7.10.4 | ||
47 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/Makefile.rules-cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/Makefile.rules-cross.patch new file mode 100644 index 000000000..7dc7096c2 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/Makefile.rules-cross.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Index: autofs-5.0.7/Makefile.rules | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/Makefile.rules 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/Makefile.rules 2012-10-26 09:23:40.270204270 -0700 | ||
5 | @@ -34,14 +34,14 @@ | ||
6 | else | ||
7 | CFLAGS ?= -O2 -Wall | ||
8 | LDFLAGS = -s | ||
9 | -STRIP = strip --strip-debug | ||
10 | +STRIP = ${TARGET_PREFIX}strip --strip-debug | ||
11 | endif | ||
12 | endif | ||
13 | |||
14 | -CC = gcc | ||
15 | -CXX = g++ | ||
16 | +CC ?= ${TARGET_PREFIX}gcc | ||
17 | +CXX ?= ${TARGET_PREFIX}g++ | ||
18 | CXXFLAGS = $(CFLAGS) | ||
19 | -LD = ld | ||
20 | +LD ?= ${TARGET_PREFIX}ld | ||
21 | SOLDFLAGS = -shared | ||
22 | |||
23 | CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/add-the-needed-stdarg.h.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/add-the-needed-stdarg.h.patch new file mode 100644 index 000000000..fdb906b22 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/add-the-needed-stdarg.h.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | [PATCH] add the needed stdarg.h | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | lib/defaults.c | 1 + | ||
8 | 1 file changed, 1 insertion(+) | ||
9 | |||
10 | diff --git a/lib/defaults.c b/lib/defaults.c | ||
11 | index 2b03ea2..5728e67 100644 | ||
12 | --- a/lib/defaults.c | ||
13 | +++ b/lib/defaults.c | ||
14 | @@ -16,6 +16,7 @@ | ||
15 | |||
16 | #include <stdlib.h> | ||
17 | #include <stdio.h> | ||
18 | +#include <stdarg.h> | ||
19 | #include <ctype.h> | ||
20 | #include <string.h> | ||
21 | #include <sys/utsname.h> | ||
22 | -- | ||
23 | 1.7.10.4 | ||
24 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-do-not-check-for-modprobe.patch new file mode 100644 index 000000000..af5be6a83 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-do-not-check-for-modprobe.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Description: Loading autofs module is #ifdef'ed in the source, so | ||
2 | there is no need to check for /proc (which is only used | ||
3 | to load module) or modprobe. Both modprobe and /proc | ||
4 | are always in the fixed location so there's no need to | ||
5 | check for these to start with. | ||
6 | |||
7 | Upstream-Status: Backport [1] | ||
8 | [1] http://www.spinics.net/lists/autofs/msg00139.html | ||
9 | |||
10 | diff -urpN a/configure.in b/configure.in | ||
11 | --- a/configure.in 2013-01-15 11:30:22.000000000 +0800 | ||
12 | +++ b/configure.in 2013-01-15 11:31:45.000000000 +0800 | ||
13 | @@ -34,11 +34,6 @@ AC_MSG_CHECKING([for binaries in]) | ||
14 | AC_MSG_RESULT([$searchpath]) | ||
15 | |||
16 | # | ||
17 | -# Make sure we have "/proc" | ||
18 | -# | ||
19 | -AF_LINUX_PROCFS() | ||
20 | - | ||
21 | -# | ||
22 | # Location of init.d directory? | ||
23 | # | ||
24 | AF_INIT_D() | ||
25 | @@ -142,7 +137,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umo | ||
26 | AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath) | ||
27 | AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath) | ||
28 | AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath) | ||
29 | -AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath) | ||
30 | |||
31 | AF_CHECK_PROG(LEX, flex lex, , $searchpath) | ||
32 | AF_CHECK_PROG(YACC, bison, , $searchpath) | ||
33 | diff -urpN a/daemon/module.c b/daemon/module.c | ||
34 | --- a/daemon/module.c 2013-01-15 11:30:49.000000000 +0800 | ||
35 | +++ b/daemon/module.c 2013-01-15 11:32:00.000000000 +0800 | ||
36 | @@ -18,6 +18,8 @@ | ||
37 | #include <stdlib.h> | ||
38 | #include "automount.h" | ||
39 | |||
40 | +#if 0 | ||
41 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
42 | int load_autofs4_module(void) | ||
43 | { | ||
44 | FILE *fp; | ||
45 | @@ -52,6 +54,7 @@ int load_autofs4_module(void) | ||
46 | |||
47 | return 1; | ||
48 | } | ||
49 | +#endif | ||
50 | |||
51 | struct lookup_mod *open_lookup(const char *name, const char *err_prefix, | ||
52 | const char *mapfmt, int argc, const char *const *argv) | ||
53 | diff -urpN a/include/automount.h b/include/automount.h | ||
54 | --- a/include/automount.h 2013-01-15 11:31:10.000000000 +0800 | ||
55 | +++ b/include/automount.h 2013-01-15 11:32:06.000000000 +0800 | ||
56 | @@ -50,16 +50,11 @@ | ||
57 | #error Failed to locate umount(8)! | ||
58 | #endif | ||
59 | |||
60 | -#ifndef HAVE_MODPROBE | ||
61 | -#error Failed to locate modprobe(8)! | ||
62 | -#endif | ||
63 | - | ||
64 | -#ifndef HAVE_LINUX_PROCFS | ||
65 | -#error Failed to verify existence of procfs filesystem! | ||
66 | -#endif | ||
67 | - | ||
68 | +#if 0 | ||
69 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
70 | #define FS_MODULE_NAME "autofs4" | ||
71 | int load_autofs4_module(void); | ||
72 | +#endif | ||
73 | |||
74 | /* The -s (sloppy) option to mount is good, if we have it... */ | ||
75 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-fix-lib-deps.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-fix-lib-deps.patch new file mode 100644 index 000000000..09fea495d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-fix-lib-deps.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 54a9bd28a307dd74df044d779ca85adcf36aa202 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe.macdonald@windriver.com> | ||
3 | Date: Tue, 18 Jun 2013 10:05:21 -0400 | ||
4 | Subject: [PATCH] Fix the dependency issue | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | autofs's lib sources have a dependency on a number of files that are | ||
9 | generated by rpcgen during buildtime | ||
10 | |||
11 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
12 | Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> | ||
13 | --- | ||
14 | lib/Makefile | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/lib/Makefile b/lib/Makefile | ||
18 | index 5418009..bff4e1d 100644 | ||
19 | --- a/lib/Makefile | ||
20 | +++ b/lib/Makefile | ||
21 | @@ -75,3 +75,4 @@ install: all | ||
22 | clean: | ||
23 | rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~ | ||
24 | |||
25 | +$(OBJS): $(RPCS) | ||
26 | -- | ||
27 | 1.7.10.4 | ||
28 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch new file mode 100644 index 000000000..3a878980a --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | From 44bdce8c6ed9b30c1643e5981172a4f9025f013c Mon Sep 17 00:00:00 2001 | ||
4 | From: Andreas Oberritter <obi@opendreambox.org> | ||
5 | Date: Wed, 13 Mar 2013 16:17:08 +0100 | ||
6 | Subject: [PATCH] autofs-5.0.7: include linux/nfs.h directly in rpc_subs.h | ||
7 | |||
8 | Fixes compile error with uclibc. Glibc's nfs/nfs.h contains | ||
9 | nothing but "#include linux/nfs.h". rpc_subs.h already includes | ||
10 | other linux/nfs*.h files directly. | ||
11 | |||
12 | Signed-off-by: Andreas Oberritter <obi@opendreambox.org> | ||
13 | --- | ||
14 | include/rpc_subs.h | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/include/rpc_subs.h b/include/rpc_subs.h | ||
18 | index b6d59f9..a2d9648 100644 | ||
19 | --- a/include/rpc_subs.h | ||
20 | +++ b/include/rpc_subs.h | ||
21 | @@ -18,7 +18,7 @@ | ||
22 | |||
23 | #include <rpc/rpc.h> | ||
24 | #include <rpc/pmap_prot.h> | ||
25 | -#include <nfs/nfs.h> | ||
26 | +#include <linux/nfs.h> | ||
27 | #include <linux/nfs2.h> | ||
28 | #include <linux/nfs3.h> | ||
29 | |||
30 | -- | ||
31 | 1.7.10.4 | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-additional-distros.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-additional-distros.patch new file mode 100644 index 000000000..6a35843ce --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/autofs-additional-distros.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- autofs-4.1.4/samples/rc.autofs.in~ 2005-04-11 06:30:54.000000000 -0500 | ||
2 | +++ autofs-4.1.4/samples/rc.autofs.in 2007-04-07 13:18:44.000000000 -0500 | ||
3 | @@ -43,6 +43,9 @@ | ||
4 | system=debian | ||
5 | elif [ -f /etc/redhat-release ]; then | ||
6 | system=redhat | ||
7 | +elif [ -f /etc/issue ] && grep -q "^SlugOS\|Yocto" /etc/issue ; then | ||
8 | + # SlugOS and Yocto behave like Debian, at least for autofs purposes. | ||
9 | + system=debian | ||
10 | else | ||
11 | echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2 | ||
12 | exit 1 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/cross.patch new file mode 100644 index 000000000..8f1af625f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/cross.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 04:45:07.000000000 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 10:47:53.263996910 -0700 | ||
5 | @@ -7,6 +7,8 @@ | ||
6 | AC_DEFUN(AF_PATH_INCLUDE, | ||
7 | [AC_PATH_PROGS($1,$2,$3,$4) | ||
8 | if test -n "$$1"; then | ||
9 | + AH_TEMPLATE([HAVE_$1], [Have $2]) | ||
10 | + AH_TEMPLATE([PATH_$1], [Have $2]) | ||
11 | AC_DEFINE(HAVE_$1,1,[define if you have $1]) | ||
12 | AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1]) | ||
13 | HAVE_$1=1 | ||
14 | Index: autofs-5.0.7/configure.in | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/configure.in 2012-10-28 04:45:06.000000000 -0700 | ||
17 | +++ autofs-5.0.7/configure.in 2012-10-28 10:50:07.580000628 -0700 | ||
18 | @@ -301,13 +301,15 @@ | ||
19 | cat > pietest.c <<EOF | ||
20 | int main(void) { return 0; } | ||
21 | EOF | ||
22 | +AF_tmp_ldflags="$LDFLAGS" | ||
23 | +AF_tmp_cflags="$CFLAGS" | ||
24 | CFLAGS=-fPIE | ||
25 | LDFLAGS=-pie | ||
26 | DAEMON_CFLAGS= | ||
27 | DAEMON_LDFLAGS= | ||
28 | AC_MSG_CHECKING([whether gcc -fPIE works]) | ||
29 | -AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
30 | - [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
31 | +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
32 | + [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
33 | AC_MSG_RESULT([$gcc_supports_pie]) | ||
34 | if test $gcc_supports_pie = yes ; then | ||
35 | DAEMON_CFLAGS="-fPIE" | ||
36 | @@ -316,6 +318,8 @@ | ||
37 | rm -f pietest.c | ||
38 | AC_SUBST(DAEMON_CFLAGS) | ||
39 | AC_SUBST(DAEMON_LDFLAGS) | ||
40 | +CFLAGS="${AF_tmp_cflags}" | ||
41 | +LDFLAGS="${AF_tmp_ldflags}" | ||
42 | |||
43 | # | ||
44 | # Enable ability to access value in external env variable | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/fix_disable_ldap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/fix_disable_ldap.patch new file mode 100644 index 000000000..31c8510a6 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/fix_disable_ldap.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | autofs: fails to compile with openldap disabled | ||
2 | |||
3 | As of 5.0.6, it appears that changes were introduced so that | ||
4 | if you compile with openldap disabled and openldap headers are not | ||
5 | available, then autofs fails to build. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Amy Fong <amy.fong@windriver.com> | ||
10 | -- | ||
11 | lookup_ldap.h | 4 ++++ | ||
12 | 1 file changed, 4 insertions(+) | ||
13 | |||
14 | --- | ||
15 | include/lookup_ldap.h | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | --- a/include/lookup_ldap.h | ||
19 | +++ b/include/lookup_ldap.h | ||
20 | @@ -1,7 +1,9 @@ | ||
21 | #ifndef LOOKUP_LDAP_H | ||
22 | #define LOOKUP_LDAP_H | ||
23 | |||
24 | +#ifdef WITH_LDAP | ||
25 | #include <ldap.h> | ||
26 | +#endif | ||
27 | |||
28 | #ifdef WITH_SASL | ||
29 | #include <openssl/ssl.h> | ||
30 | @@ -109,10 +111,12 @@ | ||
31 | |||
32 | #define LDAP_AUTH_USESIMPLE 0x0008 | ||
33 | |||
34 | +#ifdef WITH_LDAP | ||
35 | /* lookup_ldap.c */ | ||
36 | LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt); | ||
37 | int unbind_ldap_connection(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt); | ||
38 | int authtype_requires_creds(const char *authtype); | ||
39 | +#endif | ||
40 | |||
41 | #ifdef WITH_SASL | ||
42 | /* cyrus-sasl.c */ | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/force-STRIP-to-emtpy.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/force-STRIP-to-emtpy.patch new file mode 100644 index 000000000..634005bd2 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/force-STRIP-to-emtpy.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | [PATCH] force STRIP to emtpy | ||
2 | |||
3 | otherwise the generate file will be stripped | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | Makefile.rules | 2 +- | ||
8 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
9 | |||
10 | diff --git a/Makefile.rules b/Makefile.rules | ||
11 | index 710a2c9..e4334db 100644 | ||
12 | --- a/Makefile.rules | ||
13 | +++ b/Makefile.rules | ||
14 | @@ -31,7 +31,7 @@ LDFLAGS ?= -s | ||
15 | endif | ||
16 | |||
17 | ifdef DONTSTRIP | ||
18 | -STRIP ?= : | ||
19 | +STRIP = : | ||
20 | else | ||
21 | STRIP ?= strip --strip-debug | ||
22 | endif | ||
23 | -- | ||
24 | 1.7.10.4 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch new file mode 100644 index 000000000..e93021d56 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc-name-clash-backout.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | --- | ||
2 | lib/rpc_subs.c | 10 ---------- | ||
3 | 1 file changed, 10 deletions(-) | ||
4 | |||
5 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
6 | index 5d6ead0..c7177f2 100644 | ||
7 | --- a/lib/rpc_subs.c | ||
8 | +++ b/lib/rpc_subs.c | ||
9 | @@ -34,16 +34,6 @@ | ||
10 | #include <poll.h> | ||
11 | |||
12 | #ifdef WITH_LIBTIRPC | ||
13 | -#undef auth_destroy | ||
14 | -#define auth_destroy(auth) \ | ||
15 | - do { \ | ||
16 | - int refs; \ | ||
17 | - if ((refs = auth_put((auth))) == 0) \ | ||
18 | - ((*((auth)->ah_ops->ah_destroy))(auth));\ | ||
19 | - } while (0) | ||
20 | -#endif | ||
21 | - | ||
22 | -#ifdef WITH_LIBTIRPC | ||
23 | const rpcprog_t rpcb_prog = RPCBPROG; | ||
24 | const rpcvers_t rpcb_version = RPCBVERS; | ||
25 | #else | ||
26 | -- | ||
27 | 1.7.10.4 | ||
28 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc.patch new file mode 100644 index 000000000..d68944b45 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/libtirpc.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 13:17:45.504237027 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 13:20:50.108242739 -0700 | ||
5 | @@ -403,7 +403,7 @@ | ||
6 | # save current flags | ||
7 | af_check_libtirpc_save_cflags="$CFLAGS" | ||
8 | af_check_libtirpc_save_ldflags="$LDFLAGS" | ||
9 | -CFLAGS="$CFLAGS -I/usr/include/tirpc" | ||
10 | +CFLAGS="$CFLAGS -I=/usr/include/tirpc" | ||
11 | LDFLAGS="$LDFLAGS -ltirpc" | ||
12 | |||
13 | AC_TRY_LINK( | ||
14 | Index: autofs-5.0.7/Makefile.rules | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/Makefile.rules 2012-10-28 13:17:45.308237022 -0700 | ||
17 | +++ autofs-5.0.7/Makefile.rules 2012-10-28 13:21:25.720242803 -0700 | ||
18 | @@ -48,7 +48,7 @@ | ||
19 | LIBS += -lpthread | ||
20 | |||
21 | ifdef TIRPCLIB | ||
22 | -CFLAGS += -I/usr/include/tirpc | ||
23 | +CFLAGS += -I=/usr/include/tirpc | ||
24 | LIBS += $(TIRPCLIB) | ||
25 | endif | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/no-bash.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/no-bash.patch new file mode 100644 index 000000000..cf0363527 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/no-bash.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Index: autofs-5.0.7/samples/auto.net | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/samples/auto.net 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/samples/auto.net 2012-10-28 10:44:25.035991715 -0700 | ||
5 | @@ -1,4 +1,4 @@ | ||
6 | -#!/bin/bash | ||
7 | +#!/bin/sh | ||
8 | |||
9 | # This file must be executable to work! chmod 755! | ||
10 | |||
11 | Index: autofs-5.0.7/samples/auto.smb | ||
12 | =================================================================== | ||
13 | --- autofs-5.0.7.orig/samples/auto.smb 2012-07-24 23:05:26.000000000 -0700 | ||
14 | +++ autofs-5.0.7/samples/auto.smb 2012-10-28 10:44:25.035991715 -0700 | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#!/bin/bash | ||
17 | +#!/bin/sh | ||
18 | |||
19 | # This file must be executable to work! chmod 755! | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/remove-bashism.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/remove-bashism.patch new file mode 100644 index 000000000..282d6f0ad --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/remove-bashism.patch | |||
@@ -0,0 +1,120 @@ | |||
1 | From 79034f969bbd12215d65b4337dfd38a13d02d4ef Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Sat, 13 Sep 2014 20:19:28 -0700 | ||
4 | Subject: [PATCH] autofs.init.in: remove bashism | ||
5 | |||
6 | It can work without the bashism. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> | ||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
12 | --- | ||
13 | redhat/autofs.init.in | 12 ++++++------ | ||
14 | samples/rc.autofs.in | 10 +++++----- | ||
15 | 2 files changed, 11 insertions(+), 11 deletions(-) | ||
16 | |||
17 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
18 | index 9d008ff..4f1c0d8 100644 | ||
19 | --- a/redhat/autofs.init.in | ||
20 | +++ b/redhat/autofs.init.in | ||
21 | @@ -1,4 +1,4 @@ | ||
22 | -#!/bin/bash | ||
23 | +#!/bin/sh | ||
24 | # | ||
25 | # rc file for automount using a Sun-style "master map". | ||
26 | # | ||
27 | @@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then | ||
28 | . $confdir/autofs | ||
29 | fi | ||
30 | |||
31 | -function start() { | ||
32 | +start() { | ||
33 | # Make sure autofs4 module is loaded | ||
34 | if ! grep -q autofs /proc/filesystems | ||
35 | then | ||
36 | @@ -102,7 +102,7 @@ function start() { | ||
37 | return $RETVAL | ||
38 | } | ||
39 | |||
40 | -function stop() { | ||
41 | +stop() { | ||
42 | echo -n $"Stopping $prog: " | ||
43 | count=0 | ||
44 | while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do | ||
45 | @@ -125,7 +125,7 @@ function stop() { | ||
46 | return $RETVAL | ||
47 | } | ||
48 | |||
49 | -function restart() { | ||
50 | +restart() { | ||
51 | status autofs > /dev/null 2>&1 | ||
52 | if [ $? -eq 0 ]; then | ||
53 | stop | ||
54 | @@ -143,7 +143,7 @@ function restart() { | ||
55 | start | ||
56 | } | ||
57 | |||
58 | -function reload() { | ||
59 | +reload() { | ||
60 | if [ ! -f /var/lock/subsys/autofs ]; then | ||
61 | echo $"$prog not running" | ||
62 | RETVAL=1 | ||
63 | @@ -161,7 +161,7 @@ function reload() { | ||
64 | return $RETVAL | ||
65 | } | ||
66 | |||
67 | -function usage_message() { | ||
68 | +usage_message() { | ||
69 | echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" | ||
70 | } | ||
71 | |||
72 | diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in | ||
73 | index 487669f..e96cde1 100644 | ||
74 | --- a/samples/rc.autofs.in | ||
75 | +++ b/samples/rc.autofs.in | ||
76 | @@ -1,4 +1,4 @@ | ||
77 | -#!/bin/bash | ||
78 | +#!/bin/sh | ||
79 | # | ||
80 | # rc file for automount using a Sun-style "master map". | ||
81 | # | ||
82 | @@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then | ||
83 | . $confdir/autofs | ||
84 | fi | ||
85 | |||
86 | -function start() { | ||
87 | +start() { | ||
88 | echo -n "Starting $prog: " | ||
89 | |||
90 | # Make sure autofs4 module is loaded | ||
91 | @@ -85,7 +85,7 @@ function start() { | ||
92 | return $RETVAL | ||
93 | } | ||
94 | |||
95 | -function stop() { | ||
96 | +stop() { | ||
97 | echo -n $"Stopping $prog: " | ||
98 | count=0 | ||
99 | while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do | ||
100 | @@ -102,7 +102,7 @@ function stop() { | ||
101 | return $RETVAL | ||
102 | } | ||
103 | |||
104 | -function restart() { | ||
105 | +restart() { | ||
106 | stop | ||
107 | while [ -n "`pidof $prog`" ] ; do | ||
108 | sleep 5 | ||
109 | @@ -110,7 +110,7 @@ function restart() { | ||
110 | start | ||
111 | } | ||
112 | |||
113 | -function reload() { | ||
114 | +reload() { | ||
115 | pid=`pidof $prog` | ||
116 | if [ -z $pid ]; then | ||
117 | echo $"$prog not running" | ||
118 | -- | ||
119 | 1.7.9.5 | ||
120 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch new file mode 100644 index 000000000..93b76bd66 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.1.0/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | using pkg-config to detect libxml-2.0 and krb5 | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure.in | 16 ++++++++++++++-- | ||
8 | 2 files changed, 14 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/configure.in b/configure.in | ||
11 | index 392d122..a3028aa 100644 | ||
12 | --- a/configure.in | ||
13 | +++ b/configure.in | ||
14 | @@ -162,8 +162,20 @@ if test x$enable_sloppy_mount = xyes; then | ||
15 | fi | ||
16 | |||
17 | # LDAP SASL auth needs libxml and Kerberos | ||
18 | -AF_CHECK_LIBXML() | ||
19 | -AF_CHECK_KRB5() | ||
20 | +PKG_CHECK_MODULES(XML, [libxml-2.0],HAVE_LIBXML=1,HAVE_LIBXML=0) | ||
21 | +AC_SUBST([HAVE_LIBXML]) | ||
22 | +XML_FLAGS=$XML_CFLAGS | ||
23 | + | ||
24 | +PKG_CHECK_MODULES(KRB5, [krb5],HAVE_KRB5=1,HAVE_KRB5=0) | ||
25 | +AC_SUBST([HAVE_KRB5]) | ||
26 | +if test "x$HAVE_KRB5" = "x1"; then | ||
27 | + SAVE_CFLAGS=$CFLAGS | ||
28 | + SAVE_LIBS=$LIBS | ||
29 | + CFLAGS="$CFLAGS $KRB5_FLAGS" | ||
30 | + LIBS="$LIBS $KRB5_LIBS" | ||
31 | + | ||
32 | + AC_CHECK_FUNCS([krb5_principal_get_realm]) | ||
33 | +fi | ||
34 | |||
35 | AC_SEARCH_LIBS([versionsort],[]) | ||
36 | if test "$ac_cv_search_versionsort" = "no"; then | ||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb b/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb new file mode 100644 index 000000000..13af2fe45 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs_5.1.0.bb | |||
@@ -0,0 +1,71 @@ | |||
1 | SUMMARY = "Kernel based automounter for linux" | ||
2 | SECTION = "base" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
5 | |||
6 | DEPENDS += "libtirpc flex-native bison-native" | ||
7 | |||
8 | inherit autotools-brokensep systemd | ||
9 | |||
10 | SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \ | ||
11 | file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \ | ||
12 | file://no-bash.patch \ | ||
13 | file://cross.patch \ | ||
14 | file://libtirpc.patch \ | ||
15 | file://libtirpc-name-clash-backout.patch \ | ||
16 | file://autofs-5.0.7-do-not-check-for-modprobe.patch \ | ||
17 | file://fix_disable_ldap.patch \ | ||
18 | file://autofs-5.0.7-fix-lib-deps.patch \ | ||
19 | file://add-the-needed-stdarg.h.patch \ | ||
20 | file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \ | ||
21 | file://force-STRIP-to-emtpy.patch \ | ||
22 | file://remove-bashism.patch \ | ||
23 | " | ||
24 | |||
25 | SRC_URI[md5sum] = "b7724a9a55923f3c06933a8dfd1e79d3" | ||
26 | SRC_URI[sha256sum] = "794a28d178d2b21a2380ee71cbdb3b15b4be47c06f3de255b8c5c4351f046b26" | ||
27 | |||
28 | inherit update-rc.d pkgconfig | ||
29 | |||
30 | INITSCRIPT_NAME = "autofs" | ||
31 | INITSCRIPT_PARAMS = "defaults" | ||
32 | |||
33 | # FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS | ||
34 | CFLAGS += "${LDFLAGS}" | ||
35 | |||
36 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd" | ||
37 | |||
38 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
39 | |||
40 | EXTRA_OEMAKE = "DONTSTRIP=1" | ||
41 | EXTRA_OECONF += "--disable-mount-locking \ | ||
42 | --enable-ignore-busy --with-openldap=no \ | ||
43 | --with-sasl=no --with-libtirpc=yes \ | ||
44 | --with-path=${STAGING_BINDIR_NATIVE} \ | ||
45 | " | ||
46 | CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \ | ||
47 | ac_cv_path_RPCGEN=rpcgen \ | ||
48 | " | ||
49 | |||
50 | do_configure_prepend () { | ||
51 | sed -e "s:filagdir:flagdir:" -i configure.in | ||
52 | if [ ! -e acinclude.m4 ]; then | ||
53 | cp aclocal.m4 acinclude.m4 | ||
54 | fi | ||
55 | } | ||
56 | |||
57 | do_install_append () { | ||
58 | if [ -d ${D}/run ]; then | ||
59 | rmdir ${D}/run | ||
60 | fi | ||
61 | if [ -d ${D}${localstatedir}/run ]; then | ||
62 | rmdir ${D}${localstatedir}/run | ||
63 | fi | ||
64 | } | ||
65 | |||
66 | INSANE_SKIP_${PN} = "dev-so" | ||
67 | |||
68 | RPROVIDES_${PN} += "${PN}-systemd" | ||
69 | RREPLACES_${PN} += "${PN}-systemd" | ||
70 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
71 | SYSTEMD_SERVICE_${PN} = "autofs.service" | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch new file mode 100644 index 000000000..3fa8431c3 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Fix hardcoded libdir. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | plugins/Makefile.am | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/plugins/Makefile.am b/plugins/Makefile.am | ||
11 | index b00915f..25262a1 100644 | ||
12 | --- a/plugins/Makefile.am | ||
13 | +++ b/plugins/Makefile.am | ||
14 | @@ -62,7 +62,7 @@ plugindir = @plugindir@ | ||
15 | |||
16 | common_sources = plugin_common.c plugin_common.h | ||
17 | |||
18 | -sasldir = $(prefix)/lib/sasl2 | ||
19 | +sasldir = $(libdir)/sasl2 | ||
20 | sasl_LTLIBRARIES = @SASL_MECHS@ | ||
21 | EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \ | ||
22 | libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \ | ||
23 | -- | ||
24 | 1.7.4.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch new file mode 100644 index 000000000..6407721ae --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Avoid to call AC_TRY_RUN | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO | ||
6 | on cross-compile environment by definition AC_ARG_ENABLE enable-spnego | ||
7 | |||
8 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | cmulocal/sasl2.m4 | 13 ++++++++++++- | ||
11 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/cmulocal/sasl2.m4 b/cmulocal/sasl2.m4 | ||
14 | index 3c2841a..a5ecf81 100644 | ||
15 | --- a/cmulocal/sasl2.m4 | ||
16 | +++ b/cmulocal/sasl2.m4 | ||
17 | @@ -281,6 +281,17 @@ if test "$gssapi" != no; then | ||
18 | |||
19 | cmu_save_LIBS="$LIBS" | ||
20 | LIBS="$LIBS $GSSAPIBASE_LIBS" | ||
21 | + AC_ARG_ENABLE([spnego], | ||
22 | + [AC_HELP_STRING([--enable-spnego=<DIR>], | ||
23 | + [enable SPNEGO support in GSSAPI libraries [no]])], | ||
24 | + [spnego=$enableval], | ||
25 | + [spnego=no]) | ||
26 | + | ||
27 | + if test "$spnego" = no; then | ||
28 | + echo "no" | ||
29 | + elif test "$spnego" = yes; then | ||
30 | + AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO]) | ||
31 | + else | ||
32 | AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries]) | ||
33 | AC_TRY_RUN([ | ||
34 | #ifdef HAVE_GSSAPI_H | ||
35 | @@ -308,7 +319,7 @@ int main(void) | ||
36 | AC_MSG_RESULT(yes) ], | ||
37 | AC_MSG_RESULT(no)) | ||
38 | LIBS="$cmu_save_LIBS" | ||
39 | - | ||
40 | + fi | ||
41 | else | ||
42 | AC_MSG_RESULT([disabled]) | ||
43 | fi | ||
44 | -- | ||
45 | 1.7.10.4 | ||
46 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff new file mode 100644 index 000000000..8eff5a8bd --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff | |||
@@ -0,0 +1,14 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: Fix linking with libsasldb.a when saslauthd is built with sasldb | ||
3 | support. | ||
4 | --- a/saslauthd/configure.in | ||
5 | +++ b/saslauthd/configure.in | ||
6 | @@ -77,7 +77,7 @@ if test "$authsasldb" != no; then | ||
7 | AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support]) | ||
8 | SASL_DB_PATH_CHECK() | ||
9 | SASL_DB_CHECK() | ||
10 | - SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al" | ||
11 | + SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a" | ||
12 | fi | ||
13 | |||
14 | AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ], | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff new file mode 100644 index 000000000..2e5b1750d --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff | |||
@@ -0,0 +1,27 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: This patch makes sure the non-PIC version of libsasldb.a, which | ||
3 | is created out of non-PIC objects, is not going to overwrite the PIC version, | ||
4 | which is created out of PIC objects. The PIC version is placed in .libs, and | ||
5 | the non-PIC version in the current directory. This ensures that both non-PIC | ||
6 | and PIC versions are available in the correct locations. | ||
7 | --- a/lib/Makefile.am | ||
8 | +++ b/lib/Makefile.am | ||
9 | @@ -78,7 +78,7 @@ endif | ||
10 | |||
11 | libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS) | ||
12 | @echo adding static plugins and dependencies | ||
13 | - $(AR) cru .libs/$@ $(SASL_STATIC_OBJS) | ||
14 | + $(AR) cru $@ $(SASL_STATIC_OBJS) | ||
15 | @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \ | ||
16 | if test ! -f $$i; then continue; fi; . $$i; \ | ||
17 | for j in $$dependency_libs foo; do \ | ||
18 | --- a/sasldb/Makefile.am | ||
19 | +++ b/sasldb/Makefile.am | ||
20 | @@ -63,6 +63,6 @@ libsasldb_a_SOURCES = | ||
21 | EXTRA_libsasldb_a_SOURCES = | ||
22 | |||
23 | libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC) | ||
24 | - $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC) | ||
25 | + $(AR) cru $@ $(SASL_DB_BACKEND_STATIC) | ||
26 | |||
27 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch new file mode 100644 index 000000000..ecbab845d --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 92d72789c811b0d55f624a8bac5ccc4412f5996e Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Murchison <murch@andrew.cmu.edu> | ||
3 | Date: Thu, 20 Dec 2012 18:14:50 -0500 | ||
4 | Subject: [PATCH] sasl.h: #include <stddef.h> for size_t on NetBSD | ||
5 | |||
6 | This patch was imported from git://git.cyrusimap.org/cyrus-sasl | ||
7 | commit 67a188693796a14e3a76ac603104807fbbfddfc4 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
12 | --- | ||
13 | include/sasl.h | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/include/sasl.h b/include/sasl.h | ||
17 | index fef4d51..8b8a63f 100755 | ||
18 | --- a/include/sasl.h | ||
19 | +++ b/include/sasl.h | ||
20 | @@ -121,6 +121,8 @@ | ||
21 | #ifndef SASL_H | ||
22 | #define SASL_H 1 | ||
23 | |||
24 | +#include <stddef.h> /* For size_t */ | ||
25 | + | ||
26 | /* Keep in sync with win32/common.mak */ | ||
27 | #define SASL_VERSION_MAJOR 2 | ||
28 | #define SASL_VERSION_MINOR 1 | ||
29 | -- | ||
30 | 1.8.3.2 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb new file mode 100644 index 000000000..ea9cd1c24 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb | |||
@@ -0,0 +1,69 @@ | |||
1 | SUMMARY = "Generic client/server library for SASL authentication" | ||
2 | SECTION = "console/network" | ||
3 | DEPENDS = "openssl virtual/db" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396" | ||
6 | |||
7 | SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \ | ||
8 | file://avoid-to-call-AC_TRY_RUN.patch \ | ||
9 | file://Fix-hardcoded-libdir.patch \ | ||
10 | file://debian_patches_0009_sasldb_al.diff \ | ||
11 | file://debian_patches_0014_avoid_pic_overwrite.diff \ | ||
12 | file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \ | ||
13 | " | ||
14 | |||
15 | inherit autotools-brokensep pkgconfig useradd | ||
16 | |||
17 | EXTRA_OECONF += "--with-dblib=berkeley \ | ||
18 | --with-bdb-libdir=${STAGING_LIBDIR} \ | ||
19 | --with-bdb-incdir=${STAGING_INCDIR} \ | ||
20 | --with-bdb=db-5.3 \ | ||
21 | --with-plugindir="${libdir}/sasl2/" \ | ||
22 | andrew_cv_runpath_switch=none" | ||
23 | |||
24 | PACKAGECONFIG ??= "ntlm \ | ||
25 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
26 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
27 | " | ||
28 | PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5," | ||
29 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
30 | PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie," | ||
31 | PACKAGECONFIG[des] = "--with-des,--without-des,," | ||
32 | PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap," | ||
33 | PACKAGECONFIG[ntlm] = "--with-ntlm,--without-ntlm,," | ||
34 | |||
35 | CFLAGS += "-fPIC" | ||
36 | |||
37 | do_configure_prepend () { | ||
38 | rm -f acinclude.m4 config/libtool.m4 | ||
39 | |||
40 | # make it be able to work with db 5.0 version | ||
41 | local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c" | ||
42 | for sed_file in $sed_files; do | ||
43 | sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' $sed_file | ||
44 | done | ||
45 | } | ||
46 | |||
47 | do_compile_prepend () { | ||
48 | cd include | ||
49 | ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} makemd5.c -o makemd5 | ||
50 | touch makemd5.o makemd5.lo makemd5 | ||
51 | cd .. | ||
52 | } | ||
53 | |||
54 | USERADD_PACKAGES = "${PN}-bin" | ||
55 | GROUPADD_PARAM_${PN}-bin = "--system mail" | ||
56 | USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" | ||
57 | |||
58 | SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" | ||
59 | SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" | ||
60 | |||
61 | PACKAGES =+ "${PN}-bin" | ||
62 | |||
63 | FILES_${PN} += "${libdir}/sasl2/*.so*" | ||
64 | FILES_${PN}-bin += "${bindir}" | ||
65 | FILES_${PN}-dev += "${libdir}/sasl2/*.la" | ||
66 | FILES_${PN}-dbg += "${libdir}/sasl2/.debug" | ||
67 | FILES_${PN}-staticdev += "${libdir}/sasl2/*.a" | ||
68 | |||
69 | INSANE_SKIP_${PN} += "dev-so" | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils new file mode 100644 index 000000000..42fdd602f --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d root root 0755 /var/lock/iscsi none | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian new file mode 100644 index 000000000..99a763861 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian | |||
@@ -0,0 +1,119 @@ | |||
1 | #! /bin/sh | ||
2 | ### BEGIN INIT INFO | ||
3 | # Provides: | ||
4 | # Required-Start: | ||
5 | # Required-Stop: | ||
6 | # Default-Start: | ||
7 | # Default-Stop: | ||
8 | # Short-Description: Starts and stops the iSCSI initiator services and logins to default targets | ||
9 | ### END INIT INFO | ||
10 | #set -x | ||
11 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
12 | DAEMON=/usr/sbin/iscsid | ||
13 | ADM=/usr/sbin/iscsiadm | ||
14 | PIDFILE=/var/run/iscsid.pid | ||
15 | |||
16 | [ -x "$DAEMON" ] || exit 0 | ||
17 | |||
18 | if [ ! -d /sys/class/ ]; then | ||
19 | echo "Failure:" "iSCSI requires a mounted sysfs, not started." | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p' | ||
24 | |||
25 | RETVAL=0 | ||
26 | |||
27 | start() { | ||
28 | echo "Starting iSCSI initiator service" "iscsid" | ||
29 | modprobe -q iscsi_tcp 2>/dev/null || : | ||
30 | modprobe -q ib_iser 2>/dev/null || : | ||
31 | if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then | ||
32 | INITIATORNAME=$(iscsi-iname) | ||
33 | cat >/etc/iscsi/initiatorname.iscsi <<EOF | ||
34 | ## DO NOT EDIT OR REMOVE THIS FILE! | ||
35 | ## If you remove this file, the iSCSI daemon will not start. | ||
36 | ## If you change the InitiatorName, existing access control lists | ||
37 | ## may reject this initiator. The InitiatorName must be unique | ||
38 | ## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames. | ||
39 | InitiatorName=$INITIATORNAME | ||
40 | EOF | ||
41 | fi | ||
42 | start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON | ||
43 | RETVAL=$? | ||
44 | starttargets | ||
45 | } | ||
46 | |||
47 | starttargets() { | ||
48 | echo "Setting up iSCSI targets" | ||
49 | $ADM -m node --loginall=automatic | ||
50 | } | ||
51 | |||
52 | stoptargets() { | ||
53 | echo "Disconnecting iSCSI targets" | ||
54 | sync | ||
55 | $ADM -m node --logoutall=all | ||
56 | RETVAL=$? | ||
57 | #if RETVAL is 21, means no active sessions, consider ok | ||
58 | if [ "$RETVAL" = "21" ]; then | ||
59 | RETVAL=0 | ||
60 | fi | ||
61 | } | ||
62 | |||
63 | stop() { | ||
64 | stoptargets | ||
65 | if [ $RETVAL -ne 0 ]; then | ||
66 | echo "Failure:" "Could not stop all targets, try again later" | ||
67 | return $RETVAL | ||
68 | fi | ||
69 | |||
70 | echo "Stopping iSCSI initiator service" | ||
71 | start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON | ||
72 | rm -f $PIDFILE | ||
73 | status=0 | ||
74 | modprobe -r ib_iser 2>/dev/null | ||
75 | if [ "$?" -ne "0" -a "$?" -ne "1" ]; then | ||
76 | status=1 | ||
77 | fi | ||
78 | modprobe -r iscsi_tcp 2>/dev/null | ||
79 | if [ "$?" -ne "0" -a "$?" -ne "1" ]; then | ||
80 | status=1 | ||
81 | fi | ||
82 | } | ||
83 | |||
84 | restart() { | ||
85 | stop | ||
86 | if [ $RETVAL -ne 0 ]; then | ||
87 | echo "Failure:" "Stopping iSCSI initiator service failed, not starting" | ||
88 | return $RETVAL | ||
89 | fi | ||
90 | start | ||
91 | } | ||
92 | |||
93 | restarttargets() { | ||
94 | stoptargets | ||
95 | if [ $RETVAL -ne 0 ]; then | ||
96 | echo "Failure:" "Could not stop all targets, try again later" | ||
97 | return $RETVAL | ||
98 | fi | ||
99 | starttargets | ||
100 | } | ||
101 | |||
102 | status() { | ||
103 | #XXX FIXME: what to do here? | ||
104 | #status iscsid | ||
105 | # list active sessions | ||
106 | echo Current active iSCSI sessions: | ||
107 | $ADM -m session | ||
108 | } | ||
109 | |||
110 | case "$1" in | ||
111 | start|starttargets|stop|stoptargets|restart|restarttargets|status) | ||
112 | $1 | ||
113 | ;; | ||
114 | *) | ||
115 | echo "Usage: $0 {start|stop|restart|status}" | ||
116 | exit 1 | ||
117 | ;; | ||
118 | esac | ||
119 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator new file mode 100644 index 000000000..7fa49a2d6 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator | |||
@@ -0,0 +1,4 @@ | |||
1 | # default command line settings for open-iscsi's iscsid | ||
2 | |||
3 | OPTS_ISCSID="" | ||
4 | OPTS_ISCSIADM="" | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service new file mode 100644 index 000000000..564b2d21d --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service | |||
@@ -0,0 +1,15 @@ | |||
1 | [Unit] | ||
2 | Description=Open-iSCSI initiator (i.e. client) target bindings | ||
3 | After=iscsi-initiator.service | ||
4 | Requires=iscsi-initiator.service | ||
5 | |||
6 | [Service] | ||
7 | Type=oneshot | ||
8 | EnvironmentFile=/etc/default/iscsi-initiator | ||
9 | ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM | ||
10 | ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM | ||
11 | RemainAfterExit=yes | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
15 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch new file mode 100644 index 000000000..ce48e2bb3 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-dont-use-static.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | iscsi-initiator-utils not to use static | ||
2 | |||
3 | Upstream-status: Backport | ||
4 | This patch is from fedora17. | ||
5 | |||
6 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
7 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
8 | |||
9 | diff --git a/usr/Makefile b/usr/Makefile | ||
10 | index 673b7f1..fd14a10 100644 | ||
11 | --- a/usr/Makefile | ||
12 | +++ b/usr/Makefile | ||
13 | @@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o | ||
14 | |||
15 | iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \ | ||
16 | iscsistart.o statics.o | ||
17 | - $(CC) $(CFLAGS) -static $^ -o $@ | ||
18 | + $(CC) $(CFLAGS) $^ -o $@ | ||
19 | clean: | ||
20 | rm -f *.o $(PROGRAMS) .depend $(LIBSYS) | ||
21 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch new file mode 100644 index 000000000..50227a774 --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-utils-use-var-for-config.patch | |||
@@ -0,0 +1,240 @@ | |||
1 | iscsi-initiator-utils to use var for config | ||
2 | |||
3 | Upstream-status: Backport | ||
4 | This patch is from fedora. | ||
5 | |||
6 | Use /var/lib/iscsi/ instead of /etc/iscsi/ for holding | ||
7 | state files. | ||
8 | |||
9 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
10 | Signed-off-by: Vu Tran <vu.tran@windriver.com> | ||
11 | |||
12 | diff --git a/README b/README | ||
13 | index 7364b2d..5e8bff8 100644 | ||
14 | --- a/README | ||
15 | +++ b/README | ||
16 | @@ -164,10 +164,10 @@ available on all Linux installations. | ||
17 | |||
18 | The database contains two tables: | ||
19 | |||
20 | -- Discovery table (/etc/iscsi/send_targets); | ||
21 | -- Node table (/etc/iscsi/nodes). | ||
22 | +- Discovery table (/var/lib/iscsi/send_targets); | ||
23 | +- Node table (/var/lib/iscsi/nodes). | ||
24 | |||
25 | -The regular place for iSCSI database files: /etc/iscsi/nodes | ||
26 | +The regular place for iSCSI database files: /var/lib/iscsi/nodes | ||
27 | |||
28 | The iscsiadm utility is a command-line tool to manage (update, delete, | ||
29 | insert, query) the persistent database. | ||
30 | @@ -444,7 +444,7 @@ a scsi_host per HBA port). | ||
31 | To manage both types of initiator stacks, iscsiadm uses the interface (iface) | ||
32 | structure. For each HBA port or for software iscsi for each network | ||
33 | device (ethX) or NIC, that you wish to bind sessions to you must create | ||
34 | -a iface config /etc/iscsi/ifaces. | ||
35 | +a iface config /var/lib/iscsi/ifaces. | ||
36 | |||
37 | Prep: | ||
38 | |||
39 | @@ -478,29 +478,29 @@ Running: | ||
40 | iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax | ||
41 | iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax | ||
42 | |||
43 | -Will report iface configurations that are setup in /etc/iscsi/ifaces. | ||
44 | +Will report iface configurations that are setup in /var/lib/iscsi/ifaces. | ||
45 | The format is: | ||
46 | |||
47 | iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname | ||
48 | |||
49 | For software iscsi, you can create the iface configs by hand, but it is | ||
50 | reccomended that you use iscsiadm's iface mode. There is a iface.example in | ||
51 | -/etc/iscsi/ifaces which can be used as a template for the daring. | ||
52 | +/var/lib/iscsi/ifaces which can be used as a template for the daring. | ||
53 | |||
54 | For each network object you wish to bind a session to you must create | ||
55 | -a seperate iface config in /etc/iscsi/ifaces and each iface config file | ||
56 | +a seperate iface config in /var/lib/iscsi/ifaces and each iface config file | ||
57 | must have a unique name which is less than or equal to 64 characters. | ||
58 | |||
59 | Example: | ||
60 | |||
61 | If you have NIC1 with MAC address 00:0F:1F:92:6B:BF and NIC2 with | ||
62 | MAC address 00:C0:DD:08:63:E7 and you wanted to do software iscsi over | ||
63 | -TCP/IP. Then in /etc/iscsi/ifaces/iface0 you would enter: | ||
64 | +TCP/IP. Then in /var/lib/iscsi/ifaces/iface0 you would enter: | ||
65 | |||
66 | iface.transport_name = tcp | ||
67 | iface.hwaddress = 00:0F:1F:92:6B:BF | ||
68 | |||
69 | -and in /etc/iscsi/ifaces/iface1 you would enter: | ||
70 | +and in /var/lib/iscsi/ifaces/iface1 you would enter: | ||
71 | |||
72 | iface.transport_name = tcp | ||
73 | iface.hwaddress = 00:C0:DD:08:63:E7 | ||
74 | @@ -550,7 +550,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty> | ||
75 | qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty> | ||
76 | |||
77 | |||
78 | -Will report iface configurations that are setup in /etc/iscsi/ifaces. | ||
79 | +Will report iface configurations that are setup in /var/lib/iscsi/ifaces. | ||
80 | The format is: | ||
81 | |||
82 | iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname | ||
83 | @@ -636,7 +636,7 @@ need a seperate network connection to the target for discovery purposes. | ||
84 | *This will be fixed in the next version of open-iscsi* | ||
85 | |||
86 | For compatibility reasons, when you run iscsiadm to do discovery, it | ||
87 | -will check for interfaces in /etc/iscsi/iscsi/ifaces that are using | ||
88 | +will check for interfaces in /var/lib/iscsi/iscsi/ifaces that are using | ||
89 | tcp for the iface.transport and it will bind the portals that are discovered | ||
90 | so that they will be logged in through those ifaces. This behavior can also | ||
91 | be overriden by passing in the interfaces you want to use. For the case | ||
92 | @@ -654,7 +654,7 @@ we do not bind a session to a iface, then you can use the special iface | ||
93 | |||
94 | iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1 | ||
95 | |||
96 | -And if you did not define any interfaces in /etc/iscsi/ifaces and do | ||
97 | +And if you did not define any interfaces in /var/lib/iscsi/ifaces and do | ||
98 | not pass anything into iscsiadm, running iscsiadm will do the default | ||
99 | behavior, where we allow the network subsystem to decide which | ||
100 | device to use. | ||
101 | @@ -696,7 +696,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
102 | |||
103 | ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover | ||
104 | |||
105 | - This will search /etc/iscsi/send_targets for a record with the | ||
106 | + This will search /var/lib/iscsi/send_targets for a record with the | ||
107 | ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it | ||
108 | will perform discovery using the settings stored in the record. | ||
109 | If a record does not exist, it will be created using the iscsid.conf | ||
110 | @@ -705,7 +705,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
111 | The argument to -p may also be a hostname instead of an address. | ||
112 | ./iscsiadm -m discoverydb -t st -p smoehost --discover | ||
113 | |||
114 | - For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for | ||
115 | + For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for | ||
116 | interfaces using software iscsi. If any are found then nodes found | ||
117 | during discovery will be setup so that they can logged in through | ||
118 | those interfaces. To specify a specific iface, pass the | ||
119 | @@ -761,7 +761,7 @@ To now log into targets it is the same as with sofware iscsi. See section | ||
120 | This command will perform discovery, but not manipulate the node DB. | ||
121 | |||
122 | - SendTargets iSCSI Discovery with a specific interface. If you | ||
123 | - wish to only use a subset of the interfaces in /etc/iscsi/ifaces | ||
124 | + wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces | ||
125 | then you can pass them in during discovery: | ||
126 | |||
127 | ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \ | ||
128 | @@ -1072,8 +1072,8 @@ where targetname is the name of the target and ip_address:port is the address | ||
129 | and port of the portal. tpgt, is the portal group tag of | ||
130 | the portal, and is not used in iscsiadm commands except for static | ||
131 | record creation. And iface name is the name of the iscsi interface | ||
132 | -defined in /etc/iscsi/ifaces. If no interface was defined in | ||
133 | -/etc/iscsi/ifaces or passed in, the default behavior is used. | ||
134 | +defined in /var/lib/iscsi/ifaces. If no interface was defined in | ||
135 | +/var/lib/iscsi/ifaces or passed in, the default behavior is used. | ||
136 | Default here is iscsi_tcp/tcp to be used over which ever NIC the | ||
137 | network layer decides is best. | ||
138 | |||
139 | @@ -1188,7 +1188,7 @@ If set, iscsid will perform discovery to the address every | ||
140 | discovery.isns.discoveryd_poll_inval or | ||
141 | discovery.sendtargets.discoveryd_poll_inval seconds, | ||
142 | and it will log into any portals found from the discovery source using | ||
143 | -the ifaces in /etc/iscsi/ifaces. | ||
144 | +the ifaces in /var/lib/iscsi/ifaces. | ||
145 | |||
146 | Note that for iSNS the poll_interval does not have to be set. If not set, | ||
147 | iscsid will only perform rediscovery when it gets a SCN from the server. | ||
148 | diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8 | ||
149 | index 7c209f6..e94cca0 100644 | ||
150 | --- a/doc/iscsiadm.8 | ||
151 | +++ b/doc/iscsiadm.8 | ||
152 | @@ -89,7 +89,7 @@ This option is only valid for ping submode. | ||
153 | .TP | ||
154 | \fB\-I\fR, \fB\-\-interface=\fI[iface]\fR | ||
155 | The interface argument specifies the iSCSI interface to use for the operation. | ||
156 | -iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware | ||
157 | +iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware | ||
158 | iSCSI (qla4xxx) the iface config must have the hardware address | ||
159 | (iface.hwaddress = port's MAC address) | ||
160 | and the driver/transport_name (iface.transport_name). The iface's name is | ||
161 | @@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all | ||
162 | of their respective records are displayed; for \fIsession\fR, all active | ||
163 | sessions and connections are displayed; for \fIfw\fR, all boot firmware | ||
164 | values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and | ||
165 | -for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed. | ||
166 | +for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed. | ||
167 | |||
168 | .TP | ||
169 | \fB\-n\fR, \fB\-\-name=\fIname\fR | ||
170 | @@ -535,10 +535,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup. | ||
171 | The file containing the iSCSI InitiatorName and InitiatorAlias read by | ||
172 | \fBiscsid\fR and \fBiscsiadm\fR on startup. | ||
173 | .TP | ||
174 | -/etc/iscsi/nodes/ | ||
175 | +/var/lib/iscsi/nodes/ | ||
176 | This directory contains the nodes with their targets. | ||
177 | .TP | ||
178 | -/etc/iscsi/send_targets | ||
179 | +/var/lib/iscsi/send_targets | ||
180 | This directory contains the portals. | ||
181 | |||
182 | .SH "SEE ALSO" | ||
183 | diff --git a/usr/idbm.c b/usr/idbm.c | ||
184 | index 4d30aa9..316e54f 100644 | ||
185 | --- a/usr/idbm.c | ||
186 | +++ b/usr/idbm.c | ||
187 | @@ -2468,9 +2468,9 @@ free_info: | ||
188 | int idbm_init(idbm_get_config_file_fn *fn) | ||
189 | { | ||
190 | /* make sure root db dir is there */ | ||
191 | - if (access(ISCSI_CONFIG_ROOT, F_OK) != 0) { | ||
192 | - if (mkdir(ISCSI_CONFIG_ROOT, 0660) != 0) { | ||
193 | - log_error("Could not make %s %d\n", ISCSI_CONFIG_ROOT, | ||
194 | + if (access(ISCSIVAR, F_OK) != 0) { | ||
195 | + if (mkdir(ISCSIVAR, 0660) != 0) { | ||
196 | + log_error("Could not make %s %d\n", ISCSIVAR, | ||
197 | errno); | ||
198 | return errno; | ||
199 | } | ||
200 | diff --git a/usr/idbm.h b/usr/idbm.h | ||
201 | index 245f046..f45e86e 100644 | ||
202 | --- a/usr/idbm.h | ||
203 | +++ b/usr/idbm.h | ||
204 | @@ -28,12 +28,16 @@ | ||
205 | #include "config.h" | ||
206 | #include "list.h" | ||
207 | |||
208 | -#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes" | ||
209 | -#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp" | ||
210 | -#define ISNS_CONFIG_DIR ISCSI_CONFIG_ROOT"isns" | ||
211 | -#define STATIC_CONFIG_DIR ISCSI_CONFIG_ROOT"static" | ||
212 | -#define FW_CONFIG_DIR ISCSI_CONFIG_ROOT"fw" | ||
213 | -#define ST_CONFIG_DIR ISCSI_CONFIG_ROOT"send_targets" | ||
214 | +#define ISCSIVAR "/var/lib/iscsi/" | ||
215 | + | ||
216 | +#define NODE_CONFIG_DIR ISCSIVAR"nodes" | ||
217 | +#define SLP_CONFIG_DIR ISCSIVAR"slp" | ||
218 | +#define ISNS_CONFIG_DIR ISCSIVAR"isns" | ||
219 | +#define STATIC_CONFIG_DIR ISCSIVAR"static" | ||
220 | +#define FW_CONFIG_DIR ISCSIVAR"fw" | ||
221 | +#define ST_CONFIG_DIR ISCSIVAR"send_targets" | ||
222 | + | ||
223 | + | ||
224 | #define ST_CONFIG_NAME "st_config" | ||
225 | #define ISNS_CONFIG_NAME "isns_config" | ||
226 | |||
227 | diff --git a/usr/iface.h b/usr/iface.h | ||
228 | index 01f7074..2c6ef72 100644 | ||
229 | --- a/usr/iface.h | ||
230 | +++ b/usr/iface.h | ||
231 | @@ -20,7 +20,8 @@ | ||
232 | #ifndef ISCSI_IFACE_H | ||
233 | #define ISCSI_IFACE_H | ||
234 | |||
235 | -#define IFACE_CONFIG_DIR ISCSI_CONFIG_ROOT"ifaces" | ||
236 | +#include "idbm.h" | ||
237 | +#define IFACE_CONFIG_DIR ISCSIVAR"ifaces" | ||
238 | |||
239 | struct iface_rec; | ||
240 | struct list_head; | ||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service new file mode 100644 index 000000000..b1397513b --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=Open-iSCSI initiator (i.e. client) service | ||
3 | After=syslog.target | ||
4 | |||
5 | [Service] | ||
6 | EnvironmentFile=/etc/default/iscsi-initiator | ||
7 | ExecStartPre=/sbin/modprobe iscsi_tcp | ||
8 | ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
12 | |||
diff --git a/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb new file mode 100644 index 000000000..d48cf24eb --- /dev/null +++ b/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0-873.bb | |||
@@ -0,0 +1,111 @@ | |||
1 | SUMMARY = "iSCSI daemon and utility programs" | ||
2 | DESCRIPTION = "Open-iSCSI project is a high performance, transport \ | ||
3 | independent, multi-platform implementation of RFC3720. The iscsi package \ | ||
4 | provides the server daemon for the iSCSI protocol, as well as the utility \ | ||
5 | programs used to manage it. iSCSI is a protocol for distributed \ | ||
6 | disk access using SCSI commands sent over Internet Protocol networks." | ||
7 | HOMEPAGE = "http://www.open-iscsi.org/" | ||
8 | LICENSE = "GPLv2 & LGPLv2.1" | ||
9 | SECTION = "console/network" | ||
10 | DEPENDS = "openssl flex-native bison-native" | ||
11 | |||
12 | LIC_FILES_CHKSUM = \ | ||
13 | "file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \ | ||
14 | file://utils/open-isns/COPYING;md5=7fbc338309ac38fefcd64b04bb903e34" | ||
15 | |||
16 | SRC_URI = "http://www.open-iscsi.org/bits/open-iscsi-${PV}.tar.gz \ | ||
17 | file://iscsi-initiator-utils-use-var-for-config.patch \ | ||
18 | file://iscsi-initiator-utils-dont-use-static.patch \ | ||
19 | file://initd.debian \ | ||
20 | file://99_iscsi-initiator-utils \ | ||
21 | file://iscsi-initiator \ | ||
22 | file://iscsi-initiator.service \ | ||
23 | file://iscsi-initiator-targets.service \ | ||
24 | " | ||
25 | SRC_URI[md5sum] = "8b8316d7c9469149a6cc6234478347f7" | ||
26 | SRC_URI[sha256sum] = "7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9" | ||
27 | |||
28 | S = "${WORKDIR}/open-iscsi-${PV}" | ||
29 | |||
30 | inherit update-rc.d systemd | ||
31 | |||
32 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
33 | do_configure () { | ||
34 | #need to support cross-compiling in open-isns only | ||
35 | (cd utils/open-isns; gnu-configize; \ | ||
36 | ./configure --host=${TARGET_SYS} --build=${BUILD_SYS} --with-security=no ) | ||
37 | } | ||
38 | |||
39 | do_compile () { | ||
40 | #make iscsistart one of PROGRAMS if install_user in do_install | ||
41 | #sed -i -e '/^PROGRAMS = /s;$; usr/iscsistart;' Makefile | ||
42 | |||
43 | #fix the ar used in open-isns | ||
44 | sed -i -e 's:ar cr :$(AR) cr :' ${S}/utils/open-isns/Makefile | ||
45 | oe_runmake user | ||
46 | } | ||
47 | |||
48 | do_install () { | ||
49 | #completely override the install_user as bugs in Makefile | ||
50 | #oe_runmake DESTDIR="${D}" install_user | ||
51 | |||
52 | #install necessary directories | ||
53 | install -d ${D}${sbindir} \ | ||
54 | ${D}${sysconfdir}/init.d \ | ||
55 | ${D}${sysconfdir}/iscsi \ | ||
56 | ${D}${localstatedir}/lib/iscsi/nodes \ | ||
57 | ${D}${localstatedir}/lib/iscsi/send_targets \ | ||
58 | ${D}${localstatedir}/lib/iscsi/static \ | ||
59 | ${D}${localstatedir}/lib/iscsi/isns \ | ||
60 | ${D}${localstatedir}/lib/iscsi/slp \ | ||
61 | ${D}${localstatedir}/lib/iscsi/ifaces \ | ||
62 | ${D}/${mandir}/man8 | ||
63 | |||
64 | install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \ | ||
65 | ${S}/utils/iscsi-iname \ | ||
66 | ${S}/usr/iscsistart ${D}/${sbindir} | ||
67 | |||
68 | install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8 | ||
69 | install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi | ||
70 | install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid | ||
71 | |||
72 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
73 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
74 | echo "d /run/${BPN}/lock - - - -" \ | ||
75 | > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf | ||
76 | install -d ${D}/etc/default/ | ||
77 | install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/ | ||
78 | |||
79 | install -d ${D}${systemd_unitdir}/system/ | ||
80 | install -m 0644 ${WORKDIR}/iscsi-initiator.service \ | ||
81 | ${WORKDIR}/iscsi-initiator-targets.service \ | ||
82 | ${D}${systemd_unitdir}/system/ | ||
83 | else | ||
84 | install -d ${D}/etc/default/volatiles | ||
85 | install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles | ||
86 | fi | ||
87 | } | ||
88 | |||
89 | pkg_postinst_${PN}() { | ||
90 | #default there is no initiatorname.iscsi installed | ||
91 | #but it is needed or iscsid will fail | ||
92 | |||
93 | #will run only when postinst on target | ||
94 | if [ "x$D" != "x" ]; then | ||
95 | exit 1 | ||
96 | fi | ||
97 | if [ ! -f ${sysconfdir}/iscsi/initiatorname.iscsi ]; then | ||
98 | echo "InitiatorName=$(${sbindir}/iscsi-iname)" > \ | ||
99 | ${sysconfdir}/iscsi/initiatorname.iscsi | ||
100 | fi | ||
101 | |||
102 | if [ -e /etc/init.d/populate-volatile.sh ]; then | ||
103 | /etc/init.d/populate-volatile.sh update | ||
104 | elif command -v systemd-tmpfiles >/dev/null; then | ||
105 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf | ||
106 | fi | ||
107 | } | ||
108 | |||
109 | SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service " | ||
110 | INITSCRIPT_NAME = "iscsid" | ||
111 | INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ." | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/install.patch b/meta-networking/recipes-daemons/postfix/files/install.patch new file mode 100644 index 000000000..a3fe089c2 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/install.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Change fixed postconf to a variable for cross-compiling | ||
2 | |||
3 | Upstreamstatus: Inappropriate [embedded specific] | ||
4 | |||
5 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
6 | --- | ||
7 | diff --git a/postfix-install b/postfix-install | ||
8 | index 49225ac..2e4c292 100644 | ||
9 | --- a/postfix-install | ||
10 | +++ b/postfix-install | ||
11 | @@ -201,8 +201,8 @@ test -z "$non_interactive" -a ! -t 0 && { | ||
12 | exit 1 | ||
13 | } | ||
14 | |||
15 | -test -x bin/postconf || { | ||
16 | - echo $0: Error: no bin/postconf file. Did you forget to run \"make\"? 1>&2 | ||
17 | +test -x "$POSTCONF" || { | ||
18 | + echo $0: Error: no $POSTCONF file. Did you forget to run \"make\"? 1>&2 | ||
19 | exit 1 | ||
20 | } | ||
21 | |||
22 | @@ -363,7 +363,7 @@ HTML files. Specify \"no\" if you do not want to install these files." | ||
23 | |||
24 | : ${install_root=/} | ||
25 | : ${tempdir=`pwd`} | ||
26 | -: ${config_directory=`bin/postconf -c conf -h -d config_directory`} | ||
27 | +: ${config_directory=`$POSTCONF -c conf -h -d config_directory`} | ||
28 | |||
29 | # Find out the location of installed configuration files. | ||
30 | |||
31 | @@ -433,7 +433,7 @@ test -f $CONFIG_DIRECTORY/main.cf && { | ||
32 | case "$junk" in | ||
33 | "") eval unset $name;; | ||
34 | esac | ||
35 | - eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -h $name\`} || | ||
36 | + eval : \${$name=\`$POSTCONF -c $CONFIG_DIRECTORY -h $name\`} || | ||
37 | exit 1 | ||
38 | done | ||
39 | } | ||
40 | @@ -446,7 +446,7 @@ do | ||
41 | case "$junk" in | ||
42 | "") eval unset $name;; | ||
43 | esac | ||
44 | - eval : \${$name=\`bin/postconf -c conf -d -h $name\`} || exit 1 | ||
45 | + eval : \${$name=\`$POSTCONF -c conf -d -h $name\`} || exit 1 | ||
46 | done | ||
47 | |||
48 | # Override settings manually. | ||
49 | @@ -565,6 +565,8 @@ HTML_DIRECTORY=$install_root$html_directory | ||
50 | MANPAGE_DIRECTORY=$install_root$manpage_directory | ||
51 | README_DIRECTORY=$install_root$readme_directory | ||
52 | |||
53 | +test "x$POSTCONF" != "x" || POSTCONF="bin/postconf" | ||
54 | + | ||
55 | # Avoid repeated tests for existence of these; default permissions suffice. | ||
56 | |||
57 | test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1 | ||
58 | @@ -724,7 +726,7 @@ do | ||
59 | # Postfix releases, and software should not suddenly be installed in | ||
60 | # the wrong place when Postfix is being upgraded. | ||
61 | |||
62 | -bin/postconf -c $CONFIG_DIRECTORY -e \ | ||
63 | +"$POSTCONF" -c $CONFIG_DIRECTORY -e \ | ||
64 | "daemon_directory = $daemon_directory" \ | ||
65 | "data_directory = $data_directory" \ | ||
66 | "command_directory = $command_directory" \ | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/internal_recipient b/meta-networking/recipes-daemons/postfix/files/internal_recipient new file mode 100644 index 000000000..6a8f2681b --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/internal_recipient | |||
@@ -0,0 +1 @@ | |||
root@ permit_mynetworks,reject | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 b/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 new file mode 100644 index 000000000..bb314513b --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/main.cf_2.0 | |||
@@ -0,0 +1,102 @@ | |||
1 | # Configure your domain and accounts | ||
2 | #mydomain=sample.com | ||
3 | #FQDN from gethostname | ||
4 | #myhostname = | ||
5 | mydomain=localdomain | ||
6 | mydestination = $myhostname, localhost.localdomain localhost | ||
7 | mynetworks = 127.0.0.1/8 | ||
8 | inet_interfaces = 127.0.0.1 | ||
9 | |||
10 | virtual_mailbox_domains = sample.com, other.net | ||
11 | virtual_mailbox_maps = hash:/etc/postfix/virtual | ||
12 | virtual_alias_maps = hash:/etc/postfix/virtual_alias | ||
13 | |||
14 | alias_maps = hash:/etc/aliases | ||
15 | |||
16 | # You'll start with the following lines for maildir storage | ||
17 | virtual_mailbox_base = /var/spool/vmail | ||
18 | virtual_uid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 3` | ||
19 | virtual_gid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 4` | ||
20 | |||
21 | |||
22 | # You'll start with the following lines for IMAP storage | ||
23 | #virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp | ||
24 | |||
25 | |||
26 | # General stuff here again | ||
27 | #config_directory = /etc/postfix | ||
28 | sample_directory = /etc/postfix | ||
29 | queue_directory = /var/spool/postfix | ||
30 | mail_spool_directory = /var/spool/mail | ||
31 | readme_directory = no | ||
32 | command_directory = /usr/sbin | ||
33 | daemon_directory = /usr/libexec/postfix | ||
34 | mail_owner = postfix | ||
35 | setgid_group = postdrop | ||
36 | unknown_local_recipient_reject_code = 450 | ||
37 | mynetworks_style = host | ||
38 | debug_peer_level = 2 | ||
39 | sendmail_path = /usr/sbin/sendmail | ||
40 | newaliases_path = /usr/bin/newaliases | ||
41 | mailq_path = /usr/bin/mailq | ||
42 | |||
43 | smtpd_data_restrictions = | ||
44 | permit_mynetworks, | ||
45 | reject_unauth_pipelining, | ||
46 | permit | ||
47 | |||
48 | smtpd_client_restrictions = | ||
49 | permit_mynetworks, | ||
50 | # reject_unknown_client, # This can cause a lot of false rejects. | ||
51 | reject_invalid_hostname, | ||
52 | reject_rbl_client list.dsbl.org, | ||
53 | reject_rbl_client sbl.spamhaus.org, | ||
54 | reject_rbl_client cbl.abuseat.org, | ||
55 | reject_rbl_client dul.dnsbl.sorbs.net, | ||
56 | permit | ||
57 | |||
58 | smtpd_helo_required = yes | ||
59 | smtpd_helo_restrictions = | ||
60 | permit_mynetworks, | ||
61 | reject_unauth_pipelining, | ||
62 | # reject_non_fqdn_hostname, # This can cause a lot of false rejects. | ||
63 | # reject_unknown_hostname, # This can cause a lot of false rejects. | ||
64 | reject_invalid_hostname, | ||
65 | permit | ||
66 | |||
67 | smtpd_sender_restrictions = | ||
68 | permit_mynetworks, | ||
69 | reject_non_fqdn_sender, | ||
70 | # check_sender_access hash:/etc/postfix/access_domains, | ||
71 | reject_unknown_sender_domain, | ||
72 | permit | ||
73 | |||
74 | smtpd_recipient_restrictions = | ||
75 | permit_mynetworks, | ||
76 | permit_sasl_authenticated, | ||
77 | reject_unauth_destination, | ||
78 | |||
79 | # check_recipient_access pcre:/etc/postfix/recipient_checks.pcre, | ||
80 | # check_helo_access pcre:/etc/postfix/helo_checks.pcre, | ||
81 | |||
82 | # check_client_access hash:/etc/postfix/maps/access_client, | ||
83 | # check_client_access hash:/etc/postfix/maps/exceptions_client, | ||
84 | # check_helo_access hash:/etc/postfix/maps/access_helo, | ||
85 | # check_helo_access hash:/etc/postfix/maps/verify_helo, | ||
86 | # check_sender_access hash:/etc/postfix/maps/access_sender, | ||
87 | # check_sender_access hash:/etc/postfix/maps/verify_sender, | ||
88 | # check_recipient_access hash:/etc/postfix/maps/access_recipient, | ||
89 | |||
90 | # reject_multi_recipient_bounce, | ||
91 | reject_non_fqdn_recipient, | ||
92 | reject_unknown_recipient_domain, | ||
93 | # reject_unlisted_recipient, | ||
94 | #check_policy_service unix:private/policy, | ||
95 | |||
96 | # check_sender_access hash:/etc/postfix/maps/no_verify_sender, | ||
97 | # check_sender_access hash:/etc/postfix/access_domains, | ||
98 | # reject_unverified_sender, | ||
99 | # reject_unverified_recipient | ||
100 | check_recipient_access hash:/etc/postfix/internal_recipient | ||
101 | |||
102 | disable_vrfy_command = yes | ||
diff --git a/meta-networking/recipes-daemons/postfix/files/makedefs.patch b/meta-networking/recipes-daemons/postfix/files/makedefs.patch new file mode 100644 index 000000000..32c31b024 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/makedefs.patch | |||
@@ -0,0 +1,116 @@ | |||
1 | 1)remove RANLIB, SYSLIBS, AR and get them from env. | ||
2 | |||
3 | 2)reference sysroot when searching header files | ||
4 | 3)include sysroot path instead of absolute include path | ||
5 | for Linux2 and Linux3 systems. | ||
6 | 4)for non-native build, search STAGING_BASELIBDIR/LIBDIR | ||
7 | native build, search host library path for nsl and resolv library | ||
8 | which comes from libc | ||
9 | |||
10 | Upstreamstatus: Inappropriate [embedded specific] | ||
11 | |||
12 | Signed-off-by: Yao Zhao <yao.zhao@windriver.com> | ||
13 | --- | ||
14 | makedefs | 27 +++++++++++---------------- | ||
15 | 1 files changed, 11 insertions(+), 16 deletions(-) | ||
16 | |||
17 | diff --git a/makedefs b/makedefs | ||
18 | index dd5f256..e6fb795 100644 | ||
19 | --- a/makedefs | ||
20 | +++ b/makedefs | ||
21 | @@ -87,9 +87,6 @@ | ||
22 | |||
23 | # Defaults for most sane systems | ||
24 | |||
25 | -RANLIB=ranlib | ||
26 | -SYSLIBS= | ||
27 | -AR=ar | ||
28 | ARFL=rv | ||
29 | |||
30 | # Ugly function to make our error message more visible among the | ||
31 | @@ -293,12 +290,12 @@ case "$SYSTEM.$RELEASE" in | ||
32 | case "$CCARGS" in | ||
33 | *-DNO_DB*) ;; | ||
34 | *-DHAS_DB*) ;; | ||
35 | - *) if [ -f /usr/include/db.h ] | ||
36 | + *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] | ||
37 | then | ||
38 | : we are all set | ||
39 | - elif [ -f /usr/include/db/db.h ] | ||
40 | + elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] | ||
41 | then | ||
42 | - CCARGS="$CCARGS -I/usr/include/db" | ||
43 | + CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" | ||
44 | else | ||
45 | # No, we're not going to try db1 db2 db3 etc. | ||
46 | # On a properly installed system, Postfix builds | ||
47 | @@ -307,12 +304,12 @@ case "$SYSTEM.$RELEASE" in | ||
48 | echo "Install the appropriate db*-devel package first." 1>&2 | ||
49 | exit 1 | ||
50 | fi | ||
51 | - SYSLIBS="-ldb" | ||
52 | + SYSLIBS="$SYSLIBS -ldb" | ||
53 | ;; | ||
54 | esac | ||
55 | for name in nsl resolv $GDBM_LIBS | ||
56 | do | ||
57 | - for lib in /usr/lib64 /lib64 /usr/lib /lib | ||
58 | + for lib in $BUILD_SYSROOT_NSL_PATH | ||
59 | do | ||
60 | test -e $lib/lib$name.a -o -e $lib/lib$name.so && { | ||
61 | SYSLIBS="$SYSLIBS -l$name" | ||
62 | @@ -332,7 +329,7 @@ case "$SYSTEM.$RELEASE" in | ||
63 | if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ] | ||
64 | then | ||
65 | : | ||
66 | - elif [ ! -e /usr/include/sys/epoll.h ] | ||
67 | + elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ] | ||
68 | then | ||
69 | echo CCARGS="$CCARGS -DNO_EPOLL" | ||
70 | else | ||
71 | @@ -356,8 +353,6 @@ int main(int argc, char **argv) | ||
72 | } | ||
73 | EOF | ||
74 | ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1 | ||
75 | - ./makedefs.test 2>/dev/null || | ||
76 | - CCARGS="$CCARGS -DNO_EPOLL" | ||
77 | rm -f makedefs.test makedefs.test.[co] | ||
78 | fi;; | ||
79 | esac | ||
80 | @@ -366,12 +361,12 @@ EOF | ||
81 | case "$CCARGS" in | ||
82 | *-DNO_DB*) ;; | ||
83 | *-DHAS_DB*) ;; | ||
84 | - *) if [ -f /usr/include/db.h ] | ||
85 | + *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ] | ||
86 | then | ||
87 | : we are all set | ||
88 | - elif [ -f /usr/include/db/db.h ] | ||
89 | + elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ] | ||
90 | then | ||
91 | - CCARGS="$CCARGS -I/usr/include/db" | ||
92 | + CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db" | ||
93 | else | ||
94 | # On a properly installed system, Postfix builds | ||
95 | # by including <db.h> and by linking with -ldb | ||
96 | @@ -379,7 +374,7 @@ EOF | ||
97 | echo "Install the appropriate db*-devel package first." 1>&2 | ||
98 | exit 1 | ||
99 | fi | ||
100 | - SYSLIBS="-ldb" | ||
101 | + SYSLIBS="$SYSLIBS -ldb" | ||
102 | ;; | ||
103 | esac | ||
104 | for name in nsl resolv | ||
105 | @@ -415,7 +410,7 @@ EOF | ||
106 | esac | ||
107 | for name in nsl resolv | ||
108 | do | ||
109 | - for lib in /usr/lib64 /lib64 /usr/lib /lib | ||
110 | + for lib in $BUILD_SYSROOT_NSL_PATH | ||
111 | do | ||
112 | test -e $lib/lib$name.a -o -e $lib/lib$name.so && { | ||
113 | SYSLIBS="$SYSLIBS -l$name" | ||
114 | -- | ||
115 | 1.7.1 | ||
116 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix b/meta-networking/recipes-daemons/postfix/files/postfix new file mode 100755 index 000000000..7bcc81625 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | success() { | ||
4 | echo " Successful" | ||
5 | exit 0 | ||
6 | } | ||
7 | |||
8 | fail() { | ||
9 | echo " Failed" | ||
10 | exit 1 | ||
11 | |||
12 | } | ||
13 | |||
14 | check_return () { | ||
15 | local ret="$1" | ||
16 | |||
17 | if [ "$ret" = "0" ]; then | ||
18 | success | ||
19 | else | ||
20 | fail | ||
21 | fi | ||
22 | } | ||
23 | |||
24 | PIDFile=/var/spool/postfix/pid/master.pid | ||
25 | case "$1" in | ||
26 | |||
27 | start) | ||
28 | echo -n "Starting Postfix..." | ||
29 | if [ ! -e /etc/aliases.db ]; then | ||
30 | # The alias database is necessary for postfix to work correctly. | ||
31 | echo "Creating aliases database ..." | ||
32 | newaliases | ||
33 | fi | ||
34 | if ! postfix status >/dev/null 2>&1; then | ||
35 | postfix start | ||
36 | check_return $? | ||
37 | else | ||
38 | success | ||
39 | fi | ||
40 | ;; | ||
41 | |||
42 | stop) | ||
43 | echo -n "Stopping Postfix..." | ||
44 | if postfix status >/dev/null 2>&1; then | ||
45 | postfix stop | ||
46 | check_return $? | ||
47 | else | ||
48 | success | ||
49 | fi | ||
50 | ;; | ||
51 | |||
52 | reload) | ||
53 | echo -n "Reloading Postfix..." | ||
54 | if postfix status >/dev/null 2>&1; then | ||
55 | postfix reload | ||
56 | check_return $? | ||
57 | else | ||
58 | postfix start | ||
59 | check_return $? | ||
60 | fi | ||
61 | ;; | ||
62 | |||
63 | restart) | ||
64 | $0 stop | ||
65 | sleep 1 | ||
66 | $0 start | ||
67 | ;; | ||
68 | |||
69 | status) | ||
70 | if postfix status >/dev/null 2>&1; then | ||
71 | pid=`sed -e 's/\s//g' $PIDFile` | ||
72 | echo "The Postfix mail system is running (PID: $pid)" | ||
73 | exit 0 | ||
74 | else | ||
75 | echo "The Postfix mail system is not running" | ||
76 | exit 1 | ||
77 | fi | ||
78 | ;; | ||
79 | |||
80 | *) | ||
81 | echo "Usage: $0 {start|stop|status|reload|restart}" | ||
82 | exit 1 | ||
83 | ;; | ||
84 | esac | ||
85 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch b/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch new file mode 100644 index 000000000..e3e28c843 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix-add-db6-support.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Subject: [PATCH] add db6 support db6 | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
6 | --- | ||
7 | src/util/dict_db.c | 3 ++- | ||
8 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/src/util/dict_db.c b/src/util/dict_db.c | ||
11 | index 93ee480..f1ae66b 100644 | ||
12 | --- a/src/util/dict_db.c | ||
13 | +++ b/src/util/dict_db.c | ||
14 | @@ -693,7 +693,8 @@ static DICT *dict_db_open(const char *class, const char *path, int open_flags, | ||
15 | msg_fatal("set DB cache size %d: %m", dict_db_cache_size); | ||
16 | if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) | ||
17 | msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); | ||
18 | -#if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) | ||
19 | +#if DB_VERSION_MAJOR == 6 || DB_VERSION_MAJOR == 5 || \ | ||
20 | + (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) | ||
21 | if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0) | ||
22 | FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags, | ||
23 | "open database %s: %m", db_path)); | ||
24 | -- | ||
25 | 1.7.1 | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/postfix/files/postfix.service b/meta-networking/recipes-daemons/postfix/files/postfix.service new file mode 100644 index 000000000..6ea921478 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/files/postfix.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=Postfix Mail Transport Agent | ||
3 | After=syslog.target network.target | ||
4 | Conflicts=sendmail.service exim.service | ||
5 | |||
6 | [Service] | ||
7 | Type=forking | ||
8 | PIDFile=/var/spool/postfix/pid/master.pid | ||
9 | ExecStart=/usr/sbin/postfix start | ||
10 | ExecReload=/usr/sbin/postfix reload | ||
11 | ExecStop=/usr/sbin/postfix stop | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-networking/recipes-daemons/postfix/postfix.inc new file mode 100644 index 000000000..63de2a024 --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/postfix.inc | |||
@@ -0,0 +1,235 @@ | |||
1 | SUMMARY = "Postfix Mail Transport Agent" | ||
2 | DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \ | ||
3 | IBM research as an alternative to the widely-used Sendmail program. \ | ||
4 | Postfix attempts to be fast, easy to administer, and secure. The outsidei \ | ||
5 | has a definite Sendmail-ish flavor, but the inside is completely different." | ||
6 | |||
7 | HOMEPAGE= "http://www.postfix.org" | ||
8 | SECTION = "console/network" | ||
9 | DEPENDS = "virtual/db libpcre openssl postfix-native \ | ||
10 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \ | ||
11 | ${@base_contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \ | ||
12 | " | ||
13 | DEPENDS_virtclass-native = "virtual/db-native openssl-native libpcre-native" | ||
14 | |||
15 | LICENSE = "IPL-1.0" | ||
16 | LIC_FILES_CHKSUM = "file://LICENSE;md5=64375f37431336ea1b1b3005fe3fa354" | ||
17 | |||
18 | SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \ | ||
19 | file://makedefs.patch \ | ||
20 | file://install.patch \ | ||
21 | file://main.cf_2.0 \ | ||
22 | file://postfix \ | ||
23 | file://internal_recipient \ | ||
24 | file://postfix.service \ | ||
25 | " | ||
26 | |||
27 | S = "${WORKDIR}/postfix-${PV}" | ||
28 | |||
29 | BBCLASSEXTEND = "native" | ||
30 | |||
31 | inherit update-rc.d useradd update-alternatives systemd | ||
32 | |||
33 | INITSCRIPT_NAME = "postfix" | ||
34 | INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ." | ||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = \ | ||
37 | "-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \ | ||
38 | -d /var/spool/vmail -r -u 5000 -g vmail --shell /bin/false vmail \ | ||
39 | " | ||
40 | GROUPADD_PARAM_${PN} = "--system postfix;--system postdrop;-g 5000 --system vmail" | ||
41 | |||
42 | export SYSLIBS = "${LDFLAGS}" | ||
43 | |||
44 | # CCARGS specifies includes, defines | ||
45 | # AUXLIBS specifies libraries | ||
46 | # Linux2/Linux3 has HAS_DB defined | ||
47 | # makedefs will make CC to be CC+CCARGS | ||
48 | |||
49 | # ldap support | ||
50 | export CCARGS-ldap = "\ | ||
51 | ${@base_contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}" | ||
52 | export AUXLIBS-ldap = "\ | ||
53 | ${@base_contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}" | ||
54 | |||
55 | # no native openldap | ||
56 | export CCARGS-ldap_virtclass-native = "" | ||
57 | export AUXLIBS-ldap_virtclass-native = "" | ||
58 | |||
59 | # SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH | ||
60 | # current openldap didn't enable SASL | ||
61 | export CCARGS-sasl = "\ | ||
62 | ${@base_contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I=/usr/include/sasl', '', d)}" | ||
63 | export AUXLIBS-sasl = "\ | ||
64 | ${@base_contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}" | ||
65 | export CCARGS-sasl_virtclass-native = "" | ||
66 | export AUXLIBS-sasl_virtclass-native = "" | ||
67 | |||
68 | # PCRE, TLS support default | ||
69 | export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS ${CCARGS-ldap} ${CCARGS-sasl}" | ||
70 | export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}" | ||
71 | export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf" | ||
72 | |||
73 | # OPT,DEBUG is aready in CFLAGS | ||
74 | # ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS | ||
75 | EXTRA_OEMAKE += "OPT= DEBUG= OPTS= " | ||
76 | |||
77 | do_compile () { | ||
78 | unset CFLAGS CPPFLAGS CXXFLAGS | ||
79 | local native_build | ||
80 | |||
81 | native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}" | ||
82 | |||
83 | # if not native build, then pass SYSTEM and RELEASE to makedefs | ||
84 | if [ "${native_build}" != "1" ]; then | ||
85 | # uname -s for target | ||
86 | SYSTEM="Linux" | ||
87 | |||
88 | # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6 | ||
89 | RELEASE="2.6.34" | ||
90 | sed -i -e \ | ||
91 | "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \ | ||
92 | ${S}/Makefile.in | ||
93 | export BUILD_SYSROOT="${STAGING_DIR_HOST}" | ||
94 | export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \ | ||
95 | ${STAGING_LIBDIR}" | ||
96 | else | ||
97 | # native build | ||
98 | export BUILD_SYSROOT="${STAGING_DIR_NATIVE}" | ||
99 | |||
100 | # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32) | ||
101 | # on 64 bits, 32 libs in i386-linux-gnu | ||
102 | # let makedefs finds nsl and resolv libs, host CC will link | ||
103 | # the correct libraries | ||
104 | BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \ | ||
105 | sed -n '/^libraries: =/s/libraries: =//p' | \ | ||
106 | sed -e 's/:/\n/g' | xargs -n1 readlink -f | \ | ||
107 | grep -v 'gcc\|/[0-9.]\+$' | sort -u)" | ||
108 | if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then | ||
109 | BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \ | ||
110 | /lib/x86_64-linux-gnu \ | ||
111 | /usr/lib /lib \ | ||
112 | /lib/i386-linux-gnu" | ||
113 | fi | ||
114 | export BUILD_SYSROOT_NSL_PATH | ||
115 | fi | ||
116 | |||
117 | oe_runmake makefiles | ||
118 | oe_runmake | ||
119 | } | ||
120 | |||
121 | do_install_prepend_virtclass-native() { | ||
122 | export POSTCONF="bin/postconf" | ||
123 | } | ||
124 | |||
125 | SYSTEMD_SERVICE_${PN} = "postfix.service" | ||
126 | SYSTEMD_AUTO_ENABLE = "disable" | ||
127 | |||
128 | do_install () { | ||
129 | sh ./postfix-install 'install_root=${D}' \ | ||
130 | 'config_directory=${sysconfdir}/postfix' \ | ||
131 | 'daemon_directory=${exec_prefix}/libexec/postfix' \ | ||
132 | 'command_directory=${sbindir}' \ | ||
133 | 'queue_directory=${localstatedir}/spool/postfix' \ | ||
134 | 'sendmail_path=${sbindir}/sendmail.postfix' \ | ||
135 | 'newaliases_path=${bindir}/newaliases' \ | ||
136 | 'mailq_path=${bindir}/mailq' \ | ||
137 | 'manpage_directory=${mandir}' \ | ||
138 | 'readme_directory=${datadir}/doc/postfix' \ | ||
139 | 'data_directory=${localstatedir}/lib/postfix' \ | ||
140 | -non-interactive | ||
141 | rm -rf ${D}${localstatedir}/spool/postfix | ||
142 | mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf | ||
143 | install -d ${D}${sysconfdir}/init.d | ||
144 | install -m 644 ${WORKDIR}/main.cf_2.0 ${D}${sysconfdir}/postfix/main.cf | ||
145 | install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix | ||
146 | install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient | ||
147 | |||
148 | install -d ${D}${systemd_unitdir}/system | ||
149 | install -m 0644 ${WORKDIR}/postfix.service ${D}${systemd_unitdir}/system | ||
150 | sed -i 's,/usr/sbin/,${sbindir}/,g' ${D}${systemd_unitdir}/system/postfix.service | ||
151 | |||
152 | install -m 770 -d ${D}${localstatedir}/spool/postfix | ||
153 | chown postfix:postfix ${D}${localstatedir}/spool/postfix | ||
154 | chown postfix:postfix ${D}${localstatedir}/lib/postfix | ||
155 | |||
156 | install -m 2755 -d ${D}${localstatedir}/spool/mail | ||
157 | chown postfix:nogroup ${D}${localstatedir}/spool/mail | ||
158 | install -m 0755 -d ${D}${localstatedir}/lib/postfix | ||
159 | chown postfix:nogroup ${D}${localstatedir}/lib/postfix | ||
160 | install -m 0755 -d ${D}${localstatedir}/spool/postfix | ||
161 | chown root:postfix ${D}${localstatedir}/spool/postfix | ||
162 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/active | ||
163 | chown postfix:root ${D}${localstatedir}/spool/postfix/active | ||
164 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce | ||
165 | chown postfix:root ${D}${localstatedir}/spool/postfix/bounce | ||
166 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt | ||
167 | chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt | ||
168 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer | ||
169 | chown postfix:root ${D}${localstatedir}/spool/postfix/defer | ||
170 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred | ||
171 | chown postfix:root ${D}${localstatedir}/spool/postfix/deferred | ||
172 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush | ||
173 | chown postfix:root ${D}${localstatedir}/spool/postfix/flush | ||
174 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold | ||
175 | chown postfix:root ${D}${localstatedir}/spool/postfix/hold | ||
176 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming | ||
177 | chown postfix:root ${D}${localstatedir}/spool/postfix/incoming | ||
178 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved | ||
179 | chown postfix:root ${D}${localstatedir}/spool/postfix/saved | ||
180 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace | ||
181 | chown postfix:root ${D}${localstatedir}/spool/postfix/trace | ||
182 | install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop | ||
183 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop | ||
184 | install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid | ||
185 | chown root:root ${D}${localstatedir}/spool/postfix/pid | ||
186 | install -m 0700 -d ${D}${localstatedir}/spool/postfix/private | ||
187 | chown postfix:root ${D}${localstatedir}/spool/postfix/private | ||
188 | install -m 0710 -d ${D}${localstatedir}/spool/postfix/public | ||
189 | chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public | ||
190 | install -m 0755 -d ${D}${localstatedir}/spool/vmail | ||
191 | chown vmail:vmail ${D}${localstatedir}/spool/vmail | ||
192 | |||
193 | chown :postdrop ${D}${sbindir}/postqueue | ||
194 | chown :postdrop ${D}${sbindir}/postdrop | ||
195 | chmod g+s ${D}${sbindir}/postqueue | ||
196 | chmod g+s ${D}${sbindir}/postdrop | ||
197 | } | ||
198 | |||
199 | do_install_append_class-native() { | ||
200 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases | ||
201 | ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq | ||
202 | } | ||
203 | |||
204 | do_install_append_class-target() { | ||
205 | # Remove references to buildmachine paths in target makedefs.out | ||
206 | sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out | ||
207 | } | ||
208 | |||
209 | NATIVE_INSTALL_WORKS = "1" | ||
210 | |||
211 | ALTERNATIVE_${PN} = "sendmail" | ||
212 | ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix" | ||
213 | ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail" | ||
214 | ALTERNATIVE_PRIORITY = "120" | ||
215 | |||
216 | pkg_postinst_${PN} () { | ||
217 | if [ "x$D" = "x" ]; then | ||
218 | touch /etc/aliases | ||
219 | newaliases | ||
220 | |||
221 | # generate virtual_alias, default is hash | ||
222 | touch /etc/postfix/virtual_alias | ||
223 | postmap /etc/postfix/virtual_alias | ||
224 | else | ||
225 | touch $D/etc/aliases | ||
226 | newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases | ||
227 | touch $D/etc/postfix/virtual_alias | ||
228 | postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias | ||
229 | fi | ||
230 | } | ||
231 | |||
232 | # Exclude .debug directories from the main package | ||
233 | FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \ | ||
234 | ${exec_prefix}/libexec/postfix/* ${systemd_unitdir}/*" | ||
235 | FILES_${PN}-dbg += "${exec_prefix}/libexec/postfix/.debug" | ||
diff --git a/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb b/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb new file mode 100644 index 000000000..8f237dc2e --- /dev/null +++ b/meta-networking/recipes-daemons/postfix/postfix_2.11.1.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require postfix.inc | ||
2 | |||
3 | SRC_URI += "file://postfix-add-db6-support.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "56ac1f1a79737c4ac1e24535a122a4a6" | ||
6 | SRC_URI[sha256sum] = "487f98a73b95a5799409caf21ec065efea91c1dcdfb84c038a0e3a265d6489e2" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch new file mode 100644 index 000000000..4967bed1e --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | proftpd tries to get the IP address from the hostname. | ||
4 | Unluckily now the hostname is not properly configured in /etc/hosts. | ||
5 | We can use this patch as a workaround. | ||
6 | |||
7 | Author: Dexuan Cui <dexuan.cui@intel.com> | ||
8 | Tue Oct 25 12:59:27 CST 2011 | ||
9 | |||
10 | --- proftpd-1.3.3c.orig/sample-configurations/basic.conf | ||
11 | +++ proftpd-1.3.3c/sample-configurations/basic.conf | ||
12 | @@ -7,6 +7,9 @@ | ||
13 | ServerType standalone | ||
14 | DefaultServer on | ||
15 | |||
16 | +#By default we bind to all interfaces. | ||
17 | +DefaultAddress 0.0.0.0 | ||
18 | + | ||
19 | # Port 21 is the standard FTP port. | ||
20 | Port 21 | ||
21 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch new file mode 100644 index 000000000..c64535cac --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | close RequireValidShell check | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | close RequireValidShell check since we like to make /bin/false as shell | ||
6 | for ftp user | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | sample-configurations/basic.conf | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf | ||
14 | index 314eb79..abcb284 100644 | ||
15 | --- a/sample-configurations/basic.conf | ||
16 | +++ b/sample-configurations/basic.conf | ||
17 | @@ -53,6 +53,7 @@ AllowOverwrite on | ||
18 | # We want clients to be able to login with "anonymous" as well as "ftp" | ||
19 | UserAlias anonymous ftp | ||
20 | |||
21 | + RequireValidShell off | ||
22 | # Limit the maximum number of anonymous logins | ||
23 | MaxClients 10 | ||
24 | |||
25 | -- | ||
26 | 1.7.10.4 | ||
27 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-networking/recipes-daemons/proftpd/files/contrib.patch new file mode 100644 index 000000000..7e2a8e3ce --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/contrib.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | The contrib directory now contains its own Makefile which is | ||
2 | used during installation. It was required to pass DESTDIR through | ||
3 | when it gets called from the base Makefile. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com> | ||
8 | --- | ||
9 | Makefile.in | 2 +- | ||
10 | contrib/Makefile.in | 6 +++--- | ||
11 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile.in b/Makefile.in | ||
14 | index 5b2e683..ee72fe1 100644 | ||
15 | --- a/Makefile.in | ||
16 | +++ b/Makefile.in | ||
17 | @@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir) | ||
18 | test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install) | ||
19 | |||
20 | install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir) | ||
21 | - cd contrib/ && $(MAKE) install-utils | ||
22 | + cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils | ||
23 | $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount | ||
24 | $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl | ||
25 | $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub | ||
26 | diff --git a/contrib/Makefile.in b/contrib/Makefile.in | ||
27 | index 5bcc038..51d248c 100644 | ||
28 | --- a/contrib/Makefile.in | ||
29 | +++ b/contrib/Makefile.in | ||
30 | @@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status | ||
31 | cd ../ && ./config.status | ||
32 | |||
33 | install-utils: | ||
34 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
35 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
36 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
37 | + $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
38 | + $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
39 | + $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
40 | -- | ||
41 | 1.7.9.5 | ||
42 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/default b/meta-networking/recipes-daemons/proftpd/files/default new file mode 100644 index 000000000..b31f36ce2 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/default | |||
@@ -0,0 +1,9 @@ | |||
1 | # Defaults for proftpd initscript | ||
2 | |||
3 | # Master system-wide proftpd switch. The initscript | ||
4 | # will not run if it is not set to yes. | ||
5 | RUN="yes" | ||
6 | |||
7 | # Default options. | ||
8 | # For more exhaustive logging, try "-d 3". | ||
9 | OPTIONS="" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/make.patch b/meta-networking/recipes-daemons/proftpd/files/make.patch new file mode 100644 index 000000000..c5ff0136d --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/make.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: proftpd-1.3.2/Makefile.in | ||
4 | =================================================================== | ||
5 | --- proftpd-1.3.2.orig/Makefile.in | ||
6 | +++ proftpd-1.3.2/Makefile.in | ||
7 | @@ -76,7 +76,6 @@ check: proftpd$(EXEEXT) | ||
8 | $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(rundir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8: | ||
9 | @if [ ! -d $@ ]; then \ | ||
10 | mkdir -p $@; \ | ||
11 | - chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \ | ||
12 | chmod 0755 $@; \ | ||
13 | fi | ||
14 | |||
15 | @@ -86,7 +85,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc | ||
16 | rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \ | ||
17 | fi | ||
18 | ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd | ||
19 | - -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd | ||
20 | |||
21 | install-libs: $(DESTDIR)$(libdir)/proftpd | ||
22 | cd lib/ && $(MAKE) install | ||
23 | @@ -121,11 +119,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE | ||
24 | $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut | ||
25 | $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop | ||
26 | $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho | ||
27 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
28 | + $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
29 | |||
30 | install-conf: $(DESTDIR)$(sysconfdir) | ||
31 | if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \ | ||
32 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \ | ||
33 | + $(INSTALL) -m 0644 \ | ||
34 | $(top_srcdir)/sample-configurations/basic.conf \ | ||
35 | $(DESTDIR)$(sysconfdir)/proftpd.conf ; \ | ||
36 | fi | ||
37 | Index: proftpd-1.3.2/Make.rules.in | ||
38 | =================================================================== | ||
39 | --- proftpd-1.3.2.orig/Make.rules.in | ||
40 | +++ proftpd-1.3.2/Make.rules.in | ||
41 | @@ -29,9 +29,9 @@ UTILS_LIBS=@UTILS_LIBS@ @LIBS@ | ||
42 | INSTALL=@INSTALL@ | ||
43 | INSTALL_USER=@install_user@ | ||
44 | INSTALL_GROUP=@install_group@ | ||
45 | -INSTALL_BIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
46 | -INSTALL_SBIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
47 | -INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 | ||
48 | +INSTALL_BIN=$(INSTALL) -m 0755 | ||
49 | +INSTALL_SBIN=$(INSTALL) -m 0755 | ||
50 | +INSTALL_MAN=$(INSTALL) -m 0644 | ||
51 | |||
52 | RM=rm -f | ||
53 | SHELL=/bin/sh | ||
54 | Index: proftpd-1.3.2/lib/libcap/Makefile | ||
55 | =================================================================== | ||
56 | --- proftpd-1.3.2.orig/lib/libcap/Makefile | ||
57 | +++ proftpd-1.3.2/lib/libcap/Makefile | ||
58 | @@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES)) | ||
59 | all: $(LIBNAME) | ||
60 | |||
61 | _makenames: _makenames.c cap_names.sed | ||
62 | - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
63 | + $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
64 | |||
65 | cap_names.h: _makenames | ||
66 | ./_makenames > cap_names.h | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch new file mode 100644 index 000000000..953bbddef --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | move pidfile to /var/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index e6268f5..ebed38e 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33587,7 +33587,7 @@ cat >>confdefs.h <<_ACEOF | ||
16 | _ACEOF | ||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/proftpd.pid"`" | ||
20 | +#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/run/proftpd.pid"`" | ||
21 | _ACEOF | ||
22 | |||
23 | |||
24 | diff --git a/configure.in b/configure.in | ||
25 | index df9186a..e2ae868 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2790,7 +2790,7 @@ AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
29 | |||
30 | AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
31 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
32 | -AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
34 | |||
35 | prefix="$pr_saved_prefix" | ||
36 | exec_prefix="$pr_saved_exec_prefix" | ||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch new file mode 100644 index 000000000..1561ed80e --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | redefine PR_RUN_DIR as ${localstatedir}/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index ebed38e..445d5bc 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33579,7 +33579,7 @@ _ACEOF | ||
16 | |||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_RUN_DIR "`eval echo "${localstatedir}"`" | ||
20 | +#define PR_RUN_DIR "`eval echo "${localstatedir}"/run/`" | ||
21 | _ACEOF | ||
22 | |||
23 | cat >>confdefs.h <<_ACEOF | ||
24 | diff --git a/configure.in b/configure.in | ||
25 | index c17929c..df9186a 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2788,7 +2788,7 @@ locale_dir="`eval echo ${localedir}`" | ||
29 | locale_dir="`eval echo ${locale_dir}`" | ||
30 | AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
31 | |||
32 | -AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}/run"`") | ||
34 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
35 | AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
36 | |||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init new file mode 100644 index 000000000..01c998c92 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init | |||
@@ -0,0 +1,220 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: proftpd | ||
5 | # Required-Start: $remote_fs $syslog $local_fs $network | ||
6 | # Required-Stop: $remote_fs $syslog $local_fs $network | ||
7 | # Should-Start: $named | ||
8 | # Should-Stop: $named | ||
9 | # Default-Start: 2 3 4 5 | ||
10 | # Default-Stop: 0 1 6 | ||
11 | # Short-Description: Starts ProFTPD daemon | ||
12 | # Description: This script runs the FTP service offered | ||
13 | # by the ProFTPD daemon | ||
14 | ### END INIT INFO | ||
15 | |||
16 | # Start the proftpd FTP daemon. | ||
17 | |||
18 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
19 | DAEMON=/usr/sbin/proftpd | ||
20 | NAME=proftpd | ||
21 | |||
22 | # Defaults | ||
23 | RUN="no" | ||
24 | OPTIONS="" | ||
25 | CONFIG_FILE=/etc/proftpd.conf | ||
26 | |||
27 | PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'` | ||
28 | if [ "x$PIDFILE" = "x" ]; | ||
29 | then | ||
30 | PIDFILE=/var/run/proftpd.pid | ||
31 | fi | ||
32 | |||
33 | # Read config (will override defaults) | ||
34 | [ -r /etc/default/proftpd ] && . /etc/default/proftpd | ||
35 | |||
36 | trap "" 1 | ||
37 | trap "" 15 | ||
38 | |||
39 | test -f $DAEMON || exit 0 | ||
40 | |||
41 | . /etc/init.d/functions | ||
42 | |||
43 | # | ||
44 | # Servertype could be inetd|standalone|none. | ||
45 | # In all cases check against inetd and xinetd support. | ||
46 | # | ||
47 | if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE | ||
48 | then | ||
49 | if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \ | ||
50 | egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \ | ||
51 | egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null | ||
52 | then | ||
53 | RUN="no" | ||
54 | INETD="yes" | ||
55 | else | ||
56 | if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE | ||
57 | then | ||
58 | RUN="yes" | ||
59 | INETD="no" | ||
60 | else | ||
61 | RUN="no" | ||
62 | INETD="no" | ||
63 | fi | ||
64 | fi | ||
65 | fi | ||
66 | |||
67 | # /var/run could be on a tmpfs | ||
68 | |||
69 | [ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd | ||
70 | |||
71 | inetd_check() | ||
72 | { | ||
73 | if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then | ||
74 | echo "Neither inetd nor xinetd appears installed: check your configuration." | ||
75 | fi | ||
76 | } | ||
77 | |||
78 | start() | ||
79 | { | ||
80 | set -e | ||
81 | echo -n "Starting ftp server $NAME... " | ||
82 | start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS | ||
83 | echo "done." | ||
84 | } | ||
85 | |||
86 | signal() | ||
87 | { | ||
88 | |||
89 | if [ "$1" = "stop" ]; then | ||
90 | SIGNAL="TERM" | ||
91 | echo -n "Stopping ftp server $NAME... " | ||
92 | else | ||
93 | if [ "$1" = "reload" ]; then | ||
94 | SIGNAL="HUP" | ||
95 | echo -n "Reloading ftp server $NAME... " | ||
96 | else | ||
97 | echo "ERR: wrong parameter given to signal()" | ||
98 | exit 1 | ||
99 | fi | ||
100 | fi | ||
101 | if [ -f "$PIDFILE" ]; then | ||
102 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
103 | if [ $? = 0 ]; then | ||
104 | echo "done." | ||
105 | return | ||
106 | else | ||
107 | SIGNAL="KILL" | ||
108 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
109 | if [ $? != 0 ]; then | ||
110 | echo | ||
111 | [ $2 != 0 ] || exit 0 | ||
112 | else | ||
113 | echo "done." | ||
114 | return | ||
115 | fi | ||
116 | fi | ||
117 | if [ "$SIGNAL" = "KILL" ]; then | ||
118 | rm -f "$PIDFILE" | ||
119 | fi | ||
120 | else | ||
121 | echo "done." | ||
122 | return | ||
123 | fi | ||
124 | } | ||
125 | |||
126 | case "$1" in | ||
127 | start) | ||
128 | if [ "x$RUN" = "xyes" ] ; then | ||
129 | start | ||
130 | else | ||
131 | if [ "x$INETD" = "xyes" ] ; then | ||
132 | echo "ProFTPD is started from inetd/xinetd." | ||
133 | inetd_check | ||
134 | else | ||
135 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
136 | fi | ||
137 | fi | ||
138 | ;; | ||
139 | |||
140 | force-start) | ||
141 | if [ "x$INETD" = "xyes" ] ; then | ||
142 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)." | ||
143 | inetd_check | ||
144 | fi | ||
145 | start | ||
146 | ;; | ||
147 | |||
148 | stop) | ||
149 | if [ "x$RUN" = "xyes" ] ; then | ||
150 | signal stop 0 | ||
151 | else | ||
152 | if [ "x$INETD" = "xyes" ] ; then | ||
153 | echo "ProFTPD is started from inetd/xinetd." | ||
154 | inetd_check | ||
155 | else | ||
156 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
157 | fi | ||
158 | fi | ||
159 | ;; | ||
160 | |||
161 | force-stop) | ||
162 | if [ "x$INETD" = "xyes" ] ; then | ||
163 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)." | ||
164 | inetd_check | ||
165 | fi | ||
166 | signal stop 0 | ||
167 | ;; | ||
168 | |||
169 | reload) | ||
170 | signal reload 0 | ||
171 | ;; | ||
172 | |||
173 | force-reload|restart) | ||
174 | if [ "x$RUN" = "xyes" ] ; then | ||
175 | signal stop 1 | ||
176 | sleep 2 | ||
177 | start | ||
178 | else | ||
179 | if [ "x$INETD" = "xyes" ] ; then | ||
180 | echo "ProFTPD is started from inetd/xinetd." | ||
181 | inetd_check | ||
182 | else | ||
183 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
184 | fi | ||
185 | fi | ||
186 | ;; | ||
187 | |||
188 | status) | ||
189 | if [ "x$INETD" = "xyes" ] ; then | ||
190 | echo "ProFTPD is started from inetd/xinetd." | ||
191 | inetd_check | ||
192 | exit 0 | ||
193 | else | ||
194 | if [ -f "$PIDFILE" ]; then | ||
195 | pid=$(cat $PIDFILE) | ||
196 | else | ||
197 | pid="x" | ||
198 | fi | ||
199 | if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then | ||
200 | echo "ProFTPD is started in standalone mode, currently running." | ||
201 | exit 0 | ||
202 | else | ||
203 | echo "ProFTPD is started in standalone mode, currently not running." | ||
204 | exit 3 | ||
205 | fi | ||
206 | fi | ||
207 | ;; | ||
208 | |||
209 | check-config) | ||
210 | $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0 | ||
211 | exit 1 | ||
212 | ;; | ||
213 | |||
214 | *) | ||
215 | echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}" | ||
216 | exit 1 | ||
217 | ;; | ||
218 | esac | ||
219 | |||
220 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd-sftp.patch b/meta-networking/recipes-daemons/proftpd/files/proftpd-sftp.patch new file mode 100644 index 000000000..8c71263b0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-sftp.patch | |||
@@ -0,0 +1,142 @@ | |||
1 | proftpd/mod_sftp: fix too much memory allocation bug of mod_sftp | ||
2 | |||
3 | This patch fixes the too much memory allocation bug of the mod_sftp by | ||
4 | ensuring both that a) the received response count matches the number of | ||
5 | challenges sent, and b) that the received response count is not too high | ||
6 | (as an additional sanity check); the upper bound is still set to 500. | ||
7 | |||
8 | The patch is picked from: http://bugs.proftpd.org/show_bug.cgi?id=3973 | ||
9 | |||
10 | Upstream-Status: Backport CVE-2013-4359 | ||
11 | |||
12 | diff --git a/contrib/mod_sftp/kbdint.c b/contrib/mod_sftp/kbdint.c | ||
13 | index 0271fb2..de651fa 100644 | ||
14 | --- a/contrib/mod_sftp/kbdint.c | ||
15 | +++ b/contrib/mod_sftp/kbdint.c | ||
16 | @@ -1,6 +1,6 @@ | ||
17 | /* | ||
18 | * ProFTPD - mod_sftp keyboard-interactive driver mgmt | ||
19 | - * Copyright (c) 2008-2009 TJ Saunders | ||
20 | + * Copyright (c) 2008-2013 TJ Saunders | ||
21 | * | ||
22 | * This program is free software; you can redistribute it and/or modify | ||
23 | * it under the terms of the GNU General Public License as published by | ||
24 | @@ -31,6 +31,8 @@ | ||
25 | #include "utf8.h" | ||
26 | #include "kbdint.h" | ||
27 | |||
28 | +#define SFTP_KBDINT_MAX_RESPONSES 500 | ||
29 | + | ||
30 | struct kbdint_driver { | ||
31 | struct kbdint_driver *next, *prev; | ||
32 | |||
33 | @@ -252,8 +254,8 @@ int sftp_kbdint_send_challenge(const char *user, const char *instruction, | ||
34 | return res; | ||
35 | } | ||
36 | |||
37 | -int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
38 | - const char ***responses) { | ||
39 | +int sftp_kbdint_recv_response(pool *p, unsigned int expected_count, | ||
40 | + unsigned int *rcvd_count, const char ***responses) { | ||
41 | register unsigned int i; | ||
42 | char *buf; | ||
43 | cmd_rec *cmd; | ||
44 | @@ -264,7 +266,7 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
45 | int res; | ||
46 | |||
47 | if (p == NULL || | ||
48 | - count == NULL || | ||
49 | + rcvd_count == NULL || | ||
50 | responses == NULL) { | ||
51 | errno = EINVAL; | ||
52 | return -1; | ||
53 | @@ -299,6 +301,29 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
54 | |||
55 | resp_count = sftp_msg_read_int(pkt->pool, &buf, &buflen); | ||
56 | |||
57 | + /* Ensure that the number of responses sent by the client is the same | ||
58 | + * as the number of challenges sent, lest a malicious client attempt to | ||
59 | + * trick us into allocating too much memory (Bug#3973). | ||
60 | + */ | ||
61 | + if (resp_count != expected_count) { | ||
62 | + (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, | ||
63 | + "sent %lu %s, but received %lu %s", (unsigned long) expected_count, | ||
64 | + expected_count != 1 ? "challenges" : "challenge", | ||
65 | + (unsigned long) resp_count, resp_count != 1 ? "responses" : "response"); | ||
66 | + destroy_pool(pkt->pool); | ||
67 | + errno = EPERM; | ||
68 | + return -1; | ||
69 | + } | ||
70 | + | ||
71 | + if (resp_count > SFTP_KBDINT_MAX_RESPONSES) { | ||
72 | + (void) pr_log_writefile(sftp_logfd, MOD_SFTP_VERSION, | ||
73 | + "received too many responses (%lu > max %lu), rejecting", | ||
74 | + (unsigned long) resp_count, (unsigned long) SFTP_KBDINT_MAX_RESPONSES); | ||
75 | + destroy_pool(pkt->pool); | ||
76 | + errno = EPERM; | ||
77 | + return -1; | ||
78 | + } | ||
79 | + | ||
80 | list = make_array(p, resp_count, sizeof(char *)); | ||
81 | for (i = 0; i < resp_count; i++) { | ||
82 | char *resp; | ||
83 | @@ -307,7 +332,7 @@ int sftp_kbdint_recv_response(pool *p, unsigned int *count, | ||
84 | *((char **) push_array(list)) = pstrdup(p, sftp_utf8_decode_str(p, resp)); | ||
85 | } | ||
86 | |||
87 | - *count = (unsigned int) resp_count; | ||
88 | + *rcvd_count = (unsigned int) resp_count; | ||
89 | *responses = ((const char **) list->elts); | ||
90 | return 0; | ||
91 | } | ||
92 | diff --git a/contrib/mod_sftp/mod_sftp.h.in b/contrib/mod_sftp/mod_sftp.h.in | ||
93 | index 3e91390..c547be0 100644 | ||
94 | --- a/contrib/mod_sftp/mod_sftp.h.in | ||
95 | +++ b/contrib/mod_sftp/mod_sftp.h.in | ||
96 | @@ -1,6 +1,6 @@ | ||
97 | /* | ||
98 | * ProFTPD - mod_sftp | ||
99 | - * Copyright (c) 2008-2011 TJ Saunders | ||
100 | + * Copyright (c) 2008-2013 TJ Saunders | ||
101 | * | ||
102 | * This program is free software; you can redistribute it and/or modify | ||
103 | * it under the terms of the GNU General Public License as published by | ||
104 | @@ -174,7 +174,8 @@ int sftp_kbdint_register_driver(const char *name, sftp_kbdint_driver_t *driver); | ||
105 | int sftp_kbdint_unregister_driver(const char *name); | ||
106 | int sftp_kbdint_send_challenge(const char *, const char *, unsigned int, | ||
107 | sftp_kbdint_challenge_t *); | ||
108 | -int sftp_kbdint_recv_response(pool *, unsigned int *, const char ***); | ||
109 | +int sftp_kbdint_recv_response(pool *, unsigned int, unsigned int *, | ||
110 | + const char ***); | ||
111 | |||
112 | /* API for modules that which to register keystores, for the | ||
113 | * SFTPAuthorizedHostKeys and SFTPAuthorizedUserKeys directives. | ||
114 | diff --git a/contrib/mod_sftp_pam.c b/contrib/mod_sftp_pam.c | ||
115 | index 6c32df0..81aa113 100644 | ||
116 | --- a/contrib/mod_sftp_pam.c | ||
117 | +++ b/contrib/mod_sftp_pam.c | ||
118 | @@ -179,22 +179,13 @@ static int sftppam_converse(int nmsgs, PR_PAM_CONST struct pam_message **msgs, | ||
119 | return PAM_CONV_ERR; | ||
120 | } | ||
121 | |||
122 | - if (sftp_kbdint_recv_response(sftppam_driver.driver_pool, &recvd_count, | ||
123 | - &recvd_responses) < 0) { | ||
124 | + if (sftp_kbdint_recv_response(sftppam_driver.driver_pool, list->nelts, | ||
125 | + &recvd_count, &recvd_responses) < 0) { | ||
126 | pr_trace_msg(trace_channel, 3, | ||
127 | "error receiving keyboard-interactive responses: %s", strerror(errno)); | ||
128 | return PAM_CONV_ERR; | ||
129 | } | ||
130 | |||
131 | - /* Make sure that the count of responses matches the challenge count. */ | ||
132 | - if (recvd_count != list->nelts) { | ||
133 | - (void) pr_log_writefile(sftp_logfd, MOD_SFTP_PAM_VERSION, | ||
134 | - "sent %d %s, but received %u %s", nmsgs, | ||
135 | - list->nelts != 1 ? "challenges" : "challenge", recvd_count, | ||
136 | - recvd_count != 1 ? "responses" : "response"); | ||
137 | - return PAM_CONV_ERR; | ||
138 | - } | ||
139 | - | ||
140 | res = calloc(nmsgs, sizeof(struct pam_response)); | ||
141 | if (res == NULL) { | ||
142 | pr_log_pri(PR_LOG_CRIT, "Out of memory!"); | ||
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb new file mode 100644 index 000000000..a5e766af5 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb | |||
@@ -0,0 +1,73 @@ | |||
1 | SUMMARY = "Secure and configurable FTP server" | ||
2 | SECTION = "console/network" | ||
3 | HOMEPAGE = "http://www.proftpd.org" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184" | ||
6 | |||
7 | PR = "r4" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ | ||
10 | file://make.patch \ | ||
11 | file://basic.conf.patch \ | ||
12 | file://contrib.patch \ | ||
13 | file://proftpd-basic.init \ | ||
14 | file://default \ | ||
15 | file://move-pidfile-to-var-run.patch \ | ||
16 | file://close-RequireValidShell-check.patch \ | ||
17 | file://move-runfile-to-var-run.patch \ | ||
18 | file://proftpd-sftp.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2" | ||
22 | SRC_URI[sha256sum] = "9f659585cea90fc6af34a0ffae4a90e4ed37abe92dbd9b6c311f95a436c961cb" | ||
23 | |||
24 | inherit autotools-brokensep useradd update-rc.d | ||
25 | |||
26 | PACKAGECONFIG ??= "" | ||
27 | PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses,--disable-curses --disable-ncurses,ncurses" | ||
28 | |||
29 | EXTRA_OECONF = "--disable-cap \ | ||
30 | --disable-auth-pam \ | ||
31 | " | ||
32 | |||
33 | # proftpd uses libltdl which currently makes configuring using | ||
34 | # autotools.bbclass a pain... | ||
35 | do_configure () { | ||
36 | oe_runconf | ||
37 | } | ||
38 | |||
39 | FTPUSER = "ftp" | ||
40 | FTPGROUP = "ftp" | ||
41 | |||
42 | do_install () { | ||
43 | oe_runmake DESTDIR=${D} install | ||
44 | rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale | ||
45 | [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir} | ||
46 | sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf | ||
47 | sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf | ||
48 | install -d ${D}${sysconfdir}/init.d | ||
49 | install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd | ||
50 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
51 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
52 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
53 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd | ||
54 | |||
55 | install -d ${D}${sysconfdir}/default | ||
56 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd | ||
57 | |||
58 | # create the pub directory | ||
59 | mkdir -p ${D}/home/${FTPUSER}/pub/ | ||
60 | chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub | ||
61 | } | ||
62 | |||
63 | INITSCRIPT_NAME = "proftpd" | ||
64 | INITSCRIPT_PARAM = "defaults 85 15" | ||
65 | |||
66 | USERADD_PACKAGES = "${PN}" | ||
67 | GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" | ||
68 | USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ | ||
69 | --shell /bin/false ${FTPUSER}" | ||
70 | |||
71 | FILES_${PN} += "/home/${FTPUSER}" | ||
72 | |||
73 | RDEPENDS_${PN} += "perl" | ||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb new file mode 100644 index 000000000..db74e4463 --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1-rc2.bb | |||
@@ -0,0 +1,39 @@ | |||
1 | SUMMARY = "The PTP daemon (PTPd)" | ||
2 | DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \ | ||
3 | defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \ | ||
4 | and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \ | ||
5 | time coordination of LAN connected computers." | ||
6 | HOMEPAGE = "http://sourceforge.net/projects/ptpd" | ||
7 | SECTION = "network" | ||
8 | LICENSE = "BSD" | ||
9 | LIC_FILES_CHKSUM = "file://README;md5=2452033fe374283f29579898663b1aa8" | ||
10 | |||
11 | DEPENDS = "libpcap" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | # return something like '1.2.3' or '1.2.3/rc1' | ||
16 | # | ||
17 | def get_sub(d): | ||
18 | parts = d.getVar('PV',True).split('-') | ||
19 | try: | ||
20 | return parts[0] + '/' + parts[1] | ||
21 | except: | ||
22 | return parts[0] | ||
23 | |||
24 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz" | ||
25 | |||
26 | SRC_URI[md5sum] = "1ef2f1f2825080a865bbce0eb61246d4" | ||
27 | SRC_URI[sha256sum] = "2802aab758649bb222859dfcb62a5d282709ccb4d3f1df3f26f739cc091d0c8d" | ||
28 | |||
29 | S = "${WORKDIR}/ptpd-${PV}" | ||
30 | |||
31 | EXTRA_OEMAKE = "" | ||
32 | |||
33 | EXTRA_OECONF += "--disable-snmp" | ||
34 | |||
35 | do_install() { | ||
36 | install -d ${D}${bindir} ${D}${mandir}/man8 | ||
37 | install -m 0755 ${B}/src/ptpd2 ${D}${bindir} | ||
38 | install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8 | ||
39 | } | ||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch new file mode 100644 index 000000000..54088b044 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From cffca7cb7c055f82ced316ddee90bb701b85b92d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
3 | Date: Tue, 10 Jan 2012 19:15:25 +0300 | ||
4 | Subject: [PATCH] Remove hardcoded /usr/local includes from configure.ac | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
9 | --- | ||
10 | configure.ac | 12 ------------ | ||
11 | 1 files changed, 0 insertions(+), 12 deletions(-) | ||
12 | |||
13 | diff --git a/configure.ac b/configure.ac | ||
14 | index ae00c08..9ba6d8d 100644 | ||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -67,18 +67,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter) | ||
18 | python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin" | ||
19 | AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path) | ||
20 | |||
21 | -if test -d /usr/local/include; then | ||
22 | - CPPFLAGS="$CPPFLAGS -I/usr/local/include" | ||
23 | -fi | ||
24 | - | ||
25 | -if test -d /usr/kerberos/include; then | ||
26 | - CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | ||
27 | -fi | ||
28 | - | ||
29 | -if test -d /usr/local/lib; then | ||
30 | - LDFLAGS="$LDFLAGS -L/usr/local/lib" | ||
31 | -fi | ||
32 | - | ||
33 | if uname | fgrep SunOS > /dev/null 2> /dev/null ; then | ||
34 | CPPFLAGS="$CPPFLAGS -D_XPG4_2=1" | ||
35 | fi | ||
36 | -- | ||
37 | 1.7.7.3 | ||
38 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch new file mode 100644 index 000000000..5cbbc5fa7 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 45eb89d1a6fde65caaf2d6e1a5d527f1ae7beb9c Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Mon, 3 Dec 2012 17:12:11 +0000 | ||
4 | Subject: [PATCH] Don't mess with CFLAGS and LDFLAGS when --with-minimal is specified | ||
5 | |||
6 | We especially don't want stripping enabled. | ||
7 | |||
8 | Upstream-Status: Inappropriate [config] | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | --- | ||
12 | configure.ac | 2 -- | ||
13 | 1 files changed, 0 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index 3d59409..6836c0e 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -413,8 +413,6 @@ AC_ARG_WITH(minimal, | ||
20 | AC_DEFINE(NO_FTP_USERS) | ||
21 | AC_DEFINE(WITHOUT_ASCII) | ||
22 | AC_DEFINE(BORING_MODE) | ||
23 | - CFLAGS="$CFLAGS -Os -fomit-frame-pointer -fgcse -falign-functions=2 -falign-jumps=2 -fno-unroll-loops " | ||
24 | - LDFLAGS="$LDFLAGS -s " | ||
25 | fi ]) | ||
26 | |||
27 | AC_ARG_WITH(paranoidmsg, | ||
28 | -- | ||
29 | 1.7.1 | ||
30 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb new file mode 100644 index 000000000..974e6b74b --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "FTP Server with a strong focus on software security" | ||
2 | DESCRIPTION = "Pure-FTPd is a free (BSD license), secure, production-quality and standard-conformant FTP server." | ||
3 | HOMEPAGE = "http://www.pureftpd.org/project/pure-ftpd" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=ae9e161311a5a0768c333b537a40e332" | ||
6 | |||
7 | DEPENDS = "libcap" | ||
8 | |||
9 | |||
10 | SRC_URI = "http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${PV}.tar.gz \ | ||
11 | file://0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch \ | ||
12 | file://nostrip.patch \ | ||
13 | " | ||
14 | SRC_URI[md5sum] = "bbcb48e8aa6ec1abff9775b89f84af91" | ||
15 | SRC_URI[sha256sum] = "90fb63b1a9d448076aa9f3e3c74b298965f98e03c824e9a4d241fffe8eb3a130" | ||
16 | |||
17 | inherit autotools | ||
18 | |||
19 | EXTRA_OECONF = "--with-minimal" | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/radvd.default b/meta-networking/recipes-daemons/radvd/files/radvd.default new file mode 100644 index 000000000..7cb73c771 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.default | |||
@@ -0,0 +1 @@ | |||
OPTIONS="-u radvd" | |||
diff --git a/meta-networking/recipes-daemons/radvd/files/radvd.init b/meta-networking/recipes-daemons/radvd/files/radvd.init new file mode 100755 index 000000000..8b26317ee --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.init | |||
@@ -0,0 +1,135 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: radvd | ||
5 | # Required-Start: $remote_fs $named $syslog | ||
6 | # Required-Stop: $remote_fs $named $syslog | ||
7 | # Default-Start: 3 5 | ||
8 | # Default-Stop: 0 1 2 6 | ||
9 | # Description: router advertisement daemon | ||
10 | ### END INIT INFO | ||
11 | |||
12 | # Source function library. | ||
13 | . /etc/init.d/functions | ||
14 | |||
15 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
16 | DAEMON=/usr/sbin/radvd | ||
17 | NAME=radvd | ||
18 | DESC=radvd | ||
19 | CONFIG=/etc/radvd.conf | ||
20 | SAVED_SETTINGS=/var/run/radvd/saved-settings | ||
21 | PIDFILE=/var/run/radvd/radvd.pid | ||
22 | OPTIONS="-u radvd -p $PIDFILE" | ||
23 | |||
24 | test -x $DAEMON || exit 0 | ||
25 | |||
26 | set -e | ||
27 | |||
28 | # Check for IPv6 support in kernel | ||
29 | if test \! -e /proc/sys/net/ipv6; then | ||
30 | echo "IPv6 support must be enabled in the kernel for $DESC to work." | ||
31 | exit | ||
32 | fi | ||
33 | |||
34 | save_settings() | ||
35 | { | ||
36 | local file=$1 | ||
37 | |||
38 | rm -f $file | ||
39 | for if_conf in /proc/sys/net/ipv6/conf/*; do | ||
40 | echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file | ||
41 | done | ||
42 | return 0 | ||
43 | } | ||
44 | |||
45 | restore_settings() | ||
46 | { | ||
47 | file=$1 | ||
48 | |||
49 | if [ ! -f $file ]; then | ||
50 | echo "$0: warning: cannot restore settings" | ||
51 | return | ||
52 | fi | ||
53 | |||
54 | ( | ||
55 | while read f value; do | ||
56 | if [ -w $f ]; then | ||
57 | echo $value > $f | ||
58 | fi | ||
59 | done | ||
60 | ) < $file | ||
61 | } | ||
62 | |||
63 | chkconfig() { | ||
64 | if [ ! -e $CONFIG -o ! -s $CONFIG ]; then | ||
65 | echo "" | ||
66 | echo "* $CONFIG does not exist or is empty." | ||
67 | echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple" | ||
68 | echo "* configuration suitable for most systems, and radvd.conf(5)" | ||
69 | echo "* for configuration file syntax. radvd will *not* be started." | ||
70 | exit 0 | ||
71 | fi | ||
72 | } | ||
73 | |||
74 | case "$1" in | ||
75 | start) | ||
76 | echo -n "Starting $DESC: " | ||
77 | chkconfig | ||
78 | save_settings $SAVED_SETTINGS | ||
79 | |||
80 | # We must enable IPv6 forwarding for radvd to work | ||
81 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
82 | |||
83 | # Check for stale pidfile; radvd won't start if one is lying around | ||
84 | if [ -f $PIDFILE ] && ! ps `cat $PIDFILE` > /dev/null; then | ||
85 | rm -f $PIDFILE | ||
86 | fi | ||
87 | if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \ | ||
88 | --exec $DAEMON -- $OPTIONS; then | ||
89 | echo "failed." && exit 1 | ||
90 | fi | ||
91 | echo "$NAME." | ||
92 | ;; | ||
93 | stop) | ||
94 | echo -n "Stopping $DESC: " | ||
95 | if ! [ -f $PIDFILE ] ; then | ||
96 | echo "not running." | ||
97 | exit 0 | ||
98 | fi | ||
99 | start-stop-daemon --oknodo --stop --pidfile $PIDFILE \ | ||
100 | --exec $DAEMON | ||
101 | restore_settings $SAVED_SETTINGS | ||
102 | rm -f $SAVED_SETTINGS | ||
103 | echo "$NAME." | ||
104 | ;; | ||
105 | status) | ||
106 | status $DAEMON; | ||
107 | exit $? | ||
108 | ;; | ||
109 | reload|force-reload) | ||
110 | echo "Reloading $DESC configuration files." | ||
111 | start-stop-daemon --stop --signal HUP --quiet --pidfile \ | ||
112 | $PIDFILE --exec $DAEMON | ||
113 | ;; | ||
114 | restart) | ||
115 | chkconfig | ||
116 | echo -n "Restarting $DESC: " | ||
117 | if ! start-stop-daemon --stop --quiet --pidfile \ | ||
118 | $PIDFILE --exec $DAEMON; then | ||
119 | # stop failed, so we were not running | ||
120 | save_settings $SAVED_SETTINGS | ||
121 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
122 | fi | ||
123 | sleep 1 | ||
124 | start-stop-daemon --start --quiet --pidfile \ | ||
125 | $PIDFILE --exec $DAEMON -- $OPTIONS | ||
126 | echo "$NAME." | ||
127 | ;; | ||
128 | *) | ||
129 | N=/etc/init.d/$NAME | ||
130 | echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2 | ||
131 | exit 1 | ||
132 | ;; | ||
133 | esac | ||
134 | |||
135 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/radvd.service b/meta-networking/recipes-daemons/radvd/files/radvd.service new file mode 100644 index 000000000..e60798a6b --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Router advertisement daemon for IPv6 | ||
3 | After=network.target | ||
4 | ConditionPathExists=@SYSCONFDIR@/radvd.conf | ||
5 | |||
6 | [Service] | ||
7 | EnvironmentFile=-@SYSCONFDIR@/default/radvd | ||
8 | ExecStart=@SBINDIR@/radvd -n $OPTIONS | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd new file mode 100644 index 000000000..89256a40e --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d radvd root 0755 /var/run/radvd none | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-networking/recipes-daemons/radvd/radvd.inc new file mode 100644 index 000000000..6b595b07f --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd.inc | |||
@@ -0,0 +1,67 @@ | |||
1 | SUMMARY = "IPv6 router advertisement daemon" | ||
2 | DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \ | ||
3 | listens to router solicitations and sends router \ | ||
4 | advertisements as described in RFC 2461, Neighbor \ | ||
5 | Discovery for IP Version 6 (IPv6). With these \ | ||
6 | advertisements hosts can automatically configure their \ | ||
7 | addresses and some other parameters. They also can \ | ||
8 | choose a default router based on these advertisements." | ||
9 | HOMEPAGE = "http://www.litech.org/radvd/" | ||
10 | SECTION = "console/network" | ||
11 | DEPENDS = "flex-native libdaemon" | ||
12 | |||
13 | # License is BSD-Style (with advertising clause) but also has an additional 0th clause | ||
14 | LICENSE = "radvd" | ||
15 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db" | ||
16 | |||
17 | SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \ | ||
18 | file://radvd.init \ | ||
19 | file://radvd.service \ | ||
20 | file://volatiles.03_radvd \ | ||
21 | file://radvd.default" | ||
22 | |||
23 | inherit autotools update-rc.d useradd pkgconfig systemd | ||
24 | |||
25 | SYSTEMD_SERVICE_${PN} = "radvd.service" | ||
26 | SYSTEMD_AUTO_ENABLE = "disable" | ||
27 | |||
28 | do_install_append () { | ||
29 | install -m 0755 -d ${D}${sysconfdir}/init.d \ | ||
30 | ${D}${sysconfdir}/default/volatiles \ | ||
31 | ${D}${docdir}/radvd | ||
32 | # Install init script and volatiles | ||
33 | install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd | ||
34 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
35 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
36 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
37 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd | ||
38 | |||
39 | install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd | ||
40 | |||
41 | # Install systemd service files | ||
42 | install -d ${D}${systemd_unitdir}/system | ||
43 | install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system | ||
44 | sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \ | ||
45 | -e 's#@SBINDIR@#${sbindir}#g' \ | ||
46 | -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service | ||
47 | |||
48 | # Install default environment file | ||
49 | install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd | ||
50 | |||
51 | # Documentation | ||
52 | for i in radvd.conf.example README; do \ | ||
53 | install -m 0644 ${S}/$i ${D}${docdir}/radvd; \ | ||
54 | done | ||
55 | } | ||
56 | |||
57 | INITSCRIPT_NAME = "radvd" | ||
58 | INITSCRIPT_PARAMS = "defaults 20 80" | ||
59 | |||
60 | USERADD_PACKAGES = "${PN}" | ||
61 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd" | ||
62 | |||
63 | pkg_postinst_${PN} () { | ||
64 | if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then | ||
65 | /etc/init.d/populate-volatile.sh update | ||
66 | fi | ||
67 | } | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd_1.14.bb b/meta-networking/recipes-daemons/radvd/radvd_1.14.bb new file mode 100644 index 000000000..bf572e3bb --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd_1.14.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | |||
2 | require radvd.inc | ||
3 | |||
4 | SRC_URI[md5sum] = "a257e05bd6a435ef948d3b407726d56f" | ||
5 | SRC_URI[sha256sum] = "3b16dd9ef3d6c8b889cdabfdb16c81db8bd61b0f1fc42f6acc52d3cf300c6d07" | ||
6 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch b/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch new file mode 100644 index 000000000..5f845bb4c --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Add-default-entry-for-cross-compile.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From faa212a4e0aaf442ff58fca50770a8fadc1038e3 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <faa212a4e0aaf442ff58fca50770a8fadc1038e3.1382041123.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Thu, 17 Oct 2013 16:17:48 -0400 | ||
5 | Subject: [PATCH 1/1] Add default entry for cross compile | ||
6 | |||
7 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
8 | --- | ||
9 | acinclude/krb5.m4 | 6 +++++- | ||
10 | 1 files changed, 5 insertions(+), 1 deletions(-) | ||
11 | |||
12 | diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 | ||
13 | index 5d9ac36..7a072a2 100644 | ||
14 | --- a/acinclude/krb5.m4 | ||
15 | +++ b/acinclude/krb5.m4 | ||
16 | @@ -82,7 +82,11 @@ main(void) | ||
17 | |||
18 | return 0; | ||
19 | } | ||
20 | -]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ]) | ||
21 | +]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ], | ||
22 | +[ | ||
23 | + dnl Can't test in cross compiled env - so assume good | ||
24 | + squid_cv_broken_heimdal_krb5_h=no | ||
25 | +]) | ||
26 | ], | ||
27 | [ | ||
28 | dnl Can't test in cross compiled env - so assume good | ||
29 | -- | ||
30 | 1.7.4.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch b/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch new file mode 100644 index 000000000..6591d5c6f --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Change-ksh-reference-in-krb-ldap-helper-to-bash.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 37da4010f41d936c2c727fc32adab832bdde9bec Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <37da4010f41d936c2c727fc32adab832bdde9bec.1382481765.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Tue, 22 Oct 2013 18:39:39 -0400 | ||
5 | Subject: [PATCH 1/1] Change ksh reference in krb ldap helper to bash | ||
6 | |||
7 | Very simple cert_tool script with no ksh specifics. | ||
8 | Change it to use bash so a package dependency doesn't | ||
9 | get created to ksh. | ||
10 | |||
11 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
12 | --- | ||
13 | helpers/external_acl/kerberos_ldap_group/cert_tool | 3 ++- | ||
14 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/helpers/external_acl/kerberos_ldap_group/cert_tool b/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
17 | index 9f14959..b61be5d 100644 | ||
18 | --- a/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
19 | +++ b/helpers/external_acl/kerberos_ldap_group/cert_tool | ||
20 | @@ -1,4 +1,5 @@ | ||
21 | -#!/bin/ksh | ||
22 | +#!/bin/bash | ||
23 | +# The above was originally ksh | ||
24 | # | ||
25 | # ----------------------------------------------------------------------------- | ||
26 | # | ||
27 | -- | ||
28 | 1.7.4.1 | ||
29 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch b/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch new file mode 100644 index 000000000..2304c5f1d --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 0d5b337ff5ef7dd48f970f08bd95d6327917cfd1 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <0d5b337ff5ef7dd48f970f08bd95d6327917cfd1.1382375807.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Mon, 21 Oct 2013 12:50:44 -0400 | ||
5 | Subject: [PATCH 1/1] Fix flawed dynamic -ldb link test in configure | ||
6 | |||
7 | The test uses dbopen, but just ignores the fact | ||
8 | that this function may not exist in the db version | ||
9 | used. This leads to the dynamic link test failing | ||
10 | and the configure script just making assumptions | ||
11 | about why and setting the need for -ldb incorrectly. | ||
12 | |||
13 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
14 | --- | ||
15 | configure.ac | 12 ++++++++++-- | ||
16 | 1 files changed, 10 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index 962a748..42e6a93 100644 | ||
20 | --- a/configure.ac | ||
21 | +++ b/configure.ac | ||
22 | @@ -3051,8 +3051,16 @@ AC_CHECK_DECL(dbopen,,,[ | ||
23 | #include <db.h> | ||
24 | #endif]) | ||
25 | |||
26 | -dnl 1.85 | ||
27 | -SQUID_CHECK_DBOPEN_NEEDS_LIBDB | ||
28 | +if test "x$ac_cv_have_decl_dbopen" = "xyes"; then | ||
29 | + dnl 1.85 | ||
30 | + SQUID_CHECK_DBOPEN_NEEDS_LIBDB | ||
31 | +else | ||
32 | + # dbopen isn't there. So instead of running a compile/link test that | ||
33 | + # uses it and is thus guaranteed to fail, we just assume that we will | ||
34 | + # need to link in the db library, rather than fabricate some other | ||
35 | + # dynamic compile/link test. | ||
36 | + ac_cv_dbopen_libdb="yes" | ||
37 | +fi | ||
38 | if test "x$ac_cv_dbopen_libdb" = "xyes"; then | ||
39 | LIB_DB="-ldb" | ||
40 | fi | ||
41 | -- | ||
42 | 1.7.4.1 | ||
43 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch b/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch new file mode 100644 index 000000000..4ca27444a --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 17e5a28667f667859c48bee25e575a072d39ee1b Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <17e5a28667f667859c48bee25e575a072d39ee1b.1381956170.git.Jim.Somerville@windriver.com> | ||
3 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
4 | Date: Wed, 16 Oct 2013 16:41:03 -0400 | ||
5 | Subject: [PATCH 1/1] Set up for cross compilation | ||
6 | |||
7 | Set the host compiler to BUILD_CXX so | ||
8 | proper cross compilation can occur. | ||
9 | |||
10 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
11 | --- | ||
12 | configure.ac | 1 + | ||
13 | 1 files changed, 1 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index c2d3033..dda9ed9 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -19,6 +19,7 @@ m4_include([acinclude/lib-checks.m4]) | ||
20 | m4_include([acinclude/ax_cxx_compile_stdcxx_0x.m4]) | ||
21 | m4_include([acinclude/ax_cxx_0x_types.m4]) | ||
22 | |||
23 | +HOSTCXX="$BUILD_CXX" | ||
24 | PRESET_CFLAGS="$CFLAGS" | ||
25 | PRESET_CXXFLAGS="$CXXFLAGS" | ||
26 | PRESET_LDFLAGS="$LDFLAGS" | ||
27 | -- | ||
28 | 1.7.4.1 | ||
29 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch b/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch new file mode 100644 index 000000000..7b6dcc820 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | Subject: [PATCH] Skip AC_RUN_IFELSE tests | ||
2 | |||
3 | Upstream-Status: Inappropriate [cross compiling specific] | ||
4 | |||
5 | Such tests are not supported in a cross compile | ||
6 | environment. Choose sane defaults. | ||
7 | |||
8 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
9 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
10 | --- | ||
11 | acinclude/krb5.m4 | 10 +++++++++- | ||
12 | acinclude/lib-checks.m4 | 8 ++++++-- | ||
13 | 2 files changed, 15 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4 | ||
16 | index 946bea8..7a072a2 100644 | ||
17 | --- a/acinclude/krb5.m4 | ||
18 | +++ b/acinclude/krb5.m4 | ||
19 | @@ -82,7 +82,15 @@ main(void) | ||
20 | |||
21 | return 0; | ||
22 | } | ||
23 | -]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ]) | ||
24 | +]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ], | ||
25 | +[ | ||
26 | + dnl Can't test in cross compiled env - so assume good | ||
27 | + squid_cv_broken_heimdal_krb5_h=no | ||
28 | +]) | ||
29 | + ], | ||
30 | + [ | ||
31 | + dnl Can't test in cross compiled env - so assume good | ||
32 | + squid_cv_broken_heimdal_krb5_h=no | ||
33 | ]) | ||
34 | ]) | ||
35 | ]) dnl SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H | ||
36 | diff --git a/acinclude/lib-checks.m4 b/acinclude/lib-checks.m4 | ||
37 | index 2bf98ee..50dba9b 100644 | ||
38 | --- a/acinclude/lib-checks.m4 | ||
39 | +++ b/acinclude/lib-checks.m4 | ||
40 | @@ -128,7 +128,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[ | ||
41 | AC_DEFINE(SQUID_SSLGETCERTIFICATE_BUGGY, 1) | ||
42 | AC_MSG_RESULT([yes]) | ||
43 | ], | ||
44 | - []) | ||
45 | + [ | ||
46 | + AC_MSG_RESULT([skipped - can't test in cross-compiled env]) | ||
47 | + ]) | ||
48 | |||
49 | AC_MSG_CHECKING(whether the workaround for SSL_get_certificate works) | ||
50 | AC_RUN_IFELSE([ | ||
51 | @@ -154,7 +156,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_GETCERTIFICATE_WORKS],[ | ||
52 | [ | ||
53 | AC_MSG_RESULT([no]) | ||
54 | ], | ||
55 | -[]) | ||
56 | +[ | ||
57 | + AC_MSG_RESULT([skipped - can't test in cross-compiled env]) | ||
58 | +]) | ||
59 | |||
60 | SQUID_STATE_ROLLBACK(check_SSL_get_certificate) | ||
61 | ]) | ||
62 | -- | ||
63 | 1.7.1 | ||
64 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/run-ptest b/meta-networking/recipes-daemons/squid/files/run-ptest new file mode 100644 index 000000000..de79a293c --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | make -C test-suite -k runtest-TESTS | ||
diff --git a/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch b/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch new file mode 100644 index 000000000..9e2ceab88 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 2192fdbc90b0ff2d5408e8763df200620870deea Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Mon, 13 Oct 2014 01:32:37 -0700 | ||
4 | Subject: [PATCH] squid: use serial-tests config needed by ptest | ||
5 | |||
6 | ptest needs buildtest-TESTS and runtest-TESTS targets. | ||
7 | serial-tests is required to generate those targets. | ||
8 | |||
9 | Upstream-Status: Inappropriate [default automake behavior incompatible with ptest] | ||
10 | |||
11 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
12 | --- | ||
13 | configure.ac | 2 +- | ||
14 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/configure.ac b/configure.ac | ||
17 | index 6f7171f..ab9b93e 100644 | ||
18 | --- a/configure.ac | ||
19 | +++ b/configure.ac | ||
20 | @@ -3,7 +3,7 @@ AC_PREREQ(2.61) | ||
21 | AC_CONFIG_HEADERS([include/autoconf.h]) | ||
22 | AC_CONFIG_AUX_DIR(cfgaux) | ||
23 | AC_CONFIG_SRCDIR([src/main.cc]) | ||
24 | -AM_INIT_AUTOMAKE([tar-ustar nostdinc]) | ||
25 | +AM_INIT_AUTOMAKE([tar-ustar nostdinc serial-tests]) | ||
26 | AC_REVISION($Revision$)dnl | ||
27 | AC_PREFIX_DEFAULT(/usr/local/squid) | ||
28 | AM_MAINTAINER_MODE | ||
29 | -- | ||
30 | 1.7.1 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/squid/files/volatiles.03_squid b/meta-networking/recipes-daemons/squid/files/volatiles.03_squid new file mode 100644 index 000000000..b96865d73 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/files/volatiles.03_squid | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d squid squid 0755 /var/run/squid none | ||
diff --git a/meta-networking/recipes-daemons/squid/squid_3.4.7.bb b/meta-networking/recipes-daemons/squid/squid_3.4.7.bb new file mode 100644 index 000000000..cd10bd042 --- /dev/null +++ b/meta-networking/recipes-daemons/squid/squid_3.4.7.bb | |||
@@ -0,0 +1,66 @@ | |||
1 | SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux" | ||
2 | DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \ | ||
3 | Squid offers a rich access control, authorization and logging environment to \ | ||
4 | develop web proxy and content serving applications. \ | ||
5 | Squid offers a rich set of traffic optimization options, most of which are \ | ||
6 | enabled by default for simpler installation and high performance. \ | ||
7 | " | ||
8 | HOMEPAGE = "http://www.squid-cache.org" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "GPLv2+" | ||
11 | |||
12 | MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}" | ||
13 | MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}" | ||
14 | |||
15 | SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \ | ||
16 | file://Set-up-for-cross-compilation.patch \ | ||
17 | file://Skip-AC_RUN_IFELSE-tests.patch \ | ||
18 | file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \ | ||
19 | file://Change-ksh-reference-in-krb-ldap-helper-to-bash.patch \ | ||
20 | file://squid-use-serial-tests-config-needed-by-ptest.patch \ | ||
21 | file://run-ptest \ | ||
22 | file://volatiles.03_squid \ | ||
23 | " | ||
24 | |||
25 | LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \ | ||
26 | file://COPYRIGHT;md5=2900f50789c498be8e9f1eb23b55cbe9 \ | ||
27 | " | ||
28 | SRC_URI[md5sum] = "9951034b10f7ee0f45a95cfae61c57c2" | ||
29 | SRC_URI[sha256sum] = "7b423f3d3495a317503ca559ea535f80445fd7c4e3c3e268cb7a8c97c61af2b6" | ||
30 | |||
31 | DEPENDS = "libtool krb5 openldap db cyrus-sasl" | ||
32 | |||
33 | inherit autotools useradd ptest | ||
34 | |||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid" | ||
37 | |||
38 | PACKAGECONFIG ??= "" | ||
39 | PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack" | ||
40 | EXTRA_OECONF += "--with-default-user=squid" | ||
41 | |||
42 | TESTDIR = "test-suite" | ||
43 | do_compile_ptest() { | ||
44 | oe_runmake -C ${TESTDIR} buildtest-TESTS | ||
45 | } | ||
46 | |||
47 | do_install_ptest() { | ||
48 | cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH} | ||
49 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH} | ||
50 | |||
51 | # do NOT need to rebuild Makefile itself | ||
52 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile | ||
53 | } | ||
54 | |||
55 | do_install_append() { | ||
56 | install -d ${D}${sysconfdir}/default/volatiles | ||
57 | install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/volatiles.03_squid | ||
58 | rmdir "${D}${localstatedir}/run/${BPN}" | ||
59 | rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run" | ||
60 | } | ||
61 | |||
62 | FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons" | ||
63 | FILES_${PN}-dbg += "/usr/src/debug" | ||
64 | FILES_${PN}-doc += "${datadir}/*.txt" | ||
65 | |||
66 | RDEPENDS_${PN}-ptest += "make" | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/initscript b/meta-networking/recipes-daemons/syslog-ng/files/initscript new file mode 100644 index 000000000..b95e8adc2 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/initscript | |||
@@ -0,0 +1,45 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/syslog-ng and type | ||
5 | # > update-rc.d syslog-ng defaults 5 | ||
6 | # | ||
7 | |||
8 | |||
9 | syslog_ng=/usr/sbin/syslog-ng | ||
10 | test -x "$syslog_ng" || exit 0 | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "Starting syslog-ng:" | ||
15 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
16 | echo "." | ||
17 | ;; | ||
18 | stop) | ||
19 | echo -n "Stopping syslog-ng:" | ||
20 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
21 | echo "." | ||
22 | ;; | ||
23 | reload|force-reload) | ||
24 | start-stop-daemon --stop --quiet --signal 1 --exec $syslog_ng | ||
25 | ;; | ||
26 | restart) | ||
27 | echo "Stopping syslog-ng:" | ||
28 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
29 | echo -n "Waiting for syslog-ng to die off" | ||
30 | for i in 1 2 3 ; | ||
31 | do | ||
32 | sleep 1 | ||
33 | echo -n "." | ||
34 | done | ||
35 | echo "" | ||
36 | echo -n "Starting syslog-ng:" | ||
37 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
38 | echo "." | ||
39 | ;; | ||
40 | *) | ||
41 | echo "Usage: /etc/init.d/syslog-ng {start|stop|reload|restart|force-reload}" | ||
42 | exit 1 | ||
43 | esac | ||
44 | |||
45 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf new file mode 100644 index 000000000..96b631bf0 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf | |||
@@ -0,0 +1,155 @@ | |||
1 | @version: 3.2 | ||
2 | # | ||
3 | # Syslog-ng configuration file, compatible with default Debian syslogd | ||
4 | # installation. Originally written by anonymous (I can't find his name) | ||
5 | # Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>) | ||
6 | |||
7 | # First, set some global options. | ||
8 | options { long_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); | ||
9 | owner("root"); group("adm"); perm(0640); stats_freq(0); | ||
10 | bad_hostname("^gconfd$"); | ||
11 | }; | ||
12 | |||
13 | ######################## | ||
14 | # Sources | ||
15 | ######################## | ||
16 | # This is the default behavior of sysklogd package | ||
17 | # Logs may come from unix stream, but not from another machine. | ||
18 | # | ||
19 | source s_src { unix-dgram("/dev/log"); internal(); | ||
20 | file("/proc/kmsg" program_override("kernel")); | ||
21 | }; | ||
22 | |||
23 | # If you wish to get logs from remote machine you should uncomment | ||
24 | # this and comment the above source line. | ||
25 | # | ||
26 | #source s_net { tcp(ip(127.0.0.1) port(1000) authentication(required) encrypt(allow)); }; | ||
27 | |||
28 | ######################## | ||
29 | # Destinations | ||
30 | ######################## | ||
31 | # First some standard logfile | ||
32 | # | ||
33 | destination d_auth { file("/var/log/auth.log"); }; | ||
34 | destination d_cron { file("/var/log/cron.log"); }; | ||
35 | destination d_daemon { file("/var/log/daemon.log"); }; | ||
36 | destination d_kern { file("/var/log/kern.log"); }; | ||
37 | destination d_lpr { file("/var/log/lpr.log"); }; | ||
38 | destination d_mail { file("/var/log/mail.log"); }; | ||
39 | destination d_syslog { file("/var/log/syslog"); }; | ||
40 | destination d_user { file("/var/log/user.log"); }; | ||
41 | destination d_uucp { file("/var/log/uucp.log"); }; | ||
42 | |||
43 | # This files are the log come from the mail subsystem. | ||
44 | # | ||
45 | destination d_mailinfo { file("/var/log/mail/mail.info"); }; | ||
46 | destination d_mailwarn { file("/var/log/mail/mail.warn"); }; | ||
47 | destination d_mailerr { file("/var/log/mail/mail.err"); }; | ||
48 | |||
49 | # Logging for INN news system | ||
50 | # | ||
51 | destination d_newscrit { file("/var/log/news/news.crit"); }; | ||
52 | destination d_newserr { file("/var/log/news/news.err"); }; | ||
53 | destination d_newsnotice { file("/var/log/news/news.notice"); }; | ||
54 | |||
55 | # Some `catch-all' logfiles. | ||
56 | # | ||
57 | destination d_debug { file("/var/log/debug"); }; | ||
58 | destination d_error { file("/var/log/error"); }; | ||
59 | destination d_messages { file("/var/log/messages"); }; | ||
60 | |||
61 | # The root's console. | ||
62 | # | ||
63 | destination d_console { usertty("root"); }; | ||
64 | |||
65 | # Virtual console. | ||
66 | # | ||
67 | destination d_console_all { file("/dev/tty10"); }; | ||
68 | |||
69 | # The named pipe /dev/xconsole is for the nsole' utility. To use it, | ||
70 | # you must invoke nsole' with the -file' option: | ||
71 | # | ||
72 | # $ xconsole -file /dev/xconsole [...] | ||
73 | # | ||
74 | destination d_xconsole { pipe("/dev/xconsole"); }; | ||
75 | |||
76 | # Send the messages to an other host | ||
77 | # | ||
78 | #destination d_net { tcp("127.0.0.1" port(1000) authentication(on) encrypt(on) log_fifo_size(1000)); }; | ||
79 | |||
80 | # Debian only | ||
81 | destination d_ppp { file("/var/log/ppp.log"); }; | ||
82 | |||
83 | ######################## | ||
84 | # Filters | ||
85 | ######################## | ||
86 | # Here's come the filter options. With this rules, we can set which | ||
87 | # message go where. | ||
88 | |||
89 | filter f_dbg { level(debug); }; | ||
90 | filter f_info { level(info); }; | ||
91 | filter f_notice { level(notice); }; | ||
92 | filter f_warn { level(warn); }; | ||
93 | filter f_err { level(err); }; | ||
94 | filter f_crit { level(crit .. emerg); }; | ||
95 | |||
96 | filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; | ||
97 | filter f_error { level(err .. emerg) ; }; | ||
98 | filter f_messages { level(info,notice,warn) and | ||
99 | not facility(auth,authpriv,cron,daemon,mail,news); }; | ||
100 | |||
101 | filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; | ||
102 | filter f_cron { facility(cron) and not filter(f_debug); }; | ||
103 | filter f_daemon { facility(daemon) and not filter(f_debug); }; | ||
104 | filter f_kern { facility(kern) and not filter(f_debug); }; | ||
105 | filter f_lpr { facility(lpr) and not filter(f_debug); }; | ||
106 | filter f_local { facility(local0, local1, local3, local4, local5, | ||
107 | local6, local7) and not filter(f_debug); }; | ||
108 | filter f_mail { facility(mail) and not filter(f_debug); }; | ||
109 | filter f_news { facility(news) and not filter(f_debug); }; | ||
110 | filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; | ||
111 | filter f_user { facility(user) and not filter(f_debug); }; | ||
112 | filter f_uucp { facility(uucp) and not filter(f_debug); }; | ||
113 | |||
114 | filter f_cnews { level(notice, err, crit) and facility(news); }; | ||
115 | filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; | ||
116 | |||
117 | filter f_ppp { facility(local2) and not filter(f_debug); }; | ||
118 | filter f_console { level(warn .. emerg); }; | ||
119 | |||
120 | ######################## | ||
121 | # Log paths | ||
122 | ######################## | ||
123 | log { source(s_src); filter(f_auth); destination(d_auth); }; | ||
124 | log { source(s_src); filter(f_cron); destination(d_cron); }; | ||
125 | log { source(s_src); filter(f_daemon); destination(d_daemon); }; | ||
126 | log { source(s_src); filter(f_kern); destination(d_kern); }; | ||
127 | log { source(s_src); filter(f_lpr); destination(d_lpr); }; | ||
128 | log { source(s_src); filter(f_syslog3); destination(d_syslog); }; | ||
129 | log { source(s_src); filter(f_user); destination(d_user); }; | ||
130 | log { source(s_src); filter(f_uucp); destination(d_uucp); }; | ||
131 | |||
132 | log { source(s_src); filter(f_mail); destination(d_mail); }; | ||
133 | #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; | ||
134 | #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; | ||
135 | #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; | ||
136 | |||
137 | log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; | ||
138 | log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; | ||
139 | log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; | ||
140 | #log { source(s_src); filter(f_cnews); destination(d_console_all); }; | ||
141 | #log { source(s_src); filter(f_cother); destination(d_console_all); }; | ||
142 | |||
143 | #log { source(s_src); filter(f_ppp); destination(d_ppp); }; | ||
144 | |||
145 | log { source(s_src); filter(f_debug); destination(d_debug); }; | ||
146 | log { source(s_src); filter(f_error); destination(d_error); }; | ||
147 | log { source(s_src); filter(f_messages); destination(d_messages); }; | ||
148 | |||
149 | log { source(s_src); filter(f_console); destination(d_console_all); | ||
150 | destination(d_xconsole); }; | ||
151 | log { source(s_src); filter(f_crit); destination(d_console); }; | ||
152 | |||
153 | # All messages send to a remote site | ||
154 | # | ||
155 | #log { source(s_src); destination(d_net); }; | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc new file mode 100644 index 000000000..ef183d702 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc | |||
@@ -0,0 +1,78 @@ | |||
1 | DESCRIPTION = "Alternative system logger daemon" | ||
2 | DEPENDS = "libol flex eventlog glib-2.0" | ||
3 | LICENSE = "GPL LGPL" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408" | ||
5 | |||
6 | # syslog initscript is handled explicitly because order of | ||
7 | # update-rc.d and update-alternatives is important | ||
8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
9 | |||
10 | INC_PR = "r6" | ||
11 | |||
12 | inherit autotools | ||
13 | |||
14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz" | ||
15 | |||
16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | ||
17 | |||
18 | EXTRA_OECONF = " \ | ||
19 | --with-libnet=${STAGING_BINDIR_CROSS} \ | ||
20 | --enable-dynamic-linking \ | ||
21 | ${noipv6} \ | ||
22 | --enable-ssl \ | ||
23 | --disable-sub-streams \ | ||
24 | --disable-pacct \ | ||
25 | --disable-linux-caps \ | ||
26 | --disable-pcre \ | ||
27 | --disable-sql \ | ||
28 | " | ||
29 | |||
30 | do_configure_prepend() { | ||
31 | eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" | ||
32 | } | ||
33 | |||
34 | do_install_append() { | ||
35 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf | ||
36 | install -d ${D}/${sysconfdir}/init.d | ||
37 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN} | ||
38 | } | ||
39 | |||
40 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf" | ||
41 | |||
42 | pkg_postinst_${PN} () { | ||
43 | /etc/init.d/syslog stop | ||
44 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 | ||
45 | |||
46 | if test "x$D" != "x"; then | ||
47 | OPT="-r $D" | ||
48 | else | ||
49 | OPT="-s" | ||
50 | fi | ||
51 | # remove all rc.d-links potentially created from alternative | ||
52 | # syslog packages before creating new ones | ||
53 | update-rc.d $OPT -f syslog remove | ||
54 | update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 . | ||
55 | } | ||
56 | |||
57 | pkg_prerm_${PN} () { | ||
58 | if test "x$D" = "x"; then | ||
59 | if test "$1" = "upgrade" -o "$1" = "remove"; then | ||
60 | /etc/init.d/syslog stop | ||
61 | fi | ||
62 | fi | ||
63 | |||
64 | update-alternatives --remove syslog-init syslog.${PN} | ||
65 | } | ||
66 | |||
67 | pkg_postrm_${PN} () { | ||
68 | if test "x$D" != "x"; then | ||
69 | OPT="-r $D" | ||
70 | else | ||
71 | OPT="" | ||
72 | fi | ||
73 | if test "$1" = "remove" -o "$1" = "purge"; then | ||
74 | if ! test -e "/etc/init.d/syslog"; then | ||
75 | update-rc.d $OPT syslog remove | ||
76 | fi | ||
77 | fi | ||
78 | } | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb new file mode 100644 index 000000000..ce10ecefe --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | require syslog-ng.inc | ||
2 | PR = "${INC_PR}.1" | ||
3 | |||
4 | SRC_URI += " \ | ||
5 | file://syslog-ng.conf \ | ||
6 | file://initscript \ | ||
7 | " | ||
8 | |||
9 | SRC_URI[md5sum] = "4cc29efa55fc41e65c48ece9bc88f88b" | ||
10 | SRC_URI[sha256sum] = "a349a1baa272e7b07fa4b0d6a85512e71dd946476ae12bc8f9c9ad64311164d0" | ||
11 | |||
12 | INSANE_SKIP_${PN} += "dev-so" | ||
13 | |||
14 | FILES_${PN} += "/usr/share/" | ||
15 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch new file mode 100644 index 000000000..d01c20d38 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Roy.Li" <rongqing.li@windriver.com> | ||
3 | Date: Thu, 22 Aug 2013 08:56:09 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: add error check for disk filled up | ||
5 | |||
6 | Upstream-status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html] | ||
7 | |||
8 | Add error check when the write-buffer is finally flushed to the file, | ||
9 | the caller can detect if the disk filled up (or had an i/o error) and | ||
10 | return a NOSAPCE nak to the other side. | ||
11 | |||
12 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
13 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
14 | --- | ||
15 | common/tftpsubs.c | 8 +++++--- | ||
16 | tftpd/tftpd.c | 12 ++++++++++-- | ||
17 | 2 files changed, 15 insertions(+), 5 deletions(-) | ||
18 | |||
19 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
20 | index 8c999f6..b4d4ffe 100644 | ||
21 | --- a/common/tftpsubs.c | ||
22 | +++ b/common/tftpsubs.c | ||
23 | @@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert) | ||
24 | |||
25 | p = buf; | ||
26 | ct = count; | ||
27 | + count = 0; | ||
28 | while (ct--) { /* loop over the buffer */ | ||
29 | c = *p++; /* pick up a character */ | ||
30 | if (prevchar == '\r') { /* if prev char was cr */ | ||
31 | if (c == '\n') /* if have cr,lf then just */ | ||
32 | - fseek(file, -1, 1); /* smash lf on top of the cr */ | ||
33 | + count = count - 1; | ||
34 | else if (c == '\0') /* if have cr,nul then */ | ||
35 | goto skipit; /* just skip over the putc */ | ||
36 | /* else just fall through and allow it */ | ||
37 | } | ||
38 | - putc(c, file); | ||
39 | + buf[count] = c; | ||
40 | + count ++; | ||
41 | skipit: | ||
42 | prevchar = c; | ||
43 | } | ||
44 | - return count; | ||
45 | + return write(fileno(file), buf, count); | ||
46 | } | ||
47 | |||
48 | /* When an error has occurred, it is possible that the two sides | ||
49 | diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c | ||
50 | index 1873e70..c2adbda 100644 | ||
51 | --- a/tftpd/tftpd.c | ||
52 | +++ b/tftpd/tftpd.c | ||
53 | @@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
54 | syslog(LOG_WARNING, "tftpd: write(ack): %m"); | ||
55 | goto abort; | ||
56 | } | ||
57 | - write_behind(file, pf->f_convert); | ||
58 | + if(write_behind(file, pf->f_convert) < 0) { | ||
59 | + nak(ENOSPACE, NULL); | ||
60 | + (void)fclose(file); | ||
61 | + goto abort; | ||
62 | + } | ||
63 | for (;;) { | ||
64 | n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout); | ||
65 | if (n < 0) { /* really? */ | ||
66 | @@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
67 | goto abort; | ||
68 | } | ||
69 | } while (size == segsize); | ||
70 | - write_behind(file, pf->f_convert); | ||
71 | + if(write_behind(file, pf->f_convert) < 0) { | ||
72 | + nak(ENOSPACE, NULL); | ||
73 | + (void)fclose(file); | ||
74 | + goto abort; | ||
75 | + } | ||
76 | (void)fclose(file); /* close data file */ | ||
77 | |||
78 | ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */ | ||
79 | -- | ||
80 | 1.7.10.4 | ||
81 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/default b/meta-networking/recipes-daemons/tftp-hpa/files/default new file mode 100644 index 000000000..1dce7fdfe --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/default | |||
@@ -0,0 +1,3 @@ | |||
1 | #Defaults for tftpd-hpa | ||
2 | RUN_DAEMON="yes" | ||
3 | OPTIONS="-l -s /var/lib/tftpboot" | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch new file mode 100644 index 000000000..452aa05f8 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | [PATCH] fix the empty file writting | ||
2 | |||
3 | Upstream-Status: pending | ||
4 | |||
5 | With the feature that checking the disk filled up, the return | ||
6 | value of function write_behind was checked and used to detect | ||
7 | the disk status. While for empty file, without data being | ||
8 | written, this function will return -1 thus the disk filled up | ||
9 | error was miss-raised. | ||
10 | |||
11 | make write_behind to return 0 if written file is empty, to fix | ||
12 | the this bug. | ||
13 | |||
14 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
15 | --- | ||
16 | common/tftpsubs.c | 5 ++++- | ||
17 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
20 | index b4ea3f2..9f6cafc 100644 | ||
21 | --- a/common/tftpsubs.c | ||
22 | +++ b/common/tftpsubs.c | ||
23 | @@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert) | ||
24 | nextone = !nextone; /* incr for next time */ | ||
25 | buf = dp->th_data; | ||
26 | |||
27 | - if (count <= 0) | ||
28 | + if (count < 0) | ||
29 | return -1; /* nak logic? */ | ||
30 | |||
31 | + if (count == 0) | ||
32 | + return 0; | ||
33 | + | ||
34 | if (convert == 0) | ||
35 | return write(fileno(file), buf, count); | ||
36 | |||
37 | -- | ||
38 | 1.9.1 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/init b/meta-networking/recipes-daemons/tftp-hpa/files/init new file mode 100644 index 000000000..9e1843635 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/init | |||
@@ -0,0 +1,105 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # Author: Jaakko Niemi <liiwi@iki.fi> | ||
4 | # Modified from skeleton file in sarge | ||
5 | |||
6 | ### BEGIN INIT INFO | ||
7 | # Provides: tftp-hpa | ||
8 | # Required-Start: $local_fs $remote_fs $syslog $network | ||
9 | # Required-Stop: $local_fs $remote_fs $syslog $network | ||
10 | # Default-Start: 2 3 4 5 | ||
11 | # Default-Stop: 1 | ||
12 | # Short-Description: HPA's tftp client | ||
13 | # Description: tftp server to allow booting clients which support | ||
14 | # the PXE protocol. | ||
15 | ### END INIT INFO | ||
16 | |||
17 | set -e | ||
18 | |||
19 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
20 | DESC="HPA's tftpd" | ||
21 | NAME=in.tftpd-hpa | ||
22 | SCRIPTNAME=/etc/init.d/tftpd-hpa | ||
23 | |||
24 | # Read config file if it is present. | ||
25 | if [ -r /etc/default/tftpd-hpa ] | ||
26 | then | ||
27 | . /etc/default/tftpd-hpa | ||
28 | fi | ||
29 | |||
30 | DAEMON=/usr/sbin/$NAME | ||
31 | PIDFILE=/var/run/$NAME.pid | ||
32 | |||
33 | # Gracefully exit if the package has been removed. | ||
34 | test -x $DAEMON || exit 0 | ||
35 | |||
36 | if [ "$RUN_DAEMON" != "yes" ] ; then | ||
37 | echo "tftpd-hpa disabled in /etc/default/tftpd-hpa" | ||
38 | exit 0 | ||
39 | fi | ||
40 | |||
41 | # | ||
42 | # Function that starts the daemon/service. | ||
43 | # | ||
44 | d_start() { | ||
45 | start-stop-daemon --start --quiet --exec $DAEMON -- $OPTIONS | ||
46 | } | ||
47 | |||
48 | # | ||
49 | # Function that stops the daemon/service. | ||
50 | # | ||
51 | d_stop() { | ||
52 | start-stop-daemon --stop --quiet --name $NAME | ||
53 | } | ||
54 | |||
55 | # | ||
56 | # Function that sends a SIGHUP to the daemon/service. | ||
57 | # | ||
58 | d_reload() { | ||
59 | start-stop-daemon --stop --quiet --name $NAME --signal 1 | ||
60 | } | ||
61 | |||
62 | case "$1" in | ||
63 | start) | ||
64 | echo "Starting $DESC: $NAME" | ||
65 | d_start | ||
66 | echo "." | ||
67 | ;; | ||
68 | stop) | ||
69 | echo "Stopping $DESC: $NAME" | ||
70 | d_stop | ||
71 | echo "." | ||
72 | ;; | ||
73 | #reload) | ||
74 | # | ||
75 | # If the daemon can reload its configuration without | ||
76 | # restarting (for example, when it is sent a SIGHUP), | ||
77 | # then implement that here. | ||
78 | # | ||
79 | # If the daemon responds to changes in its config file | ||
80 | # directly anyway, make this an "exit 0". | ||
81 | # | ||
82 | # echo -n "Reloading $DESC configuration..." | ||
83 | # d_reload | ||
84 | # echo "done." | ||
85 | #;; | ||
86 | restart|force-reload) | ||
87 | # | ||
88 | # If the "reload" option is implemented, move the "force-reload" | ||
89 | # option to the "reload" entry above. If not, "force-reload" is | ||
90 | # just the same as "restart". | ||
91 | # | ||
92 | echo "Restarting $DESC: $NAME" | ||
93 | d_stop | ||
94 | sleep 1 | ||
95 | d_start | ||
96 | echo "." | ||
97 | ;; | ||
98 | *) | ||
99 | # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 | ||
100 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 | ||
101 | exit 1 | ||
102 | ;; | ||
103 | esac | ||
104 | |||
105 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch new file mode 100644 index 000000000..3f690609a --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/remap.c.zero tftp-hpa-0.49/tftpd/remap.c | ||
8 | --- tftp-hpa-0.49/tftpd/remap.c.zero 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/remap.c 2008-11-25 11:41:09.000000000 -0500 | ||
10 | @@ -286,6 +286,7 @@ struct rule *parserulefile(FILE * f) | ||
11 | int lineno = 0; | ||
12 | int err = 0; | ||
13 | |||
14 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
15 | while (lineno++, fgets(line, MAXLINE, f)) { | ||
16 | rv = parseline(line, this_rule, lineno); | ||
17 | if (rv < 0) | ||
18 | @@ -294,6 +295,7 @@ struct rule *parserulefile(FILE * f) | ||
19 | *last_rule = this_rule; | ||
20 | last_rule = &this_rule->next; | ||
21 | this_rule = tfmalloc(sizeof(struct rule)); | ||
22 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
23 | } | ||
24 | } | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch new file mode 100644 index 000000000..98a86b78b --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd | ||
8 | --- tftp-hpa-0.48/tftp-xinetd.tftpboot 2007-01-31 00:51:05.000000000 +0100 | ||
9 | +++ tftp-hpa-0.48/tftp-xinetd 2008-05-20 12:05:53.000000000 +0200 | ||
10 | @@ -10,7 +10,7 @@ service tftp | ||
11 | wait = yes | ||
12 | user = root | ||
13 | server = /usr/sbin/in.tftpd | ||
14 | - server_args = -s /tftpboot | ||
15 | + server_args = -s /var/lib/tftpboot | ||
16 | disable = yes | ||
17 | per_source = 11 | ||
18 | cps = 100 2 | ||
19 | diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security | ||
20 | --- tftp-hpa-0.48/README.security.tftpboot 2008-05-29 17:36:32.000000000 +0200 | ||
21 | +++ tftp-hpa-0.48/README.security 2008-05-29 17:37:21.000000000 +0200 | ||
22 | @@ -17,10 +17,10 @@ probably the following: | ||
23 | |||
24 | 1. Create a separate "tftpd" user and group only used for tftpd; | ||
25 | 2. Have all your boot files in a single directory tree (usually called | ||
26 | - /tftpboot). | ||
27 | -3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if | ||
28 | + /var/lib/tftpboot). | ||
29 | +3. Specify "-p -u tftpd -s /var/lib/tftpboot" on the tftpd command line; if | ||
30 | you want clients to be able to create files use | ||
31 | - "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever | ||
32 | + "-p -c -U 002 -u tftpd -s /var/lib/tftpboot" (replace 002 with whatever | ||
33 | umask is appropriate for your setup.) | ||
34 | |||
35 | ======================================= | ||
36 | @@ -40,12 +40,12 @@ directly. Thus, if your /etc/inetd.conf | ||
37 | line): | ||
38 | |||
39 | tftp dgram udp wait root /usr/sbin/tcpd | ||
40 | -/usr/sbin/in.tftpd -s /tftpboot -r blksize | ||
41 | +/usr/sbin/in.tftpd -s /var/lib/tftpboot -r blksize | ||
42 | |||
43 | ... it's better to change to ... | ||
44 | |||
45 | tftp dgram udp wait root /usr/sbin/in.tftpd | ||
46 | -in.tftpd -s /tftpboot -r blksize | ||
47 | +in.tftpd -s /var/lib/tftpboot -r blksize | ||
48 | |||
49 | You should make sure that you are using "wait" option in tftpd; you | ||
50 | also need to have tftpd spawned as root in order for chroot (-s) to | ||
51 | diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules | ||
52 | --- tftp-hpa-0.48/tftpd/sample.rules.tftpboot 2008-05-29 17:38:46.000000000 +0200 | ||
53 | +++ tftp-hpa-0.48/tftpd/sample.rules 2008-05-29 17:38:05.000000000 +0200 | ||
54 | @@ -30,5 +30,5 @@ rg \\ / # Convert backslashes to slash | ||
55 | rg \# @ # Convert hash marks to @ signs | ||
56 | rg /../ /..no../ # Convert /../ to /..no../ | ||
57 | e ^ok/ # These are always ok | ||
58 | -r ^[^/] /tftpboot/\0 # Convert non-absolute files | ||
59 | +r ^[^/] /var/lib/tftpboot/\0 # Convert non-absolute files | ||
60 | a \.pvt$ # Reject requests for private files | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch new file mode 100644 index 000000000..7ae1a8722 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes 2009-01-15 15:28:50.000000000 +0100 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2009-01-15 15:31:36.000000000 +0100 | ||
10 | @@ -932,7 +932,10 @@ int main(int argc, char **argv) | ||
11 | exit(EX_OSERR); | ||
12 | } | ||
13 | #ifdef __CYGWIN__ | ||
14 | - chdir("/"); /* Cygwin chroot() bug workaround */ | ||
15 | + if (chdir("/") < 0) { /* Cygwin chroot() bug workaround */ | ||
16 | + syslog(LOG_ERR, "chroot: %m"); | ||
17 | + exit(EX_OSERR); | ||
18 | + } | ||
19 | #endif | ||
20 | } | ||
21 | #ifdef HAVE_SETREGID | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch new file mode 100644 index 000000000..6b8ceaaeb --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch | |||
@@ -0,0 +1,165 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h | ||
8 | --- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200 | ||
9 | +++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200 | ||
10 | @@ -291,6 +291,7 @@ typedef int socklen_t; | ||
11 | /* Prototypes for libxtra functions */ | ||
12 | |||
13 | void *xmalloc(size_t); | ||
14 | +void *xrealloc(void *, size_t); | ||
15 | char *xstrdup(const char *); | ||
16 | |||
17 | #ifndef HAVE_BSD_SIGNAL | ||
18 | diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in | ||
19 | --- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
20 | +++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200 | ||
21 | @@ -152,6 +152,7 @@ OBJROOT=`pwd` | ||
22 | |||
23 | XTRA=false | ||
24 | PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty) | ||
25 | +PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty) | ||
26 | PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty) | ||
27 | PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal) | ||
28 | PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long) | ||
29 | diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c | ||
30 | --- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200 | ||
31 | +++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200 | ||
32 | @@ -0,0 +1,20 @@ | ||
33 | +/* | ||
34 | + * xrealloc.c | ||
35 | + * | ||
36 | + * Simple error-checking version of realloc() | ||
37 | + * | ||
38 | + */ | ||
39 | + | ||
40 | +#include "config.h" | ||
41 | + | ||
42 | +void *xrealloc(void *ptr, size_t size) | ||
43 | +{ | ||
44 | + void *p = realloc(ptr, size); | ||
45 | + | ||
46 | + if (!p) { | ||
47 | + fprintf(stderr, "Out of memory!\n"); | ||
48 | + exit(128); | ||
49 | + } | ||
50 | + | ||
51 | + return p; | ||
52 | +} | ||
53 | diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c | ||
54 | --- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
55 | +++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200 | ||
56 | @@ -89,11 +89,14 @@ int connected; | ||
57 | const struct modes *mode; | ||
58 | #ifdef WITH_READLINE | ||
59 | char *line = NULL; | ||
60 | +char *remote_pth = NULL; | ||
61 | #else | ||
62 | char line[LBUFLEN]; | ||
63 | +char remote_pth[LBUFLEN]; | ||
64 | #endif | ||
65 | int margc; | ||
66 | -char *margv[20]; | ||
67 | +char **margv; | ||
68 | +int sizeof_margv=0; | ||
69 | const char *prompt = "tftp> "; | ||
70 | sigjmp_buf toplevel; | ||
71 | void intr(int); | ||
72 | @@ -379,6 +382,10 @@ static void getmoreargs(const char *part | ||
73 | free(line); | ||
74 | line = NULL; | ||
75 | } | ||
76 | + if (remote_pth) { | ||
77 | + free(remote_pth); | ||
78 | + remote_pth = NULL; | ||
79 | + } | ||
80 | line = xmalloc(len + elen + 1); | ||
81 | strcpy(line, partial); | ||
82 | strcpy(line + len, eline); | ||
83 | @@ -535,6 +542,7 @@ void put(int argc, char *argv[]) | ||
84 | int fd; | ||
85 | int n, err; | ||
86 | char *cp, *targ; | ||
87 | + long dirlen, namelen, lastlen=0; | ||
88 | |||
89 | if (argc < 2) { | ||
90 | getmoreargs("send ", "(file) "); | ||
91 | @@ -588,9 +596,22 @@ void put(int argc, char *argv[]) | ||
92 | } | ||
93 | /* this assumes the target is a directory */ | ||
94 | /* on a remote unix system. hmmmm. */ | ||
95 | - cp = strchr(targ, '\0'); | ||
96 | - *cp++ = '/'; | ||
97 | + dirlen = strlen(targ)+1; | ||
98 | +#ifdef WITH_READLINE | ||
99 | + remote_pth = xmalloc(dirlen+1); | ||
100 | +#endif | ||
101 | + strcpy(remote_pth, targ); | ||
102 | + remote_pth[dirlen-1] = '/'; | ||
103 | + cp = remote_pth + dirlen; | ||
104 | for (n = 1; n < argc - 1; n++) { | ||
105 | +#ifdef WITH_READLINE | ||
106 | + namelen = strlen(tail(argv[n])) + 1; | ||
107 | + if (namelen > lastlen) { | ||
108 | + remote_pth = xrealloc(remote_pth, dirlen + namelen + 1); | ||
109 | + cp = remote_pth + dirlen; | ||
110 | + lastlen = namelen; | ||
111 | + } | ||
112 | +#endif | ||
113 | strcpy(cp, tail(argv[n])); | ||
114 | fd = open(argv[n], O_RDONLY | mode->m_openflags); | ||
115 | if (fd < 0) { | ||
116 | @@ -600,9 +621,9 @@ void put(int argc, char *argv[]) | ||
117 | } | ||
118 | if (verbose) | ||
119 | printf("putting %s to %s:%s [%s]\n", | ||
120 | - argv[n], hostname, targ, mode->m_mode); | ||
121 | + argv[n], hostname, remote_pth, mode->m_mode); | ||
122 | sa_set_port(&peeraddr, port); | ||
123 | - tftp_sendfile(fd, targ, mode->m_mode); | ||
124 | + tftp_sendfile(fd, remote_pth, mode->m_mode); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | @@ -801,6 +822,10 @@ static void command(void) | ||
129 | free(line); | ||
130 | line = NULL; | ||
131 | } | ||
132 | + if (remote_pth) { | ||
133 | + free(remote_pth); | ||
134 | + remote_pth = NULL; | ||
135 | + } | ||
136 | line = readline(prompt); | ||
137 | if (!line) | ||
138 | exit(0); /* EOF */ | ||
139 | @@ -872,7 +897,13 @@ struct cmd *getcmd(char *name) | ||
140 | static void makeargv(void) | ||
141 | { | ||
142 | char *cp; | ||
143 | - char **argp = margv; | ||
144 | + char **argp; | ||
145 | + | ||
146 | + if (!sizeof_margv) { | ||
147 | + sizeof_margv = 20; | ||
148 | + margv = xmalloc(sizeof_margv * sizeof(char *)); | ||
149 | + } | ||
150 | + argp = margv; | ||
151 | |||
152 | margc = 0; | ||
153 | for (cp = line; *cp;) { | ||
154 | @@ -882,6 +913,11 @@ static void makeargv(void) | ||
155 | break; | ||
156 | *argp++ = cp; | ||
157 | margc += 1; | ||
158 | + if (margc == sizeof_margv) { | ||
159 | + sizeof_margv += 20; | ||
160 | + margv = xrealloc(margv, sizeof_margv * sizeof(char *)); | ||
161 | + argp = margv + margc; | ||
162 | + } | ||
163 | while (*cp != '\0' && !isspace(*cp)) | ||
164 | cp++; | ||
165 | if (*cp == '\0') | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch new file mode 100644 index 000000000..85110eb28 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500 | ||
10 | @@ -350,6 +350,14 @@ int main(int argc, char **argv) | ||
11 | const char *pidfile = NULL; | ||
12 | u_short tp_opcode; | ||
13 | |||
14 | + time_t my_time = 0; | ||
15 | + struct tm* p_tm; | ||
16 | + char envtz[10]; | ||
17 | + my_time = time(NULL); | ||
18 | + p_tm = localtime(&my_time); | ||
19 | + snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600); | ||
20 | + setenv("TZ", envtz, 0); | ||
21 | + | ||
22 | /* basename() is way too much of a pain from a portability standpoint */ | ||
23 | |||
24 | p = strrchr(argv[0], '/'); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch new file mode 100644 index 000000000..08d2b5b7d --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400 | ||
10 | @@ -279,15 +279,16 @@ | ||
11 | struct tftphdr *tp, const char *mode) | ||
12 | { | ||
13 | char *cp; | ||
14 | + size_t len; | ||
15 | |||
16 | tp->th_opcode = htons((u_short) request); | ||
17 | cp = (char *)&(tp->th_stuff); | ||
18 | - strcpy(cp, name); | ||
19 | - cp += strlen(name); | ||
20 | - *cp++ = '\0'; | ||
21 | - strcpy(cp, mode); | ||
22 | - cp += strlen(mode); | ||
23 | - *cp++ = '\0'; | ||
24 | + len = strlen(name) + 1; | ||
25 | + memcpy(cp, name, len); | ||
26 | + cp += len; | ||
27 | + len = strlen(mode) + 1; | ||
28 | + memcpy(cp, mode, len); | ||
29 | + cp += len; | ||
30 | return (cp - (char *)tp); | ||
31 | } | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch new file mode 100644 index 000000000..720cd69de --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftp/tftp.c.stats tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49/tftp/tftp.c.stats 2011-01-03 15:38:34.217918067 +0100 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2011-01-03 15:38:37.498917014 +0100 | ||
10 | @@ -400,8 +400,8 @@ static void printstats(const char *direc | ||
11 | { | ||
12 | double delta; | ||
13 | |||
14 | - delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) - | ||
15 | - (tstart.tv_sec + (tstart.tv_usec / 100000.0)); | ||
16 | + delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) - | ||
17 | + (tstart.tv_sec + (tstart.tv_usec / 1000000.0)); | ||
18 | if (verbose) { | ||
19 | printf("%s %lu bytes in %.1f seconds", direction, amount, delta); | ||
20 | printf(" [%.0f bit/s]", (amount * 8.) / delta); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch new file mode 100644 index 000000000..216349d26 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c | ||
8 | --- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100 | ||
9 | +++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100 | ||
10 | @@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un | ||
11 | |||
12 | /* Try to enable getting the return address */ | ||
13 | #ifdef IP_RECVDSTADDR | ||
14 | - if (from->sa_family == AF_INET) | ||
15 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
16 | setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)); | ||
17 | #endif | ||
18 | #ifdef IP_PKTINFO | ||
19 | - if (from->sa_family == AF_INET) | ||
20 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
21 | setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); | ||
22 | #endif | ||
23 | #ifdef HAVE_IPV6 | ||
24 | #ifdef IPV6_RECVPKTINFO | ||
25 | - if (from->sa_family == AF_INET6) | ||
26 | + if (from->sa_family == AF_INET6 || !from->sa_family) | ||
27 | setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)); | ||
28 | #endif | ||
29 | #endif | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch new file mode 100644 index 000000000..3e220ec38 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhang Xiao <xiao.zhang@windriver.com> | ||
3 | Date: Wed, 11 Jun 2014 14:01:16 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF | ||
5 | |||
6 | In ascii mode, if the CR and LF was separated into different transfer | ||
7 | blocks, LF will be just dropped instead of replacing the previous CR. | ||
8 | Add a checking on the first character to fix it. | ||
9 | |||
10 | Upstream-Status: pending | ||
11 | |||
12 | Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> | ||
13 | --- | ||
14 | common/tftpsubs.c | 8 ++++++++ | ||
15 | 1 file changed, 8 insertions(+) | ||
16 | |||
17 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
18 | index b4d4ffe..b4ea3f2 100644 | ||
19 | --- a/common/tftpsubs.c | ||
20 | +++ b/common/tftpsubs.c | ||
21 | @@ -207,6 +207,14 @@ int write_behind(FILE * file, int convert) | ||
22 | p = buf; | ||
23 | ct = count; | ||
24 | count = 0; | ||
25 | + | ||
26 | + /* Check the first character together with prevchar */ | ||
27 | + c = *p; | ||
28 | + if ((prevchar == '\r') && (c == '\n')) { | ||
29 | + lseek(fileno(file), -1, SEEK_CUR); | ||
30 | + count++; | ||
31 | + } | ||
32 | + | ||
33 | while (ct--) { /* loop over the buffer */ | ||
34 | c = *p++; /* pick up a character */ | ||
35 | if (prevchar == '\r') { /* if prev char was cr */ | ||
36 | -- | ||
37 | 1.8.5.2.233.g932f7e4 | ||
38 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd new file mode 100644 index 000000000..fe7016396 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd | |||
@@ -0,0 +1,18 @@ | |||
1 | # default: off | ||
2 | # description: The tftp server serves files using the trivial file transfer \ | ||
3 | # protocol. The tftp protocol is often used to boot diskless \ | ||
4 | # workstations, download configuration files to network-aware printers, \ | ||
5 | # and to start the installation process for some operating systems. | ||
6 | service tftp | ||
7 | { | ||
8 | socket_type = dgram | ||
9 | protocol = udp | ||
10 | wait = yes | ||
11 | user = root | ||
12 | server = /usr/sbin/in.tftpd-hpa | ||
13 | server_args = -s /var/lib/tftpboot | ||
14 | disable = yes | ||
15 | per_source = 11 | ||
16 | cps = 100 2 | ||
17 | flags = IPv6 | ||
18 | } | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb new file mode 100644 index 000000000..3f17fd6fc --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -0,0 +1,76 @@ | |||
1 | SUMMARY = "Client for the Trivial File Transfer Protocol" | ||
2 | DESCRIPTION = \ | ||
3 | "The Trivial File Transfer Protocol (TFTP) is normally used only for \ | ||
4 | booting diskless workstations. The tftp package provides the user \ | ||
5 | interface for TFTP, which allows users to transfer files to and from a \ | ||
6 | remote machine. This program and TFTP provide very little security, \ | ||
7 | and should not be enabled unless it is expressly needed." | ||
8 | DEPENDS = "tcp-wrappers readline" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "BSD-4-Clause" | ||
11 | LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \ | ||
12 | file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4" | ||
13 | |||
14 | |||
15 | SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \ | ||
16 | file://tftp-0.40-remap.patch \ | ||
17 | file://tftp-0.42-tftpboot.patch \ | ||
18 | file://tftp-0.49-chk_retcodes.patch \ | ||
19 | file://tftp-0.49-cmd_arg.patch \ | ||
20 | file://tftp-hpa-0.39-tzfix.patch \ | ||
21 | file://tftp-hpa-0.49-fortify-strcpy-crash.patch \ | ||
22 | file://tftp-hpa-0.49-stats.patch \ | ||
23 | file://tftp-hpa-5.2-pktinfo.patch \ | ||
24 | file://default \ | ||
25 | file://init \ | ||
26 | file://add-error-check-for-disk-filled-up.patch \ | ||
27 | file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \ | ||
28 | file://fix-writing-emtpy-file.patch \ | ||
29 | " | ||
30 | |||
31 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | ||
32 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" | ||
33 | |||
34 | inherit autotools-brokensep update-rc.d update-alternatives | ||
35 | |||
36 | export AR = "${HOST_PREFIX}ar cq" | ||
37 | |||
38 | EXTRA_OECONF += "--disable-option-checking" | ||
39 | |||
40 | # configure.in has errors | ||
41 | do_configure() { | ||
42 | oe_runconf | ||
43 | } | ||
44 | |||
45 | do_install() { | ||
46 | oe_runmake install INSTALLROOT=${D} | ||
47 | mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa | ||
48 | mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa | ||
49 | |||
50 | install -m 755 -d ${D}${localstatedir}/lib/tftpboot/ | ||
51 | install -d ${D}${sysconfdir}/init.d | ||
52 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa | ||
53 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
54 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
55 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
56 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
57 | |||
58 | install -d ${D}${sysconfdir}/default | ||
59 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa | ||
60 | } | ||
61 | |||
62 | FILES_${PN} = "${bindir}" | ||
63 | |||
64 | PACKAGES += "tftp-hpa-server" | ||
65 | SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol" | ||
66 | FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}" | ||
67 | CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa" | ||
68 | |||
69 | INITSCRIPT_PACKAGES = "tftp-hpa-server" | ||
70 | INITSCRIPT_NAME = "tftpd-hpa" | ||
71 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ." | ||
72 | |||
73 | ALTERNATIVE_${PN} = "tftp" | ||
74 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" | ||
75 | ALTERNATIVE_PRIORITY = "50" | ||
76 | |||
diff --git a/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-networking/recipes-daemons/vblade/files/cross.patch new file mode 100644 index 000000000..d2eb15614 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/files/cross.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Remove CC and CFLAGS values, we set these ourselves | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -urN vblade-19.old//makefile vblade-19//makefile | ||
6 | --- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100 | ||
7 | +++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000 | ||
8 | @@ -9,8 +9,6 @@ | ||
9 | mandir = ${sharedir}/man | ||
10 | |||
11 | O=aoe.o bpf.o ${PLATFORM}.o ata.o | ||
12 | -CFLAGS += -Wall -g -O2 | ||
13 | -CC = gcc | ||
14 | |||
15 | vblade: $O | ||
16 | ${CC} -o vblade $O | ||
diff --git a/meta-networking/recipes-daemons/vblade/vblade_20.bb b/meta-networking/recipes-daemons/vblade/vblade_20.bb new file mode 100644 index 000000000..a2ebb5a48 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/vblade_20.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Virtual EtherDrive blade AoE target" | ||
2 | SECTION = "console/network" | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/aoetools/${BPN}-${PV}.tgz \ | ||
8 | file://cross.patch" | ||
9 | |||
10 | SRC_URI[md5sum] = "3c80e4a6bc7d66ae0c235b88cb44bd59" | ||
11 | SRC_URI[sha256sum] = "c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d" | ||
12 | |||
13 | inherit autotools-brokensep | ||
14 | |||
15 | do_install() { | ||
16 | install -D -m 0755 ${S}/vblade ${D}/${sbindir}/vblade | ||
17 | install -D -m 0755 ${S}/vbladed ${D}/${sbindir}/vbladed | ||
18 | install -D -m 0644 ${S}/vblade.8 ${D}/${mandir}/man8/vblade.8 | ||
19 | } | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch new file mode 100644 index 000000000..5f2860e84 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | vsftpd: change default value of secure_chroot_dir | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Change secure_chroot_dir pointing to a volatile directory. | ||
6 | |||
7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
8 | --- | ||
9 | INSTALL | 6 +++--- | ||
10 | tunables.c | 2 +- | ||
11 | vsftpd.conf.5 | 2 +- | ||
12 | 3 files changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff -urpN a/INSTALL b/INSTALL | ||
15 | --- a/INSTALL 2013-09-13 10:23:57.504972397 +0800 | ||
16 | +++ b/INSTALL 2013-09-13 10:25:25.664971779 +0800 | ||
17 | @@ -27,11 +27,11 @@ user in case it does not already exist. | ||
18 | [root@localhost root]# useradd nobody | ||
19 | useradd: user nobody exists | ||
20 | |||
21 | -2b) vsftpd needs the (empty) directory /usr/share/empty in the default | ||
22 | +2b) vsftpd needs the (empty) directory /var/run/vsftpd/empty in the default | ||
23 | configuration. Add this directory in case it does not already exist. e.g.: | ||
24 | |||
25 | -[root@localhost root]# mkdir /usr/share/empty/ | ||
26 | -mkdir: cannot create directory `/usr/share/empty': File exists | ||
27 | +[root@localhost root]# mkdir /var/run/vsftpd/empty/ | ||
28 | +mkdir: cannot create directory `/var/run/vsftpd/empty': File exists | ||
29 | |||
30 | 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a | ||
31 | valid home directory (which is NOT owned or writable by the user "ftp"). | ||
32 | diff -urpN a/tunables.c b/tunables.c | ||
33 | --- a/tunables.c 2013-09-13 10:26:29.554972817 +0800 | ||
34 | +++ b/tunables.c 2013-09-13 10:27:18.104972210 +0800 | ||
35 | @@ -254,7 +254,7 @@ tunables_load_defaults() | ||
36 | /* -rw------- */ | ||
37 | tunable_chown_upload_mode = 0600; | ||
38 | |||
39 | - install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); | ||
40 | + install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir); | ||
41 | install_str_setting("ftp", &tunable_ftp_username); | ||
42 | install_str_setting("root", &tunable_chown_username); | ||
43 | install_str_setting("/var/log/xferlog", &tunable_xferlog_file); | ||
44 | diff -urpN a/vsftpd.conf.5 b/vsftpd.conf.5 | ||
45 | --- a/vsftpd.conf.5 2013-09-13 10:09:33.774972462 +0800 | ||
46 | +++ b/vsftpd.conf.5 2013-09-13 10:10:41.914971989 +0800 | ||
47 | @@ -969,7 +969,7 @@ This option should be the name of a dire | ||
48 | directory should not be writable by the ftp user. This directory is used | ||
49 | as a secure chroot() jail at times vsftpd does not require filesystem access. | ||
50 | |||
51 | -Default: /usr/share/empty | ||
52 | +Default: /var/run/vsftpd/empty | ||
53 | .TP | ||
54 | .B ssl_ciphers | ||
55 | This option can be used to select which SSL ciphers vsftpd will allow for | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/init b/meta-networking/recipes-daemons/vsftpd/files/init new file mode 100755 index 000000000..d0ec010dc --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/init | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/sbin/vsftpd | ||
3 | NAME=vsftpd | ||
4 | DESC="FTP Server" | ||
5 | ARGS="" | ||
6 | FTPDIR=/var/lib/ftp | ||
7 | |||
8 | test -f $DAEMON || exit 0 | ||
9 | |||
10 | set -e | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "* starting $DESC: $NAME... " | ||
15 | if ! test -d $FTPDIR; then | ||
16 | mkdir -p $FTPDIR/in | ||
17 | chown ftp $FTPDIR -R | ||
18 | chmod a-w $FTPDIR | ||
19 | chmod u+w $FTPDIR/in | ||
20 | fi | ||
21 | start-stop-daemon -S -b -x $DAEMON -- $ARGS | ||
22 | echo "done." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "* stopping $DESC: $NAME... " | ||
26 | start-stop-daemon -K -x $DAEMON | ||
27 | echo "done." | ||
28 | ;; | ||
29 | restart) | ||
30 | echo "* restarting $DESC: $NAME... " | ||
31 | $0 stop | ||
32 | $0 start | ||
33 | echo "done." | ||
34 | ;; | ||
35 | *) | ||
36 | echo "Usage: $0 {start|stop|restart}" | ||
37 | exit 1 | ||
38 | ;; | ||
39 | esac | ||
40 | |||
41 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd new file mode 100644 index 000000000..8a602ba37 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd | |||
@@ -0,0 +1 @@ | |||
d root root 0755 /var/run/vsftpd/empty none | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf new file mode 100644 index 000000000..bb1929480 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf | |||
@@ -0,0 +1,139 @@ | |||
1 | # Example config file /etc/vsftpd.conf | ||
2 | # | ||
3 | # The default compiled in settings are fairly paranoid. This sample file | ||
4 | # loosens things up a bit, to make the ftp daemon more usable. | ||
5 | # Please see vsftpd.conf.5 for all compiled in defaults. | ||
6 | # | ||
7 | # READ THIS: This example file is NOT an exhaustive list of vsftpd options. | ||
8 | # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's | ||
9 | # capabilities. | ||
10 | |||
11 | # run standalone | ||
12 | listen=YES | ||
13 | |||
14 | # Allow anonymous FTP? (Beware - allowed by default if you comment this out). | ||
15 | anonymous_enable=NO | ||
16 | # | ||
17 | # Uncomment this to allow local users to log in. | ||
18 | local_enable=YES | ||
19 | # | ||
20 | # Uncomment this to enable any form of FTP write command. | ||
21 | write_enable=YES | ||
22 | # | ||
23 | # Default umask for local users is 077. You may wish to change this to 022, | ||
24 | # if your users expect that (022 is used by most other ftpd's) | ||
25 | local_umask=022 | ||
26 | # | ||
27 | # Uncomment this to allow the anonymous FTP user to upload files. This only | ||
28 | # has an effect if the above global write enable is activated. Also, you will | ||
29 | # obviously need to create a directory writable by the FTP user. | ||
30 | #anon_upload_enable=YES | ||
31 | # | ||
32 | # Uncomment this if you want the anonymous FTP user to be able to create | ||
33 | # new directories. | ||
34 | #anon_mkdir_write_enable=YES | ||
35 | # | ||
36 | # Activate directory messages - messages given to remote users when they | ||
37 | # go into a certain directory. | ||
38 | dirmessage_enable=YES | ||
39 | # | ||
40 | # Activate logging of uploads/downloads. | ||
41 | xferlog_enable=YES | ||
42 | # | ||
43 | # Make sure PORT transfer connections originate from port 20 (ftp-data). | ||
44 | connect_from_port_20=YES | ||
45 | # | ||
46 | # If you want, you can arrange for uploaded anonymous files to be owned by | ||
47 | # a different user. Note! Using "root" for uploaded files is not | ||
48 | # recommended! | ||
49 | #chown_uploads=YES | ||
50 | #chown_username=whoever | ||
51 | # | ||
52 | # You may override where the log file goes if you like. The default is shown | ||
53 | # below. | ||
54 | #xferlog_file=/var/log/vsftpd.log | ||
55 | # | ||
56 | # If you want, you can have your log file in standard ftpd xferlog format | ||
57 | xferlog_std_format=YES | ||
58 | # | ||
59 | # You may change the default value for timing out an idle session. | ||
60 | #idle_session_timeout=600 | ||
61 | # | ||
62 | # You may change the default value for timing out a data connection. | ||
63 | #data_connection_timeout=120 | ||
64 | # | ||
65 | # It is recommended that you define on your system a unique user which the | ||
66 | # ftp server can use as a totally isolated and unprivileged user. | ||
67 | #nopriv_user=ftp | ||
68 | # | ||
69 | # Enable this and the server will recognise asynchronous ABOR requests. Not | ||
70 | # recommended for security (the code is non-trivial). Not enabling it, | ||
71 | # however, may confuse older FTP clients. | ||
72 | #async_abor_enable=YES | ||
73 | # | ||
74 | # By default the server will pretend to allow ASCII mode but in fact ignore | ||
75 | # the request. Turn on the below options to have the server actually do ASCII | ||
76 | # mangling on files when in ASCII mode. | ||
77 | # Beware that turning on ascii_download_enable enables malicious remote parties | ||
78 | # to consume your I/O resources, by issuing the command "SIZE /big/file" in | ||
79 | # ASCII mode. | ||
80 | # These ASCII options are split into upload and download because you may wish | ||
81 | # to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), | ||
82 | # without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be | ||
83 | # on the client anyway.. | ||
84 | #ascii_upload_enable=YES | ||
85 | #ascii_download_enable=YES | ||
86 | # | ||
87 | # You may fully customise the login banner string: | ||
88 | #ftpd_banner=Welcome to blah FTP service. | ||
89 | # | ||
90 | # You may specify a file of disallowed anonymous e-mail addresses. Apparently | ||
91 | # useful for combatting certain DoS attacks. | ||
92 | #deny_email_enable=YES | ||
93 | # (default follows) | ||
94 | #banned_email_file=/etc/vsftpd.banned_emails | ||
95 | # | ||
96 | # You may specify an explicit list of local users to chroot() to their home | ||
97 | # directory. If chroot_local_user is YES, then this list becomes a list of | ||
98 | # users to NOT chroot(). | ||
99 | #chroot_list_enable=YES | ||
100 | # (default follows) | ||
101 | #chroot_list_file=/etc/vsftpd.chroot_list | ||
102 | # | ||
103 | # You may activate the "-R" option to the builtin ls. This is disabled by | ||
104 | # default to avoid remote users being able to cause excessive I/O on large | ||
105 | # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume | ||
106 | # the presence of the "-R" option, so there is a strong case for enabling it. | ||
107 | #ls_recurse_enable=YES | ||
108 | # | ||
109 | # This string is the name of the PAM service vsftpd will use. | ||
110 | pam_service_name=vsftpd | ||
111 | # | ||
112 | # This option is examined if userlist_enable is activated. If you set this | ||
113 | # setting to NO, then users will be denied login unless they are explicitly | ||
114 | # listed in the file specified by userlist_file. When login is denied, the | ||
115 | # denial is issued before the user is asked for a password. | ||
116 | userlist_deny=YES | ||
117 | # | ||
118 | # If enabled, vsftpd will load a list of usernames, from the filename given by | ||
119 | # userlist_file. If a user tries to log in using a name in this file, they | ||
120 | # will be denied before they are asked for a password. This may be useful in | ||
121 | # preventing cleartext passwords being transmitted. See also userlist_deny. | ||
122 | userlist_enable=YES | ||
123 | # | ||
124 | # If enabled, vsftpd will display directory listings with the time in your | ||
125 | # local time zone. The default is to display GMT. The times returned by the | ||
126 | # MDTM FTP command are also affected by this option. | ||
127 | use_localtime=YES | ||
128 | # | ||
129 | # If set to YES, local users will be (by default) placed in a chroot() jail in | ||
130 | # their home directory after login. Warning: This option has security | ||
131 | # implications, especially if the users have upload permission, or shell access. | ||
132 | # Only enable if you know what you are doing. Note that these security implications | ||
133 | # are not vsftpd specific. They apply to all FTP daemons which offer to put | ||
134 | # local users in chroot() jails. | ||
135 | chroot_local_user=YES | ||
136 | # | ||
137 | allow_writeable_chroot=YES | ||
138 | # | ||
139 | tcp_wrappers=YES | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers new file mode 100644 index 000000000..096142f5d --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers | |||
@@ -0,0 +1,15 @@ | |||
1 | # Users that are not allowed to login via ftp | ||
2 | root | ||
3 | bin | ||
4 | daemon | ||
5 | adm | ||
6 | lp | ||
7 | sync | ||
8 | shutdown | ||
9 | halt | ||
10 | |||
11 | news | ||
12 | uucp | ||
13 | operator | ||
14 | games | ||
15 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service new file mode 100644 index 000000000..e27102026 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service | |||
@@ -0,0 +1,9 @@ | |||
1 | [Unit] | ||
2 | Description=Vsftpd ftp daemon | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=@SBINDIR@/vsftpd | ||
7 | |||
8 | [Install] | ||
9 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list new file mode 100644 index 000000000..d283e3d26 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list | |||
@@ -0,0 +1,20 @@ | |||
1 | # vsftpd userlist | ||
2 | # If userlist_deny=NO, only allow users in this file | ||
3 | # If userlist_deny=YES (default), never allow users in this file, and | ||
4 | # do not even prompt for a password. | ||
5 | # Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers | ||
6 | # for users that are denied. | ||
7 | root | ||
8 | bin | ||
9 | daemon | ||
10 | adm | ||
11 | lp | ||
12 | sync | ||
13 | shutdown | ||
14 | halt | ||
15 | |||
16 | news | ||
17 | uucp | ||
18 | operator | ||
19 | games | ||
20 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-destdir.patch new file mode 100644 index 000000000..1980d09fd --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-destdir.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Use DESTDIR within install to allow installing under a prefix | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -24,21 +24,21 @@ | ||
11 | $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) | ||
12 | |||
13 | install: | ||
14 | - if [ -x /usr/local/sbin ]; then \ | ||
15 | - $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ | ||
16 | + if [ -x ${DESTDIR}/usr/local/sbin ]; then \ | ||
17 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \ | ||
18 | else \ | ||
19 | - $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi | ||
20 | - if [ -x /usr/local/man ]; then \ | ||
21 | - $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ | ||
22 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ | ||
23 | - elif [ -x /usr/share/man ]; then \ | ||
24 | - $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ | ||
25 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ | ||
26 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi | ||
27 | + if [ -x ${DESTDIR}/usr/local/man ]; then \ | ||
28 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \ | ||
29 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \ | ||
30 | + elif [ -x ${DESTDIR}/usr/share/man ]; then \ | ||
31 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \ | ||
32 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \ | ||
33 | else \ | ||
34 | - $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ | ||
35 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi | ||
36 | - if [ -x /etc/xinetd.d ]; then \ | ||
37 | - $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi | ||
38 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \ | ||
39 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi | ||
40 | + if [ -x ${DESTDIR}/etc/xinetd.d ]; then \ | ||
41 | + $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi | ||
42 | |||
43 | clean: | ||
44 | rm -f *.o *.swp vsftpd | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-libs.patch new file mode 100644 index 000000000..9a10f722f --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-libs.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Hardcode LIBS instead of using a script to determine available libs | ||
2 | |||
3 | We want to avoid this dynamic detection so we have a deterministic | ||
4 | build. | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | diff --git a/Makefile b/Makefile | ||
11 | --- a/Makefile | ||
12 | +++ b/Makefile | ||
13 | @@ -5,7 +5,7 @@ | ||
14 | #CFLAGS = -g | ||
15 | CFLAGS = -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion | ||
16 | |||
17 | -LIBS = `./vsf_findlibs.sh` | ||
18 | +LIBS = -lssl -lcrypto -lnsl -lresolv | ||
19 | LINK = -Wl,-s | ||
20 | |||
21 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-strip.patch new file mode 100644 index 000000000..fd3160037 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/makefile-strip.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable stripping at link time | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ | ||
11 | #-pedantic -Wconversion | ||
12 | |||
13 | LIBS = -lssl -lcrypto -lnsl -lresolv | ||
14 | -LINK = -Wl,-s | ||
15 | LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now | ||
16 | |||
17 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam-with-tcp_wrappers.patch new file mode 100644 index 000000000..fdcf3a02b --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam-with-tcp_wrappers.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
7 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
8 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
9 | @@ -2,7 +2,7 @@ | ||
10 | #define VSF_BUILDDEFS_H | ||
11 | |||
12 | #define VSF_BUILD_TCPWRAPPERS | ||
13 | -#define VSF_BUILD_PAM | ||
14 | +#undef VSF_BUILD_PAM | ||
15 | #undef VSF_BUILD_SSL | ||
16 | |||
17 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam.patch new file mode 100644 index 000000000..cf0d68e27 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/nopam.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
6 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
7 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
8 | @@ -2,7 +2,7 @@ | ||
9 | #define VSF_BUILDDEFS_H | ||
10 | |||
11 | #undef VSF_BUILD_TCPWRAPPERS | ||
12 | -#define VSF_BUILD_PAM | ||
13 | +#undef VSF_BUILD_PAM | ||
14 | #undef VSF_BUILD_SSL | ||
15 | |||
16 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-tcp_wrappers-support.patch new file mode 100644 index 000000000..69745b3a1 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.2/vsftpd-tcp_wrappers-support.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Enable tcp_wrapper. | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | builddefs.h | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/builddefs.h b/builddefs.h | ||
11 | index e908352..0106d1a 100644 | ||
12 | --- a/builddefs.h | ||
13 | +++ b/builddefs.h | ||
14 | @@ -1,7 +1,7 @@ | ||
15 | #ifndef VSF_BUILDDEFS_H | ||
16 | #define VSF_BUILDDEFS_H | ||
17 | |||
18 | -#undef VSF_BUILD_TCPWRAPPERS | ||
19 | +#define VSF_BUILD_TCPWRAPPERS | ||
20 | #define VSF_BUILD_PAM | ||
21 | #undef VSF_BUILD_SSL | ||
22 | |||
23 | -- | ||
24 | 1.7.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb new file mode 100644 index 000000000..e4d65eea6 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.2.bb | |||
@@ -0,0 +1,106 @@ | |||
1 | SUMMARY = "Very Secure FTP server" | ||
2 | HOMEPAGE = "https://security.appspot.com/vsftpd.html" | ||
3 | SECTION = "network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" | ||
6 | |||
7 | DEPENDS = "libcap openssl" | ||
8 | |||
9 | SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ | ||
10 | file://makefile-destdir.patch \ | ||
11 | file://makefile-libs.patch \ | ||
12 | file://makefile-strip.patch \ | ||
13 | file://init \ | ||
14 | file://vsftpd.conf \ | ||
15 | file://vsftpd.user_list \ | ||
16 | file://vsftpd.ftpusers \ | ||
17 | file://change-secure_chroot_dir.patch \ | ||
18 | file://volatiles.99_vsftpd \ | ||
19 | file://vsftpd.service \ | ||
20 | " | ||
21 | |||
22 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ | ||
23 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ | ||
24 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" | ||
25 | SRC_URI[md5sum] = "8b00c749719089401315bd3c44dddbb2" | ||
26 | SRC_URI[sha256sum] = "be46f0e2c5528fe021fafc8dab1ecfea0c1f183063a06977f8537fcd0b195e56" | ||
27 | |||
28 | |||
29 | PACKAGECONFIG ??= "tcp-wrappers" | ||
30 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" | ||
31 | SRC_URI +="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}" | ||
32 | |||
33 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
34 | RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" | ||
35 | PAMLIB = "${@base_contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" | ||
36 | NOPAM_SRC ="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" | ||
37 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}" | ||
38 | |||
39 | inherit update-rc.d useradd systemd | ||
40 | |||
41 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" | ||
42 | LDFLAGS_append =" -lcrypt -lcap" | ||
43 | |||
44 | do_configure() { | ||
45 | # Fix hardcoded /usr, /etc, /var mess. | ||
46 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ | ||
47 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new | ||
48 | mv tunables.c.new tunables.c | ||
49 | } | ||
50 | |||
51 | do_compile() { | ||
52 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} -lwrap" | ||
53 | } | ||
54 | |||
55 | do_install() { | ||
56 | install -d ${D}${sbindir} | ||
57 | install -d ${D}${mandir}/man8 | ||
58 | install -d ${D}${mandir}/man5 | ||
59 | oe_runmake 'DESTDIR=${D}' install | ||
60 | install -d ${D}${sysconfdir} | ||
61 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf | ||
62 | install -d ${D}${sysconfdir}/init.d/ | ||
63 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd | ||
64 | install -d ${D}/${sysconfdir}/default/volatiles | ||
65 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd | ||
66 | |||
67 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ | ||
68 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ | ||
69 | if ! test -z "${PAMLIB}" ; then | ||
70 | install -d ${D}${sysconfdir}/pam.d/ | ||
71 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd | ||
72 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd | ||
73 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd | ||
74 | fi | ||
75 | if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
76 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
77 | echo "d /var/run/vsftpd/empty 0755 root root -" \ | ||
78 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
79 | fi | ||
80 | |||
81 | # Install systemd unit files | ||
82 | install -d ${D}${systemd_unitdir}/system | ||
83 | install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system | ||
84 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service | ||
85 | } | ||
86 | |||
87 | INITSCRIPT_PACKAGES = "${PN}" | ||
88 | INITSCRIPT_NAME_${PN} = "vsftpd" | ||
89 | INITSCRIPT_PARAMS_${PN} = "defaults 80" | ||
90 | |||
91 | USERADD_PACKAGES = "${PN}" | ||
92 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ | ||
93 | --shell /bin/false ftp " | ||
94 | GROUPADD_PARAM_${PN} = "-r ftp" | ||
95 | |||
96 | SYSTEMD_SERVICE_${PN} = "vsftpd.service" | ||
97 | |||
98 | pkg_postinst_${PN}() { | ||
99 | if [ -z "$D" ]; then | ||
100 | if type systemd-tmpfiles >/dev/null; then | ||
101 | systemd-tmpfiles --create | ||
102 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
103 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
104 | fi | ||
105 | fi | ||
106 | } | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb new file mode 100644 index 000000000..0cc139840 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "Connection tracking userspace tools for Linux" | ||
2 | LICENSE = "GPLv2+" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
4 | DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \ | ||
5 | libnetfilter-cthelper libnetfilter-queue bison-native" | ||
6 | |||
7 | |||
8 | SRC_URI = " \ | ||
9 | http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \ | ||
10 | file://conntrack-failover \ | ||
11 | file://init \ | ||
12 | " | ||
13 | SRC_URI[tar.md5sum] = "ee737c774e01349f75e935228a2d851b" | ||
14 | SRC_URI[tar.sha256sum] = "036b032a5c4d180aad686df21399d74506b9b3d3000794eb13ac313482e24896" | ||
15 | |||
16 | inherit autotools-brokensep update-rc.d pkgconfig | ||
17 | |||
18 | INITSCRIPT_NAME = "conntrackd" | ||
19 | |||
20 | do_install_append() { | ||
21 | install -d ${D}/${sysconfdir}/conntrackd | ||
22 | install -d ${D}/${sysconfdir}/init.d | ||
23 | install -m 0644 doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
24 | install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover | ||
25 | install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd | ||
26 | |||
27 | # Fix hardcoded paths in scripts | ||
28 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
29 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
30 | sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
31 | sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd | ||
32 | } | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover new file mode 100644 index 000000000..6d92e637f --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover | |||
@@ -0,0 +1,77 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org> | ||
4 | # (C) 2009 Roman I Khimov <khimov@altell.ru> | ||
5 | # | ||
6 | # This software may be used and distributed according to the terms | ||
7 | # of the GNU General Public License, incorporated herein by reference. | ||
8 | # | ||
9 | # Description: | ||
10 | # | ||
11 | # This is the script for primary-backup setups for keepalived | ||
12 | # (http://www.keepalived.org). You may adapt it to make it work with other | ||
13 | # high-availability managers. | ||
14 | # | ||
15 | # Do not forget to include the required modifications to your keepalived.conf | ||
16 | # file to invoke this script during keepalived's state transitions. | ||
17 | # | ||
18 | # Contributions to improve this script are welcome :). | ||
19 | # | ||
20 | ## Modified to work as init.d script under pacemaker control | ||
21 | |||
22 | CONNTRACKD_BIN=/usr/sbin/conntrackd | ||
23 | CONNTRACKD_LOCK=/var/lock/conntrack.lock | ||
24 | CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | # | ||
29 | # commit the external cache into the kernel table | ||
30 | # | ||
31 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c | ||
32 | if [ $? -eq 1 ] | ||
33 | then | ||
34 | logger "ERROR: failed to invoke conntrackd -c" | ||
35 | fi | ||
36 | |||
37 | # | ||
38 | # flush the internal and the external caches | ||
39 | # | ||
40 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f | ||
41 | if [ $? -eq 1 ] | ||
42 | then | ||
43 | logger "ERROR: failed to invoke conntrackd -f" | ||
44 | fi | ||
45 | |||
46 | # | ||
47 | # resynchronize my internal cache to the kernel table | ||
48 | # | ||
49 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R | ||
50 | if [ $? -eq 1 ] | ||
51 | then | ||
52 | logger "ERROR: failed to invoke conntrackd -R" | ||
53 | fi | ||
54 | |||
55 | # | ||
56 | # send a bulk update to backups | ||
57 | # | ||
58 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B | ||
59 | if [ $? -eq 1 ] | ||
60 | then | ||
61 | logger "ERROR: failed to invoke conntrackd -B" | ||
62 | fi | ||
63 | ;; | ||
64 | stop) | ||
65 | $CONNTRACKD_BIN -t | ||
66 | $CONNTRACKD_BIN -n | ||
67 | ;; | ||
68 | status) | ||
69 | ;; | ||
70 | *) | ||
71 | logger "ERROR: unknown command" | ||
72 | echo "Usage: conntrack-failover {start|stop|status}" | ||
73 | exit 1 | ||
74 | ;; | ||
75 | esac | ||
76 | |||
77 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/init b/meta-networking/recipes-filter/conntrack-tools/files/init new file mode 100644 index 000000000..bce2075a7 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/init | |||
@@ -0,0 +1,87 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # /etc/init.d/conntrackd | ||
4 | # | ||
5 | # Maximilian Wilhelm <max@rfc2324.org> | ||
6 | # -- Mon, 06 Nov 2006 18:39:07 +0100 | ||
7 | # | ||
8 | # Roman I Khimov <khimov@altell.ru> | ||
9 | # -- Tue, 27 Oct 2009 14:34:00 +0300 | ||
10 | |||
11 | ### BEGIN INIT INFO | ||
12 | # Provides: conntrackd | ||
13 | # Required-Start: $remote_fs $syslog | ||
14 | # Required-Stop: $remote_fs $syslog | ||
15 | # Default-Start: 2 3 4 5 | ||
16 | # Default-Stop: 0 1 6 | ||
17 | # Description: Starts conntrackd | ||
18 | # short-description: Starts conntrackd | ||
19 | ### END INIT INFO | ||
20 | |||
21 | export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
22 | |||
23 | NAME="conntrackd" | ||
24 | DAEMON="/usr/sbin/conntrackd" | ||
25 | CONFIG="/etc/conntrackd/conntrackd.conf" | ||
26 | PIDFILE="/var/run/${NAME}.pid" | ||
27 | |||
28 | |||
29 | # Gracefully exit if there is no daemon (debian way of life) | ||
30 | if [ ! -x "${DAEMON}" ]; then | ||
31 | exit 0 | ||
32 | fi | ||
33 | |||
34 | # Check for config file | ||
35 | if [ ! -f /etc/conntrackd/conntrackd.conf ]; then | ||
36 | echo "Error: There is no config file for $NAME" >&2 | ||
37 | exit 1; | ||
38 | fi | ||
39 | |||
40 | case "$1" in | ||
41 | start) | ||
42 | echo -n "Starting $NAME: " | ||
43 | for i in nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_proto_dccp nf_conntrack_tftp \ | ||
44 | nf_conntrack_sane nf_conntrack_pptp nf_conntrack_irc nf_conntrack_amanda nf_conntrack_h323 \ | ||
45 | nf_conntrack_proto_udplite nf_conntrack_proto_gre nf_conntrack_proto_sctp nf_conntrack_ftp \ | ||
46 | nf_conntrack_sip; do | ||
47 | modprobe $i >/dev/null 2>/dev/null & | ||
48 | done | ||
49 | start-stop-daemon --start --quiet --make-pidfile --pidfile "/var/run/${NAME}.pid" --background --exec "${DAEMON}" | ||
50 | RET=$? | ||
51 | if [ "$?" = "0" ]; then | ||
52 | sleep 2 | ||
53 | # Sync with other server | ||
54 | conntrackd -n | ||
55 | echo "done." | ||
56 | else | ||
57 | echo "FAILED!" | ||
58 | fi | ||
59 | exit $RET | ||
60 | ;; | ||
61 | stop) | ||
62 | echo -n "Stopping $NAME:" | ||
63 | start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/${NAME}.pid" && echo "done." || echo "FAILED!" | ||
64 | ;; | ||
65 | status) | ||
66 | echo -n "conntrackd " | ||
67 | start-stop-daemon -q -K -t -x $DAEMON | ||
68 | RET=$? | ||
69 | if [ "$RET" = "0" ]; then | ||
70 | PID=`cat $PIDFILE` | ||
71 | echo "($PID) is running" | ||
72 | else | ||
73 | echo "is not running" | ||
74 | exit $RET | ||
75 | fi | ||
76 | ;; | ||
77 | restart) | ||
78 | $0 stop | ||
79 | $0 start | ||
80 | ;; | ||
81 | |||
82 | *) | ||
83 | echo "Usage: /etc/init.d/conntrackd {start|stop|restart}" | ||
84 | exit 1 | ||
85 | esac | ||
86 | |||
87 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch new file mode 100644 index 000000000..c260403ea --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
2 | ## debian_defaultconfig.dpatch by <hesso@pool.math.tu-berlin.de> | ||
3 | ## | ||
4 | ## DP: Debian enhancements to the ebtables "sysconfig" default settings. | ||
5 | |||
6 | @DPATCH@ | ||
7 | |||
8 | --- ebtables-2.0.8.1.orig/ebtables-config | ||
9 | +++ ebtables-2.0.8.1/ebtables-config | ||
10 | @@ -1,17 +1,3 @@ | ||
11 | -# Save (and possibly restore) in text format. | ||
12 | -# Value: yes|no, default: yes | ||
13 | -# Save the firewall rules in text format to __SYSCONFIG__/ebtables | ||
14 | -# If EBTABLES_BINARY_FORMAT="no" then restoring the firewall rules | ||
15 | -# is done using this text format. | ||
16 | -EBTABLES_TEXT_FORMAT="yes" | ||
17 | - | ||
18 | -# Save (and restore) in binary format. | ||
19 | -# Value: yes|no, default: yes | ||
20 | -# Save (and restore) the firewall rules in binary format to (and from) | ||
21 | -# __SYSCONFIG__/ebtables.<chain>. Enabling this option will make | ||
22 | -# firewall initialisation a lot faster. | ||
23 | -EBTABLES_BINARY_FORMAT="yes" | ||
24 | - | ||
25 | # Unload modules on restart and stop | ||
26 | # Value: yes|no, default: yes | ||
27 | # This option has to be 'yes' to get to a sane state for a firewall | ||
28 | @@ -19,6 +5,12 @@ | ||
29 | # modules. | ||
30 | EBTABLES_MODULES_UNLOAD="yes" | ||
31 | |||
32 | +# Load firewall rules on system startup. | ||
33 | +# Value: yes|no, default: no | ||
34 | +# Restores the ebtables rulesets from the last saved state when the | ||
35 | +# system boots up. | ||
36 | +EBTABLES_LOAD_ON_START="no" | ||
37 | + | ||
38 | # Save current firewall rules on stop. | ||
39 | # Value: yes|no, default: no | ||
40 | # Saves all firewall rules if firewall gets stopped | ||
41 | @@ -35,3 +27,9 @@ | ||
42 | # Save rule counters when saving a kernel table to a file. If the | ||
43 | # rule counters were saved, they will be restored when restoring the table. | ||
44 | EBTABLES_SAVE_COUNTER="no" | ||
45 | + | ||
46 | +# Backup suffix for ruleset save files. | ||
47 | +# Value: <string>, default: "~" | ||
48 | +# Keep one backup level of saved rules. | ||
49 | +# Set this variable to the empty string to disable backups. | ||
50 | +EBTABLES_BACKUP_SUFFIX="~" | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common new file mode 100644 index 000000000..640025dba --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common | |||
@@ -0,0 +1,163 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -x /sbin/ebtables ] || exit 1 | ||
4 | |||
5 | EBTABLES_DUMPFILE_STEM=/etc/ebtables/dump | ||
6 | |||
7 | RETVAL=0 | ||
8 | prog="ebtables" | ||
9 | desc="Ethernet bridge filtering" | ||
10 | umask 0077 | ||
11 | |||
12 | #default configuration | ||
13 | EBTABLES_MODULES_UNLOAD="yes" | ||
14 | EBTABLES_LOAD_ON_START="no" | ||
15 | EBTABLES_SAVE_ON_STOP="no" | ||
16 | EBTABLES_SAVE_ON_RESTART="no" | ||
17 | EBTABLES_SAVE_COUNTER="no" | ||
18 | EBTABLES_BACKUP_SUFFIX="~" | ||
19 | |||
20 | config=/etc/default/$prog | ||
21 | [ -f "$config" ] && . "$config" | ||
22 | |||
23 | function get_supported_tables() { | ||
24 | EBTABLES_SUPPORTED_TABLES= | ||
25 | /sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission | ||
26 | if [ $? -eq 0 ]; then | ||
27 | echo "Error: insufficient privileges to access the ebtables rulesets." | ||
28 | exit 1 | ||
29 | fi | ||
30 | for table in filter nat broute; do | ||
31 | /sbin/ebtables -t $table -L &> /dev/null | ||
32 | if [ $? -eq 0 ]; then | ||
33 | EBTABLES_SUPPORTED_TABLES="${EBTABLES_SUPPORTED_TABLES} $table" | ||
34 | fi | ||
35 | done | ||
36 | } | ||
37 | |||
38 | function load() { | ||
39 | RETVAL=0 | ||
40 | get_supported_tables | ||
41 | echo -n "Restoring ebtables rulesets: " | ||
42 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
43 | echo -n "$table " | ||
44 | if [ -s ${EBTABLES_DUMPFILE_STEM}.$table ]; then | ||
45 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-commit | ||
46 | RET=$? | ||
47 | if [ $RET -ne 0 ]; then | ||
48 | echo -n "(failed) " | ||
49 | RETVAL=$RET | ||
50 | fi | ||
51 | else | ||
52 | echo -n "(no saved state) " | ||
53 | fi | ||
54 | done | ||
55 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
56 | echo -n "no kernel support. " | ||
57 | else | ||
58 | echo -n "done. " | ||
59 | fi | ||
60 | if [ $RETVAL -eq 0 ]; then | ||
61 | echo "ok" | ||
62 | else | ||
63 | echo "fail" | ||
64 | fi | ||
65 | } | ||
66 | |||
67 | function clear() { | ||
68 | RETVAL=0 | ||
69 | get_supported_tables | ||
70 | echo -n "Clearing ebtables rulesets: " | ||
71 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
72 | echo -n "$table " | ||
73 | /sbin/ebtables -t $table --init-table | ||
74 | done | ||
75 | |||
76 | if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then | ||
77 | for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -d' ' -f1) ebtables; do | ||
78 | rmmod $mod 2> /dev/null | ||
79 | done | ||
80 | fi | ||
81 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
82 | echo -n "no kernel support. " | ||
83 | else | ||
84 | echo -n "done. " | ||
85 | fi | ||
86 | if [ $RETVAL -eq 0 ]; then | ||
87 | echo "ok" | ||
88 | else | ||
89 | echo "fail" | ||
90 | fi | ||
91 | } | ||
92 | |||
93 | function save() { | ||
94 | RETVAL=0 | ||
95 | get_supported_tables | ||
96 | echo -n "Saving ebtables rulesets: " | ||
97 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
98 | echo -n "$table " | ||
99 | [ -n "$EBTABLES_BACKUP_SUFFIX" ] && [ -s ${EBTABLES_DUMPFILE_STEM}.$table ] && \ | ||
100 | mv ${EBTABLES_DUMPFILE_STEM}.$table ${EBTABLES_DUMPFILE_STEM}.$table$EBTABLES_BACKUP_SUFFIX | ||
101 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-save | ||
102 | RET=$? | ||
103 | if [ $RET -ne 0 ]; then | ||
104 | echo -n "(failed) " | ||
105 | RETVAL=$RET | ||
106 | else | ||
107 | if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then | ||
108 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table -Z | ||
109 | fi | ||
110 | fi | ||
111 | done | ||
112 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
113 | echo -n "no kernel support. " | ||
114 | else | ||
115 | echo -n "done. " | ||
116 | fi | ||
117 | if [ $RETVAL -eq 0 ]; then | ||
118 | echo "ok" | ||
119 | else | ||
120 | echo "fail" | ||
121 | fi | ||
122 | } | ||
123 | |||
124 | case "$1" in | ||
125 | start) | ||
126 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
127 | ;; | ||
128 | stop) | ||
129 | [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save | ||
130 | clear | ||
131 | ;; | ||
132 | restart|reload|force-reload) | ||
133 | [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save | ||
134 | clear | ||
135 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
136 | ;; | ||
137 | load) | ||
138 | load | ||
139 | ;; | ||
140 | save) | ||
141 | save | ||
142 | ;; | ||
143 | status) | ||
144 | get_supported_tables | ||
145 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
146 | echo "No kernel support for ebtables." | ||
147 | RETVAL=1 | ||
148 | else | ||
149 | echo -n "Ebtables support available, number of installed rules: " | ||
150 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
151 | COUNT=$(( $(/sbin/ebtables -t $table -L | sed -e "/^Bridge chain/! d" -e "s/^.*entries: //" -e "s/,.*$/ +/") 0 )) | ||
152 | echo -n "$table($COUNT) " | ||
153 | done | ||
154 | echo ok | ||
155 | RETVAL=0 | ||
156 | fi | ||
157 | ;; | ||
158 | *) | ||
159 | echo "Usage: $0 {start|stop|restart|reload|force-reload|load|save|status}" >&2 | ||
160 | RETVAL=1 | ||
161 | esac | ||
162 | |||
163 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init new file mode 100755 index 000000000..c9a77a29e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init | |||
@@ -0,0 +1,26 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # init script for the Ethernet Bridge filter tables | ||
4 | # | ||
5 | # Written by Dag Wieers <dag@wieers.com> | ||
6 | # Modified by Rok Papez <rok.papez@arnes.si> | ||
7 | # Bart De Schuymer <bdschuym@pandora.be> | ||
8 | # Adapted to Debian by Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> | ||
9 | # Adapted to OpenEmbedded by Roman I Khimov <khimov@altell.ru> | ||
10 | # | ||
11 | # chkconfig: - 15 85 | ||
12 | # description: Ethernet Bridge filtering tables | ||
13 | # | ||
14 | ### BEGIN INIT INFO | ||
15 | # Provides: ebtables | ||
16 | # Required-Start: | ||
17 | # Required-Stop: | ||
18 | # Should-Start: $local_fs | ||
19 | # Should-Stop: $local_fs | ||
20 | # Default-Start: S | ||
21 | # Default-Stop: 0 6 | ||
22 | # Short-Description: ebtables ruleset management | ||
23 | # Description: Saves and restores the state of the ebtables rulesets. | ||
24 | ### END INIT INFO | ||
25 | |||
26 | /usr/sbin/ebtables.common $1 | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service new file mode 100644 index 000000000..3abd1fe3e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Ethernet Bridge Filtering Tables | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | RemainAfterExit=yes | ||
7 | ExecStart=@SBINDIR@/ebtables.common start | ||
8 | ExecStop=@SBINDIR@/ebtables.common stop | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch new file mode 100644 index 000000000..bcd9bed23 --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | diff --git a/Makefile b/Makefile | ||
2 | index c1106a4..7ea6b7a 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g') | ||
6 | scripts: ebtables-save ebtables.sysv ebtables-config | ||
7 | cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ | ||
8 | mkdir -p $(DESTDIR)$(BINDIR) | ||
9 | - install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
10 | + install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
11 | cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ | ||
12 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi | ||
13 | - if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
14 | + if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
15 | cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ | ||
16 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi | ||
17 | - if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
18 | + if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
19 | rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ | ||
20 | |||
21 | tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g') | ||
22 | $(MANDIR)/man8/ebtables.8: ebtables.8 | ||
23 | mkdir -p $(DESTDIR)$(@D) | ||
24 | sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_ | ||
25 | - install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@ | ||
26 | + install -m 0644 ebtables.8_ $(DESTDIR)$@ | ||
27 | rm -f ebtables.8_ | ||
28 | |||
29 | $(DESTDIR)$(ETHERTYPESFILE): ethertypes | ||
30 | mkdir -p $(@D) | ||
31 | - install -m 0644 -o root -g root $< $@ | ||
32 | + install -m 0644 $< $@ | ||
33 | |||
34 | .PHONY: exec | ||
35 | exec: ebtables ebtables-restore | ||
36 | mkdir -p $(DESTDIR)$(BINDIR) | ||
37 | - install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
38 | - install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
39 | + install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
40 | + install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
41 | |||
42 | .PHONY: install | ||
43 | install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch new file mode 100644 index 000000000..336119d6b --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | link ebtables with --no-as-needed and adjust the link order to fix runtime crash | ||
2 | |||
3 | Program terminated with signal 11, Segmentation fault. | ||
4 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
5 | (gdb) bt | ||
6 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
7 | #1 0x00007ffaa83824dc in do_command () from /lib64/ebtables/libebtc.so | ||
8 | #2 0x000000000040065c in ?? () | ||
9 | #3 0x00007ffaa7fed755 in __libc_start_main () from /lib64/libc.so.6 | ||
10 | #4 0x0000000000400691 in ?? () | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Index: ebtables-v2.0.10-4/Makefile | ||
14 | =================================================================== | ||
15 | --- ebtables-v2.0.10-4.orig/Makefile 2011-12-15 12:02:47.000000000 -0800 | ||
16 | +++ ebtables-v2.0.10-4/Makefile 2012-12-17 22:09:45.065973753 -0800 | ||
17 | @@ -90,7 +90,7 @@ | ||
18 | $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2) | ||
19 | |||
20 | ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so | ||
21 | - $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ | ||
22 | + $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \ | ||
23 | -Wl,-rpath,$(LIBDIR) | ||
24 | |||
25 | ebtablesu: ebtablesu.c | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb new file mode 100644 index 000000000..32cfc752b --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | |||
@@ -0,0 +1,77 @@ | |||
1 | SUMMARY = "Filtering tool for a Linux-based bridging firewall" | ||
2 | DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \ | ||
3 | advanced logging, MAC DNAT/SNAT and brouting." | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" | ||
6 | SECTION = "console/network" | ||
7 | PR = "r3" | ||
8 | |||
9 | RDEPENDS_${PN} += "perl" | ||
10 | |||
11 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ | ||
12 | " | ||
13 | |||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ | ||
15 | file://installnonroot.patch \ | ||
16 | file://01debian_defaultconfig.patch \ | ||
17 | file://ebtables.init \ | ||
18 | file://ebtables.common \ | ||
19 | file://ebtables.service \ | ||
20 | file://no-as-needed.patch \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0" | ||
24 | SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d" | ||
25 | |||
26 | S = "${WORKDIR}/ebtables-v${PV}" | ||
27 | |||
28 | inherit update-rc.d systemd | ||
29 | |||
30 | EXTRA_OEMAKE = " \ | ||
31 | BINDIR=${base_sbindir} \ | ||
32 | MANDIR=${mandir} \ | ||
33 | ETHERTYPESPATH=${sysconfdir} \ | ||
34 | INITDIR=${sysconfdir}/init.d \ | ||
35 | SYSCONFIGDIR=${sysconfdir}/default \ | ||
36 | LIBDIR=${base_libdir}/ebtables \ | ||
37 | 'CC=${CC}' \ | ||
38 | 'CFLAGS=${CFLAGS}' \ | ||
39 | 'LDFLAGS=${LDFLAGS} -Wl,--no-as-needed' \ | ||
40 | 'LD=${LD}' \ | ||
41 | " | ||
42 | |||
43 | do_install () { | ||
44 | install -d ${D}${sbindir} | ||
45 | install -m 0755 ${WORKDIR}/ebtables.common ${D}${sbindir}/ebtables.common | ||
46 | # Fix hardcoded paths in scripts | ||
47 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${sbindir}/ebtables.common | ||
48 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sbindir}/ebtables.common | ||
49 | |||
50 | install -d ${D}${sysconfdir}/init.d | ||
51 | install -d ${D}${sysconfdir}/default | ||
52 | install -d ${D}${sysconfdir}/ebtables | ||
53 | oe_runmake DESTDIR='${D}' install | ||
54 | install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables | ||
55 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables | ||
56 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables | ||
57 | |||
58 | # The script ebtables-save refernces perl in exec_prefix, so | ||
59 | # move it to sbindir to avoid QA issue | ||
60 | install -d ${D}/${sbindir} | ||
61 | mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir} | ||
62 | |||
63 | # Install systemd service files | ||
64 | install -d ${D}${systemd_unitdir}/system | ||
65 | install -m 0644 ${WORKDIR}/ebtables.service ${D}${systemd_unitdir}/system | ||
66 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/ebtables.service | ||
67 | } | ||
68 | |||
69 | CONFFILES_${PN} += "${sysconfdir}/default/ebtables" | ||
70 | |||
71 | INITSCRIPT_NAME = "ebtables" | ||
72 | INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ." | ||
73 | |||
74 | SYSTEMD_SERVICE_${PN} = "ebtables.service" | ||
75 | |||
76 | FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug" | ||
77 | FILES_${PN} += "${base_libdir}/ebtables/*.so" | ||
diff --git a/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb new file mode 100644 index 000000000..74f909660 --- /dev/null +++ b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | SUMMARY = "Minimalistic user-space Netlink utility library" | ||
2 | DESCRIPTION = "Minimalistic user-space library oriented to Netlink developers, providing \ | ||
3 | functions for common tasks in parsing, validating, and constructing both the Netlink header and TLVs." | ||
4 | HOMEPAGE = "http://www.netfilter.org/projects/libmnl/index.html" | ||
5 | LICENSE = "LGPLv2.1+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libmnl/files/libmnl-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "7d95fc3bea3365bc03c48e484224f65f" | ||
10 | SRC_URI[tar.sha256sum] = "6f14336e9acdbc62c2dc71bbb59ce162e54e9af5c80153e92476c5443fe784de" | ||
11 | |||
12 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb new file mode 100644 index 000000000..fb915abbf --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "447114b5d61bb9a9617ead3217c3d3ff" | ||
10 | SRC_URI[tar.sha256sum] = "a0bd747dd58ae1513586b43c7125b41e6325f97eb95ac63d53cf5aeb33254d12" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_conntrack-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb new file mode 100644 index 000000000..405e8bfae --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking helper library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_cthelper/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd" | ||
10 | SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_cthelper-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb new file mode 100644 index 000000000..2f2585217 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | SUMMARY = "Netfilter connection tracking timeout library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter fine-grain connection tracking timeout infrastructure" | ||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
5 | DEPENDS = "libmnl" | ||
6 | |||
7 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar" | ||
8 | SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" | ||
9 | SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" | ||
10 | |||
11 | S = "${WORKDIR}/libnetfilter_cttimeout-${PV}" | ||
12 | |||
13 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb new file mode 100644 index 000000000..81909b8be --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter logging library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter log message (NFLOG)" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_log/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_log/files/libnetfilter_log-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "2a4bb0654ae675a52d2e8d1c06090b94" | ||
10 | SRC_URI[tar.sha256sum] = "74e0fe75753dba3ac114531b5e73240452c789a3f3adccf5c51217da1d933b21" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_log-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb new file mode 100644 index 000000000..b932ff65f --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter packet queue access library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to access the Linux kernel netfilter packet queue" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_queue/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "df09befac35cb215865b39a36c96a3fa" | ||
10 | SRC_URI[tar.sha256sum] = "838490eb5dbe358f9669823704982f5313a8d397111562373200203f93ac1a32" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_queue-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb new file mode 100644 index 000000000..9cb615bb4 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Low-level library for netfilter related kernel/userspace communication" | ||
2 | DESCRIPTION = "libnfnetlink is the low-level library for netfilter related \ | ||
3 | kernel/userspace communication. It provides a generic messaging \ | ||
4 | infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, \ | ||
5 | nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or \ | ||
6 | management tools in userspace." | ||
7 | HOMEPAGE = "http://www.netfilter.org/projects/libnfnetlink/index.html" | ||
8 | SECTION = "devel/libs" | ||
9 | LICENSE = "GPLv2+" | ||
10 | |||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
13 | |||
14 | SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar" | ||
15 | SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e" | ||
16 | SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" | ||
17 | |||
18 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-irc/znc/znc/0001-Fix-NULL-pointer-dereference-in-webadmin.patch b/meta-networking/recipes-irc/znc/znc/0001-Fix-NULL-pointer-dereference-in-webadmin.patch new file mode 100644 index 000000000..68e441470 --- /dev/null +++ b/meta-networking/recipes-irc/znc/znc/0001-Fix-NULL-pointer-dereference-in-webadmin.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Subject: [PATCH] Fix NULL pointer dereference in webadmin. | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | commit 2bd410ee5570cea127233f1133ea22f25174eb28 upstream | ||
6 | |||
7 | Triggerable by any non-admin, if webadmin is loaded. | ||
8 | |||
9 | The only affected version is 1.0 | ||
10 | |||
11 | Thanks to ChauffeR (Simone Esposito) for reporting this. | ||
12 | --- | ||
13 | modules/webadmin.cpp | 8 ++++---- | ||
14 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
15 | |||
16 | diff --git a/modules/webadmin.cpp b/modules/webadmin.cpp | ||
17 | index b793c02..816f217 100644 | ||
18 | --- a/modules/webadmin.cpp | ||
19 | +++ b/modules/webadmin.cpp | ||
20 | @@ -419,7 +419,7 @@ public: | ||
21 | CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock); | ||
22 | |||
23 | // Admin||Self Check | ||
24 | - if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) { | ||
25 | + if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) { | ||
26 | return false; | ||
27 | } | ||
28 | |||
29 | @@ -448,7 +448,7 @@ public: | ||
30 | CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock); | ||
31 | |||
32 | // Admin||Self Check | ||
33 | - if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) { | ||
34 | + if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) { | ||
35 | return false; | ||
36 | } | ||
37 | |||
38 | @@ -472,7 +472,7 @@ public: | ||
39 | CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock); | ||
40 | |||
41 | // Admin||Self Check | ||
42 | - if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) { | ||
43 | + if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) { | ||
44 | return false; | ||
45 | } | ||
46 | |||
47 | @@ -486,7 +486,7 @@ public: | ||
48 | CIRCNetwork* pNetwork = SafeGetNetworkFromParam(WebSock); | ||
49 | |||
50 | // Admin||Self Check | ||
51 | - if (!spSession->IsAdmin() && (!spSession->GetUser() || spSession->GetUser() != pNetwork->GetUser())) { | ||
52 | + if (!spSession->IsAdmin() && (!spSession->GetUser() || !pNetwork || spSession->GetUser() != pNetwork->GetUser())) { | ||
53 | return false; | ||
54 | } | ||
55 | |||
56 | -- | ||
57 | 1.8.5.2.233.g932f7e4 | ||
58 | |||
diff --git a/meta-networking/recipes-irc/znc/znc_git.bb b/meta-networking/recipes-irc/znc/znc_git.bb new file mode 100644 index 000000000..77db25b33 --- /dev/null +++ b/meta-networking/recipes-irc/znc/znc_git.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | SUMMARY = "ZNC, an advanced IRC bouncer" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" | ||
4 | |||
5 | DEPENDS = "openssl" | ||
6 | |||
7 | PV = "1.0+git" | ||
8 | |||
9 | SRCREV = "ef59c23068547c132cb678092fba9a21317fd5f2" | ||
10 | SRC_URI = "git://github.com/znc/znc.git \ | ||
11 | file://0001-Fix-NULL-pointer-dereference-in-webadmin.patch \ | ||
12 | " | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | inherit autotools-brokensep pkgconfig | ||
17 | |||
18 | # ZNC has a custom autogen.sh that states that this command is needed *and* expected to fail | ||
19 | do_configure_prepend() { | ||
20 | automake --add-missing || true | ||
21 | } | ||
diff --git a/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb b/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb new file mode 100644 index 000000000..526818c05 --- /dev/null +++ b/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | SUMMARY = "ACCEL-PPP is a high performance VPN server application for linux" | ||
2 | HOMEPAGE = "http://sourceforge.net/apps/trac/accel-ppp/wiki" | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" | ||
6 | |||
7 | DEPENDS = "openssl libpcre" | ||
8 | |||
9 | inherit cmake | ||
10 | |||
11 | PR = "r1" | ||
12 | PV = "1.7.3+git" | ||
13 | |||
14 | SRCREV = "4acfa46c321a344b9a6ce4128e72d1e02828d8a0" | ||
15 | SRC_URI = "git://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp;branch=1.7" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | EXTRA_OECMAKE = " \ | ||
20 | -DBUILD_DRIVER=FALSE \ | ||
21 | -DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
22 | -DCMAKE_BUILD_TYPE=Release \ | ||
23 | -DLOG_PGSQL=FALSE \ | ||
24 | -DRADIUS=FALSE \ | ||
25 | -DNETSNMP=FALSE \ | ||
26 | " | ||
27 | FILES_${PN}-dbg += "/usr/lib/${BPN}/.debug/*" | ||
28 | |||
29 | PACKAGES =+ "${PN}-libs" | ||
30 | FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so" | ||
31 | INSANE_SKIP_${PN}-libs = "dev-so" | ||
32 | RDEPENDS_${PN} += "${PN}-libs" | ||
33 | |||
34 | do_install_prepend() { | ||
35 | cmlist=`find ${S} -name CMakeLists.txt` | ||
36 | for file in $cmlist; do | ||
37 | sed -i -e "s:LIBRARY DESTINATION lib/accel-ppp:LIBRARY DESTINATION ${baselib}/accel-ppp:g" \ | ||
38 | -e "s:\${CMAKE_INSTALL_PREFIX}/lib/accel-ppp:\${CMAKE_INSTALL_PREFIX}/${baselib}/accel-ppp:g" \ | ||
39 | $cmlist | ||
40 | done | ||
41 | } | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch b/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch new file mode 100644 index 000000000..859c52c3e --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Signed-off-by: Jack Mitchell <jack@embed.me.uk> | ||
2 | Upstream-Status: Pending | ||
3 | Bug-Report: http://sourceforge.net/p/net-snmp/bugs/2449/ | ||
4 | |||
5 | diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
6 | index 3419811..d6eb91a 100644 | ||
7 | --- a/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
8 | +++ b/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
9 | @@ -18,7 +18,31 @@ netsnmp_feature_require(interface_ioctl_flags_set) | ||
10 | |||
11 | #ifdef HAVE_PCI_LOOKUP_NAME | ||
12 | #include <pci/pci.h> | ||
13 | +#include <setjmp.h> | ||
14 | static struct pci_access *pci_access; | ||
15 | + | ||
16 | +/* Avoid letting libpci call exit(1) when no PCI bus is available. */ | ||
17 | +static int do_longjmp =0; | ||
18 | +static jmp_buf err_buf; | ||
19 | +static void | ||
20 | +netsnmp_pci_error(char *msg, ...) | ||
21 | +{ | ||
22 | + va_list args; | ||
23 | + char *buf; | ||
24 | + int buflen; | ||
25 | + | ||
26 | + va_start(args, msg); | ||
27 | + buflen = strlen("pcilib: ")+strlen(msg)+2; | ||
28 | + buf = malloc(buflen); | ||
29 | + snprintf(buf, buflen, "pcilib: %s\n", msg); | ||
30 | + snmp_vlog(LOG_ERR, buf, args); | ||
31 | + free(buf); | ||
32 | + va_end(args); | ||
33 | + if (do_longjmp) | ||
34 | + longjmp(err_buf, 1); | ||
35 | + else | ||
36 | + exit(1); | ||
37 | +} | ||
38 | #endif | ||
39 | |||
40 | #ifdef HAVE_LINUX_ETHTOOL_H | ||
41 | @@ -147,10 +171,22 @@ netsnmp_arch_interface_init(void) | ||
42 | |||
43 | #ifdef HAVE_PCI_LOOKUP_NAME | ||
44 | pci_access = pci_alloc(); | ||
45 | - if (pci_access) | ||
46 | + if (!pci_access) { | ||
47 | + snmp_log(LOG_ERR, "pcilib: pci_alloc failed\n"); | ||
48 | + return; | ||
49 | + } | ||
50 | + | ||
51 | + pci_access->error = netsnmp_pci_error; | ||
52 | + | ||
53 | + do_longjmp = 1; | ||
54 | + if (setjmp(err_buf)) { | ||
55 | + pci_cleanup(pci_access); | ||
56 | + snmp_log(LOG_ERR, "pcilib: pci_init failed\n"); | ||
57 | + pci_access = NULL; | ||
58 | + } | ||
59 | + else if (pci_access) | ||
60 | pci_init(pci_access); | ||
61 | - else | ||
62 | - snmp_log(LOG_ERR, "Unable to create pci access method\n"); | ||
63 | + do_longjmp = 0; | ||
64 | #endif | ||
65 | } | ||
66 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/init b/meta-networking/recipes-protocols/net-snmp/files/init new file mode 100755 index 000000000..434b2fa3f --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/init | |||
@@ -0,0 +1,63 @@ | |||
1 | #! /bin/sh | ||
2 | # /etc/init.d/snmpd: start snmp daemon. | ||
3 | |||
4 | test -x /usr/sbin/snmpd || exit 0 | ||
5 | test -x /usr/sbin/snmptrapd || exit 0 | ||
6 | |||
7 | # Defaults | ||
8 | export MIBDIRS=/usr/share/snmp/mibs | ||
9 | SNMPDRUN=yes | ||
10 | SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid' | ||
11 | TRAPDRUN=no | ||
12 | TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid' | ||
13 | |||
14 | # Cd to / before starting any daemons. | ||
15 | cd / | ||
16 | |||
17 | case "$1" in | ||
18 | start) | ||
19 | echo -n "Starting network management services:" | ||
20 | if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then | ||
21 | start-stop-daemon -S -x /usr/sbin/snmpd \ | ||
22 | -- $SNMPDOPTS | ||
23 | echo -n " snmpd" | ||
24 | fi | ||
25 | if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then | ||
26 | start-stop-daemon -S -x /usr/sbin/snmptrapd \ | ||
27 | -- $TRAPDOPTS | ||
28 | echo -n " snmptrapd" | ||
29 | fi | ||
30 | echo "." | ||
31 | ;; | ||
32 | stop) | ||
33 | echo -n "Stopping network management services:" | ||
34 | start-stop-daemon -K -x /usr/sbin/snmpd | ||
35 | echo -n " snmpd" | ||
36 | start-stop-daemon -K -x /usr/sbin/snmptrapd | ||
37 | echo -n " snmptrapd" | ||
38 | echo "." | ||
39 | ;; | ||
40 | restart|reload|force-reload) | ||
41 | echo -n "Restarting network management services:" | ||
42 | start-stop-daemon -K -x /usr/sbin/snmpd | ||
43 | start-stop-daemon -K -x /usr/sbin/snmptrapd | ||
44 | # Allow the daemons time to exit completely. | ||
45 | sleep 2 | ||
46 | if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then | ||
47 | start-stop-daemon -S -x /usr/sbin/snmpd -- $SNMPDOPTS | ||
48 | echo -n " snmpd" | ||
49 | fi | ||
50 | if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then | ||
51 | # Allow snmpd time to start up. | ||
52 | sleep 1 | ||
53 | start-stop-daemon -S -x /usr/sbin/snmptrapd -- $TRAPDOPTS | ||
54 | echo -n " snmptrapd" | ||
55 | fi | ||
56 | echo "." | ||
57 | ;; | ||
58 | *) | ||
59 | echo "Usage: /etc/init.d/snmpd {start|stop|restart|reload|force-reload}" | ||
60 | exit 1 | ||
61 | esac | ||
62 | |||
63 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf b/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf new file mode 100644 index 000000000..728171c42 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf | |||
@@ -0,0 +1,422 @@ | |||
1 | ############################################################################### | ||
2 | # | ||
3 | # EXAMPLE.conf: | ||
4 | # An example configuration file for configuring the ucd-snmp snmpd agent. | ||
5 | # | ||
6 | ############################################################################### | ||
7 | # | ||
8 | # This file is intended to only be an example. If, however, you want | ||
9 | # to use it, it should be placed in /etc/snmp/snmpd.conf. | ||
10 | # When the snmpd agent starts up, this is where it will look for it. | ||
11 | # | ||
12 | # You might be interested in generating your own snmpd.conf file using | ||
13 | # the "snmpconf" program (perl script) instead. It's a nice menu | ||
14 | # based interface to writing well commented configuration files. Try it! | ||
15 | # | ||
16 | # Note: This file is automatically generated from EXAMPLE.conf.def. | ||
17 | # Do NOT read the EXAMPLE.conf.def file! Instead, after you have run | ||
18 | # configure & make, and then make sure you read the EXAMPLE.conf file | ||
19 | # instead, as it will tailor itself to your configuration. | ||
20 | |||
21 | # All lines beginning with a '#' are comments and are intended for you | ||
22 | # to read. All other lines are configuration commands for the agent. | ||
23 | |||
24 | # | ||
25 | # PLEASE: read the snmpd.conf(5) manual page as well! | ||
26 | # | ||
27 | |||
28 | |||
29 | ############################################################################### | ||
30 | # Access Control | ||
31 | ############################################################################### | ||
32 | |||
33 | # YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY | ||
34 | # KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO | ||
35 | # SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE. | ||
36 | |||
37 | # By far, the most common question I get about the agent is "why won't | ||
38 | # it work?", when really it should be "how do I configure the agent to | ||
39 | # allow me to access it?" | ||
40 | # | ||
41 | # By default, the agent responds to the "public" community for read | ||
42 | # only access, if run out of the box without any configuration file in | ||
43 | # place. The following examples show you other ways of configuring | ||
44 | # the agent so that you can change the community names, and give | ||
45 | # yourself write access as well. | ||
46 | # | ||
47 | # The following lines change the access permissions of the agent so | ||
48 | # that the COMMUNITY string provides read-only access to your entire | ||
49 | # NETWORK (EG: 10.10.10.0/24), and read/write access to only the | ||
50 | # localhost (127.0.0.1, not its real ipaddress). | ||
51 | # | ||
52 | # For more information, read the FAQ as well as the snmpd.conf(5) | ||
53 | # manual page. | ||
54 | |||
55 | #### | ||
56 | # First, map the community name (COMMUNITY) into a security name | ||
57 | # (local and mynetwork, depending on where the request is coming | ||
58 | # from): | ||
59 | |||
60 | # sec.name source community | ||
61 | com2sec paranoid default public | ||
62 | #com2sec readonly default public | ||
63 | #com2sec readwrite default private | ||
64 | |||
65 | #### | ||
66 | # Second, map the security names into group names: | ||
67 | |||
68 | # sec.model sec.name | ||
69 | group MyROSystem v1 paranoid | ||
70 | group MyROSystem v2c paranoid | ||
71 | group MyROSystem usm paranoid | ||
72 | group MyROGroup v1 readonly | ||
73 | group MyROGroup v2c readonly | ||
74 | group MyROGroup usm readonly | ||
75 | group MyRWGroup v1 readwrite | ||
76 | group MyRWGroup v2c readwrite | ||
77 | group MyRWGroup usm readwrite | ||
78 | |||
79 | #### | ||
80 | # Third, create a view for us to let the groups have rights to: | ||
81 | |||
82 | # incl/excl subtree mask | ||
83 | view all included .1 80 | ||
84 | view system included .iso.org.dod.internet.mgmt.mib-2.system | ||
85 | |||
86 | #### | ||
87 | # Finally, grant the 2 groups access to the 1 view with different | ||
88 | # write permissions: | ||
89 | |||
90 | # context sec.model sec.level match read write notif | ||
91 | access MyROSystem "" any noauth exact system none none | ||
92 | access MyROGroup "" any noauth exact all none none | ||
93 | access MyRWGroup "" any noauth exact all all none | ||
94 | |||
95 | # ----------------------------------------------------------------------------- | ||
96 | |||
97 | |||
98 | ############################################################################### | ||
99 | # System contact information | ||
100 | # | ||
101 | |||
102 | # It is also possible to set the sysContact and sysLocation system | ||
103 | # variables through the snmpd.conf file. **PLEASE NOTE** that setting | ||
104 | # the value of these objects here makes these objects READ-ONLY | ||
105 | # (regardless of any access control settings). Any attempt to set the | ||
106 | # value of an object whose value is given here will fail with an error | ||
107 | # status of notWritable. | ||
108 | |||
109 | syslocation Unknown (configure /etc/snmp/snmpd.local.conf) | ||
110 | syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf) | ||
111 | |||
112 | # Example output of snmpwalk: | ||
113 | # % snmpwalk -v 1 -c public localhost system | ||
114 | # system.sysDescr.0 = "SunOS name sun4c" | ||
115 | # system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4 | ||
116 | # system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55 | ||
117 | # system.sysContact.0 = "Me <me@somewhere.org>" | ||
118 | # system.sysName.0 = "name" | ||
119 | # system.sysLocation.0 = "Right here, right now." | ||
120 | # system.sysServices.0 = 72 | ||
121 | |||
122 | |||
123 | # ----------------------------------------------------------------------------- | ||
124 | |||
125 | |||
126 | ############################################################################### | ||
127 | # Process checks. | ||
128 | # | ||
129 | # The following are examples of how to use the agent to check for | ||
130 | # processes running on the host. The syntax looks something like: | ||
131 | # | ||
132 | # proc NAME [MAX=0] [MIN=0] | ||
133 | # | ||
134 | # NAME: the name of the process to check for. It must match | ||
135 | # exactly (ie, http will not find httpd processes). | ||
136 | # MAX: the maximum number allowed to be running. Defaults to 0. | ||
137 | # MIN: the minimum number to be running. Defaults to 0. | ||
138 | |||
139 | # | ||
140 | # Examples: | ||
141 | # | ||
142 | |||
143 | # Make sure mountd is running | ||
144 | #proc mountd | ||
145 | |||
146 | # Make sure there are no more than 4 ntalkds running, but 0 is ok too. | ||
147 | #proc ntalkd 4 | ||
148 | |||
149 | # Make sure at least one sendmail, but less than or equal to 10 are running. | ||
150 | #proc sendmail 10 1 | ||
151 | |||
152 | # A snmpwalk of the prTable would look something like this: | ||
153 | # | ||
154 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2 | ||
155 | # enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1 | ||
156 | # enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2 | ||
157 | # enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3 | ||
158 | # enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd" | ||
159 | # enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd" | ||
160 | # enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail" | ||
161 | # enterprises.ucdavis.procTable.prEntry.prMin.1 = 0 | ||
162 | # enterprises.ucdavis.procTable.prEntry.prMin.2 = 0 | ||
163 | # enterprises.ucdavis.procTable.prEntry.prMin.3 = 1 | ||
164 | # enterprises.ucdavis.procTable.prEntry.prMax.1 = 0 | ||
165 | # enterprises.ucdavis.procTable.prEntry.prMax.2 = 4 | ||
166 | # enterprises.ucdavis.procTable.prEntry.prMax.3 = 10 | ||
167 | # enterprises.ucdavis.procTable.prEntry.prCount.1 = 0 | ||
168 | # enterprises.ucdavis.procTable.prEntry.prCount.2 = 0 | ||
169 | # enterprises.ucdavis.procTable.prEntry.prCount.3 = 1 | ||
170 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1 | ||
171 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0 | ||
172 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0 | ||
173 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running." | ||
174 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = "" | ||
175 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = "" | ||
176 | # enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0 | ||
177 | # enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0 | ||
178 | # enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0 | ||
179 | # | ||
180 | # Note that the errorFlag for mountd is set to 1 because one is not | ||
181 | # running (in this case an rpc.mountd is, but thats not good enough), | ||
182 | # and the ErrMessage tells you what's wrong. The configuration | ||
183 | # imposed in the snmpd.conf file is also shown. | ||
184 | # | ||
185 | # Special Case: When the min and max numbers are both 0, it assumes | ||
186 | # you want a max of infinity and a min of 1. | ||
187 | # | ||
188 | |||
189 | |||
190 | # ----------------------------------------------------------------------------- | ||
191 | |||
192 | |||
193 | ############################################################################### | ||
194 | # Executables/scripts | ||
195 | # | ||
196 | |||
197 | # | ||
198 | # You can also have programs run by the agent that return a single | ||
199 | # line of output and an exit code. Here are two examples. | ||
200 | # | ||
201 | # exec NAME PROGRAM [ARGS ...] | ||
202 | # | ||
203 | # NAME: A generic name. | ||
204 | # PROGRAM: The program to run. Include the path! | ||
205 | # ARGS: optional arguments to be passed to the program | ||
206 | |||
207 | # a simple hello world | ||
208 | #exec echotest /bin/echo hello world | ||
209 | |||
210 | # Run a shell script containing: | ||
211 | # | ||
212 | # #!/bin/sh | ||
213 | # echo hello world | ||
214 | # echo hi there | ||
215 | # exit 35 | ||
216 | # | ||
217 | # Note: this has been specifically commented out to prevent | ||
218 | # accidental security holes due to someone else on your system writing | ||
219 | # a /tmp/shtest before you do. Uncomment to use it. | ||
220 | # | ||
221 | #exec shelltest /bin/sh /tmp/shtest | ||
222 | |||
223 | # Then, | ||
224 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8 | ||
225 | # enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1 | ||
226 | # enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2 | ||
227 | # enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest" | ||
228 | # enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest" | ||
229 | # enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world" | ||
230 | # enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest" | ||
231 | # enterprises.ucdavis.extTable.extEntry.extResult.1 = 0 | ||
232 | # enterprises.ucdavis.extTable.extEntry.extResult.2 = 35 | ||
233 | # enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world." | ||
234 | # enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world." | ||
235 | # enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0 | ||
236 | # enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0 | ||
237 | |||
238 | # Note that the second line of the /tmp/shtest shell script is cut | ||
239 | # off. Also note that the exit status of 35 was returned. | ||
240 | |||
241 | # ----------------------------------------------------------------------------- | ||
242 | |||
243 | |||
244 | ############################################################################### | ||
245 | # disk checks | ||
246 | # | ||
247 | |||
248 | # The agent can check the amount of available disk space, and make | ||
249 | # sure it is above a set limit. | ||
250 | |||
251 | # disk PATH [MIN=DEFDISKMINIMUMSPACE] | ||
252 | # | ||
253 | # PATH: mount path to the disk in question. | ||
254 | # MIN: Disks with space below this value will have the Mib's errorFlag set. | ||
255 | # Default value = DEFDISKMINIMUMSPACE. | ||
256 | |||
257 | # Check the / partition and make sure it contains at least 10 megs. | ||
258 | |||
259 | #disk / 10000 | ||
260 | |||
261 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9 | ||
262 | # enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0 | ||
263 | # enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F | ||
264 | # enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0" | ||
265 | # enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000 | ||
266 | # enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130 | ||
267 | # enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325 | ||
268 | # enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092 | ||
269 | # enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58 | ||
270 | # enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0 | ||
271 | # enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = "" | ||
272 | |||
273 | # ----------------------------------------------------------------------------- | ||
274 | |||
275 | |||
276 | ############################################################################### | ||
277 | # load average checks | ||
278 | # | ||
279 | |||
280 | # load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE] | ||
281 | # | ||
282 | # 1MAX: If the 1 minute load average is above this limit at query | ||
283 | # time, the errorFlag will be set. | ||
284 | # 5MAX: Similar, but for 5 min average. | ||
285 | # 15MAX: Similar, but for 15 min average. | ||
286 | |||
287 | # Check for loads: | ||
288 | #load 12 14 14 | ||
289 | |||
290 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10 | ||
291 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1 | ||
292 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2 | ||
293 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3 | ||
294 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1" | ||
295 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5" | ||
296 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15" | ||
297 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39 | ||
298 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31 | ||
299 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36 | ||
300 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00" | ||
301 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00" | ||
302 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00" | ||
303 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0 | ||
304 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0 | ||
305 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0 | ||
306 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = "" | ||
307 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = "" | ||
308 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = "" | ||
309 | |||
310 | # ----------------------------------------------------------------------------- | ||
311 | |||
312 | |||
313 | ############################################################################### | ||
314 | # Extensible sections. | ||
315 | # | ||
316 | |||
317 | # This alleviates the multiple line output problem found in the | ||
318 | # previous executable mib by placing each mib in its own mib table: | ||
319 | |||
320 | # Run a shell script containing: | ||
321 | # | ||
322 | # #!/bin/sh | ||
323 | # echo hello world | ||
324 | # echo hi there | ||
325 | # exit 35 | ||
326 | # | ||
327 | # Note: this has been specifically commented out to prevent | ||
328 | # accidental security holes due to someone else on your system writing | ||
329 | # a /tmp/shtest before you do. Uncomment to use it. | ||
330 | # | ||
331 | # exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest | ||
332 | |||
333 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50 | ||
334 | # enterprises.ucdavis.50.1.1 = 1 | ||
335 | # enterprises.ucdavis.50.2.1 = "shelltest" | ||
336 | # enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest" | ||
337 | # enterprises.ucdavis.50.100.1 = 35 | ||
338 | # enterprises.ucdavis.50.101.1 = "hello world." | ||
339 | # enterprises.ucdavis.50.101.2 = "hi there." | ||
340 | # enterprises.ucdavis.50.102.1 = 0 | ||
341 | |||
342 | # Now the Output has grown to two lines, and we can see the 'hi | ||
343 | # there.' output as the second line from our shell script. | ||
344 | # | ||
345 | # Note that you must alter the mib.txt file to be correct if you want | ||
346 | # the .50.* outputs above to change to reasonable text descriptions. | ||
347 | |||
348 | # Other ideas: | ||
349 | # | ||
350 | # exec .1.3.6.1.4.1.2021.51 ps /bin/ps | ||
351 | # exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top | ||
352 | # exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq | ||
353 | |||
354 | # ----------------------------------------------------------------------------- | ||
355 | |||
356 | |||
357 | ############################################################################### | ||
358 | # Pass through control. | ||
359 | # | ||
360 | |||
361 | # Usage: | ||
362 | # pass MIBOID EXEC-COMMAND | ||
363 | # | ||
364 | # This will pass total control of the mib underneath the MIBOID | ||
365 | # portion of the mib to the EXEC-COMMAND. | ||
366 | # | ||
367 | # Note: You'll have to change the path of the passtest script to your | ||
368 | # source directory or install it in the given location. | ||
369 | # | ||
370 | # Example: (see the script for details) | ||
371 | # (commented out here since it requires that you place the | ||
372 | # script in the right location. (its not installed by default)) | ||
373 | |||
374 | # pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/passtest | ||
375 | |||
376 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255 | ||
377 | # enterprises.ucdavis.255.1 = "life the universe and everything" | ||
378 | # enterprises.ucdavis.255.2.1 = 42 | ||
379 | # enterprises.ucdavis.255.2.2 = OID: 42.42.42 | ||
380 | # enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42 | ||
381 | # enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1 | ||
382 | # enterprises.ucdavis.255.5 = 42 | ||
383 | # enterprises.ucdavis.255.6 = Gauge: 42 | ||
384 | # | ||
385 | # % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5 | ||
386 | # enterprises.ucdavis.255.5 = 42 | ||
387 | # | ||
388 | # % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string" | ||
389 | # enterprises.ucdavis.255.1 = "New string" | ||
390 | # | ||
391 | |||
392 | # For specific usage information, see the man/snmpd.conf.5 manual page | ||
393 | # as well as the local/passtest script used in the above example. | ||
394 | |||
395 | ############################################################################### | ||
396 | # Subagent control | ||
397 | # | ||
398 | |||
399 | # The agent can support subagents using a number of extension mechanisms. | ||
400 | # From the 4.2.1 release, AgentX support is being compiled in by default. | ||
401 | # However, this is still experimental code, so should not be used on | ||
402 | # critical production systems. | ||
403 | # Please see the file README.agentx for more details. | ||
404 | # | ||
405 | # If having read, marked, learnt and inwardly digested this information, | ||
406 | # you decide that you do wish to make use of this mechanism, simply | ||
407 | # uncomment the following directive. | ||
408 | # | ||
409 | # master agentx | ||
410 | # | ||
411 | # I repeat - this is *NOT* regarded as suitable for front-line production | ||
412 | # systems, though it is probably stable enough for day-to-day use. | ||
413 | # Probably. | ||
414 | # | ||
415 | # No refunds will be given. | ||
416 | |||
417 | ############################################################################### | ||
418 | # Further Information | ||
419 | # | ||
420 | # See the snmpd.conf manual page, and the output of "snmpd -H". | ||
421 | # MUCH more can be done with the snmpd.conf than is shown as an | ||
422 | # example here. | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf b/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf new file mode 100644 index 000000000..8d2e4375e --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf | |||
@@ -0,0 +1,18 @@ | |||
1 | ############################################################################### | ||
2 | # | ||
3 | # EXAMPLE.conf: | ||
4 | # An example configuration file for configuring the ucd-snmp snmptrapd agent. | ||
5 | # | ||
6 | ############################################################################### | ||
7 | # | ||
8 | # This file is intended to only be an example. If, however, you want | ||
9 | # to use it, it should be placed in /etc/snmp/snmptrapd.conf. | ||
10 | # When the snmptrapd agent starts up, this is where it will look for it. | ||
11 | # | ||
12 | # All lines beginning with a '#' are comments and are intended for you | ||
13 | # to read. All other lines are configuration commands for the agent. | ||
14 | |||
15 | # | ||
16 | # PLEASE: read the snmptrapd.conf(5) manual page as well! | ||
17 | # | ||
18 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Added-checks-for-printing-variables-with-wrong-types.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Added-checks-for-printing-variables-with-wrong-types.patch new file mode 100644 index 000000000..30374cfe9 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Added-checks-for-printing-variables-with-wrong-types.patch | |||
@@ -0,0 +1,455 @@ | |||
1 | From 7f4a7b891332899cea26e95be0337aae01648742 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jan Safranek <jsafranek@users.sourceforge.net> | ||
3 | Date: Thu, 31 Jul 2014 13:46:49 +0200 | ||
4 | Subject: [PATCH] Added checks for printing variables with wrong types. | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | When -OQ command line argument is used, variable formatter preffers the type | ||
9 | of the varible parsed from a MIB file instead of checking type of the variable | ||
10 | as parsed from SNMP message. | ||
11 | |||
12 | This can lead to crashes when incoming packets contains a variable with | ||
13 | NULL type, while the MIB says the variable should be non-NULL, like Integer. | ||
14 | The formatter then tries to interpret the NULL (from packet) as Integer (from | ||
15 | MIB file). | ||
16 | |||
17 | Signed-off-by: Jan Safranek <jsafranek@users.sourceforge.net> | ||
18 | --- | ||
19 | snmplib/mib.c | 270 ++++++++++++++++++++++++++++----------------------------- | ||
20 | 1 file changed, 135 insertions(+), 135 deletions(-) | ||
21 | |||
22 | diff --git a/snmplib/mib.c b/snmplib/mib.c | ||
23 | index 9d3ca41..c6e0010 100644 | ||
24 | --- a/snmplib/mib.c | ||
25 | +++ b/snmplib/mib.c | ||
26 | @@ -439,17 +439,16 @@ sprint_realloc_octet_string(u_char ** buf, size_t * buf_len, | ||
27 | u_char *cp; | ||
28 | int output_format, cnt; | ||
29 | |||
30 | - if ((var->type != ASN_OCTET_STR) && | ||
31 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
32 | - const char str[] = "Wrong Type (should be OCTET STRING): "; | ||
33 | - if (snmp_cstrcat | ||
34 | - (buf, buf_len, out_len, allow_realloc, str)) { | ||
35 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
36 | + if (var->type != ASN_OCTET_STR) { | ||
37 | + if (!netsnmp_ds_get_boolean( | ||
38 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
39 | + const char str[] = "Wrong Type (should be OCTET STRING): "; | ||
40 | + if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str)) | ||
41 | + return 0; | ||
42 | + } | ||
43 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
44 | allow_realloc, var, NULL, NULL, | ||
45 | NULL); | ||
46 | - } else { | ||
47 | - return 0; | ||
48 | - } | ||
49 | } | ||
50 | |||
51 | |||
52 | @@ -702,16 +701,16 @@ sprint_realloc_float(u_char ** buf, size_t * buf_len, | ||
53 | const struct enum_list *enums, | ||
54 | const char *hint, const char *units) | ||
55 | { | ||
56 | - if ((var->type != ASN_OPAQUE_FLOAT) && | ||
57 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
58 | - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, | ||
59 | - "Wrong Type (should be Float): ")) { | ||
60 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
61 | + if (var->type != ASN_OPAQUE_FLOAT) { | ||
62 | + if (!netsnmp_ds_get_boolean( | ||
63 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
64 | + u_char str[] = "Wrong Type (should be Float): "; | ||
65 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
66 | + return 0; | ||
67 | + } | ||
68 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
69 | allow_realloc, var, NULL, NULL, | ||
70 | NULL); | ||
71 | - } else { | ||
72 | - return 0; | ||
73 | - } | ||
74 | } | ||
75 | |||
76 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
77 | @@ -772,17 +771,16 @@ sprint_realloc_double(u_char ** buf, size_t * buf_len, | ||
78 | const struct enum_list *enums, | ||
79 | const char *hint, const char *units) | ||
80 | { | ||
81 | - if ((var->type != ASN_OPAQUE_DOUBLE) && | ||
82 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
83 | - if (snmp_cstrcat | ||
84 | - (buf, buf_len, out_len, allow_realloc, | ||
85 | - "Wrong Type (should be Double): ")) { | ||
86 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
87 | + if (var->type != ASN_OPAQUE_DOUBLE) { | ||
88 | + if (!netsnmp_ds_get_boolean( | ||
89 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
90 | + u_char str[] = "Wrong Type (should be Double): "; | ||
91 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
92 | + return 0; | ||
93 | + } | ||
94 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
95 | allow_realloc, var, NULL, NULL, | ||
96 | NULL); | ||
97 | - } else { | ||
98 | - return 0; | ||
99 | - } | ||
100 | } | ||
101 | |||
102 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
103 | @@ -847,20 +845,21 @@ sprint_realloc_counter64(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
104 | { | ||
105 | char a64buf[I64CHARSZ + 1]; | ||
106 | |||
107 | - if ((var->type != ASN_COUNTER64 | ||
108 | + if (var->type != ASN_COUNTER64 | ||
109 | #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES | ||
110 | && var->type != ASN_OPAQUE_COUNTER64 | ||
111 | && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64 | ||
112 | #endif | ||
113 | - ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
114 | - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, | ||
115 | - "Wrong Type (should be Counter64): ")) { | ||
116 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
117 | + ) { | ||
118 | + if (!netsnmp_ds_get_boolean( | ||
119 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
120 | + u_char str[] = "Wrong Type (should be Counter64): "; | ||
121 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
122 | + return 0; | ||
123 | + } | ||
124 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
125 | allow_realloc, var, NULL, NULL, | ||
126 | NULL); | ||
127 | - } else { | ||
128 | - return 0; | ||
129 | - } | ||
130 | } | ||
131 | |||
132 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
133 | @@ -948,23 +947,25 @@ sprint_realloc_opaque(u_char ** buf, size_t * buf_len, | ||
134 | const struct enum_list *enums, | ||
135 | const char *hint, const char *units) | ||
136 | { | ||
137 | - if ((var->type != ASN_OPAQUE | ||
138 | + if (var->type != ASN_OPAQUE | ||
139 | #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES | ||
140 | && var->type != ASN_OPAQUE_COUNTER64 | ||
141 | && var->type != ASN_OPAQUE_U64 | ||
142 | && var->type != ASN_OPAQUE_I64 | ||
143 | && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE | ||
144 | #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ | ||
145 | - ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
146 | - if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, | ||
147 | - "Wrong Type (should be Opaque): ")) { | ||
148 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
149 | + ) { | ||
150 | + if (!netsnmp_ds_get_boolean( | ||
151 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
152 | + u_char str[] = "Wrong Type (should be Opaque): "; | ||
153 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
154 | + return 0; | ||
155 | + } | ||
156 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
157 | allow_realloc, var, NULL, NULL, | ||
158 | NULL); | ||
159 | - } else { | ||
160 | - return 0; | ||
161 | - } | ||
162 | } | ||
163 | + | ||
164 | #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES | ||
165 | switch (var->type) { | ||
166 | case ASN_OPAQUE_COUNTER64: | ||
167 | @@ -1040,17 +1041,16 @@ sprint_realloc_object_identifier(u_char ** buf, size_t * buf_len, | ||
168 | { | ||
169 | int buf_overflow = 0; | ||
170 | |||
171 | - if ((var->type != ASN_OBJECT_ID) && | ||
172 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
173 | - u_char str[] = | ||
174 | - "Wrong Type (should be OBJECT IDENTIFIER): "; | ||
175 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
176 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
177 | + if (var->type != ASN_OBJECT_ID) { | ||
178 | + if (!netsnmp_ds_get_boolean( | ||
179 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
180 | + u_char str[] = "Wrong Type (should be OBJECT IDENTIFIER): "; | ||
181 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
182 | + return 0; | ||
183 | + } | ||
184 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
185 | allow_realloc, var, NULL, NULL, | ||
186 | NULL); | ||
187 | - } else { | ||
188 | - return 0; | ||
189 | - } | ||
190 | } | ||
191 | |||
192 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
193 | @@ -1110,16 +1110,16 @@ sprint_realloc_timeticks(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
194 | { | ||
195 | char timebuf[40]; | ||
196 | |||
197 | - if ((var->type != ASN_TIMETICKS) && | ||
198 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
199 | - u_char str[] = "Wrong Type (should be Timeticks): "; | ||
200 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
201 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
202 | + if (var->type != ASN_TIMETICKS) { | ||
203 | + if (!netsnmp_ds_get_boolean( | ||
204 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
205 | + u_char str[] = "Wrong Type (should be Timeticks): "; | ||
206 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
207 | + return 0; | ||
208 | + } | ||
209 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
210 | allow_realloc, var, NULL, NULL, | ||
211 | NULL); | ||
212 | - } else { | ||
213 | - return 0; | ||
214 | - } | ||
215 | } | ||
216 | |||
217 | if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) { | ||
218 | @@ -1277,17 +1277,18 @@ sprint_realloc_integer(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
219 | { | ||
220 | char *enum_string = NULL; | ||
221 | |||
222 | - if ((var->type != ASN_INTEGER) && | ||
223 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
224 | - u_char str[] = "Wrong Type (should be INTEGER): "; | ||
225 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
226 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
227 | + if (var->type != ASN_INTEGER) { | ||
228 | + if (!netsnmp_ds_get_boolean( | ||
229 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
230 | + u_char str[] = "Wrong Type (should be INTEGER): "; | ||
231 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
232 | + return 0; | ||
233 | + } | ||
234 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
235 | allow_realloc, var, NULL, NULL, | ||
236 | NULL); | ||
237 | - } else { | ||
238 | - return 0; | ||
239 | - } | ||
240 | } | ||
241 | + | ||
242 | for (; enums; enums = enums->next) { | ||
243 | if (enums->value == *var->val.integer) { | ||
244 | enum_string = enums->label; | ||
245 | @@ -1380,16 +1381,16 @@ sprint_realloc_uinteger(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
246 | { | ||
247 | char *enum_string = NULL; | ||
248 | |||
249 | - if ((var->type != ASN_UINTEGER) && | ||
250 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
251 | - u_char str[] = "Wrong Type (should be UInteger32): "; | ||
252 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
253 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
254 | + if (var->type != ASN_UINTEGER) { | ||
255 | + if (!netsnmp_ds_get_boolean( | ||
256 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
257 | + u_char str[] = "Wrong Type (should be UInteger32): "; | ||
258 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
259 | + return 0; | ||
260 | + } | ||
261 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
262 | allow_realloc, var, NULL, NULL, | ||
263 | NULL); | ||
264 | - } else { | ||
265 | - return 0; | ||
266 | - } | ||
267 | } | ||
268 | |||
269 | for (; enums; enums = enums->next) { | ||
270 | @@ -1477,17 +1478,16 @@ sprint_realloc_gauge(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
271 | { | ||
272 | char tmp[32]; | ||
273 | |||
274 | - if ((var->type != ASN_GAUGE) && | ||
275 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
276 | - u_char str[] = | ||
277 | - "Wrong Type (should be Gauge32 or Unsigned32): "; | ||
278 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
279 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
280 | + if (var->type != ASN_GAUGE) { | ||
281 | + if (!netsnmp_ds_get_boolean( | ||
282 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
283 | + u_char str[] = "Wrong Type (should be Gauge32 or Unsigned32): "; | ||
284 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
285 | + return 0; | ||
286 | + } | ||
287 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
288 | allow_realloc, var, NULL, NULL, | ||
289 | NULL); | ||
290 | - } else { | ||
291 | - return 0; | ||
292 | - } | ||
293 | } | ||
294 | |||
295 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
296 | @@ -1550,16 +1550,16 @@ sprint_realloc_counter(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
297 | { | ||
298 | char tmp[32]; | ||
299 | |||
300 | - if ((var->type != ASN_COUNTER) && | ||
301 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
302 | - u_char str[] = "Wrong Type (should be Counter32): "; | ||
303 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
304 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
305 | + if (var->type != ASN_COUNTER) { | ||
306 | + if (!netsnmp_ds_get_boolean( | ||
307 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
308 | + u_char str[] = "Wrong Type (should be Counter32): "; | ||
309 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
310 | + return 0; | ||
311 | + } | ||
312 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
313 | allow_realloc, var, NULL, NULL, | ||
314 | NULL); | ||
315 | - } else { | ||
316 | - return 0; | ||
317 | - } | ||
318 | } | ||
319 | |||
320 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
321 | @@ -1613,16 +1613,16 @@ sprint_realloc_networkaddress(u_char ** buf, size_t * buf_len, | ||
322 | { | ||
323 | size_t i; | ||
324 | |||
325 | - if ((var->type != ASN_IPADDRESS) && | ||
326 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
327 | - u_char str[] = "Wrong Type (should be NetworkAddress): "; | ||
328 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
329 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
330 | + if (var->type != ASN_IPADDRESS) { | ||
331 | + if (!netsnmp_ds_get_boolean( | ||
332 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
333 | + u_char str[] = "Wrong Type (should be NetworkAddress): "; | ||
334 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
335 | + return 0; | ||
336 | + } | ||
337 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
338 | allow_realloc, var, NULL, NULL, | ||
339 | NULL); | ||
340 | - } else { | ||
341 | - return 0; | ||
342 | - } | ||
343 | } | ||
344 | |||
345 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
346 | @@ -1679,16 +1679,16 @@ sprint_realloc_ipaddress(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
347 | { | ||
348 | u_char *ip = var->val.string; | ||
349 | |||
350 | - if ((var->type != ASN_IPADDRESS) && | ||
351 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
352 | - u_char str[] = "Wrong Type (should be IpAddress): "; | ||
353 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
354 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
355 | + if (var->type != ASN_IPADDRESS) { | ||
356 | + if (!netsnmp_ds_get_boolean( | ||
357 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
358 | + u_char str[] = "Wrong Type (should be IpAddress): "; | ||
359 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
360 | + return 0; | ||
361 | + } | ||
362 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
363 | allow_realloc, var, NULL, NULL, | ||
364 | NULL); | ||
365 | - } else { | ||
366 | - return 0; | ||
367 | - } | ||
368 | } | ||
369 | |||
370 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
371 | @@ -1737,20 +1737,20 @@ sprint_realloc_null(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
372 | const struct enum_list *enums, | ||
373 | const char *hint, const char *units) | ||
374 | { | ||
375 | - if ((var->type != ASN_NULL) && | ||
376 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
377 | - u_char str[] = "Wrong Type (should be NULL): "; | ||
378 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
379 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
380 | + if (var->type != ASN_NULL) { | ||
381 | + if (!netsnmp_ds_get_boolean( | ||
382 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
383 | + u_char str[] = "Wrong Type (should be NULL): "; | ||
384 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
385 | + return 0; | ||
386 | + } | ||
387 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
388 | allow_realloc, var, NULL, NULL, | ||
389 | NULL); | ||
390 | - } else { | ||
391 | - return 0; | ||
392 | - } | ||
393 | - } else { | ||
394 | - u_char str[] = "NULL"; | ||
395 | - return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); | ||
396 | } | ||
397 | + | ||
398 | + u_char str[] = "NULL"; | ||
399 | + return snmp_strcat(buf, buf_len, out_len, allow_realloc, str); | ||
400 | } | ||
401 | |||
402 | |||
403 | @@ -1785,16 +1785,16 @@ sprint_realloc_bitstring(u_char ** buf, size_t * buf_len, size_t * out_len, | ||
404 | u_char *cp; | ||
405 | char *enum_string; | ||
406 | |||
407 | - if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) && | ||
408 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
409 | - u_char str[] = "Wrong Type (should be BITS): "; | ||
410 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
411 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
412 | + if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) { | ||
413 | + if (!netsnmp_ds_get_boolean( | ||
414 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
415 | + u_char str[] = "Wrong Type (should be BITS): "; | ||
416 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
417 | + return 0; | ||
418 | + } | ||
419 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
420 | allow_realloc, var, NULL, NULL, | ||
421 | NULL); | ||
422 | - } else { | ||
423 | - return 0; | ||
424 | - } | ||
425 | } | ||
426 | |||
427 | if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
428 | @@ -1869,16 +1869,16 @@ sprint_realloc_nsapaddress(u_char ** buf, size_t * buf_len, | ||
429 | const struct enum_list *enums, const char *hint, | ||
430 | const char *units) | ||
431 | { | ||
432 | - if ((var->type != ASN_NSAP) && | ||
433 | - (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) { | ||
434 | - u_char str[] = "Wrong Type (should be NsapAddress): "; | ||
435 | - if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) { | ||
436 | - return sprint_realloc_by_type(buf, buf_len, out_len, | ||
437 | + if (var->type != ASN_NSAP) { | ||
438 | + if (!netsnmp_ds_get_boolean( | ||
439 | + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) { | ||
440 | + u_char str[] = "Wrong Type (should be NsapAddress): "; | ||
441 | + if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) | ||
442 | + return 0; | ||
443 | + } | ||
444 | + return sprint_realloc_by_type(buf, buf_len, out_len, | ||
445 | allow_realloc, var, NULL, NULL, | ||
446 | NULL); | ||
447 | - } else { | ||
448 | - return 0; | ||
449 | - } | ||
450 | } | ||
451 | |||
452 | if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) { | ||
453 | -- | ||
454 | 1.7.10.4 | ||
455 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service new file mode 100644 index 000000000..10a1eb212 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Management Protocol (SNMP) Daemon. | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=notify | ||
7 | Environment=OPTIONS="-LS0-6d" | ||
8 | EnvironmentFile=-/etc/default/snmpd | ||
9 | ExecStart=/usr/sbin/snmpd $OPTIONS -f | ||
10 | ExecReload=/bin/kill -HUP $MAINPID | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service new file mode 100644 index 000000000..951f9f270 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Management Protocol (SNMP) Trap Daemon. | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=notify | ||
7 | Environment=OPTIONS="-Lsd" | ||
8 | EnvironmentFile=-/etc/default/snmptrapd | ||
9 | ExecStart=/usr/sbin/snmptrapd $OPTIONS -f | ||
10 | ExecReload=/bin/kill -HUP $MAINPID | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch new file mode 100644 index 000000000..e19153bbc --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch | |||
@@ -0,0 +1,1618 @@ | |||
1 | Systemd support backported from the master branch as of 23/04/2012 (post 5.7.1, pre 5.8). | ||
2 | |||
3 | The following commits have been cherry-picked: | ||
4 | |||
5 | 19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11 | ||
6 | fef6cddfdb94da1a6b1fb768af62918b80f11fd3 | ||
7 | 0641e43c694c485cbbffef0556efc4641bd3ff50 | ||
8 | 76530a89f1c8bbd0b63acce63e10d5d4812a1a16 (conflict resolved) | ||
9 | bf108d7f1354f6276fc43c129963f2c49b9fc242 | ||
10 | 3692875172352f72cf3afd0d35f355e83d7e421b | ||
11 | 74412748067c685e1d8ab6ed3bcc3ca9c2774844 | ||
12 | 86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0 | ||
13 | 63557cf8986a33dba1d4429b583a901361052c4f | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | |||
17 | Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com> | ||
18 | diff --git a/README.systemd b/README.systemd | ||
19 | new file mode 100644 | ||
20 | index 0000000..f731851 | ||
21 | --- /dev/null | ||
22 | +++ b/README.systemd | ||
23 | @@ -0,0 +1,41 @@ | ||
24 | +README.systemd | ||
25 | +-------------- | ||
26 | +Net-SNMP provides two daemons, which support systemd system manager. | ||
27 | +See http://www.freedesktop.org/wiki/Software/systemd to learn how | ||
28 | +systemd works. Both socket activation and notification is supported by these | ||
29 | +daemons. | ||
30 | + | ||
31 | +To enable systemd support, the sources must be compiled with | ||
32 | +--with-systemd configure option. | ||
33 | + | ||
34 | +snmpd - The SNMP agent | ||
35 | +---------------------- | ||
36 | +Socket activation od snmpd daemon is implemented, but it's discouraged. | ||
37 | +The reason is simple - snmpd not only listens and processes SNMP requests | ||
38 | +from network, but also gathers system statistics counters, sends traps and | ||
39 | +communicates with subagents. It even opens few netlink sockets. | ||
40 | + | ||
41 | +In other words, snmpd should run from system start to properly work. | ||
42 | +This can be done in two ways: | ||
43 | +1) either as snmpd service unit with 'Type=notification' and without a socket | ||
44 | + unit | ||
45 | +2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit | ||
46 | + and the snmpd service enabled. This way systemd creates the snmpd listening | ||
47 | + socket early during boot and passes the sockets to snmpd slightly later | ||
48 | + (but still during machine boot). This way systemd can paralelize start of | ||
49 | + services, which depend on snmpd. Admins must adjust the socket file manually, | ||
50 | + depending if the snmpd support AgentX, IPv6, SMUX etc. | ||
51 | + | ||
52 | +snmpd should be started with '-f' command line parameter to disable forking - | ||
53 | +systemd does that for us automatically. | ||
54 | + | ||
55 | + | ||
56 | +snmptrapd - The trap processing daemon | ||
57 | +-------------------------------------- | ||
58 | +snmptrapd supports full socket activation and also notification (if needed). | ||
59 | +Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services | ||
60 | +will work. Again, '-f' parameter should be provided on snmptrapd command line. | ||
61 | + | ||
62 | +If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should | ||
63 | +start during boot and not after first SNMP trap arrives. Same rules as for snmpd | ||
64 | +applies then. | ||
65 | \ No newline at end of file | ||
66 | diff --git a/agent/snmpd.c b/agent/snmpd.c | ||
67 | index b177d5b..08bdfc7 100644 | ||
68 | --- a/agent/snmpd.c | ||
69 | +++ b/agent/snmpd.c | ||
70 | @@ -164,6 +164,10 @@ typedef long fd_mask; | ||
71 | |||
72 | #endif | ||
73 | |||
74 | +#ifndef NETSNMP_NO_SYSTEMD | ||
75 | +#include <net-snmp/library/sd-daemon.h> | ||
76 | +#endif | ||
77 | + | ||
78 | netsnmp_feature_want(logging_file) | ||
79 | netsnmp_feature_want(logging_stdio) | ||
80 | netsnmp_feature_want(logging_syslog) | ||
81 | @@ -441,18 +445,28 @@ main(int argc, char *argv[]) | ||
82 | int agent_mode = -1; | ||
83 | char *pid_file = NULL; | ||
84 | char option_compatability[] = "-Le"; | ||
85 | +#ifndef WIN32 | ||
86 | + int prepared_sockets = 0; | ||
87 | +#endif | ||
88 | #if HAVE_GETPID | ||
89 | int fd; | ||
90 | FILE *PID; | ||
91 | #endif | ||
92 | |||
93 | #ifndef WIN32 | ||
94 | +#ifndef NETSNMP_NO_SYSTEMD | ||
95 | + /* check if systemd has sockets for us and don't close them */ | ||
96 | + prepared_sockets = netsnmp_sd_listen_fds(0); | ||
97 | +#endif /* NETSNMP_NO_SYSTEMD */ | ||
98 | + | ||
99 | /* | ||
100 | * close all non-standard file descriptors we may have | ||
101 | * inherited from the shell. | ||
102 | */ | ||
103 | - for (i = getdtablesize() - 1; i > 2; --i) { | ||
104 | - (void) close(i); | ||
105 | + if (!prepared_sockets) { | ||
106 | + for (i = getdtablesize() - 1; i > 2; --i) { | ||
107 | + (void) close(i); | ||
108 | + } | ||
109 | } | ||
110 | #endif /* #WIN32 */ | ||
111 | |||
112 | @@ -1100,6 +1114,19 @@ main(int argc, char *argv[]) | ||
113 | netsnmp_addrcache_initialise(); | ||
114 | |||
115 | /* | ||
116 | + * Let systemd know we're up. | ||
117 | + */ | ||
118 | +#ifndef NETSNMP_NO_SYSTEMD | ||
119 | + netsnmp_sd_notify(1, "READY=1\n"); | ||
120 | + if (prepared_sockets) | ||
121 | + /* | ||
122 | + * Clear the environment variable, we already processed all the sockets | ||
123 | + * by now. | ||
124 | + */ | ||
125 | + netsnmp_sd_listen_fds(1); | ||
126 | +#endif | ||
127 | + | ||
128 | + /* | ||
129 | * Forever monitor the dest_port for incoming PDUs. | ||
130 | */ | ||
131 | DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n")); | ||
132 | diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c | ||
133 | index 1a52080..0857ae1 100644 | ||
134 | --- a/apps/snmptrapd.c | ||
135 | +++ b/apps/snmptrapd.c | ||
136 | @@ -125,6 +125,10 @@ SOFTWARE. | ||
137 | |||
138 | #include <net-snmp/net-snmp-features.h> | ||
139 | |||
140 | +#ifndef NETSNMP_NO_SYSTEMD | ||
141 | +#include <net-snmp/library/sd-daemon.h> | ||
142 | +#endif | ||
143 | + | ||
144 | #ifndef BSD4_3 | ||
145 | #define BSD4_2 | ||
146 | #endif | ||
147 | @@ -655,15 +659,24 @@ main(int argc, char *argv[]) | ||
148 | int agentx_subagent = 1; | ||
149 | #endif | ||
150 | netsnmp_trapd_handler *traph; | ||
151 | +#ifndef WIN32 | ||
152 | + int prepared_sockets = 0; | ||
153 | +#endif | ||
154 | |||
155 | |||
156 | #ifndef WIN32 | ||
157 | +#ifndef NETSNMP_NO_SYSTEMD | ||
158 | + /* check if systemd has sockets for us and don't close them */ | ||
159 | + prepared_sockets = netsnmp_sd_listen_fds(0); | ||
160 | +#endif | ||
161 | /* | ||
162 | * close all non-standard file descriptors we may have | ||
163 | * inherited from the shell. | ||
164 | */ | ||
165 | - for (i = getdtablesize() - 1; i > 2; --i) { | ||
166 | - (void) close(i); | ||
167 | + if (!prepared_sockets) { | ||
168 | + for (i = getdtablesize() - 1; i > 2; --i) { | ||
169 | + (void) close(i); | ||
170 | + } | ||
171 | } | ||
172 | #endif /* #WIN32 */ | ||
173 | |||
174 | @@ -1311,6 +1324,19 @@ main(int argc, char *argv[]) | ||
175 | #endif | ||
176 | #endif | ||
177 | |||
178 | + /* | ||
179 | + * Let systemd know we're up. | ||
180 | + */ | ||
181 | +#ifndef NETSNMP_NO_SYSTEMD | ||
182 | + netsnmp_sd_notify(1, "READY=1\n"); | ||
183 | + if (prepared_sockets) | ||
184 | + /* | ||
185 | + * Clear the environment variable, we already processed all the sockets | ||
186 | + * by now. | ||
187 | + */ | ||
188 | + netsnmp_sd_listen_fds(1); | ||
189 | +#endif | ||
190 | + | ||
191 | #ifdef WIN32SERVICE | ||
192 | trapd_status = SNMPTRAPD_RUNNING; | ||
193 | #endif | ||
194 | diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib | ||
195 | index b6609c1..5849072 100644 | ||
196 | --- a/configure.d/config_modules_lib | ||
197 | +++ b/configure.d/config_modules_lib | ||
198 | @@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" | ||
199 | other_ftobjs_list="$other_ftobjs_list winpipe.ft" | ||
200 | fi | ||
201 | |||
202 | +# Linux systemd | ||
203 | +if test "x$with_systemd" == "xyes"; then | ||
204 | + other_src_list="$other_src_list sd-daemon.c" | ||
205 | + other_objs_list="$other_objs_list sd-daemon.o" | ||
206 | + other_lobjs_list="$other_lobjs_list sd-daemon.lo" | ||
207 | + other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" | ||
208 | +fi | ||
209 | + | ||
210 | AC_SUBST(other_src_list) | ||
211 | AC_SUBST(other_objs_list) | ||
212 | AC_SUBST(other_lobjs_list) | ||
213 | diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable | ||
214 | index 8b46ad2..59d6d5c 100644 | ||
215 | --- a/configure.d/config_project_with_enable | ||
216 | +++ b/configure.d/config_project_with_enable | ||
217 | @@ -689,6 +689,15 @@ if test "x$with_dummy_values" != "xyes"; then | ||
218 | data for]) | ||
219 | fi | ||
220 | |||
221 | +NETSNMP_ARG_WITH(systemd, | ||
222 | +[ --with-systemd Provide systemd support. See README.systemd | ||
223 | + for details.]) | ||
224 | +# Define unless specifically suppressed (i.e., option defaults to false). | ||
225 | +if test "x$with_systemd" != "xyes"; then | ||
226 | + AC_DEFINE(NETSNMP_NO_SYSTEMD, 1, | ||
227 | + [If you don't want to integrate with systemd.]) | ||
228 | +fi | ||
229 | + | ||
230 | NETSNMP_ARG_ENABLE(set-support, | ||
231 | [ --disable-set-support Do not allow SNMP set requests.]) | ||
232 | if test "x$enable_set_support" = "xno"; then | ||
233 | diff --git a/dist/snmpd.service b/dist/snmpd.service | ||
234 | new file mode 100644 | ||
235 | index 0000000..31391e5 | ||
236 | --- /dev/null | ||
237 | +++ b/dist/snmpd.service | ||
238 | @@ -0,0 +1,18 @@ | ||
239 | +# | ||
240 | +# SNMP agent service file for systemd | ||
241 | +# | ||
242 | +# | ||
243 | +# The service should be enabled, i.e. snmpd should start during machine boot. | ||
244 | +# Socket activation shall not be used. See README.systemd for details. | ||
245 | + | ||
246 | +[Unit] | ||
247 | +Description=Simple Network Management Protocol (SNMP) daemon. | ||
248 | +After=syslog.target network.target | ||
249 | + | ||
250 | +[Service] | ||
251 | +# Type=notify is also supported. It should be set when snmpd.socket is not used. | ||
252 | +Type=simple | ||
253 | +ExecStart=/usr/sbin/snmpd -f | ||
254 | + | ||
255 | +[Install] | ||
256 | +WantedBy=multi-user.target | ||
257 | diff --git a/dist/snmpd.socket b/dist/snmpd.socket | ||
258 | new file mode 100644 | ||
259 | index 0000000..7f3a2d9 | ||
260 | --- /dev/null | ||
261 | +++ b/dist/snmpd.socket | ||
262 | @@ -0,0 +1,17 @@ | ||
263 | +[Unit] | ||
264 | +Description=Socket listening for SNMP and AgentX messages | ||
265 | + | ||
266 | +[Socket] | ||
267 | +ListenDatagram=0.0.0.0:161 | ||
268 | +# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. | ||
269 | +# It must match listening addresses/ports defined in snmpd.service | ||
270 | +# or snmpd.conf. | ||
271 | +# ListenStream=0.0.0.0:161 | ||
272 | +# ListenDatagram=[::]:161 | ||
273 | +# ListenStream=[::]:161 | ||
274 | +# | ||
275 | +# Uncomment AgentX socket if snmpd.conf enables AgentX protocol. | ||
276 | +# ListenStream=/var/agentx/master | ||
277 | + | ||
278 | +[Install] | ||
279 | +WantedBy=sockets.target | ||
280 | diff --git a/dist/snmptrapd.service b/dist/snmptrapd.service | ||
281 | new file mode 100644 | ||
282 | index 0000000..e88a5b4 | ||
283 | --- /dev/null | ||
284 | +++ b/dist/snmptrapd.service | ||
285 | @@ -0,0 +1,16 @@ | ||
286 | +# | ||
287 | +# SNMP trap-processing service file for systemd | ||
288 | +# | ||
289 | + | ||
290 | +[Unit] | ||
291 | +Description=Simple Network Management Protocol (SNMP) Trap daemon. | ||
292 | +After=syslog.target network.target | ||
293 | + | ||
294 | +[Service] | ||
295 | +# Type=notify is also supported. It should be set when snmptrapd.socket is not | ||
296 | +# used. | ||
297 | +Type=simple | ||
298 | +ExecStart=/usr/sbin/snmptrapd -f | ||
299 | + | ||
300 | +[Install] | ||
301 | +WantedBy=multi-user.target | ||
302 | diff --git a/dist/snmptrapd.socket b/dist/snmptrapd.socket | ||
303 | new file mode 100644 | ||
304 | index 0000000..0fc8a7c | ||
305 | --- /dev/null | ||
306 | +++ b/dist/snmptrapd.socket | ||
307 | @@ -0,0 +1,14 @@ | ||
308 | +[Unit] | ||
309 | +Description=Socket listening for SNMP trap messages | ||
310 | + | ||
311 | +[Socket] | ||
312 | +ListenDatagram=0.0.0.0:162 | ||
313 | +# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. | ||
314 | +# It must match listening addresses/ports defined in snmptrapd.service | ||
315 | +# or snmptrapd.conf. | ||
316 | +# ListenStream=0.0.0.0:162 | ||
317 | +# ListenDatagram=[::]:162 | ||
318 | +# ListenStream=[::]:162 | ||
319 | + | ||
320 | +[Install] | ||
321 | +WantedBy=sockets.target | ||
322 | diff --git a/include/net-snmp/library/sd-daemon.h b/include/net-snmp/library/sd-daemon.h | ||
323 | new file mode 100644 | ||
324 | index 0000000..85274c9 | ||
325 | --- /dev/null | ||
326 | +++ b/include/net-snmp/library/sd-daemon.h | ||
327 | @@ -0,0 +1,290 @@ | ||
328 | +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | ||
329 | + | ||
330 | +#ifndef SNMPD_SD_DAEMON_H | ||
331 | +#define SNMPD_SD_DAEMON_H | ||
332 | + | ||
333 | +/*** | ||
334 | + Copyright 2010 Lennart Poettering | ||
335 | + | ||
336 | + Permission is hereby granted, free of charge, to any person | ||
337 | + obtaining a copy of this software and associated documentation files | ||
338 | + (the "Software"), to deal in the Software without restriction, | ||
339 | + including without limitation the rights to use, copy, modify, merge, | ||
340 | + publish, distribute, sublicense, and/or sell copies of the Software, | ||
341 | + and to permit persons to whom the Software is furnished to do so, | ||
342 | + subject to the following conditions: | ||
343 | + | ||
344 | + The above copyright notice and this permission notice shall be | ||
345 | + included in all copies or substantial portions of the Software. | ||
346 | + | ||
347 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
348 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
349 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
350 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
351 | + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
352 | + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
353 | + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
354 | + SOFTWARE. | ||
355 | +***/ | ||
356 | + | ||
357 | +#ifdef HAVE_SYS_TYPES_H | ||
358 | +#include <sys/types.h> | ||
359 | +#endif | ||
360 | +#ifdef HAVE_INTTYPES_H | ||
361 | +#include <inttypes.h> | ||
362 | +#endif | ||
363 | + | ||
364 | +#ifdef __cplusplus | ||
365 | +extern "C" { | ||
366 | +#endif | ||
367 | + | ||
368 | +/* | ||
369 | + Reference implementation of a few systemd related interfaces for | ||
370 | + writing daemons. These interfaces are trivial to implement. To | ||
371 | + simplify porting we provide this reference implementation. | ||
372 | + Applications are welcome to reimplement the algorithms described | ||
373 | + here if they do not want to include these two source files. | ||
374 | + | ||
375 | + The following functionality is provided: | ||
376 | + | ||
377 | + - Support for logging with log levels on stderr | ||
378 | + - File descriptor passing for socket-based activation | ||
379 | + - Daemon startup and status notification | ||
380 | + - Detection of systemd boots | ||
381 | + | ||
382 | + You may compile this with -DDISABLE_SYSTEMD to disable systemd | ||
383 | + support. This makes all those calls NOPs that are directly related to | ||
384 | + systemd (i.e. only sd_is_xxx() will stay useful). | ||
385 | + | ||
386 | + Since this is drop-in code we don't want any of our symbols to be | ||
387 | + exported in any case. Hence we declare hidden visibility for all of | ||
388 | + them. | ||
389 | + | ||
390 | + You may find an up-to-date version of these source files online: | ||
391 | + | ||
392 | + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h | ||
393 | + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c | ||
394 | + | ||
395 | + This should compile on non-Linux systems, too, but with the | ||
396 | + exception of the sd_is_xxx() calls all functions will become NOPs. | ||
397 | + | ||
398 | + See sd-daemon(7) for more information. | ||
399 | +*/ | ||
400 | + | ||
401 | +#ifndef _sd_printf_attr_ | ||
402 | +#if __GNUC__ >= 4 | ||
403 | +#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||
404 | +#else | ||
405 | +#define _sd_printf_attr_(a,b) | ||
406 | +#endif | ||
407 | +#endif | ||
408 | + | ||
409 | +/* | ||
410 | + Log levels for usage on stderr: | ||
411 | + | ||
412 | + fprintf(stderr, SD_NOTICE "Hello World!\n"); | ||
413 | + | ||
414 | + This is similar to printk() usage in the kernel. | ||
415 | +*/ | ||
416 | +#define SD_EMERG "<0>" /* system is unusable */ | ||
417 | +#define SD_ALERT "<1>" /* action must be taken immediately */ | ||
418 | +#define SD_CRIT "<2>" /* critical conditions */ | ||
419 | +#define SD_ERR "<3>" /* error conditions */ | ||
420 | +#define SD_WARNING "<4>" /* warning conditions */ | ||
421 | +#define SD_NOTICE "<5>" /* normal but significant condition */ | ||
422 | +#define SD_INFO "<6>" /* informational */ | ||
423 | +#define SD_DEBUG "<7>" /* debug-level messages */ | ||
424 | + | ||
425 | +/* The first passed file descriptor is fd 3 */ | ||
426 | +#define SD_LISTEN_FDS_START 3 | ||
427 | + | ||
428 | +/* | ||
429 | + Returns how many file descriptors have been passed, or a negative | ||
430 | + errno code on failure. Optionally, removes the $LISTEN_FDS and | ||
431 | + $LISTEN_PID file descriptors from the environment (recommended, but | ||
432 | + problematic in threaded environments). If r is the return value of | ||
433 | + this function you'll find the file descriptors passed as fds | ||
434 | + SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative | ||
435 | + errno style error code on failure. This function call ensures that | ||
436 | + the FD_CLOEXEC flag is set for the passed file descriptors, to make | ||
437 | + sure they are not passed on to child processes. If FD_CLOEXEC shall | ||
438 | + not be set, the caller needs to unset it after this call for all file | ||
439 | + descriptors that are used. | ||
440 | + | ||
441 | + See sd_listen_fds(3) for more information. | ||
442 | +*/ | ||
443 | +int netsnmp_sd_listen_fds(int unset_environment); | ||
444 | + | ||
445 | +/* | ||
446 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
447 | + the file descriptor is a FIFO in the file system stored under the | ||
448 | + specified path, 0 otherwise. If path is NULL a path name check will | ||
449 | + not be done and the call only verifies if the file descriptor | ||
450 | + refers to a FIFO. Returns a negative errno style error code on | ||
451 | + failure. | ||
452 | + | ||
453 | + See sd_is_fifo(3) for more information. | ||
454 | +*/ | ||
455 | +int netsnmp_sd_is_fifo(int fd, const char *path); | ||
456 | + | ||
457 | +/* | ||
458 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
459 | + the file descriptor is a special character device on the file | ||
460 | + system stored under the specified path, 0 otherwise. | ||
461 | + If path is NULL a path name check will not be done and the call | ||
462 | + only verifies if the file descriptor refers to a special character. | ||
463 | + Returns a negative errno style error code on failure. | ||
464 | + | ||
465 | + See sd_is_special(3) for more information. | ||
466 | +*/ | ||
467 | +int netsnmp_sd_is_special(int fd, const char *path); | ||
468 | + | ||
469 | +/* | ||
470 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
471 | + the file descriptor is a socket of the specified family (AF_INET, | ||
472 | + ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If | ||
473 | + family is 0 a socket family check will not be done. If type is 0 a | ||
474 | + socket type check will not be done and the call only verifies if | ||
475 | + the file descriptor refers to a socket. If listening is > 0 it is | ||
476 | + verified that the socket is in listening mode. (i.e. listen() has | ||
477 | + been called) If listening is == 0 it is verified that the socket is | ||
478 | + not in listening mode. If listening is < 0 no listening mode check | ||
479 | + is done. Returns a negative errno style error code on failure. | ||
480 | + | ||
481 | + See sd_is_socket(3) for more information. | ||
482 | +*/ | ||
483 | +int netsnmp_sd_is_socket(int fd, int family, int type, int listening); | ||
484 | + | ||
485 | +/* | ||
486 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
487 | + the file descriptor is an Internet socket, of the specified family | ||
488 | + (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, | ||
489 | + SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version | ||
490 | + check is not done. If type is 0 a socket type check will not be | ||
491 | + done. If port is 0 a socket port check will not be done. The | ||
492 | + listening flag is used the same way as in sd_is_socket(). Returns a | ||
493 | + negative errno style error code on failure. | ||
494 | + | ||
495 | + See sd_is_socket_inet(3) for more information. | ||
496 | +*/ | ||
497 | +int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); | ||
498 | + | ||
499 | +/* | ||
500 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
501 | + the file descriptor is an AF_UNIX socket of the specified type | ||
502 | + (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 | ||
503 | + a socket type check will not be done. If path is NULL a socket path | ||
504 | + check will not be done. For normal AF_UNIX sockets set length to | ||
505 | + 0. For abstract namespace sockets set length to the length of the | ||
506 | + socket name (including the initial 0 byte), and pass the full | ||
507 | + socket path in path (including the initial 0 byte). The listening | ||
508 | + flag is used the same way as in sd_is_socket(). Returns a negative | ||
509 | + errno style error code on failure. | ||
510 | + | ||
511 | + See sd_is_socket_unix(3) for more information. | ||
512 | +*/ | ||
513 | +int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); | ||
514 | + | ||
515 | +/* | ||
516 | + Informs systemd about changed daemon state. This takes a number of | ||
517 | + newline separated environment-style variable assignments in a | ||
518 | + string. The following variables are known: | ||
519 | + | ||
520 | + READY=1 Tells systemd that daemon startup is finished (only | ||
521 | + relevant for services of Type=notify). The passed | ||
522 | + argument is a boolean "1" or "0". Since there is | ||
523 | + little value in signaling non-readiness the only | ||
524 | + value daemons should send is "READY=1". | ||
525 | + | ||
526 | + STATUS=... Passes a single-line status string back to systemd | ||
527 | + that describes the daemon state. This is free-from | ||
528 | + and can be used for various purposes: general state | ||
529 | + feedback, fsck-like programs could pass completion | ||
530 | + percentages and failing programs could pass a human | ||
531 | + readable error message. Example: "STATUS=Completed | ||
532 | + 66% of file system check..." | ||
533 | + | ||
534 | + ERRNO=... If a daemon fails, the errno-style error code, | ||
535 | + formatted as string. Example: "ERRNO=2" for ENOENT. | ||
536 | + | ||
537 | + BUSERROR=... If a daemon fails, the D-Bus error-style error | ||
538 | + code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" | ||
539 | + | ||
540 | + MAINPID=... The main pid of a daemon, in case systemd did not | ||
541 | + fork off the process itself. Example: "MAINPID=4711" | ||
542 | + | ||
543 | + Daemons can choose to send additional variables. However, it is | ||
544 | + recommended to prefix variable names not listed above with X_. | ||
545 | + | ||
546 | + Returns a negative errno-style error code on failure. Returns > 0 | ||
547 | + if systemd could be notified, 0 if it couldn't possibly because | ||
548 | + systemd is not running. | ||
549 | + | ||
550 | + Example: When a daemon finished starting up, it could issue this | ||
551 | + call to notify systemd about it: | ||
552 | + | ||
553 | + sd_notify(0, "READY=1"); | ||
554 | + | ||
555 | + See sd_notifyf() for more complete examples. | ||
556 | + | ||
557 | + See sd_notify(3) for more information. | ||
558 | +*/ | ||
559 | +int netsnmp_sd_notify(int unset_environment, const char *state); | ||
560 | + | ||
561 | +/* | ||
562 | + Similar to sd_notify() but takes a format string. | ||
563 | + | ||
564 | + Example 1: A daemon could send the following after initialization: | ||
565 | + | ||
566 | + sd_notifyf(0, "READY=1\n" | ||
567 | + "STATUS=Processing requests...\n" | ||
568 | + "MAINPID=%lu", | ||
569 | + (unsigned long) getpid()); | ||
570 | + | ||
571 | + Example 2: A daemon could send the following shortly before | ||
572 | + exiting, on failure: | ||
573 | + | ||
574 | + sd_notifyf(0, "STATUS=Failed to start up: %s\n" | ||
575 | + "ERRNO=%i", | ||
576 | + strerror(errno), | ||
577 | + errno); | ||
578 | + | ||
579 | + See sd_notifyf(3) for more information. | ||
580 | +*/ | ||
581 | +int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); | ||
582 | + | ||
583 | +/* | ||
584 | + Returns > 0 if the system was booted with systemd. Returns < 0 on | ||
585 | + error. Returns 0 if the system was not booted with systemd. Note | ||
586 | + that all of the functions above handle non-systemd boots just | ||
587 | + fine. You should NOT protect them with a call to this function. Also | ||
588 | + note that this function checks whether the system, not the user | ||
589 | + session is controlled by systemd. However the functions above work | ||
590 | + for both user and system services. | ||
591 | + | ||
592 | + See sd_booted(3) for more information. | ||
593 | +*/ | ||
594 | +int netsnmp_sd_booted(void); | ||
595 | + | ||
596 | +/** | ||
597 | + * Find an socket with given parameters. See man sd_is_socket_inet for | ||
598 | + * description of the arguments. | ||
599 | + * | ||
600 | + * Returns the file descriptor if it is found, 0 otherwise. | ||
601 | + */ | ||
602 | +int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port); | ||
603 | + | ||
604 | +/** | ||
605 | + * Find an unix socket with given parameters. See man sd_is_socket_unix for | ||
606 | + * description of the arguments. | ||
607 | + * | ||
608 | + * Returns the file descriptor if it is found, 0 otherwise. | ||
609 | + */ | ||
610 | +int | ||
611 | +netsnmp_sd_find_unix_socket(int type, int listening, const char *path); | ||
612 | + | ||
613 | +#ifdef __cplusplus | ||
614 | +} | ||
615 | +#endif | ||
616 | + | ||
617 | +#endif /* SNMPD_SD_DAEMON_H */ | ||
618 | diff --git a/snmplib/sd-daemon.c b/snmplib/sd-daemon.c | ||
619 | new file mode 100644 | ||
620 | index 0000000..42dba29 | ||
621 | --- /dev/null | ||
622 | +++ b/snmplib/sd-daemon.c | ||
623 | @@ -0,0 +1,532 @@ | ||
624 | +/* | ||
625 | + * Systemd integration parts. | ||
626 | + * | ||
627 | + * Most of this file is directly copied from systemd sources. | ||
628 | + * Changes: | ||
629 | + * - all functions were renamed to have netsnmp_ prefix | ||
630 | + * - includes were changed to match Net-SNMP style. | ||
631 | + * - removed gcc export macros | ||
632 | + * - removed POSIX message queues | ||
633 | + */ | ||
634 | + | ||
635 | +#include <net-snmp/net-snmp-config.h> | ||
636 | +#include <net-snmp/net-snmp-features.h> | ||
637 | +#include <net-snmp/types.h> | ||
638 | +#include <net-snmp/library/snmp_debug.h> | ||
639 | + | ||
640 | +#ifndef NETSNMP_NO_SYSTEMD | ||
641 | + | ||
642 | +/*** | ||
643 | + Copyright 2010 Lennart Poettering | ||
644 | + | ||
645 | + Permission is hereby granted, free of charge, to any person | ||
646 | + obtaining a copy of this software and associated documentation files | ||
647 | + (the "Software"), to deal in the Software without restriction, | ||
648 | + including without limitation the rights to use, copy, modify, merge, | ||
649 | + publish, distribute, sublicense, and/or sell copies of the Software, | ||
650 | + and to permit persons to whom the Software is furnished to do so, | ||
651 | + subject to the following conditions: | ||
652 | + | ||
653 | + The above copyright notice and this permission notice shall be | ||
654 | + included in all copies or substantial portions of the Software. | ||
655 | + | ||
656 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
657 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
658 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
659 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
660 | + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
661 | + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
662 | + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
663 | + SOFTWARE. | ||
664 | +***/ | ||
665 | + | ||
666 | +#ifndef _GNU_SOURCE | ||
667 | +#define _GNU_SOURCE | ||
668 | +#endif | ||
669 | + | ||
670 | +#include <sys/types.h> | ||
671 | +#include <sys/stat.h> | ||
672 | +#include <sys/socket.h> | ||
673 | +#include <sys/un.h> | ||
674 | +#include <sys/fcntl.h> | ||
675 | +#include <netinet/in.h> | ||
676 | +#include <stdlib.h> | ||
677 | +#include <errno.h> | ||
678 | +#include <unistd.h> | ||
679 | +#include <string.h> | ||
680 | +#include <stdarg.h> | ||
681 | +#include <stdio.h> | ||
682 | +#include <stddef.h> | ||
683 | +#include <limits.h> | ||
684 | + | ||
685 | +#include <net-snmp/library/sd-daemon.h> | ||
686 | + | ||
687 | +int netsnmp_sd_listen_fds(int unset_environment) { | ||
688 | + | ||
689 | + int r, fd; | ||
690 | + const char *e; | ||
691 | + char *p = NULL; | ||
692 | + unsigned long l; | ||
693 | + | ||
694 | + if (!(e = getenv("LISTEN_PID"))) { | ||
695 | + r = 0; | ||
696 | + goto finish; | ||
697 | + } | ||
698 | + | ||
699 | + errno = 0; | ||
700 | + l = strtoul(e, &p, 10); | ||
701 | + | ||
702 | + if (errno != 0) { | ||
703 | + r = -errno; | ||
704 | + goto finish; | ||
705 | + } | ||
706 | + | ||
707 | + if (!p || *p || l <= 0) { | ||
708 | + r = -EINVAL; | ||
709 | + goto finish; | ||
710 | + } | ||
711 | + | ||
712 | + /* Is this for us? */ | ||
713 | + if (getpid() != (pid_t) l) { | ||
714 | + r = 0; | ||
715 | + goto finish; | ||
716 | + } | ||
717 | + | ||
718 | + if (!(e = getenv("LISTEN_FDS"))) { | ||
719 | + r = 0; | ||
720 | + goto finish; | ||
721 | + } | ||
722 | + | ||
723 | + errno = 0; | ||
724 | + l = strtoul(e, &p, 10); | ||
725 | + | ||
726 | + if (errno != 0) { | ||
727 | + r = -errno; | ||
728 | + goto finish; | ||
729 | + } | ||
730 | + | ||
731 | + if (!p || *p) { | ||
732 | + r = -EINVAL; | ||
733 | + goto finish; | ||
734 | + } | ||
735 | + | ||
736 | + for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { | ||
737 | + int flags; | ||
738 | + | ||
739 | + if ((flags = fcntl(fd, F_GETFD)) < 0) { | ||
740 | + r = -errno; | ||
741 | + goto finish; | ||
742 | + } | ||
743 | + | ||
744 | + if (flags & FD_CLOEXEC) | ||
745 | + continue; | ||
746 | + | ||
747 | + if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { | ||
748 | + r = -errno; | ||
749 | + goto finish; | ||
750 | + } | ||
751 | + } | ||
752 | + | ||
753 | + r = (int) l; | ||
754 | + | ||
755 | +finish: | ||
756 | + if (unset_environment) { | ||
757 | + unsetenv("LISTEN_PID"); | ||
758 | + unsetenv("LISTEN_FDS"); | ||
759 | + } | ||
760 | + | ||
761 | + return r; | ||
762 | +} | ||
763 | + | ||
764 | +int netsnmp_sd_is_fifo(int fd, const char *path) { | ||
765 | + struct stat st_fd; | ||
766 | + | ||
767 | + if (fd < 0) | ||
768 | + return -EINVAL; | ||
769 | + | ||
770 | + memset(&st_fd, 0, sizeof(st_fd)); | ||
771 | + if (fstat(fd, &st_fd) < 0) | ||
772 | + return -errno; | ||
773 | + | ||
774 | + if (!S_ISFIFO(st_fd.st_mode)) | ||
775 | + return 0; | ||
776 | + | ||
777 | + if (path) { | ||
778 | + struct stat st_path; | ||
779 | + | ||
780 | + memset(&st_path, 0, sizeof(st_path)); | ||
781 | + if (stat(path, &st_path) < 0) { | ||
782 | + | ||
783 | + if (errno == ENOENT || errno == ENOTDIR) | ||
784 | + return 0; | ||
785 | + | ||
786 | + return -errno; | ||
787 | + } | ||
788 | + | ||
789 | + return | ||
790 | + st_path.st_dev == st_fd.st_dev && | ||
791 | + st_path.st_ino == st_fd.st_ino; | ||
792 | + } | ||
793 | + | ||
794 | + return 1; | ||
795 | +} | ||
796 | + | ||
797 | +int netsnmp_sd_is_special(int fd, const char *path) { | ||
798 | + struct stat st_fd; | ||
799 | + | ||
800 | + if (fd < 0) | ||
801 | + return -EINVAL; | ||
802 | + | ||
803 | + if (fstat(fd, &st_fd) < 0) | ||
804 | + return -errno; | ||
805 | + | ||
806 | + if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) | ||
807 | + return 0; | ||
808 | + | ||
809 | + if (path) { | ||
810 | + struct stat st_path; | ||
811 | + | ||
812 | + if (stat(path, &st_path) < 0) { | ||
813 | + | ||
814 | + if (errno == ENOENT || errno == ENOTDIR) | ||
815 | + return 0; | ||
816 | + | ||
817 | + return -errno; | ||
818 | + } | ||
819 | + | ||
820 | + if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) | ||
821 | + return | ||
822 | + st_path.st_dev == st_fd.st_dev && | ||
823 | + st_path.st_ino == st_fd.st_ino; | ||
824 | + else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) | ||
825 | + return st_path.st_rdev == st_fd.st_rdev; | ||
826 | + else | ||
827 | + return 0; | ||
828 | + } | ||
829 | + | ||
830 | + return 1; | ||
831 | +} | ||
832 | + | ||
833 | +static int sd_is_socket_internal(int fd, int type, int listening) { | ||
834 | + struct stat st_fd; | ||
835 | + | ||
836 | + if (fd < 0 || type < 0) | ||
837 | + return -EINVAL; | ||
838 | + | ||
839 | + if (fstat(fd, &st_fd) < 0) | ||
840 | + return -errno; | ||
841 | + | ||
842 | + if (!S_ISSOCK(st_fd.st_mode)) | ||
843 | + return 0; | ||
844 | + | ||
845 | + if (type != 0) { | ||
846 | + int other_type = 0; | ||
847 | + socklen_t l = sizeof(other_type); | ||
848 | + | ||
849 | + if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) | ||
850 | + return -errno; | ||
851 | + | ||
852 | + if (l != sizeof(other_type)) | ||
853 | + return -EINVAL; | ||
854 | + | ||
855 | + if (other_type != type) | ||
856 | + return 0; | ||
857 | + } | ||
858 | + | ||
859 | + if (listening >= 0) { | ||
860 | + int accepting = 0; | ||
861 | + socklen_t l = sizeof(accepting); | ||
862 | + | ||
863 | + if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) | ||
864 | + return -errno; | ||
865 | + | ||
866 | + if (l != sizeof(accepting)) | ||
867 | + return -EINVAL; | ||
868 | + | ||
869 | + if (!accepting != !listening) | ||
870 | + return 0; | ||
871 | + } | ||
872 | + | ||
873 | + return 1; | ||
874 | +} | ||
875 | + | ||
876 | +union sockaddr_union { | ||
877 | + struct sockaddr sa; | ||
878 | + struct sockaddr_in in4; | ||
879 | + struct sockaddr_in6 in6; | ||
880 | + struct sockaddr_un un; | ||
881 | + struct sockaddr_storage storage; | ||
882 | +}; | ||
883 | + | ||
884 | +int netsnmp_sd_is_socket(int fd, int family, int type, int listening) { | ||
885 | + int r; | ||
886 | + | ||
887 | + if (family < 0) | ||
888 | + return -EINVAL; | ||
889 | + | ||
890 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
891 | + return r; | ||
892 | + | ||
893 | + if (family > 0) { | ||
894 | + union sockaddr_union sockaddr; | ||
895 | + socklen_t l; | ||
896 | + | ||
897 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
898 | + l = sizeof(sockaddr); | ||
899 | + | ||
900 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
901 | + return -errno; | ||
902 | + | ||
903 | + if (l < sizeof(sa_family_t)) | ||
904 | + return -EINVAL; | ||
905 | + | ||
906 | + return sockaddr.sa.sa_family == family; | ||
907 | + } | ||
908 | + | ||
909 | + return 1; | ||
910 | +} | ||
911 | + | ||
912 | +int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { | ||
913 | + union sockaddr_union sockaddr; | ||
914 | + socklen_t l; | ||
915 | + int r; | ||
916 | + | ||
917 | + if (family != 0 && family != AF_INET && family != AF_INET6) | ||
918 | + return -EINVAL; | ||
919 | + | ||
920 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
921 | + return r; | ||
922 | + | ||
923 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
924 | + l = sizeof(sockaddr); | ||
925 | + | ||
926 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
927 | + return -errno; | ||
928 | + | ||
929 | + if (l < sizeof(sa_family_t)) | ||
930 | + return -EINVAL; | ||
931 | + | ||
932 | + if (sockaddr.sa.sa_family != AF_INET && | ||
933 | + sockaddr.sa.sa_family != AF_INET6) | ||
934 | + return 0; | ||
935 | + | ||
936 | + if (family > 0) | ||
937 | + if (sockaddr.sa.sa_family != family) | ||
938 | + return 0; | ||
939 | + | ||
940 | + if (port > 0) { | ||
941 | + if (sockaddr.sa.sa_family == AF_INET) { | ||
942 | + if (l < sizeof(struct sockaddr_in)) | ||
943 | + return -EINVAL; | ||
944 | + | ||
945 | + return htons(port) == sockaddr.in4.sin_port; | ||
946 | + } else { | ||
947 | + if (l < sizeof(struct sockaddr_in6)) | ||
948 | + return -EINVAL; | ||
949 | + | ||
950 | + return htons(port) == sockaddr.in6.sin6_port; | ||
951 | + } | ||
952 | + } | ||
953 | + | ||
954 | + return 1; | ||
955 | +} | ||
956 | + | ||
957 | +int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { | ||
958 | + union sockaddr_union sockaddr; | ||
959 | + socklen_t l; | ||
960 | + int r; | ||
961 | + | ||
962 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
963 | + return r; | ||
964 | + | ||
965 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
966 | + l = sizeof(sockaddr); | ||
967 | + | ||
968 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
969 | + return -errno; | ||
970 | + | ||
971 | + if (l < sizeof(sa_family_t)) | ||
972 | + return -EINVAL; | ||
973 | + | ||
974 | + if (sockaddr.sa.sa_family != AF_UNIX) | ||
975 | + return 0; | ||
976 | + | ||
977 | + if (path) { | ||
978 | + if (length <= 0) | ||
979 | + length = strlen(path); | ||
980 | + | ||
981 | + if (length <= 0) | ||
982 | + /* Unnamed socket */ | ||
983 | + return l == offsetof(struct sockaddr_un, sun_path); | ||
984 | + | ||
985 | + if (path[0]) | ||
986 | + /* Normal path socket */ | ||
987 | + return | ||
988 | + (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && | ||
989 | + memcmp(path, sockaddr.un.sun_path, length+1) == 0; | ||
990 | + else | ||
991 | + /* Abstract namespace socket */ | ||
992 | + return | ||
993 | + (l == offsetof(struct sockaddr_un, sun_path) + length) && | ||
994 | + memcmp(path, sockaddr.un.sun_path, length) == 0; | ||
995 | + } | ||
996 | + | ||
997 | + return 1; | ||
998 | +} | ||
999 | + | ||
1000 | +int netsnmp_sd_notify(int unset_environment, const char *state) { | ||
1001 | + int fd = -1, r; | ||
1002 | + struct msghdr msghdr; | ||
1003 | + struct iovec iovec; | ||
1004 | + union sockaddr_union sockaddr; | ||
1005 | + const char *e; | ||
1006 | + | ||
1007 | + if (!state) { | ||
1008 | + r = -EINVAL; | ||
1009 | + goto finish; | ||
1010 | + } | ||
1011 | + | ||
1012 | + if (!(e = getenv("NOTIFY_SOCKET"))) | ||
1013 | + return 0; | ||
1014 | + | ||
1015 | + /* Must be an abstract socket, or an absolute path */ | ||
1016 | + if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { | ||
1017 | + r = -EINVAL; | ||
1018 | + goto finish; | ||
1019 | + } | ||
1020 | + | ||
1021 | + if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { | ||
1022 | + r = -errno; | ||
1023 | + goto finish; | ||
1024 | + } | ||
1025 | + | ||
1026 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
1027 | + sockaddr.sa.sa_family = AF_UNIX; | ||
1028 | + strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); | ||
1029 | + | ||
1030 | + if (sockaddr.un.sun_path[0] == '@') | ||
1031 | + sockaddr.un.sun_path[0] = 0; | ||
1032 | + | ||
1033 | + memset(&iovec, 0, sizeof(iovec)); | ||
1034 | + iovec.iov_base = (char *)state; | ||
1035 | + iovec.iov_len = strlen(state); | ||
1036 | + | ||
1037 | + memset(&msghdr, 0, sizeof(msghdr)); | ||
1038 | + msghdr.msg_name = &sockaddr; | ||
1039 | + msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); | ||
1040 | + | ||
1041 | + if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) | ||
1042 | + msghdr.msg_namelen = sizeof(struct sockaddr_un); | ||
1043 | + | ||
1044 | + msghdr.msg_iov = &iovec; | ||
1045 | + msghdr.msg_iovlen = 1; | ||
1046 | + | ||
1047 | + if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { | ||
1048 | + r = -errno; | ||
1049 | + goto finish; | ||
1050 | + } | ||
1051 | + | ||
1052 | + r = 1; | ||
1053 | + | ||
1054 | +finish: | ||
1055 | + if (unset_environment) | ||
1056 | + unsetenv("NOTIFY_SOCKET"); | ||
1057 | + | ||
1058 | + if (fd >= 0) | ||
1059 | + close(fd); | ||
1060 | + | ||
1061 | + return r; | ||
1062 | +} | ||
1063 | + | ||
1064 | +int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) { | ||
1065 | + va_list ap; | ||
1066 | + char *p = NULL; | ||
1067 | + int r; | ||
1068 | + | ||
1069 | + va_start(ap, format); | ||
1070 | + r = vasprintf(&p, format, ap); | ||
1071 | + va_end(ap); | ||
1072 | + | ||
1073 | + if (r < 0 || !p) | ||
1074 | + return -ENOMEM; | ||
1075 | + | ||
1076 | + r = netsnmp_sd_notify(unset_environment, p); | ||
1077 | + free(p); | ||
1078 | + | ||
1079 | + return r; | ||
1080 | +} | ||
1081 | + | ||
1082 | +int netsnmp_sd_booted(void) { | ||
1083 | + struct stat a, b; | ||
1084 | + | ||
1085 | + /* We simply test whether the systemd cgroup hierarchy is | ||
1086 | + * mounted */ | ||
1087 | + | ||
1088 | + if (lstat("/sys/fs/cgroup", &a) < 0) | ||
1089 | + return 0; | ||
1090 | + | ||
1091 | + if (lstat("/sys/fs/cgroup/systemd", &b) < 0) | ||
1092 | + return 0; | ||
1093 | + | ||
1094 | + return a.st_dev != b.st_dev; | ||
1095 | +} | ||
1096 | + | ||
1097 | +/* End of original sd-daemon.c from systemd sources */ | ||
1098 | + | ||
1099 | +int | ||
1100 | +netsnmp_sd_find_inet_socket(int family, int type, int listening, int port) | ||
1101 | +{ | ||
1102 | + int count, fd; | ||
1103 | + | ||
1104 | + count = netsnmp_sd_listen_fds(0); | ||
1105 | + if (count <= 0) { | ||
1106 | + DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n")); | ||
1107 | + return 0; | ||
1108 | + } | ||
1109 | + DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n", | ||
1110 | + count)); | ||
1111 | + | ||
1112 | + for (fd = 3; fd < 3+count; fd++) { | ||
1113 | + int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port); | ||
1114 | + if (rc < 0) | ||
1115 | + DEBUGMSGTL(("systemd:find_inet_socket", | ||
1116 | + "sd_is_socket_inet error: %d\n", rc)); | ||
1117 | + if (rc > 0) { | ||
1118 | + DEBUGMSGTL(("systemd:find_inet_socket", | ||
1119 | + "Found the socket in LISTEN_FDS\n")); | ||
1120 | + return fd; | ||
1121 | + } | ||
1122 | + } | ||
1123 | + DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n")); | ||
1124 | + return 0; | ||
1125 | +} | ||
1126 | + | ||
1127 | +int | ||
1128 | +netsnmp_sd_find_unix_socket(int type, int listening, const char *path) | ||
1129 | +{ | ||
1130 | + int count, fd; | ||
1131 | + | ||
1132 | + count = netsnmp_sd_listen_fds(0); | ||
1133 | + if (count <= 0) { | ||
1134 | + DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n")); | ||
1135 | + return 0; | ||
1136 | + } | ||
1137 | + DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n", | ||
1138 | + count)); | ||
1139 | + | ||
1140 | + for (fd = 3; fd < 3+count; fd++) { | ||
1141 | + int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0); | ||
1142 | + if (rc < 0) | ||
1143 | + DEBUGMSGTL(("systemd:find_unix_socket", | ||
1144 | + "netsnmp_sd_is_socket_unix error: %d\n", rc)); | ||
1145 | + if (rc > 0) { | ||
1146 | + DEBUGMSGTL(("systemd:find_unix_socket", | ||
1147 | + "Found the socket in LISTEN_FDS\n")); | ||
1148 | + return fd; | ||
1149 | + } | ||
1150 | + } | ||
1151 | + DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n")); | ||
1152 | + return 0; | ||
1153 | +} | ||
1154 | + | ||
1155 | +#endif /* ! NETSNMP_NO_SYSTEMD */ | ||
1156 | diff --git a/snmplib/transports/snmpTCPDomain.c b/snmplib/transports/snmpTCPDomain.c | ||
1157 | index b8bdba4..ab7f3a1 100644 | ||
1158 | --- a/snmplib/transports/snmpTCPDomain.c | ||
1159 | +++ b/snmplib/transports/snmpTCPDomain.c | ||
1160 | @@ -43,6 +43,10 @@ | ||
1161 | #include <net-snmp/library/snmpTCPBaseDomain.h> | ||
1162 | #include <net-snmp/library/tools.h> | ||
1163 | |||
1164 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1165 | +#include <net-snmp/library/sd-daemon.h> | ||
1166 | +#endif | ||
1167 | + | ||
1168 | /* | ||
1169 | * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c | ||
1170 | * and perl/agent/agent.xs | ||
1171 | @@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1172 | netsnmp_transport *t = NULL; | ||
1173 | netsnmp_udp_addr_pair *addr_pair = NULL; | ||
1174 | int rc = 0; | ||
1175 | + int socket_initialized = 0; | ||
1176 | |||
1177 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1178 | if (local) | ||
1179 | @@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1180 | t->domain_length = | ||
1181 | sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]); | ||
1182 | |||
1183 | - t->sock = socket(PF_INET, SOCK_STREAM, 0); | ||
1184 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1185 | + /* | ||
1186 | + * Maybe the socket was already provided by systemd... | ||
1187 | + */ | ||
1188 | + if (local) { | ||
1189 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1, | ||
1190 | + ntohs(addr->sin_port)); | ||
1191 | + if (t->sock) | ||
1192 | + socket_initialized = 1; | ||
1193 | + } | ||
1194 | +#endif | ||
1195 | + if (!socket_initialized) | ||
1196 | + t->sock = socket(PF_INET, SOCK_STREAM, 0); | ||
1197 | if (t->sock < 0) { | ||
1198 | netsnmp_transport_free(t); | ||
1199 | return NULL; | ||
1200 | @@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1201 | setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, | ||
1202 | sizeof(opt)); | ||
1203 | |||
1204 | - rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); | ||
1205 | - if (rc != 0) { | ||
1206 | - netsnmp_socketbase_close(t); | ||
1207 | - netsnmp_transport_free(t); | ||
1208 | - return NULL; | ||
1209 | + if (!socket_initialized) { | ||
1210 | + rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); | ||
1211 | + if (rc != 0) { | ||
1212 | + netsnmp_socketbase_close(t); | ||
1213 | + netsnmp_transport_free(t); | ||
1214 | + return NULL; | ||
1215 | + } | ||
1216 | } | ||
1217 | |||
1218 | /* | ||
1219 | @@ -235,12 +254,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1220 | /* | ||
1221 | * Now sit here and wait for connections to arrive. | ||
1222 | */ | ||
1223 | - | ||
1224 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1225 | - if (rc != 0) { | ||
1226 | - netsnmp_socketbase_close(t); | ||
1227 | - netsnmp_transport_free(t); | ||
1228 | - return NULL; | ||
1229 | + if (!socket_initialized) { | ||
1230 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1231 | + if (rc != 0) { | ||
1232 | + netsnmp_socketbase_close(t); | ||
1233 | + netsnmp_transport_free(t); | ||
1234 | + return NULL; | ||
1235 | + } | ||
1236 | } | ||
1237 | |||
1238 | /* | ||
1239 | diff --git a/snmplib/transports/snmpTCPIPv6Domain.c b/snmplib/transports/snmpTCPIPv6Domain.c | ||
1240 | index 3c96856..305a861 100644 | ||
1241 | --- a/snmplib/transports/snmpTCPIPv6Domain.c | ||
1242 | +++ b/snmplib/transports/snmpTCPIPv6Domain.c | ||
1243 | @@ -49,6 +49,10 @@ | ||
1244 | #include <net-snmp/library/snmpTCPBaseDomain.h> | ||
1245 | #include <net-snmp/library/tools.h> | ||
1246 | |||
1247 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1248 | +#include <net-snmp/library/sd-daemon.h> | ||
1249 | +#endif | ||
1250 | + | ||
1251 | #include "inet_ntop.h" | ||
1252 | |||
1253 | oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 }; | ||
1254 | @@ -140,6 +144,8 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1255 | { | ||
1256 | netsnmp_transport *t = NULL; | ||
1257 | int rc = 0; | ||
1258 | + char *str = NULL; | ||
1259 | + int socket_initialized = 0; | ||
1260 | |||
1261 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1262 | if (local) | ||
1263 | @@ -174,7 +180,19 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1264 | t->domain = netsnmp_TCPIPv6Domain; | ||
1265 | t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid); | ||
1266 | |||
1267 | - t->sock = socket(PF_INET6, SOCK_STREAM, 0); | ||
1268 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1269 | + /* | ||
1270 | + * Maybe the socket was already provided by systemd... | ||
1271 | + */ | ||
1272 | + if (local) { | ||
1273 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1, | ||
1274 | + ntohs(addr->sin6_port)); | ||
1275 | + if (t->sock) | ||
1276 | + socket_initialized = 1; | ||
1277 | + } | ||
1278 | +#endif | ||
1279 | + if (!socket_initialized) | ||
1280 | + t->sock = socket(PF_INET6, SOCK_STREAM, 0); | ||
1281 | if (t->sock < 0) { | ||
1282 | netsnmp_transport_free(t); | ||
1283 | return NULL; | ||
1284 | @@ -220,12 +238,14 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1285 | |||
1286 | setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt)); | ||
1287 | |||
1288 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1289 | - sizeof(struct sockaddr_in6)); | ||
1290 | - if (rc != 0) { | ||
1291 | - netsnmp_socketbase_close(t); | ||
1292 | - netsnmp_transport_free(t); | ||
1293 | - return NULL; | ||
1294 | + if (!socket_initialized) { | ||
1295 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1296 | + sizeof(struct sockaddr_in6)); | ||
1297 | + if (rc != 0) { | ||
1298 | + netsnmp_socketbase_close(t); | ||
1299 | + netsnmp_transport_free(t); | ||
1300 | + return NULL; | ||
1301 | + } | ||
1302 | } | ||
1303 | |||
1304 | /* | ||
1305 | @@ -242,11 +262,13 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1306 | * Now sit here and wait for connections to arrive. | ||
1307 | */ | ||
1308 | |||
1309 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1310 | - if (rc != 0) { | ||
1311 | - netsnmp_socketbase_close(t); | ||
1312 | - netsnmp_transport_free(t); | ||
1313 | - return NULL; | ||
1314 | + if (!socket_initialized) { | ||
1315 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1316 | + if (rc != 0) { | ||
1317 | + netsnmp_socketbase_close(t); | ||
1318 | + netsnmp_transport_free(t); | ||
1319 | + return NULL; | ||
1320 | + } | ||
1321 | } | ||
1322 | |||
1323 | /* | ||
1324 | diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1325 | index c67427b..428e6d6 100644 | ||
1326 | --- a/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1327 | +++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1328 | @@ -40,6 +40,10 @@ | ||
1329 | |||
1330 | #include <net-snmp/library/snmpSocketBaseDomain.h> | ||
1331 | |||
1332 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1333 | +#include <net-snmp/library/sd-daemon.h> | ||
1334 | +#endif | ||
1335 | + | ||
1336 | #if (defined(linux) && defined(IP_PKTINFO)) \ | ||
1337 | || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \ | ||
1338 | && HAVE_STRUCT_MSGHDR_MSG_FLAGS | ||
1339 | @@ -67,6 +71,7 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1340 | char *client_socket = NULL; | ||
1341 | netsnmp_indexed_addr_pair addr_pair; | ||
1342 | socklen_t local_addr_len; | ||
1343 | + int socket_initialized = 0; | ||
1344 | |||
1345 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1346 | if (local) | ||
1347 | @@ -91,7 +96,19 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1348 | free(str); | ||
1349 | } | ||
1350 | |||
1351 | - t->sock = socket(PF_INET, SOCK_DGRAM, 0); | ||
1352 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1353 | + /* | ||
1354 | + * Maybe the socket was already provided by systemd... | ||
1355 | + */ | ||
1356 | + if (local) { | ||
1357 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1, | ||
1358 | + ntohs(addr->sin_port)); | ||
1359 | + if (t->sock) | ||
1360 | + socket_initialized = 1; | ||
1361 | + } | ||
1362 | +#endif | ||
1363 | + if (!socket_initialized) | ||
1364 | + t->sock = socket(PF_INET, SOCK_DGRAM, 0); | ||
1365 | DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local)); | ||
1366 | if (t->sock < 0) { | ||
1367 | netsnmp_transport_free(t); | ||
1368 | @@ -141,12 +158,14 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1369 | DEBUGMSGTL(("netsnmp_udp", "set IP_RECVDSTADDR\n")); | ||
1370 | } | ||
1371 | #endif | ||
1372 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1373 | - sizeof(struct sockaddr)); | ||
1374 | - if (rc != 0) { | ||
1375 | - netsnmp_socketbase_close(t); | ||
1376 | - netsnmp_transport_free(t); | ||
1377 | - return NULL; | ||
1378 | + if (!socket_initialized) { | ||
1379 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1380 | + sizeof(struct sockaddr)); | ||
1381 | + if (rc != 0) { | ||
1382 | + netsnmp_socketbase_close(t); | ||
1383 | + netsnmp_transport_free(t); | ||
1384 | + return NULL; | ||
1385 | + } | ||
1386 | } | ||
1387 | t->data = NULL; | ||
1388 | t->data_length = 0; | ||
1389 | diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c | ||
1390 | index b3eaae4..35b617f 100644 | ||
1391 | --- a/snmplib/transports/snmpUDPIPv6Domain.c | ||
1392 | +++ b/snmplib/transports/snmpUDPIPv6Domain.c | ||
1393 | @@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; | ||
1394 | #include <net-snmp/library/snmpSocketBaseDomain.h> | ||
1395 | #include <net-snmp/library/tools.h> | ||
1396 | |||
1397 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1398 | +#include <net-snmp/library/sd-daemon.h> | ||
1399 | +#endif | ||
1400 | + | ||
1401 | #include "inet_ntop.h" | ||
1402 | #include "inet_pton.h" | ||
1403 | |||
1404 | @@ -190,6 +194,8 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1405 | { | ||
1406 | netsnmp_transport *t = NULL; | ||
1407 | int rc = 0; | ||
1408 | + char *str = NULL; | ||
1409 | + int socket_initialized = 0; | ||
1410 | |||
1411 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1412 | if (local) | ||
1413 | @@ -217,7 +223,19 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1414 | t->domain_length = | ||
1415 | sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]); | ||
1416 | |||
1417 | - t->sock = socket(PF_INET6, SOCK_DGRAM, 0); | ||
1418 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1419 | + /* | ||
1420 | + * Maybe the socket was already provided by systemd... | ||
1421 | + */ | ||
1422 | + if (local) { | ||
1423 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1, | ||
1424 | + ntohs(addr->sin6_port)); | ||
1425 | + if (t->sock) | ||
1426 | + socket_initialized = 1; | ||
1427 | + } | ||
1428 | +#endif | ||
1429 | + if (!socket_initialized) | ||
1430 | + t->sock = socket(PF_INET6, SOCK_DGRAM, 0); | ||
1431 | if (t->sock < 0) { | ||
1432 | netsnmp_transport_free(t); | ||
1433 | return NULL; | ||
1434 | @@ -242,13 +260,14 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1435 | } | ||
1436 | } | ||
1437 | #endif | ||
1438 | - | ||
1439 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1440 | - sizeof(struct sockaddr_in6)); | ||
1441 | - if (rc != 0) { | ||
1442 | - netsnmp_socketbase_close(t); | ||
1443 | - netsnmp_transport_free(t); | ||
1444 | - return NULL; | ||
1445 | + if (!socket_initialized) { | ||
1446 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1447 | + sizeof(struct sockaddr_in6)); | ||
1448 | + if (rc != 0) { | ||
1449 | + netsnmp_socketbase_close(t); | ||
1450 | + netsnmp_transport_free(t); | ||
1451 | + return NULL; | ||
1452 | + } | ||
1453 | } | ||
1454 | t->local = (unsigned char*)malloc(18); | ||
1455 | if (t->local == NULL) { | ||
1456 | diff --git a/snmplib/transports/snmpUnixDomain.c b/snmplib/transports/snmpUnixDomain.c | ||
1457 | index 674dc2b..9f3d3cb 100644 | ||
1458 | --- a/snmplib/transports/snmpUnixDomain.c | ||
1459 | +++ b/snmplib/transports/snmpUnixDomain.c | ||
1460 | @@ -37,6 +37,10 @@ | ||
1461 | #include <net-snmp/library/system.h> /* mkdirhier */ | ||
1462 | #include <net-snmp/library/tools.h> | ||
1463 | |||
1464 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1465 | +#include <net-snmp/library/sd-daemon.h> | ||
1466 | +#endif | ||
1467 | + | ||
1468 | netsnmp_feature_child_of(transport_unix_socket_all, transport_all) | ||
1469 | netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all) | ||
1470 | |||
1471 | @@ -295,6 +299,8 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1472 | netsnmp_transport *t = NULL; | ||
1473 | sockaddr_un_pair *sup = NULL; | ||
1474 | int rc = 0; | ||
1475 | + char *string = NULL; | ||
1476 | + int socket_initialized = 0; | ||
1477 | |||
1478 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1479 | /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate, | ||
1480 | @@ -333,7 +339,18 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1481 | t->data_length = sizeof(sockaddr_un_pair); | ||
1482 | sup = (sockaddr_un_pair *) t->data; | ||
1483 | |||
1484 | - t->sock = socket(PF_UNIX, SOCK_STREAM, 0); | ||
1485 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1486 | + /* | ||
1487 | + * Maybe the socket was already provided by systemd... | ||
1488 | + */ | ||
1489 | + if (local) { | ||
1490 | + t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path); | ||
1491 | + if (t->sock) | ||
1492 | + socket_initialized = 1; | ||
1493 | + } | ||
1494 | +#endif | ||
1495 | + if (!socket_initialized) | ||
1496 | + t->sock = socket(PF_UNIX, SOCK_STREAM, 0); | ||
1497 | if (t->sock < 0) { | ||
1498 | netsnmp_transport_free(t); | ||
1499 | return NULL; | ||
1500 | @@ -357,25 +374,26 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1501 | |||
1502 | t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; | ||
1503 | |||
1504 | - unlink(addr->sun_path); | ||
1505 | - rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1506 | - | ||
1507 | - if (rc != 0 && errno == ENOENT && create_path) { | ||
1508 | - rc = mkdirhier(addr->sun_path, create_mode, 1); | ||
1509 | + if (!socket_initialized) { | ||
1510 | + unlink(addr->sun_path); | ||
1511 | + rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1512 | + if (rc != 0 && errno == ENOENT && create_path) { | ||
1513 | + rc = mkdirhier(addr->sun_path, create_mode, 1); | ||
1514 | + if (rc != 0) { | ||
1515 | + netsnmp_unix_close(t); | ||
1516 | + netsnmp_transport_free(t); | ||
1517 | + return NULL; | ||
1518 | + } | ||
1519 | + rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1520 | + } | ||
1521 | if (rc != 0) { | ||
1522 | + DEBUGMSGTL(("netsnmp_unix_transport", | ||
1523 | + "couldn't bind \"%s\", errno %d (%s)\n", | ||
1524 | + addr->sun_path, errno, strerror(errno))); | ||
1525 | netsnmp_unix_close(t); | ||
1526 | netsnmp_transport_free(t); | ||
1527 | return NULL; | ||
1528 | } | ||
1529 | - rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1530 | - } | ||
1531 | - if (rc != 0) { | ||
1532 | - DEBUGMSGTL(("netsnmp_unix_transport", | ||
1533 | - "couldn't bind \"%s\", errno %d (%s)\n", | ||
1534 | - addr->sun_path, errno, strerror(errno))); | ||
1535 | - netsnmp_unix_close(t); | ||
1536 | - netsnmp_transport_free(t); | ||
1537 | - return NULL; | ||
1538 | } | ||
1539 | |||
1540 | /* | ||
1541 | @@ -391,16 +409,17 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1542 | * Now sit here and listen for connections to arrive. | ||
1543 | */ | ||
1544 | |||
1545 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1546 | - if (rc != 0) { | ||
1547 | - DEBUGMSGTL(("netsnmp_unix_transport", | ||
1548 | - "couldn't listen to \"%s\", errno %d (%s)\n", | ||
1549 | - addr->sun_path, errno, strerror(errno))); | ||
1550 | - netsnmp_unix_close(t); | ||
1551 | - netsnmp_transport_free(t); | ||
1552 | - return NULL; | ||
1553 | + if (!socket_initialized) { | ||
1554 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1555 | + if (rc != 0) { | ||
1556 | + DEBUGMSGTL(("netsnmp_unix_transport", | ||
1557 | + "couldn't listen to \"%s\", errno %d (%s)\n", | ||
1558 | + addr->sun_path, errno, strerror(errno))); | ||
1559 | + netsnmp_unix_close(t); | ||
1560 | + netsnmp_transport_free(t); | ||
1561 | + return NULL; | ||
1562 | + } | ||
1563 | } | ||
1564 | - | ||
1565 | } else { | ||
1566 | t->remote = (u_char *)malloc(strlen(addr->sun_path)); | ||
1567 | if (t->remote == NULL) { | ||
1568 | diff --git a/win32/libsnmp/Makefile.in b/win32/libsnmp/Makefile.in | ||
1569 | index 98d83c8..dd5689b 100644 | ||
1570 | --- a/win32/libsnmp/Makefile.in | ||
1571 | +++ b/win32/libsnmp/Makefile.in | ||
1572 | @@ -42,6 +42,7 @@ LIB32_OBJS= \ | ||
1573 | "$(INTDIR)\read_config.obj" \ | ||
1574 | "$(INTDIR)\readdir.obj" \ | ||
1575 | "$(INTDIR)\scapi.obj" \ | ||
1576 | + "$(INTDIR)\sd-daemon.obj" \ | ||
1577 | "$(INTDIR)\snmp-tc.obj" \ | ||
1578 | "$(INTDIR)\snmp.obj" \ | ||
1579 | "$(INTDIR)\snmpCallbackDomain.obj" \ | ||
1580 | @@ -307,6 +308,12 @@ SOURCE=..\..\snmplib\scapi.c | ||
1581 | $(CPP) $(CPP_PROJ) $(SOURCE) | ||
1582 | |||
1583 | |||
1584 | +SOURCE=..\..\snmplib\sd-daemon.c | ||
1585 | + | ||
1586 | +"$(INTDIR)\sd-daemon.obj" : $(SOURCE) "$(INTDIR)" | ||
1587 | + $(CPP) $(CPP_PROJ) $(SOURCE) | ||
1588 | + | ||
1589 | + | ||
1590 | SOURCE="..\..\snmplib\snmp-tc.c" | ||
1591 | |||
1592 | "$(INTDIR)\snmp-tc.obj" : $(SOURCE) "$(INTDIR)" | ||
1593 | diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h | ||
1594 | index 7791ee0..1eccf42 100644 | ||
1595 | --- a/win32/net-snmp/net-snmp-config.h | ||
1596 | +++ b/win32/net-snmp/net-snmp-config.h | ||
1597 | @@ -1705,6 +1705,8 @@ enum { | ||
1598 | #define DMALLOC_FUNC_CHECK | ||
1599 | #endif | ||
1600 | |||
1601 | +#define NETSNMP_NO_SYSTEMD | ||
1602 | + | ||
1603 | /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ | ||
1604 | |||
1605 | /* define if agentx transport is to use domain sockets only */ | ||
1606 | diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in | ||
1607 | index 5215865..1607bfa 100644 | ||
1608 | --- a/win32/net-snmp/net-snmp-config.h.in | ||
1609 | +++ b/win32/net-snmp/net-snmp-config.h.in | ||
1610 | @@ -1705,6 +1705,8 @@ enum { | ||
1611 | #define DMALLOC_FUNC_CHECK | ||
1612 | #endif | ||
1613 | |||
1614 | +#define NETSNMP_NO_SYSTEMD | ||
1615 | + | ||
1616 | /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ | ||
1617 | |||
1618 | /* define if agentx transport is to use domain sockets only */ | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb new file mode 100644 index 000000000..f6ddcacec --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.1.bb | |||
@@ -0,0 +1,136 @@ | |||
1 | SUMMARY = "Various tools relating to the Simple Network Management Protocol" | ||
2 | HOMEPAGE = "http://www.net-snmp.org/" | ||
3 | LICENSE = "BSD" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" | ||
6 | |||
7 | DEPENDS = "openssl libnl pciutils" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \ | ||
10 | file://0001-Added-checks-for-printing-variables-with-wrong-types.patch \ | ||
11 | file://init \ | ||
12 | file://snmpd.conf \ | ||
13 | file://snmptrapd.conf \ | ||
14 | file://systemd-support.patch \ | ||
15 | file://snmpd.service \ | ||
16 | file://snmptrapd.service \ | ||
17 | file://ifmib.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI[md5sum] = "a2c83518648b0f2a5d378625e45c0e18" | ||
21 | SRC_URI[sha256sum] = "ac9105539971f7cfb1456a86d479e18e8a8b3712212595ad40504347ba5843da" | ||
22 | |||
23 | inherit autotools update-rc.d siteinfo systemd | ||
24 | |||
25 | EXTRA_OEMAKE = "INSTALL_PREFIX=${D}" | ||
26 | |||
27 | PARALLEL_MAKE = "" | ||
28 | CCACHE = "" | ||
29 | |||
30 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
31 | |||
32 | EXTRA_OECONF = "--disable-embedded-perl \ | ||
33 | --with-perl-modules=no \ | ||
34 | --enable-shared \ | ||
35 | --disable-manuals \ | ||
36 | --with-defaults \ | ||
37 | ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}" | ||
38 | |||
39 | CACHED_CONFIGUREVARS = " \ | ||
40 | ac_cv_header_valgrind_valgrind_h=no \ | ||
41 | ac_cv_header_valgrind_memcheck_h=no \ | ||
42 | " | ||
43 | |||
44 | do_configure_prepend() { | ||
45 | export PERLPROG="${bindir}/env perl" | ||
46 | } | ||
47 | |||
48 | do_install_append() { | ||
49 | install -d ${D}${sysconfdir}/snmp | ||
50 | install -d ${D}${sysconfdir}/init.d | ||
51 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd | ||
52 | install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/ | ||
53 | install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/ | ||
54 | sed -e "s@-I/usr/include@@g" \ | ||
55 | -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}@g" \ | ||
56 | -e "s@^exec_prefix=.*@exec_prefix=${STAGING_DIR_HOST}@g" \ | ||
57 | -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ | ||
58 | -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ | ||
59 | -i ${D}${bindir}/net-snmp-config | ||
60 | install -d ${D}${systemd_unitdir}/system | ||
61 | install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system | ||
62 | install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system | ||
63 | } | ||
64 | |||
65 | SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" | ||
66 | |||
67 | net_snmp_sysroot_preprocess () { | ||
68 | if [ -e ${D}${bindir}/net-snmp-config ]; then | ||
69 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ | ||
70 | install -m 755 ${D}${bindir}/net-snmp-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ | ||
71 | fi | ||
72 | } | ||
73 | |||
74 | PACKAGES =+ "${PN}-static ${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd \ | ||
75 | ${PN}-server-snmptrapd" | ||
76 | |||
77 | ALLOW_EMPTY_${PN}-server = "1" | ||
78 | ALLOW_EMPTY_${PN} = "1" | ||
79 | |||
80 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" | ||
81 | FILES_${PN}-mibs = "${datadir}/snmp/mibs" | ||
82 | FILES_${PN}-server-snmpd = "${sbindir}/snmpd \ | ||
83 | ${sysconfdir}/snmp/snmpd.conf \ | ||
84 | ${sysconfdir}/init.d \ | ||
85 | ${systemd_unitdir}/system/snmpd.service \ | ||
86 | " | ||
87 | |||
88 | FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ | ||
89 | ${sysconfdir}/snmp/snmptrapd.conf \ | ||
90 | ${systemd_unitdir}/system/snmptrapd.service \ | ||
91 | " | ||
92 | |||
93 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" | ||
94 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" | ||
95 | FILES_${PN}-dev += "${bindir}/net-snmp-config ${bindir}/mib2c ${bindir}/mib2c-update" | ||
96 | |||
97 | CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" | ||
98 | CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" | ||
99 | |||
100 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
101 | INITSCRIPT_NAME_${PN}-server = "snmpd" | ||
102 | INITSCRIPT_PARAMS_${PN}-server = "defaults" | ||
103 | |||
104 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}" | ||
105 | |||
106 | SYSTEMD_PACKAGES = "${PN}-server-snmpd \ | ||
107 | ${PN}-server-snmptrapd" | ||
108 | |||
109 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" | ||
110 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" | ||
111 | |||
112 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" | ||
113 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" | ||
114 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" | ||
115 | RDEPENDS_${PN}-client += "net-snmp-mibs" | ||
116 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
117 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
118 | |||
119 | RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
120 | RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
121 | RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
122 | |||
123 | RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
124 | RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
125 | RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
126 | |||
127 | LEAD_SONAME = "libnetsnmp.so" | ||
128 | |||
129 | pkg_postrm_${PN}-server() { | ||
130 | if test "x$D" != "x"; then | ||
131 | OPT="-r $D " | ||
132 | else | ||
133 | OPT="" | ||
134 | /etc/init.d/snmpd stop | ||
135 | fi | ||
136 | } | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-networking/recipes-protocols/openflow/openflow.inc new file mode 100644 index 000000000..1a226f82c --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow.inc | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "OpenFlow communications protocol" | ||
2 | DESCRIPTION = "\ | ||
3 | Open standard that enables researchers to run experimental protocols in \ | ||
4 | contained networks. OpenFlow is a communications interface between \ | ||
5 | control and forwarding planes of a software-defined networking architecture.\ | ||
6 | " | ||
7 | HOMEPAGE = "http://www.openflow.org" | ||
8 | |||
9 | SECTION = "networking" | ||
10 | LICENSE = "GPLv2" | ||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2" | ||
13 | |||
14 | SRC_URI = "git://gitosis.stanford.edu/openflow.git;protocol=git" | ||
15 | |||
16 | DEPENDS = "virtual/libc" | ||
17 | |||
18 | EXTRA_OECONF += "KARCH=${TARGET_ARCH}" | ||
19 | |||
20 | PACKAGECONFIG ??= "openssl" | ||
21 | PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl, libssl" | ||
22 | |||
23 | S = "${WORKDIR}/git" | ||
24 | |||
25 | inherit autotools-brokensep | ||
26 | |||
27 | do_configure() { | ||
28 | ./boot.sh | ||
29 | oe_runconf | ||
30 | } | ||
31 | |||
32 | do_install_append() { | ||
33 | # Remove /var/run as it is created on startup | ||
34 | rm -rf ${D}${localstatedir}/run | ||
35 | } | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow_1.0.bb b/meta-networking/recipes-protocols/openflow/openflow_1.0.bb new file mode 100644 index 000000000..a7e254dd8 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow_1.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | include ${BPN}.inc | ||
2 | |||
3 | SRCREV = "5ccca75a69f99791659bcfbcf35353ab1921320a" | ||
4 | PV = "1.0" | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow_git.bb b/meta-networking/recipes-protocols/openflow/openflow_git.bb new file mode 100644 index 000000000..6403bfb22 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow_git.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | include ${BPN}.inc | ||
2 | |||
3 | SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a" | ||
4 | PV = "1.0+git${SRCPV}" | ||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch new file mode 100644 index 000000000..96dbc7551 --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch | |||
@@ -0,0 +1,106 @@ | |||
1 | From 152486fa3c36c3b99d17d5b553cf87ef412fae8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Li xin <lixin.fnst@cn.fujitsu.com> | ||
3 | Date: Mon, 1 Dec 2014 01:53:41 +0900 | ||
4 | Subject: [PATCH] Makefile:modify CFLAGS to aviod build error. | ||
5 | |||
6 | Upstream-Status: pending | ||
7 | |||
8 | Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> | ||
9 | --- | ||
10 | Makefile | 22 +++++++++++----------- | ||
11 | plugins/Makefile | 6 +++--- | ||
12 | 2 files changed, 14 insertions(+), 14 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile b/Makefile | ||
15 | index 4aaa448..baa7882 100644 | ||
16 | --- a/Makefile | ||
17 | +++ b/Makefile | ||
18 | @@ -152,10 +152,10 @@ LIBS.dmalloc= -ldmalloc | ||
19 | export USE_DMALLOC | ||
20 | endif | ||
21 | |||
22 | -CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) | ||
23 | -CFLAGS= -I. -Iusl -Icli -isystem include \ | ||
24 | - -MMD -Wall -Werror -Wno-strict-aliasing \ | ||
25 | - $(CPPFLAGS) $(CPPFLAGS.dmalloc) \ | ||
26 | +ADD_CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y) | ||
27 | +ADD_CFLAGS= -I. -Iusl -Icli -isystem include \ | ||
28 | + -MMD -Wall -Wno-strict-aliasing \ | ||
29 | + $(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \ | ||
30 | -DSYS_LIBDIR=$(SYS_LIBDIR) | ||
31 | LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc | ||
32 | LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc | ||
33 | @@ -170,10 +170,10 @@ CFLAGS.optimize= $(OPT_CFLAGS) | ||
34 | endif | ||
35 | export CFLAGS.optimize | ||
36 | |||
37 | -CFLAGS+= $(CFLAGS.optimize) | ||
38 | +ADD_CFLAGS+= $(CFLAGS.optimize) | ||
39 | |||
40 | ifeq ($(L2TP_USE_ASYNC_RPC),y) | ||
41 | -CPPFLAGS+= -DL2TP_ASYNC_RPC | ||
42 | +ADD_CPPFLAGS+= -DL2TP_ASYNC_RPC | ||
43 | endif | ||
44 | |||
45 | ifeq ($(L2TP_FEATURE_RPC_MANAGEMENT),y) | ||
46 | @@ -220,13 +220,13 @@ endif | ||
47 | |||
48 | # Compile without -Wall because rpcgen-generated code is full of warnings. | ||
49 | %_xdr.o: %_xdr.c | ||
50 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
51 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
52 | |||
53 | %_client.o: %_client.c | ||
54 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
55 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
56 | |||
57 | %_server.o: %_server.c | ||
58 | - $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $< | ||
59 | + $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $< | ||
60 | |||
61 | %_xdr.c: %.x | ||
62 | -$(RM) $@ | ||
63 | @@ -272,7 +272,7 @@ l2tpconfig: $(L2TPCONFIG_SRCS.o) | ||
64 | $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig) | ||
65 | |||
66 | %.o: %.c | ||
67 | - $(CC) -c $(CFLAGS) $< -o $@ | ||
68 | + $(CC) -c $(CFLAGS) $(ADD_CFLAGS) $< -o $@ | ||
69 | |||
70 | l2tp_options.h: FORCE | ||
71 | @rm -f $@.tmp | ||
72 | @@ -325,7 +325,7 @@ install: install-all | ||
73 | install-all: all install-daemon install-app | ||
74 | |||
75 | install-daemon: | ||
76 | - @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done | ||
77 | + @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS) $(ADD_CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done | ||
78 | $(INSTALL) -d $(DESTDIR)/usr/sbin | ||
79 | $(INSTALL) openl2tpd $(DESTDIR)/usr/sbin | ||
80 | |||
81 | diff --git a/plugins/Makefile b/plugins/Makefile | ||
82 | index 5be996d..6810236 100644 | ||
83 | --- a/plugins/Makefile | ||
84 | +++ b/plugins/Makefile | ||
85 | @@ -1,7 +1,7 @@ | ||
86 | -CFLAGS := $(CFLAGS.optimize) -MMD -Wall \ | ||
87 | +ADD_CFLAGS := $(CFLAGS.optimize) -MMD -Wall \ | ||
88 | -isystem ../include \ | ||
89 | -I. -I.. -I../usl -fPIC $(EXTRA_CFLAGS) | ||
90 | -LDFLAGS := -shared | ||
91 | +ADD_LDFLAGS := -shared | ||
92 | |||
93 | PLUGINS.c:= ppp_unix.c ppp_null.c ipsec.c event_sock.c | ||
94 | |||
95 | @@ -21,7 +21,7 @@ clean: | ||
96 | $(RM) $(PLUGINS.so) $(wildcard *.o) $(wildcard *.d) $(SRC.generated) | ||
97 | |||
98 | %.so: %.c | ||
99 | - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $< | ||
100 | + $(CC) -o $@ $(LDFLAGS) $(ADD_LDFLAGS) $(CFLAGS) $(ADD_CFLAGS) $< | ||
101 | |||
102 | install: all | ||
103 | $(INSTALL) -d $(DESTDIR)$(SYS_LIBDIR)/openl2tp | ||
104 | -- | ||
105 | 1.8.4.2 | ||
106 | |||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch new file mode 100644 index 000000000..c11a127b8 --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 460549a3de27f8dd8371b6d6fc1f69d8bffa102b Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe_macdonald@mentor.com> | ||
3 | Date: Tue, 6 Jan 2015 11:23:21 -0500 | ||
4 | Subject: [PATCH] openl2tp: simplify gcc warning hack | ||
5 | |||
6 | The hack to work around the gcc warning causes problems with some modern | ||
7 | gcc configurations. Since the redef behaviour is essentially correct | ||
8 | everywhere and since the hack is still required on 32-bit builders, leave | ||
9 | it in place but remove the #if guard since it is only there to ensure that | ||
10 | the l2tp_private.h file is updated if the rpc source file is changed and | ||
11 | the two get out of sync. | ||
12 | |||
13 | Upstream-status: pending | ||
14 | |||
15 | Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com> | ||
16 | --- | ||
17 | l2tp_private.h | 6 ------ | ||
18 | 1 file changed, 6 deletions(-) | ||
19 | |||
20 | diff --git a/l2tp_private.h b/l2tp_private.h | ||
21 | index f3c1af7..cca6806 100644 | ||
22 | --- a/l2tp_private.h | ||
23 | +++ b/l2tp_private.h | ||
24 | @@ -89,14 +89,8 @@ | ||
25 | * So we redefine the constant with UL suffix to avoid the gcc warning. | ||
26 | * Is there some C preprocessor magic that could avoid having to do this? | ||
27 | */ | ||
28 | -#if L2TP_API_TUNNEL_FLAG_MTU != 2147483648 | ||
29 | -#error Constant L2TP_API_TUNNEL_FLAG_MTU changed. Update local definition here. | ||
30 | -#endif | ||
31 | #undef L2TP_API_TUNNEL_FLAG_MTU | ||
32 | #define L2TP_API_TUNNEL_FLAG_MTU 2147483648UL | ||
33 | -#if L2TP_API_SESSION_FLAG_NO_PPP != 2147483648 | ||
34 | -#error Constant L2TP_API_SESSION_FLAG_NO_PPP changed. Update local definition here. | ||
35 | -#endif | ||
36 | #undef L2TP_API_SESSION_FLAG_NO_PPP | ||
37 | #define L2TP_API_SESSION_FLAG_NO_PPP 2147483648UL | ||
38 | |||
39 | -- | ||
40 | 1.9.1 | ||
41 | |||
diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb new file mode 100644 index 000000000..5a041073d --- /dev/null +++ b/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | SUMMARY = "An L2TP client/server, designed for VPN use." | ||
2 | DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \ | ||
3 | specifically for Linux. It has been designed for use as an enterprise \ | ||
4 | L2TP VPN server or in commercial, Linux-based, embedded networking \ | ||
5 | products and is able to support hundreds of sessions, each with \ | ||
6 | different configuration. It is used by several ISPs to provide \ | ||
7 | L2TP services and by corporations to implement L2TP VPNs." | ||
8 | HOMEPAGE = "http://www.openl2tp.org/" | ||
9 | SECTION = "console/network" | ||
10 | LICENSE = "GPL-2.0" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585" | ||
12 | DEPENDS = "popt flex readline" | ||
13 | |||
14 | SRC_URI = "http://ftp.jaist.ac.jp/pub/sourceforge/o/op/${PN}/${PN}/${PV}/${BP}.tar.gz \ | ||
15 | file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \ | ||
16 | file://openl2tp-simplify-gcc-warning-hack.patch \ | ||
17 | " | ||
18 | SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0" | ||
19 | SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f" | ||
20 | |||
21 | inherit autotools-brokensep pkgconfig | ||
22 | |||
23 | PARALLEL_MAKE = "" | ||
24 | EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-nused-but-set-variable"' | ||
25 | |||
26 | do_compile_prepend() { | ||
27 | sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \ | ||
28 | -e 's:$(CROSS_COMPILE)as:${AS}:g' \ | ||
29 | -e 's:$(CROSS_COMPILE)ld:${LD}:g' \ | ||
30 | -e 's:$(CROSS_COMPILE)gcc:${CC}:g' \ | ||
31 | -e 's:$(CROSS_COMPILE)ar:${AR}:g' \ | ||
32 | -e 's:$(CROSS_COMPILE)nm:${NM}:g' \ | ||
33 | -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \ | ||
34 | -e 's:$(CROSS_COMPILE)install:install:g' \ | ||
35 | ${S}/Makefile | ||
36 | } | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch new file mode 100644 index 000000000..77722b064 --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | pptp.c and version.c depend on config.h | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | Upstream has already similar fixes. Will be available on next release. | ||
6 | |||
7 | Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> | ||
8 | |||
9 | --- a/Makefile 2013-02-27 17:09:24.431226665 +0800 | ||
10 | +++ b/Makefile 2013-02-27 17:09:03.442075550 +0800 | ||
11 | @@ -43,6 +43,8 @@ | ||
12 | pptpsetup.8: pptpsetup | ||
13 | pod2man $? > $@ | ||
14 | |||
15 | +pptp.o version.o: config.h | ||
16 | + | ||
17 | config.h: | ||
18 | echo "/* text added by Makefile target config.h */" > config.h | ||
19 | echo "#define PPTP_LINUX_VERSION \"$(VERSION)$(RELEASE)\"" >> config.h | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp new file mode 100644 index 000000000..f446e22a6 --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp | |||
@@ -0,0 +1,30 @@ | |||
1 | # | ||
2 | # Lock the port | ||
3 | # | ||
4 | lock | ||
5 | |||
6 | # | ||
7 | # We don't need the tunnel server to authenticate itself | ||
8 | # | ||
9 | noauth | ||
10 | |||
11 | # | ||
12 | # Turn off transmission protocols we know won't be used | ||
13 | # | ||
14 | nobsdcomp | ||
15 | nodeflate | ||
16 | |||
17 | # | ||
18 | # We want MPPE | ||
19 | # (option naming specific to ppp 2.4.0 with unofficial patch) | ||
20 | # | ||
21 | #mppe-40 | ||
22 | mppe-128 | ||
23 | #mppe-stateless | ||
24 | |||
25 | # | ||
26 | # We want a sane mtu/mru | ||
27 | # (ppp 2.4.0 with unofficial patch) | ||
28 | # | ||
29 | #mtu 1000 | ||
30 | #mru 1000 | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb new file mode 100644 index 000000000..6a90578bc --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "Client for Microsoft PPTP VPNs" | ||
2 | DESCRIPTION = "PPTP Client is a Linux, FreeBSD, NetBSD \ | ||
3 | and OpenBSD client for the proprietary Microsoft Point-to-Point \ | ||
4 | Tunneling Protocol, PPTP. Allows connection to a PPTP based \ | ||
5 | Virtual Private Network (VPN) as used by employers and some \ | ||
6 | cable and ADSL internet service providers." | ||
7 | HOMEPAGE = "http://pptpclient.sourceforge.net" | ||
8 | SECTION = "network" | ||
9 | LICENSE = "GPLv2+" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
11 | |||
12 | PR = "r1" | ||
13 | |||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/pptpclient/pptp-${PV}.tar.gz \ | ||
15 | file://options.pptp \ | ||
16 | file://fix-parallel-build.patch \ | ||
17 | " | ||
18 | |||
19 | SRC_URI[md5sum] = "4c3d19286a37459a632c7128c92a9857" | ||
20 | SRC_URI[sha256sum] = "e98ae0065d2a39fa3131654ff28cb7070e996f668ed6d0e7d9a445b8d37694bc" | ||
21 | |||
22 | S = "${WORKDIR}/pptp-${PV}" | ||
23 | |||
24 | do_install() { | ||
25 | install -d ${D}${sbindir} ${D}${sysconfdir}/ppp ${D}${mandir}/man8 | ||
26 | install -m 555 pptp ${D}${sbindir} | ||
27 | install -m 644 pptp.8 ${D}${mandir}/man8 | ||
28 | install -m 644 ${WORKDIR}/options.pptp ${D}${sysconfdir}/ppp | ||
29 | } | ||
30 | |||
31 | RDEPENDS_${PN} = "ppp" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch new file mode 100644 index 000000000..35f4637d8 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | sync zebra routing table with the kernel one when interface is down | ||
2 | |||
3 | Add router to kernel main router table with "ip", then you can see | ||
4 | a router item in kernel main router table. Also can see this router | ||
5 | item in zebra router table. If down the interface, this router item | ||
6 | will be deleted from kernel main router table, but it will not be | ||
7 | deleted from zebra router table, just set as inactive. | ||
8 | |||
9 | This patch is adopted from [1]. | ||
10 | [1] http://www.gossamer-threads.com/lists/quagga/dev/22609 | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-of-by: Aws Ismail <aws.ismail@windriver.com> | ||
15 | Signed-of-by: Roy.Li <rongqing.li@windriver.com> | ||
16 | |||
17 | --- | ||
18 | zebra/zebra_rib.c | 7 +++++++ | ||
19 | 1 files changed, 7 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c | ||
22 | index 154e8d5..63434d0 100644 | ||
23 | --- a/zebra/zebra_rib.c | ||
24 | +++ b/zebra/zebra_rib.c | ||
25 | @@ -765,6 +765,9 @@ rib_match_ipv6 (struct in6_addr *addr) | ||
26 | #define RIB_SYSTEM_ROUTE(R) \ | ||
27 | ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT) | ||
28 | |||
29 | +#define RIB_KERNEL_ROUTE(R) \ | ||
30 | + ((R)->type == ZEBRA_ROUTE_KERNEL) | ||
31 | + | ||
32 | /* This function verifies reachability of one given nexthop, which can be | ||
33 | * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored | ||
34 | * in nexthop->flags field. If the 4th parameter, 'set', is non-zero, | ||
35 | @@ -1135,6 +1138,10 @@ rib_process (struct route_node *rn) | ||
36 | redistribute_delete (&rn->p, fib); | ||
37 | if (! RIB_SYSTEM_ROUTE (fib)) | ||
38 | rib_uninstall_kernel (rn, fib); | ||
39 | +#ifdef GNU_LINUX | ||
40 | + else if(RIB_KERNEL_ROUTE (fib) && !if_is_up(if_lookup_by_index(fib->nexthop->ifindex))) | ||
41 | + del=fib; | ||
42 | +#endif | ||
43 | UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); | ||
44 | |||
45 | /* Set real nexthop. */ | ||
46 | -- | ||
47 | 1.7.4.1 | ||
48 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch new file mode 100644 index 000000000..c2757a2fb --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From ba71f768e6dbb1f2ac72ed3bd880bff75a48d345 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roy Li <rongqing.li@windriver.com> | ||
3 | Date: Wed, 19 Feb 2014 14:13:40 +0800 | ||
4 | Subject: [PATCH] babeld: close stdout once the background daemon is created | ||
5 | |||
6 | Upstream-Status: pending | ||
7 | |||
8 | Once babald becomes a background daemon, it should not output information to | ||
9 | stdout, so need to close stdout. | ||
10 | |||
11 | In fact, other daemons close their stdout when they run into background, like | ||
12 | ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c | ||
13 | |||
14 | Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp } | ||
15 | |||
16 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
17 | --- | ||
18 | babeld/util.c | 10 +++++++++- | ||
19 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/babeld/util.c b/babeld/util.c | ||
22 | index 011f382..76203bc 100644 | ||
23 | --- a/babeld/util.c | ||
24 | +++ b/babeld/util.c | ||
25 | @@ -425,7 +425,7 @@ uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src) | ||
26 | int | ||
27 | daemonise() | ||
28 | { | ||
29 | - int rc; | ||
30 | + int rc, fd; | ||
31 | |||
32 | fflush(stdout); | ||
33 | fflush(stderr); | ||
34 | @@ -441,5 +441,13 @@ daemonise() | ||
35 | if(rc < 0) | ||
36 | return -1; | ||
37 | |||
38 | + fd = open("/dev/null", O_RDWR, 0); | ||
39 | + if (fd != -1) | ||
40 | + { | ||
41 | + dup2(fd, STDOUT_FILENO); | ||
42 | + if (fd > 2) | ||
43 | + close(fd); | ||
44 | + } | ||
45 | + | ||
46 | return 1; | ||
47 | } | ||
48 | -- | ||
49 | 1.7.10.4 | ||
50 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/babeld.service b/meta-networking/recipes-protocols/quagga/files/babeld.service new file mode 100644 index 000000000..dd344b0b3 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/babeld.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=Babel routing daemon | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/babeld.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/babeld -d $babeld_options -f /etc/quagga/babeld.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/bgpd.service b/meta-networking/recipes-protocols/quagga/files/bgpd.service new file mode 100644 index 000000000..164c81724 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/bgpd.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=BGP routing daemon | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f /etc/quagga/bgpd.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/isisd.service b/meta-networking/recipes-protocols/quagga/files/isisd.service new file mode 100644 index 000000000..9bfe7b65e --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/isisd.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=IS-IS routing daemon | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/isisd.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/isisd -d $isisd_options -f /etc/quagga/isisd.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/ospf6d.service b/meta-networking/recipes-protocols/quagga/files/ospf6d.service new file mode 100644 index 000000000..4b8ebf802 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ospf6d.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=OSPF routing daemon for IPv6 | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f /etc/quagga/ospf6d.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/ospfd.service b/meta-networking/recipes-protocols/quagga/files/ospfd.service new file mode 100644 index 000000000..f9f5031b4 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ospfd.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=OSPF routing daemon | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f /etc/quagga/ospfd.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch new file mode 100644 index 000000000..a07e33f9f --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | quagga: Avoid duplicate connected address adding to the list | ||
2 | |||
3 | commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal") | ||
4 | introduces an regression: ifp->connected list is cleaned up when ripd is | ||
5 | restarting, however, for interface addresses which are not specified in | ||
6 | ripd configuration file, they are never to be added into ifp->connected | ||
7 | again, this will lead to some abnormal behavior for route advertising. | ||
8 | |||
9 | Instead of cleaning up the ifp->connected list to avoid duplicated | ||
10 | connected address being added into this list, we can check this | ||
11 | condition during interface address adding process and return early | ||
12 | when an identical address has already been added. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: Hu Yadi <Yadi.hu@windriver.com> | ||
17 | Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> | ||
18 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
19 | --- | ||
20 | --- a/lib/if.c | ||
21 | +++ b/lib/if.c | ||
22 | @@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac | ||
23 | struct prefix *destination) | ||
24 | { | ||
25 | struct connected *ifc; | ||
26 | + struct listnode *cnode; | ||
27 | + struct connected *c; | ||
28 | + int ret = 0; | ||
29 | + | ||
30 | + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) | ||
31 | + { | ||
32 | + ret = connected_same_prefix (p, (c->address)); | ||
33 | + if(ret == 1) | ||
34 | + return NULL; | ||
35 | + } | ||
36 | |||
37 | /* Allocate new connected address. */ | ||
38 | ifc = connected_new (); | ||
39 | --- a/ripd/rip_interface.c | ||
40 | +++ b/ripd/rip_interface.c | ||
41 | @@ -516,13 +516,6 @@ rip_interface_clean (void) | ||
42 | thread_cancel (ri->t_wakeup); | ||
43 | ri->t_wakeup = NULL; | ||
44 | } | ||
45 | - | ||
46 | - for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) | ||
47 | - { | ||
48 | - ifc = listgetdata (conn_node); | ||
49 | - next = conn_node->next; | ||
50 | - listnode_delete (ifp->connected, ifc); | ||
51 | - } | ||
52 | } | ||
53 | } | ||
54 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-networking/recipes-protocols/quagga/files/quagga.default new file mode 100644 index 000000000..0c1ce6c04 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.default | |||
@@ -0,0 +1,13 @@ | |||
1 | # If this option is set the /etc/init.d/quagga script automatically loads | ||
2 | # the config via "vtysh -b" when the servers are started. | ||
3 | vtysh_enable=yes | ||
4 | |||
5 | # Bind all daemons to loopback only by default | ||
6 | zebra_options=" --daemon -A 127.0.0.1" | ||
7 | babeld_options="--daemon -A 127.0.0.1" | ||
8 | bgpd_options=" --daemon -A 127.0.0.1" | ||
9 | ospfd_options=" --daemon -A 127.0.0.1" | ||
10 | ospf6d_options="--daemon -A ::1" | ||
11 | ripd_options=" --daemon -A 127.0.0.1" | ||
12 | ripngd_options="--daemon -A ::1" | ||
13 | isisd_options=" --daemon -A 127.0.0.1" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-networking/recipes-protocols/quagga/files/quagga.init new file mode 100644 index 000000000..60b5ab01a --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.init | |||
@@ -0,0 +1,200 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # /etc/init.d/quagga -- start/stop the Quagga routing daemons | ||
4 | # | ||
5 | # Based on debian version by Endre Hirling <endre@mail.elte.hu> and | ||
6 | # Christian Hammers <ch@debian.org>. | ||
7 | # | ||
8 | |||
9 | ### BEGIN INIT INFO | ||
10 | # Provides: quagga | ||
11 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
12 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
13 | # Default-Start: 2 3 4 5 | ||
14 | # Default-Stop: 0 1 6 | ||
15 | # Short-Description: start and stop the Quagga routing suite | ||
16 | # Description: Quagga is a routing suite for IP routing protocols like | ||
17 | # BGP, OSPF, RIP and others. This script contols the main | ||
18 | # daemon "quagga" as well as the individual protocol daemons. | ||
19 | ### END INIT INFO | ||
20 | |||
21 | # NOTE: sbin must be before bin so we get the iproute2 ip and not the | ||
22 | # busybox ip command. The busybox one flushes all routes instead of just | ||
23 | # the dynamic routes | ||
24 | PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin | ||
25 | D_PATH=/usr/sbin | ||
26 | C_PATH=/etc/quagga | ||
27 | |||
28 | # Keep zebra first and do not list watchquagga! | ||
29 | DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld" | ||
30 | |||
31 | # Print the name of the pidfile. | ||
32 | pidfile() | ||
33 | { | ||
34 | echo "/var/run/quagga/$1.pid" | ||
35 | } | ||
36 | |||
37 | # Check if daemon is started by using the pidfile. | ||
38 | started() | ||
39 | { | ||
40 | [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 | ||
41 | return 1 | ||
42 | } | ||
43 | |||
44 | # Loads the config via vtysh -b if configured to do so. | ||
45 | vtysh_b () | ||
46 | { | ||
47 | # Rember, that all variables have been incremented by 1 in convert_daemon_prios() | ||
48 | if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then | ||
49 | /usr/bin/vtysh -b | ||
50 | fi | ||
51 | } | ||
52 | |||
53 | # Check if the daemon is activated and if its executable and config files | ||
54 | # are in place. | ||
55 | # params: daemon name | ||
56 | # returns: 0=ok, 1=error | ||
57 | check_daemon() | ||
58 | { | ||
59 | # If the integrated config file is used the others are not checked. | ||
60 | if [ -r "$C_PATH/Quagga.conf" ]; then | ||
61 | return 0 | ||
62 | fi | ||
63 | |||
64 | # check for config file | ||
65 | if [ ! -r "$C_PATH/$1.conf" ]; then | ||
66 | return 1 | ||
67 | fi | ||
68 | return 0 | ||
69 | } | ||
70 | |||
71 | # Starts the server if it's not alrady running according to the pid file. | ||
72 | # The Quagga daemons creates the pidfile when starting. | ||
73 | start() | ||
74 | { | ||
75 | if ! check_daemon $1; then echo -n " (!$1)"; return; fi | ||
76 | echo -n " $1" | ||
77 | start-stop-daemon \ | ||
78 | --start \ | ||
79 | --pidfile=`pidfile $1` \ | ||
80 | --exec "$D_PATH/$1" \ | ||
81 | -- \ | ||
82 | `eval echo "$""$1""_options"` | ||
83 | |||
84 | } | ||
85 | |||
86 | # Stop the daemon given in the parameter, printing its name to the terminal. | ||
87 | stop() | ||
88 | { | ||
89 | if ! started "$1" ; then | ||
90 | echo -n " (!$1)" | ||
91 | return 0 | ||
92 | else | ||
93 | PIDFILE=`pidfile $1` | ||
94 | PID=`cat $PIDFILE 2>/dev/null` | ||
95 | start-stop-daemon --stop --quiet --exec "$D_PATH/$1" | ||
96 | # | ||
97 | # Now we have to wait until $DAEMON has _really_ stopped. | ||
98 | # | ||
99 | if test -n "$PID" && kill -0 $PID 2>/dev/null; then | ||
100 | echo -n " (waiting) ." | ||
101 | cnt=0 | ||
102 | while kill -0 $PID 2>/dev/null; do | ||
103 | cnt=`expr $cnt + 1` | ||
104 | if [ $cnt -gt 60 ]; then | ||
105 | # Waited 120 secs now, fail. | ||
106 | echo -n "Failed.. " | ||
107 | break | ||
108 | fi | ||
109 | sleep 2 | ||
110 | echo -n "." | ||
111 | done | ||
112 | fi | ||
113 | echo -n " $1" | ||
114 | rm -f `pidfile $1` | ||
115 | fi | ||
116 | } | ||
117 | |||
118 | stop_all() | ||
119 | { | ||
120 | local daemon_list | ||
121 | daemon_list=${1:-$DAEMONS} | ||
122 | |||
123 | echo -n "Stopping Quagga daemons:" | ||
124 | for daemon_name in $daemon_list; do | ||
125 | stop "$daemon_name" | ||
126 | done | ||
127 | echo "." | ||
128 | } | ||
129 | |||
130 | start_all() | ||
131 | { | ||
132 | local daemon_list | ||
133 | daemon_list=${1:-$DAEMONS} | ||
134 | |||
135 | echo -n "Starting Quagga daemons:" | ||
136 | for daemon_name in $daemon_list; do | ||
137 | start "$daemon_name" | ||
138 | done | ||
139 | echo "." | ||
140 | } | ||
141 | |||
142 | status_all() | ||
143 | { | ||
144 | local daemon_list | ||
145 | daemon_list=${1:-$DAEMONS} | ||
146 | res=1 | ||
147 | |||
148 | echo -n "quagga: " | ||
149 | for daemon_name in $daemon_list; do | ||
150 | if started "$daemon_name" ; then | ||
151 | id=`cat \`pidfile $daemon_name\`` | ||
152 | echo -n "$daemon_name (pid $id) " | ||
153 | res=0 | ||
154 | fi | ||
155 | done | ||
156 | if [ $res -eq 0 ]; then | ||
157 | echo "is running..." | ||
158 | else | ||
159 | echo "is stopped..." | ||
160 | fi | ||
161 | exit $res | ||
162 | } | ||
163 | |||
164 | ######################################################### | ||
165 | # Main program # | ||
166 | ######################################################### | ||
167 | |||
168 | # Load configuration | ||
169 | test -f /etc/default/quagga && . /etc/default/quagga | ||
170 | |||
171 | case "$1" in | ||
172 | start) | ||
173 | cd $C_PATH/ | ||
174 | start_all $2 | ||
175 | vtysh_b | ||
176 | ;; | ||
177 | |||
178 | stop) | ||
179 | stop_all $2 | ||
180 | echo "Removing all routes made by zebra." | ||
181 | ip route flush proto zebra | ||
182 | ;; | ||
183 | |||
184 | status) | ||
185 | status_all $2 | ||
186 | ;; | ||
187 | |||
188 | restart|force-reload) | ||
189 | $0 stop $2 | ||
190 | sleep 1 | ||
191 | $0 start $2 | ||
192 | ;; | ||
193 | |||
194 | *) | ||
195 | echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" | ||
196 | exit 1 | ||
197 | ;; | ||
198 | esac | ||
199 | |||
200 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.pam b/meta-networking/recipes-protocols/quagga/files/quagga.pam new file mode 100644 index 000000000..3541a975a --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.pam | |||
@@ -0,0 +1,13 @@ | |||
1 | # | ||
2 | # The PAM configuration file for the quagga `vtysh' service | ||
3 | # | ||
4 | |||
5 | # This allows root to change user infomation without being | ||
6 | # prompted for a password | ||
7 | auth sufficient pam_rootok.so | ||
8 | |||
9 | # The standard Unix authentication modules, used with | ||
10 | # NIS (man nsswitch) as well as normal /etc/passwd and | ||
11 | # /etc/shadow entries. | ||
12 | auth include common-auth | ||
13 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch b/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file mode 100644 index 000000000..4b8c9a929 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | ripd: Fix two bugs after received SIGHUP signal | ||
2 | |||
3 | There are two problems for ripd implementation after received | ||
4 | SIGHUP signal: | ||
5 | 1). ripd didn't clean up ifp->connected list before reload | ||
6 | configuration file. | ||
7 | 2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON | ||
8 | which lead to the unnecessary route to be advertised. | ||
9 | |||
10 | Upstream-Status: Submitted [http://patchwork.diac24.net/patch/604/] | ||
11 | |||
12 | Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> | ||
13 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
14 | --- | ||
15 | --- a/ripd/rip_interface.c | ||
16 | +++ b/ripd/rip_interface.c | ||
17 | @@ -500,6 +500,8 @@ | ||
18 | struct listnode *node; | ||
19 | struct interface *ifp; | ||
20 | struct rip_interface *ri; | ||
21 | + struct connected *ifc; | ||
22 | + struct listnode *conn_node, *next; | ||
23 | |||
24 | for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) | ||
25 | { | ||
26 | @@ -514,6 +516,13 @@ | ||
27 | thread_cancel (ri->t_wakeup); | ||
28 | ri->t_wakeup = NULL; | ||
29 | } | ||
30 | + | ||
31 | + for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) | ||
32 | + { | ||
33 | + ifc = listgetdata (conn_node); | ||
34 | + next = conn_node->next; | ||
35 | + listnode_delete (ifp->connected, ifc); | ||
36 | + } | ||
37 | } | ||
38 | } | ||
39 | |||
40 | @@ -548,8 +557,8 @@ | ||
41 | ri->key_chain = NULL; | ||
42 | } | ||
43 | |||
44 | - ri->split_horizon = RIP_NO_SPLIT_HORIZON; | ||
45 | - ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; | ||
46 | + ri->split_horizon = RIP_SPLIT_HORIZON; | ||
47 | + ri->split_horizon_default = RIP_SPLIT_HORIZON; | ||
48 | |||
49 | ri->list[RIP_FILTER_IN] = NULL; | ||
50 | ri->list[RIP_FILTER_OUT] = NULL; | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/ripd.service b/meta-networking/recipes-protocols/quagga/files/ripd.service new file mode 100644 index 000000000..5dfd28b3a --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ripd.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=RIP routing daemon | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/ripd -d $ripd_options -f /etc/quagga/ripd.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/ripngd.service b/meta-networking/recipes-protocols/quagga/files/ripngd.service new file mode 100644 index 000000000..936b81fb9 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ripngd.service | |||
@@ -0,0 +1,14 @@ | |||
1 | i[Unit] | ||
2 | Description=RIP routing daemon for IPv6 | ||
3 | BindTo=zebra.service | ||
4 | After=zebra.service | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f /etc/quagga/ripngd.conf | ||
11 | Restart=on-abort | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga new file mode 100644 index 000000000..1f28c0b24 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga | |||
@@ -0,0 +1,3 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d quagga quagga 0755 /var/run/quagga none | ||
3 | d quagga quagga 0755 /var/log/quagga none | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-networking/recipes-protocols/quagga/files/watchquagga.default new file mode 100644 index 000000000..2d601ec97 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.default | |||
@@ -0,0 +1,12 @@ | |||
1 | # Watchquagga configuration | ||
2 | #watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" | ||
3 | watch_daemons="zebra" | ||
4 | |||
5 | # To enable restarts when multiple daemons are being used, uncomment this line (but first be sure to edit | ||
6 | # the WATCH_DAEMONS line to reflect the daemons you are actually using): | ||
7 | #watch_options="-Az -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" | ||
8 | |||
9 | # Since we are using one quagga daemon for now, use the following line. If using | ||
10 | # multiple daemons, comment the line below and uncoment the line mentioned | ||
11 | # above. | ||
12 | watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-networking/recipes-protocols/quagga/files/watchquagga.init new file mode 100644 index 000000000..5ddd94a3d --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.init | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: watchquagga | ||
5 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
6 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | # Short-Description: start and stop the Quagga watchdog | ||
10 | ### END INIT INFO | ||
11 | |||
12 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
13 | |||
14 | # Load configuration | ||
15 | test -f /etc/default/watchquagga && . /etc/default/watchquagga | ||
16 | |||
17 | # Check that there are daemons to be monitored. | ||
18 | [ -z "$watch_daemons" ] && exit 0 | ||
19 | |||
20 | pidfile="/var/run/quagga/watchquagga.pid" | ||
21 | |||
22 | case "$1" in | ||
23 | start) | ||
24 | echo -n "Starting quagga watchdog daemon: watchquagga" | ||
25 | start-stop-daemon --start \ | ||
26 | --pidfile $pidfile \ | ||
27 | --exec /usr/sbin/watchquagga \ | ||
28 | -- -d $watch_options $watch_daemons | ||
29 | echo "." | ||
30 | ;; | ||
31 | |||
32 | stop) | ||
33 | echo -n "Stopping quagga watchdog daemon: watchquagga" | ||
34 | start-stop-daemon --stop --quiet \ | ||
35 | --pidfile $pidfile | ||
36 | echo "." | ||
37 | ;; | ||
38 | |||
39 | status) | ||
40 | echo -n "watchquagga " | ||
41 | res=1 | ||
42 | [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null | ||
43 | if [ $? -eq 0 ]; then | ||
44 | echo "(pid `cat $pidfile`) is running..." | ||
45 | res=0 | ||
46 | else | ||
47 | echo "is stopped..." | ||
48 | fi | ||
49 | exit $res | ||
50 | ;; | ||
51 | |||
52 | restart|force-reload) | ||
53 | $0 stop $2 | ||
54 | sleep 1 | ||
55 | $0 start $2 | ||
56 | ;; | ||
57 | |||
58 | *) | ||
59 | echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" | ||
60 | exit 1 | ||
61 | ;; | ||
62 | esac | ||
63 | |||
64 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/zebra.service b/meta-networking/recipes-protocols/quagga/files/zebra.service new file mode 100644 index 000000000..afdd9e52d --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/zebra.service | |||
@@ -0,0 +1,15 @@ | |||
1 | [Unit] | ||
2 | Description=GNU Zebra routing manager | ||
3 | Wants=network.target | ||
4 | Before=network.target | ||
5 | ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | EnvironmentFile=-@SYSCONFDIR@/default/quagga | ||
10 | ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra | ||
11 | ExecStart=@SBINDIR@/zebra -d $zebra_options -f /etc/quagga/zebra.conf | ||
12 | Restart=on-abort | ||
13 | |||
14 | [Install] | ||
15 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc new file mode 100644 index 000000000..2c0817b83 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga.inc | |||
@@ -0,0 +1,250 @@ | |||
1 | SUMMARY = "BGP/OSPF/RIP routing daemon" | ||
2 | DESCRIPTION = "Quagga is a routing software suite, providing \ | ||
3 | implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for \ | ||
4 | Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. \ | ||
5 | Quagga is a fork of GNU Zebra which was developed by Kunihiro \ | ||
6 | Ishiguro. The Quagga tree aims to build a more involved community \ | ||
7 | around Quagga than the current centralised model of GNU Zebra." | ||
8 | HOMEPAGE = "http://www.nongnu.org/quagga/" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "GPL-2.0 & LGPL-2.0" | ||
11 | DEPENDS = "readline ncurses perl-native" | ||
12 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'snmp', 'net-snmp', '', d)}" | ||
13 | SNMP_CONF="${@base_contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}" | ||
14 | |||
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=81bcece21748c91ba9992349a91ec11d \ | ||
16 | file://COPYING.LIB;md5=01ef24401ded36cd8e5d18bfe947240c" | ||
17 | |||
18 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
19 | RDEPENDS_${PN} += "iproute2" | ||
20 | |||
21 | QUAGGASUBDIR = "" | ||
22 | # ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old | ||
23 | # versions and leave it empty for recent versions. | ||
24 | SRC_URI = "${SAVANNAH_GNU_MIRROR}/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz; \ | ||
25 | file://Zebra-sync-zebra-routing-table-with-the-kernel-one.patch \ | ||
26 | file://quagga.init \ | ||
27 | file://quagga.default \ | ||
28 | file://watchquagga.init \ | ||
29 | file://watchquagga.default \ | ||
30 | file://volatiles.03_quagga \ | ||
31 | file://quagga.pam \ | ||
32 | file://ripd-fix-two-bugs-after-received-SIGHUP.patch \ | ||
33 | file://quagga-Avoid-duplicate-connected-address.patch \ | ||
34 | file://babeld.service \ | ||
35 | file://bgpd.service \ | ||
36 | file://isisd.service \ | ||
37 | file://ospf6d.service \ | ||
38 | file://ospfd.service \ | ||
39 | file://ripd.service \ | ||
40 | file://ripngd.service \ | ||
41 | file://zebra.service \ | ||
42 | " | ||
43 | |||
44 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
45 | PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" | ||
46 | PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam" | ||
47 | |||
48 | inherit autotools update-rc.d useradd systemd | ||
49 | |||
50 | SYSTEMD_PACKAGES = "${PN} ${PN}-babeld ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd" | ||
51 | SYSTEMD_SERVICE_${PN}-babeld = "babeld.service" | ||
52 | SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service" | ||
53 | SYSTEMD_SERVICE_${PN}-isisd = "isisd.service" | ||
54 | SYSTEMD_SERVICE_${PN}-ospf6d = "ospf6d.service" | ||
55 | SYSTEMD_SERVICE_${PN}-ospfd = "ospfd.service" | ||
56 | SYSTEMD_SERVICE_${PN}-ripd = "ripd.service" | ||
57 | SYSTEMD_SERVICE_${PN}-ripngd = "ripngd.service" | ||
58 | SYSTEMD_SERVICE_${PN} = "zebra.service" | ||
59 | |||
60 | EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ | ||
61 | --localstatedir=${localstatedir}/run/quagga \ | ||
62 | --enable-exampledir=${docdir}/quagga/examples/ \ | ||
63 | --enable-vtysh \ | ||
64 | --enable-isisd \ | ||
65 | ${@base_contains('DISTRO_FEATURES', 'sysvinit', '--enable-watchquagga', '--disable-watchquagga', d)} \ | ||
66 | --enable-ospf-te \ | ||
67 | --enable-opaque-lsa \ | ||
68 | --enable-ipv6 \ | ||
69 | --enable-ospfclient=yes \ | ||
70 | --enable-multipath=64 \ | ||
71 | --enable-user=quagga \ | ||
72 | --enable-group=quagga \ | ||
73 | --enable-vty-group=quaggavty \ | ||
74 | --enable-configfile-mask=0640 \ | ||
75 | --enable-logfile-mask=0640 \ | ||
76 | --enable-rtadv \ | ||
77 | --enable-linux24-tcp-md5 \ | ||
78 | ap_cv_cc_pie=no \ | ||
79 | ${SNMP_CONF}" | ||
80 | |||
81 | do_install () { | ||
82 | # Install init script and default settings | ||
83 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \ | ||
84 | ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles | ||
85 | install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga | ||
86 | install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga | ||
87 | install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga | ||
88 | install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga | ||
89 | install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
90 | |||
91 | # Install sample configurations for the daemons | ||
92 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
93 | install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample | ||
94 | done | ||
95 | |||
96 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
97 | touch ${D}${sysconfdir}/quagga/$f.conf | ||
98 | done | ||
99 | chown quagga:quaggavty ${D}${sysconfdir}/quagga | ||
100 | chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf | ||
101 | chmod 750 ${D}${sysconfdir}/quagga | ||
102 | chmod 640 ${D}${sysconfdir}/quagga/*.conf | ||
103 | |||
104 | # Install quagga | ||
105 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ | ||
106 | sbindir=${sbindir} \ | ||
107 | sysconfdir=${sysconfdir}/quagga \ | ||
108 | localstatedir=${localstatedir}/run/quagga | ||
109 | |||
110 | # Fix hardcoded paths | ||
111 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/* | ||
112 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga | ||
113 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga | ||
114 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
115 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/* | ||
116 | |||
117 | # Remove generated info dir file, it doesn't belong in the generated | ||
118 | # package. | ||
119 | rm -f ${D}${infodir}/dir | ||
120 | |||
121 | # For PAM | ||
122 | for feature in ${DISTRO_FEATURES}; do | ||
123 | if [ "$feature" = "pam" ]; then | ||
124 | install -D -m 644 ${WORKDIR}/quagga.pam ${D}/${sysconfdir}/pam.d/quagga | ||
125 | break | ||
126 | fi | ||
127 | done | ||
128 | |||
129 | if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | ||
130 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
131 | echo "d /var/run/quagga 0755 quagga quagga -" \ | ||
132 | > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf | ||
133 | fi | ||
134 | |||
135 | # Remove sysinit script if sysvinit is not in DISTRO_FEATURES | ||
136 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then | ||
137 | rm -rf ${D}${sysconfdir}/init.d/ | ||
138 | rm -f ${D}${sysconfdir}/default/watchquagga | ||
139 | fi | ||
140 | |||
141 | install -d ${D}${systemd_unitdir}/system | ||
142 | for i in babeld bgpd isisd ospf6d ospfd ripd ripngd zebra; do | ||
143 | install -m 0644 ${WORKDIR}/$i.service ${D}${systemd_unitdir}/system | ||
144 | done | ||
145 | sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \ | ||
146 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
147 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
148 | -i ${D}${systemd_unitdir}/system/*.service | ||
149 | } | ||
150 | |||
151 | DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" | ||
152 | pkg_postinst_${PN} () { | ||
153 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then | ||
154 | if [ -n "$D" ]; then | ||
155 | OPTS="--root=$D" | ||
156 | fi | ||
157 | systemctl $OPTS mask quagga.service | ||
158 | fi | ||
159 | } | ||
160 | |||
161 | # Split into a main package and separate per-protocol packages | ||
162 | PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-babeld ${PN}-bgpd \ | ||
163 | ${PN}-ripd ${PN}-ripngd ${PN}-isisd \ | ||
164 | ${PN}-ospfclient ${@base_contains('DISTRO_FEATURES', 'sysvinit', '${PN}-watchquagga', '', d)}" | ||
165 | |||
166 | RDEPENDS_${PN} += "${PN}-babeld ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd" | ||
167 | |||
168 | FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*" | ||
169 | FILES_${PN}-ospf6d = "${sbindir}/ospf6d" | ||
170 | FILES_${PN}-babeld = "${sbindir}/babeld" | ||
171 | FILES_${PN}-bgpd = "${sbindir}/bgpd" | ||
172 | FILES_${PN}-ripd = "${sbindir}/ripd" | ||
173 | FILES_${PN}-ripngd = "${sbindir}/ripngd" | ||
174 | FILES_${PN}-isisd = "${sbindir}/isisd" | ||
175 | FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*" | ||
176 | FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \ | ||
177 | ${sysconfdir}/init.d/watchquagga" | ||
178 | |||
179 | # Indicate that the default files are configuration files | ||
180 | CONFFILES_${PN} = "${sysconfdir}/default/quagga \ | ||
181 | ${sysconfdir}/quagga/bgpd.conf \ | ||
182 | ${sysconfdir}/quagga/vtysh.conf \ | ||
183 | ${sysconfdir}/quagga/babeld.conf \ | ||
184 | ${sysconfdir}/quagga/isisd.conf \ | ||
185 | ${sysconfdir}/quagga/ospfd.conf \ | ||
186 | ${sysconfdir}/quagga/ripngd.conf \ | ||
187 | ${sysconfdir}/quagga/zebra.conf \ | ||
188 | ${sysconfdir}/quagga/ripd.conf \ | ||
189 | ${sysconfdir}/quagga/ospf6d.conf \ | ||
190 | " | ||
191 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" | ||
192 | |||
193 | # Stop the names being rewritten due to the internal shared libraries | ||
194 | DEBIAN_NOAUTONAME_${PN}-ospfd = "1" | ||
195 | DEBIAN_NOAUTONAME_${PN}-ospfclient = "1" | ||
196 | |||
197 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
198 | RDEPENDS_${PN} += "iproute2" | ||
199 | |||
200 | # Main init script starts all deamons | ||
201 | # Seperate init script for watchquagga | ||
202 | INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga" | ||
203 | INITSCRIPT_NAME_${PN} = "quagga" | ||
204 | INITSCRIPT_PARAMS_${PN} = "defaults 15 85" | ||
205 | INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga" | ||
206 | INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10" | ||
207 | |||
208 | # Add quagga's user and group | ||
209 | USERADD_PACKAGES = "${PN}" | ||
210 | GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" | ||
211 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga --shell /bin/false quagga" | ||
212 | |||
213 | pkg_postinst_${PN} () { | ||
214 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
215 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
216 | fi | ||
217 | } | ||
218 | |||
219 | # Stop apps before uninstall | ||
220 | pkg_prerm_${PN} () { | ||
221 | ${sysconfdir}/init.d/quagga stop | ||
222 | } | ||
223 | |||
224 | pkg_prerm_${PN}-ospfd () { | ||
225 | ${sysconfdir}/init.d/quagga stop ospfd | ||
226 | } | ||
227 | |||
228 | pkg_prerm_${PN}-ospf6d () { | ||
229 | ${sysconfdir}/init.d/quagga stop ospf6d | ||
230 | } | ||
231 | |||
232 | pkg_prerm_${PN}-babeld () { | ||
233 | ${sysconfdir}/init.d/quagga stop babeld | ||
234 | } | ||
235 | |||
236 | pkg_prerm_${PN}-bgpd () { | ||
237 | ${sysconfdir}/init.d/quagga stop bgpd | ||
238 | } | ||
239 | |||
240 | pkg_prerm_${PN}-ripd () { | ||
241 | ${sysconfdir}/init.d/quagga stop ripd | ||
242 | } | ||
243 | |||
244 | pkg_prerm_${PN}-ripngd () { | ||
245 | ${sysconfdir}/init.d/quagga stop ripngd | ||
246 | } | ||
247 | |||
248 | pkg_prerm_${PN}-isisd () { | ||
249 | ${sysconfdir}/init.d/quagga stop isisd | ||
250 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/quagga_0.99.23.bb b/meta-networking/recipes-protocols/quagga/quagga_0.99.23.bb new file mode 100644 index 000000000..a56767e51 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga_0.99.23.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require quagga.inc | ||
2 | |||
3 | SRC_URI += "file://babel-close-the-stdout-stderr-as-in-other-daemons.patch \ | ||
4 | " | ||
5 | |||
6 | SRC_URI[md5sum] = "d17145e62b6ea14f0f13bb63f59e5166" | ||
7 | SRC_URI[sha256sum] = "2c7798204f35dc7acea9f206647e8aa3957cae3b21733cdff413b506481a101c" | ||
8 | |||
9 | QUAGGASUBDIR = "" | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure.patch new file mode 100644 index 000000000..1380ba489 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | Index: rp-pppoe-3.8/configure.in | ||
2 | =================================================================== | ||
3 | --- rp-pppoe-3.8.orig/configure.in 2014-07-16 19:31:33.549991388 +0000 | ||
4 | +++ rp-pppoe-3.8/configure.in 2014-07-17 22:01:18.116590827 +0000 | ||
5 | @@ -1,4 +1,4 @@ | ||
6 | -AC_INIT(src/pppoe.c) | ||
7 | -AM_INIT_AUTOMAKE([rp-pppoe], [3.8]) | ||
8 | +AC_INIT([rp-pppoe], [3.8]) | ||
9 | +AM_INIT_AUTOMAKE([foreign]) | ||
10 | AC_CONFIG_SUBDIRS(src) | ||
11 | AC_OUTPUT(Makefile) | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch new file mode 100644 index 000000000..189675942 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch | |||
@@ -0,0 +1,142 @@ | |||
1 | Update the configure script to cross-compiling with OE. This hard-codes | ||
2 | a few target paths, reworks a few tests to be more friendly for cross | ||
3 | and drops other tests. | ||
4 | |||
5 | Upstream-Status: Inappropriate [build system specific changes] | ||
6 | |||
7 | Index: src/configure.in | ||
8 | =================================================================== | ||
9 | --- rp-pppoe-3.8.orig/src/configure.in 2006-04-03 00:29:42.000000000 +1000 | ||
10 | +++ rp-pppoe-3.8/src/configure.in 2007-06-07 22:19:36.000000000 +1000 | ||
11 | @@ -5,6 +5,13 @@ | ||
12 | dnl pppd directory for kernel-mode PPPoE | ||
13 | PPPD_DIR=ppp-2.4.1.pppoe2 | ||
14 | |||
15 | +dnl hard code some paths | ||
16 | +PPPD=/usr/sbin/pppd | ||
17 | +ID=/usr/bin/id | ||
18 | +ECHO=/bin/echo | ||
19 | +AC_ARG_VAR(PPPD) | ||
20 | +AC_ARG_VAR(ID) | ||
21 | + | ||
22 | AC_CONFIG_HEADER(config.h) | ||
23 | |||
24 | AC_PREFIX_DEFAULT(/usr) | ||
25 | @@ -44,7 +51,7 @@ | ||
26 | AC_MSG_RESULT($ac_cv_struct_sockaddr_ll) | ||
27 | |||
28 | if test "$ac_cv_struct_sockaddr_ll" = yes ; then | ||
29 | -AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL) | ||
30 | +AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL]) | ||
31 | fi | ||
32 | |||
33 | dnl Check for N_HDLC line discipline | ||
34 | @@ -55,7 +62,7 @@ | ||
35 | ac_cv_n_hdlc=no) | ||
36 | AC_MSG_RESULT($ac_cv_n_hdlc) | ||
37 | if test "$ac_cv_n_hdlc" = yes ; then | ||
38 | -AC_DEFINE(HAVE_N_HDLC) | ||
39 | +AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC]) | ||
40 | fi | ||
41 | |||
42 | AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no) | ||
43 | @@ -100,13 +107,13 @@ | ||
44 | if test "$ac_cv_header_linux_if_pppox_h" = yes ; then | ||
45 | if test "$ac_cv_pluginpath" != no ; then | ||
46 | LINUX_KERNELMODE_PLUGIN=rp-pppoe.so | ||
47 | - AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE) | ||
48 | + AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE]) | ||
49 | PPPD_INCDIR=$ac_cv_pluginpath | ||
50 | fi | ||
51 | fi | ||
52 | |||
53 | if test "$ac_cv_debugging" = "yes" ; then | ||
54 | - AC_DEFINE(DEBUGGING_ENABLED) | ||
55 | + AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled]) | ||
56 | fi | ||
57 | |||
58 | AC_SUBST(LINUX_KERNELMODE_PLUGIN) | ||
59 | @@ -131,15 +138,8 @@ | ||
60 | AC_CHECK_SIZEOF(unsigned int) | ||
61 | AC_CHECK_SIZEOF(unsigned long) | ||
62 | |||
63 | -dnl Check for location of pppd | ||
64 | -AC_PATH_PROG(PPPD, pppd, NOTFOUND, $PATH:/sbin:/usr/sbin:/usr/local/sbin) | ||
65 | -AC_PATH_PROG(ECHO, echo, echo) | ||
66 | - | ||
67 | -dnl Check for setsid (probably Linux-specific) | ||
68 | -AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin) | ||
69 | - | ||
70 | dnl Check for an "id" which accepts "-u" option -- hack for Solaris. | ||
71 | -AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH) | ||
72 | +dnl AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH) | ||
73 | |||
74 | dnl Check for Linux-specific kernel support for PPPoE | ||
75 | AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support) | ||
76 | @@ -183,44 +183,8 @@ | ||
77 | CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -ansi" | ||
78 | fi | ||
79 | |||
80 | -dnl If we couldn't find pppd, die | ||
81 | -if test "$PPPD" = "NOTFOUND"; then | ||
82 | - AC_MSG_WARN([*** Oops! I couldn't find pppd, the PPP daemon anywhere.]) | ||
83 | - AC_MSG_WARN([*** You must install pppd, version 2.3.10 or later.]) | ||
84 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
85 | - PPPD=pppd | ||
86 | -fi | ||
87 | - | ||
88 | -dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than | ||
89 | -dnl 2.3.7 -- stop | ||
90 | - | ||
91 | -PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'` | ||
92 | - | ||
93 | -case "$PPPD_VERSION" in | ||
94 | -1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6) | ||
95 | - AC_MSG_WARN([*** Oops! Your version of pppd is $PPPD_VERSION, which is too old.]) | ||
96 | - AC_MSG_WARN([*** You need at least 2.3.7 (2.3.10 or newer recommended.]) | ||
97 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
98 | - ;; | ||
99 | - | ||
100 | -2.3.7|2.3.8|2.3.9) | ||
101 | - AC_MSG_WARN([*** Warning. Your version of pppd is $PPPD_VERSION. You will]) | ||
102 | - AC_MSG_WARN([*** not be able to use connect-on-demand. Upgrade to pppd]) | ||
103 | - AC_MSG_WARN([*** 2.3.10 or newer if you need connect-on-demand.]) | ||
104 | - ;; | ||
105 | - | ||
106 | -2*|3*|4*|5*|6*|7*|8*|9*) | ||
107 | - ;; | ||
108 | - | ||
109 | -*) | ||
110 | - AC_MSG_WARN([*** Oops. I cannot figure out what version of pppd you have.]) | ||
111 | - AC_MSG_WARN([*** All I got back was '$PPPD_VERSION']) | ||
112 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
113 | - ;; | ||
114 | -esac | ||
115 | - | ||
116 | dnl Figure out packing order of structures | ||
117 | -AC_MSG_CHECKING([packing order of bit fields]) | ||
118 | +AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[ | ||
119 | AC_TRY_RUN([ | ||
120 | union foo { | ||
121 | struct bar { | ||
122 | @@ -245,10 +209,11 @@ | ||
123 | } | ||
124 | }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, | ||
125 | $ECHO "no defaults for cross-compiling"; exit 0) | ||
126 | +]) | ||
127 | |||
128 | if test "$rpppoe_cv_pack_bitfields" = "rev" ; then | ||
129 | AC_MSG_RESULT(reversed) | ||
130 | - AC_DEFINE(PACK_BITFIELDS_REVERSED) | ||
131 | + AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields]) | ||
132 | else | ||
133 | AC_MSG_RESULT(normal) | ||
134 | fi | ||
135 | @@ -312,6 +277,7 @@ | ||
136 | AC_SUBST(RDYNAMIC) | ||
137 | AC_SUBST(LIBEVENT) | ||
138 | AC_SUBST(ECHO) | ||
139 | +AC_SUBST(HAVE_STRUCT_SOCKADDR_LL) | ||
140 | |||
141 | datadir_evaluated=`eval echo $datadir` | ||
142 | AC_SUBST(datadir_evaluated) | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch new file mode 100644 index 000000000..8b7886485 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 611c9fe719c5aa264a2ad2eb920cf4522ae2ddec Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <b28495@freescale.com> | ||
3 | Date: Tue, 12 Jun 2012 14:26:16 -0400 | ||
4 | Subject: [PATCH] discard use of dnl in Makefile.am | ||
5 | |||
6 | Since Makefile.am is not processed by m4, but by automake, 'dnl' does | ||
7 | not introduce a comment. | ||
8 | |||
9 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
10 | --- | ||
11 | Makefile.am | 2 +- | ||
12 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile.am b/Makefile.am | ||
15 | index eff6977..3091c33 100644 | ||
16 | --- a/Makefile.am | ||
17 | +++ b/Makefile.am | ||
18 | @@ -1,5 +1,5 @@ | ||
19 | PACKAGE = rp-pppoe | ||
20 | VERSION = 3.8 | ||
21 | |||
22 | -dnl AM_CFLAGS = -Wall -DDEBUG | ||
23 | +##dnl AM_CFLAGS = -Wall -DDEBUG | ||
24 | SUBDIRS = src | ||
25 | -- | ||
26 | 1.7.6.5 | ||
27 | |||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch new file mode 100644 index 000000000..c7fc9cfac --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Further fixup to the configure scripts to not swallow errors | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | --- a/src/configure.in.org 2008-01-14 21:08:38.000000000 +0200 | ||
6 | +++ a/src/configure.in 2008-01-14 21:20:09.000000000 +0200 | ||
7 | @@ -208,7 +208,7 @@ | ||
8 | return 2; | ||
9 | } | ||
10 | }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, | ||
11 | -$ECHO "no defaults for cross-compiling"; exit 0) | ||
12 | +$ECHO "no defaults for cross-compiling"; exit 1) | ||
13 | ]) | ||
14 | |||
15 | if test "$rpppoe_cv_pack_bitfields" = "rev" ; then | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default new file mode 100644 index 000000000..996d57f3c --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default | |||
@@ -0,0 +1,22 @@ | |||
1 | # PPPoE Server options | ||
2 | |||
3 | # Maximum segment size, not used for in kernel PPPoE | ||
4 | #MSS=1412 | ||
5 | |||
6 | # Device(s) - Space seperated list of devices to listen on | ||
7 | #DEVICES="eth1" | ||
8 | |||
9 | # Local IP | ||
10 | #LOCAL_IP=10.0.0.1 | ||
11 | |||
12 | # Starting remote IP | ||
13 | #REMOTE_IP=10.67.15.1 | ||
14 | |||
15 | # Service name | ||
16 | #SERVICE_NAME="acme" | ||
17 | |||
18 | # Maximum number of sessions, default is 16 | ||
19 | #MAX_SESSIONS=64 | ||
20 | |||
21 | # Access concentrator name, default is the hostname | ||
22 | #ACCESS_CONCENTRATOR_NAME="pppoe-rtr-1" | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init new file mode 100755 index 000000000..21afe0be3 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init | |||
@@ -0,0 +1,59 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | test -f /usr/sbin/pppoe-server || exit 0 | ||
4 | test -f /etc/default/pppoe-server && . /etc/default/pppoe-server | ||
5 | |||
6 | case $1 in | ||
7 | start) | ||
8 | OPTIONS="" | ||
9 | if [ -n "$MSS" ]; then | ||
10 | OPTIONS="$OPTIONS -m $MSS" | ||
11 | fi | ||
12 | if [ -n "$DEVICES" ]; then | ||
13 | for i in $DEVICES; do | ||
14 | OPTIONS="$OPTIONS -I $i" | ||
15 | done | ||
16 | fi | ||
17 | if [ -n "$LOCAL_IP" ]; then | ||
18 | OPTIONS="$OPTIONS -L $LOCAL_IP" | ||
19 | fi | ||
20 | if [ -n "$REMOTE_IP" ]; then | ||
21 | OPTIONS="$OPTIONS -R $REMOTE_IP" | ||
22 | fi | ||
23 | if [ -n "$SERVICE_NAME" ]; then | ||
24 | OPTIONS="$OPTIONS -S $SERVICE_NAME" | ||
25 | fi | ||
26 | if [ -n "$MAX_SESSIONS" ]; then | ||
27 | OPTIONS="$OPTIONS -N $MAX_SESSIONS" | ||
28 | fi | ||
29 | if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then | ||
30 | OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME" | ||
31 | fi | ||
32 | echo -n "Starting PPPoE server: pppoe-server" | ||
33 | start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS | ||
34 | echo "." | ||
35 | ;; | ||
36 | stop) | ||
37 | echo -n "Stopping PPPoE server: pppoe-server" | ||
38 | start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS | ||
39 | echo "." | ||
40 | ;; | ||
41 | status) | ||
42 | pid=$(pidof pppoe-server) | ||
43 | if [ -n "$pid" ] ; then | ||
44 | echo "Running with pid $pid" | ||
45 | else | ||
46 | echo "Not running" | ||
47 | fi | ||
48 | ;; | ||
49 | restart|force-reload) | ||
50 | $0 stop | ||
51 | $0 start | ||
52 | ;; | ||
53 | *) | ||
54 | echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}" | ||
55 | exit 1 | ||
56 | ;; | ||
57 | esac | ||
58 | |||
59 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch new file mode 100644 index 000000000..bcf4d1164 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Relax restrictions on the PPPoE src address, as per debian bug | ||
2 | 293811: | ||
3 | |||
4 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293811 | ||
5 | |||
6 | Upstream-Status: Inappropriate [Backport from Debian] | ||
7 | |||
8 | --- rp-pppoe-3.8.orig/src/discovery.c | ||
9 | +++ rp-pppoe-3.8/src/discovery.c | ||
10 | @@ -376,8 +376,8 @@ | ||
11 | if (!packetIsForMe(conn, &packet)) continue; | ||
12 | |||
13 | if (packet.code == CODE_PADO) { | ||
14 | - if (NOT_UNICAST(packet.ethHdr.h_source)) { | ||
15 | - printErr("Ignoring PADO packet from non-unicast MAC address"); | ||
16 | + if (BROADCAST(packet.ethHdr.h_source)) { | ||
17 | + printErr("Ignoring broadcast PADO packet"); | ||
18 | continue; | ||
19 | } | ||
20 | parsePacket(&packet, parsePADOTags, &pc); | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch new file mode 100644 index 000000000..4fe73d017 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | The autoconf stuff is all in a subdirectory, which is rather annoying | ||
2 | as OE expects patches to be applied and autoconf stuff to be done in | ||
3 | S. This adds enough autoconf at the top level to allow it to be | ||
4 | called there - all it does is run a sub autoconf stuff in the src | ||
5 | directory. | ||
6 | |||
7 | Upstream-Status: Inappropriate [build system specific change] | ||
8 | |||
9 | Index: rp-pppoe-3.8/Makefile.am | ||
10 | =================================================================== | ||
11 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
12 | +++ rp-pppoe-3.8/Makefile.am 2007-06-08 15:58:16.000000000 +1000 | ||
13 | @@ -0,0 +1,5 @@ | ||
14 | +PACKAGE = rp-pppoe | ||
15 | +VERSION = 3.8 | ||
16 | + | ||
17 | +dnl AM_CFLAGS = -Wall -DDEBUG | ||
18 | +SUBDIRS = src | ||
19 | Index: rp-pppoe-3.8/configure.in | ||
20 | =================================================================== | ||
21 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
22 | +++ rp-pppoe-3.8/configure.in 2007-06-08 15:58:16.000000000 +1000 | ||
23 | @@ -0,0 +1,4 @@ | ||
24 | +AC_INIT(src/pppoe.c) | ||
25 | +AM_INIT_AUTOMAKE([rp-pppoe], [3.8]) | ||
26 | +AC_CONFIG_SUBDIRS(src) | ||
27 | +AC_OUTPUT(Makefile) | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch new file mode 100644 index 000000000..42a3bc62c --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Set the timeout to 0 since we don't want pppoe to try reconnecting, | ||
2 | we want whatever is calling it to reconnect. Lots of odd things | ||
3 | happen when you have pppoe retrying itself. | ||
4 | |||
5 | The path for the plugin is wrong, it's now part of ppp and is in a | ||
6 | ppp's plugin lib directory. If no path is specified then that's where | ||
7 | ppp looks, so that's what we do here. | ||
8 | |||
9 | Upstream-Status: Inappropriate [configuration] | ||
10 | |||
11 | Index: rp-pppoe-3.8/configs/pppoe.conf | ||
12 | =================================================================== | ||
13 | --- rp-pppoe-3.8.orig/configs/pppoe.conf 2006-04-03 00:29:41.000000000 +1000 | ||
14 | +++ rp-pppoe-3.8/configs/pppoe.conf 2007-06-08 16:02:47.000000000 +1000 | ||
15 | @@ -66,7 +66,7 @@ | ||
16 | # to connect forever after pppoe-start is called. Otherwise, it will | ||
17 | # give out after CONNECT_TIMEOUT seconds and will not attempt to | ||
18 | # connect again, making it impossible to reach. | ||
19 | -CONNECT_TIMEOUT=30 | ||
20 | +CONNECT_TIMEOUT=0 | ||
21 | |||
22 | # How often in seconds pppoe-start polls to check if link is up | ||
23 | CONNECT_POLL=2 | ||
24 | @@ -115,7 +115,7 @@ | ||
25 | FIREWALL=NONE | ||
26 | |||
27 | # Linux kernel-mode plugin for pppd. If you want to try the kernel-mode | ||
28 | -# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so | ||
29 | +# plugin, use LINUX_PLUGIN=rp-pppoe.so | ||
30 | LINUX_PLUGIN= | ||
31 | |||
32 | # Any extra arguments to pass to pppoe. Normally, use a blank string | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch new file mode 100644 index 000000000..95f629298 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | Make the Makefile obey LDFLAGS. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | --- a/src/Makefile.in 2006-04-02 18:29:42.000000000 +0400 | ||
6 | +++ b/src/Makefile.in 2010-04-16 17:51:31.000000000 +0400 | ||
7 | @@ -67,16 +67,16 @@ all: $(TARGETS) | ||
8 | @echo "Type 'make install' as root to install the software." | ||
9 | |||
10 | pppoe-sniff: pppoe-sniff.o if.o common.o debug.o | ||
11 | - @CC@ -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o | ||
12 | + @CC@ -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o $(LDFLAGS) | ||
13 | |||
14 | pppoe-server: pppoe-server.o if.o debug.o common.o md5.o libevent/libevent.a @PPPOE_SERVER_DEPS@ | ||
15 | - @CC@ -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent | ||
16 | + @CC@ -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent $(LDFLAGS) | ||
17 | |||
18 | pppoe: pppoe.o if.o debug.o common.o ppp.o discovery.o | ||
19 | - @CC@ -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o | ||
20 | + @CC@ -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o $(LDFLAGS) | ||
21 | |||
22 | pppoe-relay: relay.o if.o debug.o common.o | ||
23 | - @CC@ -o pppoe-relay relay.o if.o debug.o common.o | ||
24 | + @CC@ -o pppoe-relay relay.o if.o debug.o common.o $(LDFLAGS) | ||
25 | |||
26 | pppoe.o: pppoe.c pppoe.h | ||
27 | @CC@ $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe.o pppoe.c | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb new file mode 100644 index 000000000..d1b0481b9 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb | |||
@@ -0,0 +1,59 @@ | |||
1 | SUMMARY = "A user-mode PPPoE client and server suite for Linux" | ||
2 | HOMEPAGE = "http://www.roaringpenguin.com/products/pppoe" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=a194eaefae2be54ee3221339b10d0581" | ||
6 | |||
7 | PR = "r10" | ||
8 | |||
9 | SRC_URI = "http://www.roaringpenguin.com/files/download/${BP}.tar.gz \ | ||
10 | file://top-autoconf.patch \ | ||
11 | file://configure_in_cross.patch \ | ||
12 | file://pppoe-src-restrictions.patch \ | ||
13 | file://update-config.patch \ | ||
14 | file://dont-swallow-errors.patch \ | ||
15 | file://discard-use-of-dnl-in-Makefile.am.patch \ | ||
16 | file://use-ldflags.patch \ | ||
17 | file://configure.patch \ | ||
18 | file://pppoe-server.default \ | ||
19 | file://pppoe-server.init" | ||
20 | |||
21 | SRC_URI[md5sum] = "0e32760f498f9cde44081ee6aafc823b" | ||
22 | SRC_URI[sha256sum] = "d916e9cfe1e62395f63a5361936fa855f6d0f0a37dc7227b394cdb725f553479" | ||
23 | |||
24 | inherit autotools-brokensep update-rc.d | ||
25 | |||
26 | do_install() { | ||
27 | # Install init script and default settings | ||
28 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d | ||
29 | install -m 0644 ${WORKDIR}/pppoe-server.default ${D}${sysconfdir}/default/pppoe-server | ||
30 | install -m 0755 ${WORKDIR}/pppoe-server.init ${D}${sysconfdir}/init.d/pppoe-server | ||
31 | # Install | ||
32 | oe_runmake -C ${S} RPM_INSTALL_ROOT=${D} docdir=${docdir} install | ||
33 | chmod 4755 ${D}${sbindir}/pppoe | ||
34 | } | ||
35 | |||
36 | # Insert server package before main package | ||
37 | PACKAGES = "${PN}-dbg ${PN}-server ${PN}-relay ${PN}-sniff ${PN} ${PN}-doc" | ||
38 | |||
39 | FILES_${PN}-server = "${sysconfdir}/default/pppoe-server \ | ||
40 | ${sysconfdir}/init.d/pppoe-server \ | ||
41 | ${sbindir}/pppoe-server \ | ||
42 | ${sysconfdir}/ppp/pppoe-server-options" | ||
43 | FILES_${PN}-relay = "${sbindir}/pppoe-relay" | ||
44 | FILES_${PN}-sniff = "${sbindir}/pppoe-sniff" | ||
45 | |||
46 | CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe.conf \ | ||
47 | ${sysconfdir}/ppp/firewall-standalone \ | ||
48 | ${sysconfdir}/ppp/firewall-masq" | ||
49 | CONFFILES_${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \ | ||
50 | ${sysconfdir}/default/pppoe-server" | ||
51 | |||
52 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
53 | INITSCRIPT_NAME_${PN}-server = "pppoe-server" | ||
54 | INITSCRIPT_PARAMS_${PN}-server = "defaults 92 8" | ||
55 | |||
56 | RDEPENDS_${PN} = "ppp" | ||
57 | RDEPENDS_${PN}-server = "${PN}" | ||
58 | RRECOMMENDS_${PN} = "ppp-oe" | ||
59 | |||
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc new file mode 100644 index 000000000..f4ea2b826 --- /dev/null +++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc | |||
@@ -0,0 +1,40 @@ | |||
1 | SUMMARY = "Xelerance version of the Layer 2 Tunneling Protocol (L2TP) daemon" | ||
2 | HOMEPAGE = "http://www.xelerance.com/software/xl2tpd/" | ||
3 | SECTION = "network" | ||
4 | DEPENDS = "ppp virtual/kernel" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
8 | |||
9 | INC_PR = "r0" | ||
10 | |||
11 | SRC_URI = "git://github.com/xelerance/xl2tpd.git" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | inherit update-rc.d | ||
16 | |||
17 | do_compile () { | ||
18 | oe_runmake CFLAGS="${CFLAGS} -DLINUX" LDFLAGS="${LDFLAGS}" PREFIX="${prefix}" KERNELSRC=${STAGING_KERNEL_DIR} all | ||
19 | } | ||
20 | |||
21 | do_install () { | ||
22 | oe_runmake PREFIX="${D}${prefix}" install | ||
23 | |||
24 | install -d ${D}${sysconfdir}/init.d | ||
25 | touch ${D}${sysconfdir}/xl2tpd.conf | ||
26 | install -m 0755 debian/xl2tpd.init ${D}${sysconfdir}/init.d/xl2tpd | ||
27 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
28 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
29 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
30 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/xl2tpd | ||
31 | |||
32 | install -d ${D}${sysconfdir}/default | ||
33 | install -m 0644 debian/xl2tpd.default ${D}${sysconfdir}/default/xl2tpd | ||
34 | } | ||
35 | |||
36 | CONFFILES_${PN} += "${sysconfdir}/xl2tpd.conf ${sysconfdir}/default/xl2tpd" | ||
37 | |||
38 | INITSCRIPT_PACKAGES = "${PN}" | ||
39 | INITSCRIPT_NAME_${PN} = "xl2tpd" | ||
40 | |||
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb new file mode 100644 index 000000000..bd084aa00 --- /dev/null +++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require xl2tpd.inc | ||
2 | PR = "${INC_PR}.0" | ||
3 | |||
4 | SRCREV = "df7e30eb199fc5710faa83866381aea18b66e60c" | ||
5 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch b/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch new file mode 100644 index 000000000..328e574a9 --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | | zeroconf.c: In function 'main': | ||
2 | | zeroconf.c:145: error: 'PATH_MAX' undeclared (first use in this function) | ||
3 | |||
4 | RP - 4/9/09 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: zeroconf-0.9/zeroconf.c | ||
9 | =================================================================== | ||
10 | --- zeroconf-0.9.orig/zeroconf.c 2009-09-04 10:05:25.000000000 +0100 | ||
11 | +++ zeroconf-0.9/zeroconf.c 2009-09-04 10:05:42.000000000 +0100 | ||
12 | @@ -33,6 +33,7 @@ | ||
13 | #include <net/if_arp.h> | ||
14 | #include <sys/time.h> | ||
15 | #include <signal.h> | ||
16 | +#include <limits.h> | ||
17 | |||
18 | #include "delay.h" | ||
19 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf b/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf new file mode 100644 index 000000000..0c9d15ba1 --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ ! -x /usr/sbin/zeroconf ]; then | ||
4 | exit 0 | ||
5 | fi | ||
6 | |||
7 | # IPv4 link-local addresses (zeroconf) are | ||
8 | # only applicable on the 'inet' address family | ||
9 | [ "X$ADDRFAM" != "Xinet" ] && exit 0 | ||
10 | |||
11 | # However there are some methods where it doesn't | ||
12 | # make any sense to configure an IPv4LL address | ||
13 | |||
14 | # not on loopback | ||
15 | [ "X$METHOD" = "Xloopback" ] && exit 0 | ||
16 | |||
17 | # not on ppp or wvdial either | ||
18 | [ "X$METHOD" = "Xppp" ] && exit 0 | ||
19 | [ "X$METHOD" = "Xwvdial" ] && exit 0 | ||
20 | |||
21 | # The administrator may have blacklisted interfaces | ||
22 | # or only want zeroconf in a fallback situation | ||
23 | [ -f /etc/default/zeroconf ] && | ||
24 | . /etc/default/zeroconf | ||
25 | |||
26 | [ -n "$DISABLE" ] && exit 0 | ||
27 | |||
28 | for BLACK in $IFBLACKLIST; do | ||
29 | case $IFACE in | ||
30 | $BLACK) | ||
31 | exit 0 | ||
32 | ;; | ||
33 | esac | ||
34 | done | ||
35 | |||
36 | # should we only allocate an address if we do not already have one? | ||
37 | if [ -n "$FALLBACK" ]; then | ||
38 | /sbin/ip addr show $IFACE scope global | grep -q "inet" | ||
39 | IP=$? | ||
40 | if [ $IP -eq 0 ]; then | ||
41 | /sbin/ip route add 169.254.0.0/16 dev $IFACE | ||
42 | exit 0 | ||
43 | fi | ||
44 | fi | ||
45 | |||
46 | # otherwise, run if we aren't already going | ||
47 | if [ ! -r /var/run/zeroconf.$IFACE.pid ]; then | ||
48 | /usr/sbin/zeroconf -i $IFACE | ||
49 | fi | ||
50 | |||
51 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default b/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default new file mode 100644 index 000000000..cc07b275f --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default | |||
@@ -0,0 +1,17 @@ | |||
1 | # Default for zeroconf | ||
2 | |||
3 | # disable zeroconf | ||
4 | # If you want to disable zeroconf completely, uncomment the following line | ||
5 | # this may be useful if you are debugging zeroconf or starting it manually | ||
6 | #DISABLE=yes | ||
7 | |||
8 | # black-listed interfaces | ||
9 | # Interfaces which you never wish to have zeroconf run on should | ||
10 | # be listed here. e.g. "eth2 wlan1" in a space seperated string | ||
11 | IFBLACKLIST="" | ||
12 | |||
13 | # fallback only | ||
14 | # If you would only like a link-local address if you were unable to | ||
15 | # obtain an address via DHCP then uncomment the following line | ||
16 | #FALLBACK=yes | ||
17 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb new file mode 100644 index 000000000..9307263c7 --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "IPv4 link-local address allocator" | ||
2 | DESCRIPTION = "Zeroconf is a program that is used to claim IPv4 \ | ||
3 | link-local addresses. IPv4 link-local addresses are useful when setting \ | ||
4 | up ad-hoc networking between devices without the involvement of a either \ | ||
5 | a DHCP server or network administrator. \ | ||
6 | These addresses are allocated from the 169.254.0.0/16 address range and \ | ||
7 | are normally attached to each Ethernet device in your computer. \ | ||
8 | Addresses are assigned randomly by each host and, in case of collision, \ | ||
9 | both hosts (are supposed to) renumber." | ||
10 | AUTHOR = "Anand Kumria <wildfire@progsoc.uts.edu.au>" | ||
11 | HOMEPAGE = "http://www.progsoc.org/~wildfire/zeroconf/" | ||
12 | LICENSE = "GPLv2+" | ||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4 \ | ||
14 | file://zeroconf.c;beginline=1;endline=13;md5=a5bada96e1e34b08eb7446b28e2630b2" | ||
15 | SECTION = "net" | ||
16 | |||
17 | PR = "r1" | ||
18 | |||
19 | SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.gz \ | ||
20 | file://compilefix.patch \ | ||
21 | file://zeroconf-default \ | ||
22 | file://debian-zeroconf" | ||
23 | |||
24 | SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2" | ||
25 | SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b" | ||
26 | |||
27 | do_install () { | ||
28 | install -d ${D}${sbindir} | ||
29 | install -d ${D}${sysconfdir}/network/if-up.d | ||
30 | install -d ${D}${sysconfdir}/default | ||
31 | install -c -m 755 ${S}/zeroconf ${D}${sbindir}/zeroconf | ||
32 | install -c -m 755 ${WORKDIR}/debian-zeroconf ${D}${sysconfdir}/network/if-up.d/zeroconf | ||
33 | install -c ${WORKDIR}/zeroconf-default ${D}${sysconfdir}/default/zeroconf | ||
34 | } | ||
diff --git a/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch b/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch new file mode 100644 index 000000000..ec89b7a53 --- /dev/null +++ b/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 38c97e590fde19213f6ba31e72d1c227db869427 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Sun, 31 Aug 2014 22:28:38 -0700 | ||
4 | Subject: [PATCH] aoe-stat.in: no bashism | ||
5 | |||
6 | The checkbashisms shows there is no bashism, so use /bin/sh. | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
11 | --- | ||
12 | aoe-stat.in | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/aoe-stat.in b/aoe-stat.in | ||
16 | index 50e6ac6..0c1d6f5 100755 | ||
17 | --- a/aoe-stat.in | ||
18 | +++ b/aoe-stat.in | ||
19 | @@ -1,4 +1,4 @@ | ||
20 | -#! /bin/bash | ||
21 | +#! /bin/sh | ||
22 | # aoe-stat - collate and present information about AoE storage | ||
23 | # Copyright 2012, CORAID, Inc., and licensed under GPL v.2. | ||
24 | |||
25 | -- | ||
26 | 1.7.9.5 | ||
27 | |||
diff --git a/meta-networking/recipes-support/aoetools/aoetools_36.bb b/meta-networking/recipes-support/aoetools/aoetools_36.bb new file mode 100644 index 000000000..2b80ae74f --- /dev/null +++ b/meta-networking/recipes-support/aoetools/aoetools_36.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "ATA over Ethernet Tools" | ||
2 | DESCRIPTION = " \ | ||
3 | The aoetools are programs for users of the ATA over Ethernet (AoE)network \ | ||
4 | storage protocol, a simple protocol for using storage over anethernet LAN. \ | ||
5 | The vblade program (storage target) exports a blockdevice using AoE. \ | ||
6 | " | ||
7 | HOMEPAGE = "http://sourceforge.net/projects/${BPN}" | ||
8 | SECTION = "console/network" | ||
9 | LICENSE = "GPLv2" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
11 | RRECOMMENDS_${PN} = "kernel-module-aoe" | ||
12 | |||
13 | SRC_URI = "http://sourceforge.net/projects/${BPN}/files/${BPN}/${BPN}-${PV}.tar.gz \ | ||
14 | file://aoe-stat-no-bashism.patch \ | ||
15 | " | ||
16 | SRC_URI[md5sum] = "bff30daa988a65f69d4448ce4726a6db" | ||
17 | SRC_URI[sha256sum] = "fb5e2cd0de7644cc1ec04ee3aeb43211cf7445a0c19e13d6b3ed5a8fbdf215ff" | ||
18 | |||
19 | # EXTRA_OEMAKE is typically: -e MAKEFLAGS= | ||
20 | # the -e causes problems as CFLAGS is modified in the Makefile. | ||
21 | EXTRA_OEMAKE = "" | ||
22 | |||
23 | do_install() { | ||
24 | oe_runmake DESTDIR=${D} install | ||
25 | } | ||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch new file mode 100644 index 000000000..0875344fe --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | arptables: fix the redefinition of 'arpt_get_target' | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | This function is already defined as a static inline function in | ||
6 | include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the | ||
7 | inline will not work, and the redefinition error will happen | ||
8 | |||
9 | Signed-off-by: Aws Ismail <aws.ismail@windriver.com> | ||
10 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
11 | |||
12 | diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c | ||
13 | index 35736db..addd3f9 100644 | ||
14 | --- a/libarptc/libarptc_incl.c | ||
15 | +++ b/libarptc/libarptc_incl.c | ||
16 | @@ -11,14 +11,6 @@ | ||
17 | /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See | ||
18 | COPYING for details). */ | ||
19 | |||
20 | -#ifndef __OPTIMIZE__ | ||
21 | -STRUCT_ENTRY_TARGET * | ||
22 | -GET_TARGET(STRUCT_ENTRY *e) | ||
23 | -{ | ||
24 | - return (void *)e + e->target_offset; | ||
25 | -} | ||
26 | -#endif | ||
27 | - | ||
28 | static int sockfd = -1; | ||
29 | static void *arptc_fn = NULL; | ||
30 | |||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch new file mode 100644 index 000000000..80e980472 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | Index: arptables-v0.0.3-4/Makefile | ||
2 | =================================================================== | ||
3 | --- arptables-v0.0.3-4.orig/Makefile 2010-03-08 18:49:28.000000000 +0300 | ||
4 | +++ arptables-v0.0.3-4/Makefile 2010-03-22 15:52:56.000000000 +0300 | ||
5 | @@ -6,12 +6,11 @@ | ||
6 | LIBDIR:=$(PREFIX)/lib | ||
7 | BINDIR:=$(PREFIX)/sbin | ||
8 | MANDIR:=$(PREFIX)/man | ||
9 | -INITDIR:=/etc/rc.d/init.d | ||
10 | +INITDIR:=/etc/init.d | ||
11 | SYSCONFIGDIR:=/etc/sysconfig | ||
12 | DESTDIR:= | ||
13 | |||
14 | -COPT_FLAGS:=-O2 | ||
15 | -CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG | ||
16 | +ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" | ||
17 | |||
18 | ifndef ARPT_LIBDIR | ||
19 | ARPT_LIBDIR:=$(LIBDIR)/arptables | ||
20 | @@ -22,16 +21,16 @@ | ||
21 | all: arptables | ||
22 | |||
23 | arptables.o: arptables.c | ||
24 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
25 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
26 | |||
27 | arptables-standalone.o: arptables-standalone.c | ||
28 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
29 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
30 | |||
31 | libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c | ||
32 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
33 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
34 | |||
35 | arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS) | ||
36 | - $(CC) $(CFLAGS) -o $@ $^ | ||
37 | + $(CC) $(LDFLAGS) $(CFLAGS) $(ARPCFLAGS) -o $@ $^ | ||
38 | |||
39 | $(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8 | ||
40 | mkdir -p $(@D) | ||
41 | @@ -50,6 +49,7 @@ | ||
42 | cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_ | ||
43 | install -m 0755 -o root -g root arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore | ||
44 | cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_ | ||
45 | + install -d $(DESTDIR)$(INITDIR) | ||
46 | if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi | ||
47 | rm -f arptables-save_ arptables-restore_ arptables.sysv_ | ||
48 | |||
49 | Index: arptables-v0.0.3-4/extensions/Makefile | ||
50 | =================================================================== | ||
51 | --- arptables-v0.0.3-4.orig/extensions/Makefile 2010-03-08 18:49:28.000000000 +0300 | ||
52 | +++ arptables-v0.0.3-4/extensions/Makefile 2010-03-22 15:52:38.000000000 +0300 | ||
53 | @@ -4,4 +4,7 @@ | ||
54 | EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o) | ||
55 | |||
56 | extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h | ||
57 | - $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< | ||
58 | + $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< | ||
59 | + | ||
60 | +extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h | ||
61 | + $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< | ||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch new file mode 100644 index 000000000..24956c4ca --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | Index: arptables-v0.0.3-4/arptables.sysv | ||
2 | =================================================================== | ||
3 | --- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300 | ||
4 | +++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300 | ||
5 | @@ -12,10 +12,10 @@ | ||
6 | # config: __SYSCONFIG__/arptables | ||
7 | |||
8 | source /etc/init.d/functions | ||
9 | -source /etc/sysconfig/network | ||
10 | +# source /etc/sysconfig/network | ||
11 | |||
12 | # Check that networking is up. | ||
13 | -[ ${NETWORKING} = "no" ] && exit 0 | ||
14 | +# [ ${NETWORKING} = "no" ] && exit 0 | ||
15 | |||
16 | [ -x __EXEC_PATH__/arptables ] || exit 1 | ||
17 | [ -x __EXEC_PATH__/arptables-save ] || exit 1 | ||
18 | @@ -28,32 +28,30 @@ | ||
19 | desc="Arp filtering" | ||
20 | |||
21 | start() { | ||
22 | - echo -n $"Starting $desc ($prog): " | ||
23 | + echo -n "Starting $desc ($prog): " | ||
24 | __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1 | ||
25 | |||
26 | if [ $RETVAL -eq 0 ]; then | ||
27 | - success "$prog startup" | ||
28 | - rm -f /var/lock/subsys/$prog | ||
29 | + echo "$prog ok" | ||
30 | + touch /var/lock/subsys/$prog | ||
31 | else | ||
32 | - failure "$prog startup" | ||
33 | + echo "$prog failed" | ||
34 | fi | ||
35 | |||
36 | - echo | ||
37 | return $RETVAL | ||
38 | } | ||
39 | |||
40 | stop() { | ||
41 | - echo -n $"Stopping $desc ($prog): " | ||
42 | + echo -n "Stopping $desc ($prog): " | ||
43 | __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1 | ||
44 | |||
45 | if [ $RETVAL -eq 0 ]; then | ||
46 | - success "$prog shutdown" | ||
47 | - rm -f %{_localstatedir}/lock/subsys/$prog | ||
48 | + echo "$prog stopped" | ||
49 | + rm -f /var/lock/subsys/$prog | ||
50 | else | ||
51 | - failure "$prog shutdown" | ||
52 | + echo "$prog failed to stop" | ||
53 | fi | ||
54 | |||
55 | - echo | ||
56 | return $RETVAL | ||
57 | } | ||
58 | |||
59 | @@ -63,15 +61,14 @@ | ||
60 | } | ||
61 | |||
62 | save() { | ||
63 | - echo -n $"Saving $desc ($prog): " | ||
64 | + echo -n "Saving $desc ($prog): " | ||
65 | __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1 | ||
66 | |||
67 | if [ $RETVAL -eq 0 ]; then | ||
68 | - success "$prog saved" | ||
69 | + echo "$prog saved" | ||
70 | else | ||
71 | - failure "$prog saved" | ||
72 | + echo "$prog is not saved" | ||
73 | fi | ||
74 | - echo | ||
75 | } | ||
76 | |||
77 | case "$1" in | ||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch new file mode 100644 index 000000000..f332658bc --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-remove-bashism.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From cd312bc0e3686404428878d23b8888cba09a20e1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Thu, 18 Sep 2014 19:46:58 -0700 | ||
4 | Subject: [PATCH] arptables.sysv: remove bashism | ||
5 | |||
6 | Use "." to replace of "source", and change /bin/bash to /bin/sh, the | ||
7 | echo $"foo" works well in busybox. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
12 | --- | ||
13 | arptables.sysv | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/arptables.sysv b/arptables.sysv | ||
17 | index 7a90bd2..7710376 100644 | ||
18 | --- a/arptables.sysv | ||
19 | +++ b/arptables.sysv | ||
20 | @@ -1,4 +1,4 @@ | ||
21 | -#!/bin/bash | ||
22 | +#!/bin/sh | ||
23 | # | ||
24 | # init script for arptables | ||
25 | # | ||
26 | @@ -11,7 +11,7 @@ | ||
27 | # | ||
28 | # config: __SYSCONFIG__/arptables | ||
29 | |||
30 | -source /etc/init.d/functions | ||
31 | +. /etc/init.d/functions | ||
32 | # source /etc/sysconfig/network | ||
33 | |||
34 | # Check that networking is up. | ||
35 | -- | ||
36 | 1.7.9.5 | ||
37 | |||
diff --git a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb new file mode 100644 index 000000000..41a55c027 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "Administration tool for arp packet filtering" | ||
2 | PRIORITY = "optional" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | PR = "r2" | ||
7 | |||
8 | RDEPENDS_${PN} += "perl" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
11 | SRC_URI = " \ | ||
12 | ${SOURCEFORGE_MIRROR}/ebtables/arptables-v${PV}.tar.gz;name=arptables \ | ||
13 | file://arptables-compile-install.patch \ | ||
14 | file://arptables-init-busybox.patch \ | ||
15 | file://arptables-arpt-get-target-fix.patch \ | ||
16 | file://arptables-remove-bashism.patch \ | ||
17 | " | ||
18 | SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" | ||
19 | SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" | ||
20 | |||
21 | S = "${WORKDIR}/arptables-v${PV}" | ||
22 | |||
23 | do_compile () { | ||
24 | oe_runmake | ||
25 | } | ||
26 | |||
27 | # the install target is not multi-job safe, but it doesn't do much | ||
28 | # so we just install serially | ||
29 | # | ||
30 | PARALLEL_MAKEINST = "-j1" | ||
31 | |||
32 | fakeroot do_install () { | ||
33 | oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install | ||
34 | } | ||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils.inc b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc new file mode 100644 index 000000000..feeba7435 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "Tools for ethernet bridging" | ||
2 | HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | |||
6 | DEPENDS = "sysfsutils" | ||
7 | |||
8 | SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \ | ||
9 | file://bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch \ | ||
10 | file://bridge-utils-1.5-fix-error-message-for-incorrect-command.patch \ | ||
11 | file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \ | ||
12 | " | ||
13 | |||
14 | inherit autotools-brokensep update-alternatives | ||
15 | |||
16 | ALTERNATIVE_${PN} = "brctl" | ||
17 | ALTERNATIVE_PRIORITY[brctl] = "100" | ||
18 | ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl" | ||
19 | |||
20 | EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}" | ||
21 | |||
22 | do_install_append () { | ||
23 | install -d ${D}/${datadir}/bridge-utils | ||
24 | install -d ${D}/${sysconfdir}/network/if-pre-up.d | ||
25 | install -d ${D}/${sysconfdir}/network/if-post-down.d | ||
26 | } | ||
27 | |||
28 | RRECOMMENDS_${PN} = "kernel-module-bridge" | ||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch new file mode 100644 index 000000000..d00af9c15 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From bb9970a9df95837e39d680021b1f73d231e85406 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:52:43 -0700 | ||
8 | Subject: [PATCH 3/3] Check error returns from write to sysfs | ||
9 | |||
10 | Add helper function to check write to sysfs files. | ||
11 | |||
12 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
13 | --- | ||
14 | libbridge/libbridge_devif.c | 37 +++++++++++++++++++++++-------------- | ||
15 | 1 files changed, 23 insertions(+), 14 deletions(-) | ||
16 | |||
17 | diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c | ||
18 | index aa8bc36..1e83925 100644 | ||
19 | --- a/libbridge/libbridge_devif.c | ||
20 | +++ b/libbridge/libbridge_devif.c | ||
21 | @@ -280,25 +280,38 @@ fallback: | ||
22 | return old_get_port_info(brname, port, info); | ||
23 | } | ||
24 | |||
25 | +static int set_sysfs(const char *path, unsigned long value) | ||
26 | +{ | ||
27 | + int fd, ret = 0, cc; | ||
28 | + char buf[32]; | ||
29 | + | ||
30 | + fd = open(path, O_WRONLY); | ||
31 | + if (fd < 0) | ||
32 | + return -1; | ||
33 | + | ||
34 | + cc = snprintf(buf, sizeof(buf), "%lu\n", value); | ||
35 | + if (write(fd, buf, cc) < 0) | ||
36 | + ret = -1; | ||
37 | + close(fd); | ||
38 | + | ||
39 | + return ret; | ||
40 | +} | ||
41 | + | ||
42 | |||
43 | static int br_set(const char *bridge, const char *name, | ||
44 | unsigned long value, unsigned long oldcode) | ||
45 | { | ||
46 | int ret; | ||
47 | char path[SYSFS_PATH_MAX]; | ||
48 | - FILE *f; | ||
49 | |||
50 | - snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name); | ||
51 | + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s", | ||
52 | + bridge, name); | ||
53 | |||
54 | - f = fopen(path, "w"); | ||
55 | - if (f) { | ||
56 | - ret = fprintf(f, "%ld\n", value); | ||
57 | - fclose(f); | ||
58 | - } else { | ||
59 | + if ((ret = set_sysfs(path, value)) < 0) { | ||
60 | /* fallback to old ioctl */ | ||
61 | struct ifreq ifr; | ||
62 | unsigned long args[4] = { oldcode, value, 0, 0 }; | ||
63 | - | ||
64 | + | ||
65 | strncpy(ifr.ifr_name, bridge, IFNAMSIZ); | ||
66 | ifr.ifr_data = (char *) &args; | ||
67 | ret = ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr); | ||
68 | @@ -348,14 +361,10 @@ static int port_set(const char *bridge, const char *ifname, | ||
69 | { | ||
70 | int ret; | ||
71 | char path[SYSFS_PATH_MAX]; | ||
72 | - FILE *f; | ||
73 | |||
74 | snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport/%s", ifname, name); | ||
75 | - f = fopen(path, "w"); | ||
76 | - if (f) { | ||
77 | - ret = fprintf(f, "%ld\n", value); | ||
78 | - fclose(f); | ||
79 | - } else { | ||
80 | + | ||
81 | + if ((ret = set_sysfs(path, value)) < 0) { | ||
82 | int index = get_portno(bridge, ifname); | ||
83 | |||
84 | if (index < 0) | ||
85 | -- | ||
86 | 1.7.5.2 | ||
87 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch new file mode 100644 index 000000000..2d0494e53 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From c7ed0996ef58b497d3d30be802ab5ae6c37099b5 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:49:57 -0700 | ||
8 | Subject: [PATCH 2/3] Fix error message for incorrect command | ||
9 | |||
10 | Debian bug 406907 | ||
11 | Error message was refering to incorrect command argument. | ||
12 | |||
13 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
14 | --- | ||
15 | brctl/brctl.c | 2 +- | ||
16 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/brctl/brctl.c b/brctl/brctl.c | ||
19 | index 454b8dd..46ca352 100644 | ||
20 | --- a/brctl/brctl.c | ||
21 | +++ b/brctl/brctl.c | ||
22 | @@ -69,7 +69,7 @@ int main(int argc, char *const* argv) | ||
23 | argc -= optind; | ||
24 | argv += optind; | ||
25 | if ((cmd = command_lookup(*argv)) == NULL) { | ||
26 | - fprintf(stderr, "never heard of command [%s]\n", argv[1]); | ||
27 | + fprintf(stderr, "never heard of command [%s]\n", *argv); | ||
28 | goto help; | ||
29 | } | ||
30 | |||
31 | -- | ||
32 | 1.7.5.2 | ||
33 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch new file mode 100644 index 000000000..6f6d6d423 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-incorrect-command-in-manual.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From 8ef7b77562b636efcbd8b759eb324d6c069200f2 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:48:40 -0700 | ||
8 | Subject: [PATCH 1/3] Fix incorrect command in manual | ||
9 | |||
10 | Command is "setageing" not "setageingtime"; fix man page. | ||
11 | Debian bug report. | ||
12 | |||
13 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
14 | --- | ||
15 | doc/brctl.8 | 2 +- | ||
16 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/doc/brctl.8 b/doc/brctl.8 | ||
19 | index d904047..771f323 100644 | ||
20 | --- a/doc/brctl.8 | ||
21 | +++ b/doc/brctl.8 | ||
22 | @@ -89,7 +89,7 @@ data. Machines can move to other ports, network cards can be replaced | ||
23 | .B brctl showmacs <brname> | ||
24 | shows a list of learned MAC addresses for this bridge. | ||
25 | |||
26 | -.B brctl setageingtime <brname> <time> | ||
27 | +.B brctl setageing <brname> <time> | ||
28 | sets the ethernet (MAC) address ageing time, in seconds. After <time> | ||
29 | seconds of not having seen a frame coming from a certain address, the | ||
30 | bridge will time out (delete) that address from the Forwarding | ||
31 | -- | ||
32 | 1.7.5.2 | ||
33 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch new file mode 100644 index 000000000..de36f0598 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | include missing kernel header | ||
2 | |||
3 | Fixes errors like | ||
4 | |||
5 | | /b/kraj/jlinux-next/poky/build/tmp-eglibc/sysroots/re-64b/usr/include/linux/if_bridge.h:172:20: error: field 'ip6' has incomplete type | ||
6 | | In file included from ../libbridge/libbridge.h:24:0, | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Index: bridge-utils-1.5/libbridge/libbridge.h | ||
12 | =================================================================== | ||
13 | --- bridge-utils-1.5.orig/libbridge/libbridge.h 2011-03-28 17:52:54.000000000 -0700 | ||
14 | +++ bridge-utils-1.5/libbridge/libbridge.h 2013-03-04 21:16:25.781188309 -0800 | ||
15 | @@ -20,6 +20,7 @@ | ||
16 | #define _LIBBRIDGE_H | ||
17 | |||
18 | #include <sys/socket.h> | ||
19 | +#include <linux/in6.h> | ||
20 | #include <linux/if.h> | ||
21 | #include <linux/if_bridge.h> | ||
22 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb new file mode 100644 index 000000000..04f863b22 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | require bridge-utils.inc | ||
2 | |||
3 | SRC_URI += "file://kernel-headers.patch" | ||
4 | |||
5 | PARALLEL_MAKE = "" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37" | ||
8 | |||
9 | SRC_URI[md5sum] = "ec7b381160b340648dede58c31bb2238" | ||
10 | SRC_URI[sha256sum] = "42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688" | ||
11 | |||
diff --git a/meta-networking/recipes-support/cifs/cifs-utils_git.bb b/meta-networking/recipes-support/cifs/cifs-utils_git.bb new file mode 100644 index 000000000..2b7a0dd66 --- /dev/null +++ b/meta-networking/recipes-support/cifs/cifs-utils_git.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | DESCRIPTION = "A a package of utilities for doing and managing mounts of the Linux CIFS filesystem." | ||
2 | HOMEPAGE = "http://wiki.samba.org/index.php/LinuxCIFS_utils" | ||
3 | |||
4 | LICENSE = "GPLv3 & LGPLv3" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | ||
6 | |||
7 | PV = "5.9" | ||
8 | PR = "r1" | ||
9 | |||
10 | SRCREV = "353d491dcb5d69d31434abeb962c8e9a49c36867" | ||
11 | SRC_URI = "git://git.samba.org/cifs-utils.git" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | PACKAGECONFIG ??= "" | ||
16 | PACKAGECONFIG[cap] = "--with-libcap,--without-libcap,libcap" | ||
17 | # when enabled, it creates ${bindir}/cifscreds and --ignore-fail-on-non-empty in do_install_append is needed | ||
18 | PACKAGECONFIG[cifscreds] = "--enable-cifscreds,--disable-cifscreds,keyutils" | ||
19 | # when enabled, it creates ${sbindir}/cifs.upcall and --ignore-fail-on-non-empty in do_install_append is needed | ||
20 | PACKAGECONFIG[cifsupcall] = "--enable-cifsupcall,--disable-cifsupcall,krb5 talloc keyutils" | ||
21 | |||
22 | inherit autotools pkgconfig | ||
23 | |||
24 | do_install_append() { | ||
25 | # Remove empty /usr/bin and /usr/sbin directories since the mount helper | ||
26 | # is installed to /sbin | ||
27 | rmdir --ignore-fail-on-non-empty ${D}${bindir} ${D}${sbindir} | ||
28 | } | ||
29 | |||
30 | RRECOMMENDS_${PN} = "kernel-module-cifs" | ||
diff --git a/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb b/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb new file mode 100644 index 000000000..06c0dd985 --- /dev/null +++ b/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb | |||
@@ -0,0 +1,23 @@ | |||
1 | require cim-schema.inc | ||
2 | |||
3 | LICENSE = "DMTF" | ||
4 | |||
5 | SRC_URI = "http://dmtf.org/sites/default/files/cim/cim_schema_v2400/cim_schema_${PV}Final-Doc.zip \ | ||
6 | file://LICENSE \ | ||
7 | " | ||
8 | SRC_URI[md5sum] = "3d01940bc1085c6c42184c25fb61f739" | ||
9 | SRC_URI[sha256sum] = "3174cf0f8657b19d80dc59e184778d8e553da424728cb2966fe9d5428dd84267" | ||
10 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=eecc6f71a56ff3caf17f15bf7aeac7b4" | ||
11 | |||
12 | do_unpack() { | ||
13 | unzip -q ${DL_DIR}/cim_schema_${PV}Final-Doc.zip -d ${S} | ||
14 | cp -f ${FILE_DIRNAME}/files/LICENSE ${WORKDIR}/ | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d -m 0755 ${D}${datadir}/doc/cim-schema-${PV}-docs | ||
19 | cp -a ${S}/* ${D}${datadir}/doc/cim-schema-${PV}-docs | ||
20 | } | ||
21 | |||
22 | FILES_${PN} = "${datadir}/doc/*" | ||
23 | FILES_${PN}-doc = "" | ||
diff --git a/meta-networking/recipes-support/cim-schema/cim-schema.inc b/meta-networking/recipes-support/cim-schema/cim-schema.inc new file mode 100644 index 000000000..e35bff69c --- /dev/null +++ b/meta-networking/recipes-support/cim-schema/cim-schema.inc | |||
@@ -0,0 +1,9 @@ | |||
1 | SUMMARY = "Common Information Model (CIM) Schema" | ||
2 | DESCRIPTION = "Common Information Model (CIM) is a model for describing overall\ | ||
3 | management information in a network or enterprise environment. CIM\ | ||
4 | consists of a specification and a schema. The specification defines the\ | ||
5 | details for integration with other management models. The schema\ | ||
6 | provides the actual model descriptions." | ||
7 | |||
8 | HOMEPAGE = "http://www.dmtf.org/" | ||
9 | SECTION = "Development/Libraries" | ||
diff --git a/meta-networking/recipes-support/cim-schema/cim-schema_2.40.0.bb b/meta-networking/recipes-support/cim-schema/cim-schema_2.40.0.bb new file mode 100644 index 000000000..ff6c29dc5 --- /dev/null +++ b/meta-networking/recipes-support/cim-schema/cim-schema_2.40.0.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | require cim-schema.inc | ||
2 | |||
3 | LICENSE = "DMTF" | ||
4 | |||
5 | SRC_URI = "http://dmtf.org/sites/default/files/cim/cim_schema_v2400/cim_schema_${PV}Final-MOFs.zip \ | ||
6 | file://LICENSE \ | ||
7 | " | ||
8 | SRC_URI[md5sum] = "a9bdf17c7374e3b5b7adeaac4842c4ad" | ||
9 | SRC_URI[sha256sum] = "dbfa3064ea427acd71a4bebbc172ca2dc44b0b09a6d83b0945b9ffa988a9058a" | ||
10 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=eecc6f71a56ff3caf17f15bf7aeac7b4" | ||
11 | |||
12 | do_unpack() { | ||
13 | unzip -q ${DL_DIR}/cim_schema_${PV}Final-MOFs.zip -d ${S} | ||
14 | cp -f ${FILE_DIRNAME}/files/LICENSE ${WORKDIR}/ | ||
15 | } | ||
16 | |||
17 | do_install() { | ||
18 | install -d -m 0755 ${D}${datadir}/mof/cimv${PV}/ | ||
19 | install -d -m 0755 ${D}${datadir}/doc/cim-schema-${PV} | ||
20 | install -m 644 ${WORKDIR}/LICENSE ${D}${datadir}/doc/cim-schema-${PV} | ||
21 | |||
22 | cp -a ${S}/* ${D}${datadir}/mof/cimv${PV}/ | ||
23 | for i in `find ${D}${datadir}/mof/cimv${PV} -name "*.mof"`; do | ||
24 | sed -i -e 's/\r//g' $i | ||
25 | done | ||
26 | ln -s cimv${PV} ${D}${datadir}/mof/cim-current | ||
27 | ln -s cim_schema_${PV}.mof ${D}${datadir}/mof/cim-current/CIM_Schema.mof | ||
28 | } | ||
29 | |||
30 | FILES_${PN} = "${datadir}/mof/* ${datadir}/doc/*" | ||
31 | FILES_${PN}-doc = "" | ||
diff --git a/meta-networking/recipes-support/cim-schema/files/LICENSE b/meta-networking/recipes-support/cim-schema/files/LICENSE new file mode 100644 index 000000000..54a28120e --- /dev/null +++ b/meta-networking/recipes-support/cim-schema/files/LICENSE | |||
@@ -0,0 +1,34 @@ | |||
1 | // Copyright 1998-2008 Distributed Management Task Force, Inc. (DMTF). | ||
2 | // All rights reserved. | ||
3 | // DMTF is a not-for-profit association of industry members dedicated | ||
4 | // to promoting enterprise and systems management and interoperability. | ||
5 | // DMTF specifications and documents may be reproduced by | ||
6 | // members and non-members, provided that correct attribution is given. | ||
7 | // As DMTF specifications may be revised from time to time, | ||
8 | // the particular version and release date should always be noted. | ||
9 | // | ||
10 | // Implementation of certain elements of this standard or proposed | ||
11 | // standard may be subject to third party patent rights, including | ||
12 | // provisional patent rights (herein "patent rights"). DMTF makes | ||
13 | // no representations to users of the standard as to the existence | ||
14 | // of such rights, and is not responsible to recognize, disclose, or | ||
15 | // identify any or all such third party patent right, owners or | ||
16 | // claimants, nor for any incomplete or inaccurate identification or | ||
17 | // disclosure of such rights, owners or claimants. DMTF shall have no | ||
18 | // liability to any party, in any manner or circumstance, under any | ||
19 | // legal theory whatsoever, for failure to recognize, disclose, or | ||
20 | // identify any such third party patent rights, or for such party's | ||
21 | // reliance on the standard or incorporation thereof in its product, | ||
22 | // protocols or testing procedures. DMTF shall have no liability to | ||
23 | // any party implementing such standard, whether such implementation | ||
24 | // is foreseeable or not, nor to any patent owner or claimant, and shall | ||
25 | // have no liability or responsibility for costs or losses incurred if | ||
26 | // a standard is withdrawn or modified after publication, and shall be | ||
27 | // indemnified and held harmless by any party implementing the | ||
28 | // standard from any and all claims of infringement by a patent owner | ||
29 | // for such implementations. | ||
30 | // | ||
31 | // For information about patents held by third-parties which have | ||
32 | // notified the DMTF that, in their opinion, such patent may relate to | ||
33 | // or impact implementations of DMTF standards, visit | ||
34 | // http://www.dmtf.org/about/policies/disclosures.php. | ||
diff --git a/meta-networking/recipes-support/curlpp/curlpp/example21.cpp-remove-deprecated-code.patch b/meta-networking/recipes-support/curlpp/curlpp/example21.cpp-remove-deprecated-code.patch new file mode 100644 index 000000000..dae583d85 --- /dev/null +++ b/meta-networking/recipes-support/curlpp/curlpp/example21.cpp-remove-deprecated-code.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | example21.cpp: remove deprecated code | ||
2 | |||
3 | The deprecated code was no longer used, so remove it to avoid | ||
4 | compiling failure with -Werror=unused-function | ||
5 | ... | ||
6 | | example21.cpp:51:8: error: 'size_t {anonymous}::readData(char*, | ||
7 | size_t, size_t)' defined but not used [-Werror=unused-function] | ||
8 | | size_t readData(char *buffer, size_t size, size_t nitems) | ||
9 | ... | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
14 | --- | ||
15 | examples/example21.cpp | 17 ----------------- | ||
16 | 1 file changed, 17 deletions(-) | ||
17 | |||
18 | diff --git a/examples/example21.cpp b/examples/example21.cpp | ||
19 | --- a/examples/example21.cpp | ||
20 | +++ b/examples/example21.cpp | ||
21 | @@ -39,23 +39,6 @@ | ||
22 | #include <curlpp/Options.hpp> | ||
23 | #include <curlpp/Exception.hpp> | ||
24 | |||
25 | -/* | ||
26 | - anonymous namespace to prevent name clash in case other examples using the same global entities | ||
27 | - would be compiled in the same project | ||
28 | -*/ | ||
29 | -namespace | ||
30 | -{ | ||
31 | - | ||
32 | -char *data = NULL; | ||
33 | - | ||
34 | -size_t readData(char *buffer, size_t size, size_t nitems) | ||
35 | -{ | ||
36 | - strncpy(buffer, data, size * nitems); | ||
37 | - return size * nitems; | ||
38 | -} | ||
39 | - | ||
40 | -} // namespace | ||
41 | - | ||
42 | int main(int argc, char *argv[]) | ||
43 | { | ||
44 | if(argc != 3) { | ||
45 | -- | ||
46 | 1.9.1 | ||
47 | |||
diff --git a/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch b/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch new file mode 100644 index 000000000..ad73c0088 --- /dev/null +++ b/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Upstream-Status: Inappropriate [packaging] | ||
2 | |||
3 | |||
4 | Index: curl-7.20.0/libcurl.pc.in | ||
5 | =================================================================== | ||
6 | --- curl-7.20.0.orig/libcurl.pc.in 2009-11-17 18:11:07.000000000 +0000 | ||
7 | +++ curl-7.20.0/libcurl.pc.in 2010-03-25 12:13:26.814051066 +0000 | ||
8 | @@ -35,6 +35,7 @@ | ||
9 | URL: http://curl.haxx.se/ | ||
10 | Description: Library to transfer files with ftp, http, etc. | ||
11 | Version: @CURLVERSION@ | ||
12 | -Libs: -L${libdir} -lcurl @LIBS@ | ||
13 | -Libs.private: @LIBCURL_LIBS@ @LIBS@ | ||
14 | +Requires.private: @GNUTLS_REQUIRED@ | ||
15 | +Libs: -L${libdir} -lcurl | ||
16 | +Libs.private: -ldl -lz | ||
17 | Cflags: -I${includedir} | ||
18 | Index: curl-7.20.0/configure.ac | ||
19 | =================================================================== | ||
20 | --- curl-7.20.0.orig/configure.ac 2010-02-04 21:41:46.000000000 +0000 | ||
21 | +++ curl-7.20.0/configure.ac 2010-03-25 12:12:18.673129001 +0000 | ||
22 | @@ -1668,6 +1668,7 @@ | ||
23 | AC_SUBST(USE_GNUTLS, [1]) | ||
24 | GNUTLS_ENABLED=1 | ||
25 | USE_GNUTLS="yes" | ||
26 | + GNUTLS_REQUIRED="gnutls" | ||
27 | curl_ssl_msg="enabled (GnuTLS)" | ||
28 | ], | ||
29 | [ | ||
30 | @@ -1696,6 +1697,8 @@ | ||
31 | |||
32 | fi dnl OPENSSL != 1 | ||
33 | |||
34 | +AC_SUBST(GNUTLS_REQUIRED) | ||
35 | + | ||
36 | dnl ---------------------------------------------------- | ||
37 | dnl NSS. Only check if GnuTLS and OpenSSL are not enabled | ||
38 | dnl ---------------------------------------------------- | ||
diff --git a/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb b/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb new file mode 100644 index 000000000..48f5178b5 --- /dev/null +++ b/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb | |||
@@ -0,0 +1,88 @@ | |||
1 | SUMMARY = "C++ library for client-side URL transfers" | ||
2 | HOMEPAGE = "http://code.google.com/p/curlpp/" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
6 | |||
7 | DEPENDS = "curl boost" | ||
8 | DEPENDS_class-native = "curl-native" | ||
9 | |||
10 | SRC_URI = "http://curlpp.googlecode.com/files/curlpp-${PV}.tar.gz \ | ||
11 | file://example21.cpp-remove-deprecated-code.patch \ | ||
12 | " | ||
13 | |||
14 | SRC_URI[md5sum] = "ccc3d30d4b3b5d2cdbed635898c29485" | ||
15 | SRC_URI[sha256sum] = "e3f9427b27c5bddf898d383d45c0d3d5397e2056ff935d9a5cdaef6a9a653bd5" | ||
16 | |||
17 | inherit autotools-brokensep pkgconfig binconfig | ||
18 | |||
19 | EXTRA_OECONF = "--prefix=${STAGING_DIR} \ | ||
20 | --with-boost=${STAGING_DIR} \ | ||
21 | " | ||
22 | |||
23 | do_install() { | ||
24 | install -d ${D}/${includedir}/curlpp | ||
25 | cp -r include/curlpp/* ${D}${includedir}/curlpp | ||
26 | |||
27 | install -d ${D}${includedir}/utilspp | ||
28 | cp -r include/utilspp/* ${D}${includedir}/utilspp | ||
29 | |||
30 | install -d ${D}/${libdir} | ||
31 | install -m 664 src/curlpp/.libs/libcurlpp.a ${D}/${libdir} | ||
32 | install -m 664 src/curlpp/.libs/libcurlpp.lai ${D}/${libdir}/libcurlpp.la | ||
33 | |||
34 | install -m 775 src/curlpp/.libs/libcurlpp.so.0.0.2 ${D}/${libdir} | ||
35 | |||
36 | install -m 664 src/utilspp/.libs/libutilspp.a ${D}/${libdir} | ||
37 | install -m 664 src/utilspp/.libs/libutilspp.lai ${D}/${libdir}/libutilspp.la | ||
38 | |||
39 | install -m 664 src/utilspp/.libs/libutilspp.so.0.0.0 ${D}/${libdir} | ||
40 | |||
41 | install -d ${D}/${libdir}/pkgconfig | ||
42 | install -m 664 curlpp.pc ${D}/${libdir}/pkgconfig | ||
43 | |||
44 | install -d ${D}/${bindir} | ||
45 | install -m 755 curlpp-config ${D}/${bindir} | ||
46 | |||
47 | install -d ${D}/${includedir}/curlpp | ||
48 | install -d ${D}/${includedir}/curlpp/internal | ||
49 | install -d ${D}/${includedir}/utilspp | ||
50 | install -d ${D}/${includedir}/utilspp/functor | ||
51 | install -d ${D}/${includedir}/utilspp/singleton | ||
52 | |||
53 | install -m 664 include/curlpp/config* ${D}/${includedir}/curlpp | ||
54 | install -m 664 include/curlpp/*.h* ${D}/${includedir}/curlpp | ||
55 | install -m 664 include/curlpp/*.inl ${D}/${includedir}/curlpp | ||
56 | |||
57 | install -m 664 include/curlpp/internal/*.h* ${D}/${includedir}/curlpp/internal | ||
58 | install -m 664 include/curlpp/internal/*.inl ${D}/${includedir}/curlpp/internal | ||
59 | |||
60 | install -m 664 include/utilspp/*.h* ${D}/${includedir}/utilspp | ||
61 | install -m 664 include/utilspp/*.inl ${D}/${includedir}/utilspp | ||
62 | |||
63 | install -m 664 include/utilspp/functor/*.h* ${D}/${includedir}/utilspp/functor | ||
64 | install -m 664 include/utilspp/singleton/*.h* ${D}/${includedir}/utilspp/singleton | ||
65 | install -m 664 include/utilspp/singleton/*.inl ${D}/${includedir}/utilspp/singleton | ||
66 | install -m 755 curlpp-config ${D}/${bindir} | ||
67 | } | ||
68 | |||
69 | pkg_postinst_${PN}() { | ||
70 | ln -sf libcurlpp.so.0.0.2 /usr/lib/libcurlpp.so.0 | ||
71 | ln -sf libcurlpp.so.0.0.2 /usr/lib/libcurlpp.so | ||
72 | ln -sf libutilspp.so.0.0.0 /usr/lib/libutilspp.so.0 | ||
73 | ln -sf libutilspp.so.0.0.0 /usr/lib/libutilspp.so | ||
74 | } | ||
75 | |||
76 | PACKAGES =+ "libcurlpp libcurlpp-dev libcurlpp-staticdev" | ||
77 | |||
78 | FILES_lib${BPN} = "${libdir}/lib*.so.* \ | ||
79 | " | ||
80 | |||
81 | FILES_lib${BPN}-dev = "${includedir} \ | ||
82 | ${libdir}/lib*.la \ | ||
83 | ${libdir}/pkgconfig \ | ||
84 | ${bindir}/*-config" | ||
85 | |||
86 | FILES_lib${BPN}-staticdev = "${libdir}/lib*.a" | ||
87 | |||
88 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq.inc b/meta-networking/recipes-support/dnsmasq/dnsmasq.inc new file mode 100644 index 000000000..133524598 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq.inc | |||
@@ -0,0 +1,66 @@ | |||
1 | SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server" | ||
2 | HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html" | ||
3 | SECTION = "console/network" | ||
4 | # GPLv3 was added in version 2.41 as license option | ||
5 | LICENSE = "GPLv2 | GPLv3" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
7 | file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504" | ||
8 | |||
9 | #at least versions 2.15 and prior are moved to the archive folder on the server | ||
10 | SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV',1).split('.')[1]) > 15]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \ | ||
11 | file://init \ | ||
12 | file://dnsmasq.conf \ | ||
13 | file://dnsmasq.service \ | ||
14 | " | ||
15 | |||
16 | inherit pkgconfig update-rc.d systemd | ||
17 | |||
18 | INITSCRIPT_NAME = "dnsmasq" | ||
19 | INITSCRIPT_PARAMS = "defaults" | ||
20 | |||
21 | PACKAGECONFIG ?= "" | ||
22 | PACKAGECONFIG[dbus] = ",,dbus" | ||
23 | PACKAGECONFIG[idn] = ",,libidn" | ||
24 | PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack" | ||
25 | PACKAGECONFIG[lua] = ",,lua" | ||
26 | EXTRA_OEMAKE = "\ | ||
27 | 'COPTS=${@base_contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \ | ||
28 | ${@base_contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \ | ||
29 | ${@base_contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \ | ||
30 | ${@base_contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \ | ||
31 | 'CFLAGS=${CFLAGS}' \ | ||
32 | 'LDFLAGS=${LDFLAGS}' \ | ||
33 | " | ||
34 | |||
35 | do_compile_append() { | ||
36 | # build dhcp_release | ||
37 | cd ${S}/contrib/wrt | ||
38 | oe_runmake | ||
39 | } | ||
40 | |||
41 | do_install () { | ||
42 | oe_runmake "PREFIX=${D}${prefix}" \ | ||
43 | "BINDIR=${D}${bindir}" \ | ||
44 | "MANDIR=${D}${mandir}" \ | ||
45 | install | ||
46 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d | ||
47 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ | ||
48 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq | ||
49 | |||
50 | install -d ${D}${systemd_unitdir}/system | ||
51 | install -m 0644 ${WORKDIR}/dnsmasq.service ${D}${systemd_unitdir}/system | ||
52 | |||
53 | install -m 0755 ${S}/contrib/wrt/dhcp_release ${D}${bindir} | ||
54 | |||
55 | if [ "${@base_contains('PACKAGECONFIG', 'dbus', 'dbus', '', d)}" != "" ]; then | ||
56 | install -d ${D}${sysconfdir}/dbus-1/system.d | ||
57 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ | ||
58 | fi | ||
59 | } | ||
60 | |||
61 | CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf" | ||
62 | |||
63 | RPROVIDES_${PN} += "${PN}-systemd" | ||
64 | RREPLACES_${PN} += "${PN}-systemd" | ||
65 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
66 | SYSTEMD_SERVICE_${PN} = "dnsmasq.service" | ||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch b/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch new file mode 100644 index 000000000..918c0b6d5 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 1e5be0a0bcf85913d63408030dec038d360a5fa6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe_macdonald@mentor.com> | ||
3 | Date: Tue, 9 Sep 2014 10:24:58 -0400 | ||
4 | Subject: [PATCH] Upstream-status: Inappropriate [OE specific] | ||
5 | |||
6 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
7 | |||
8 | --- | ||
9 | Makefile | 4 ++-- | ||
10 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
11 | |||
12 | diff --git a/Makefile b/Makefile | ||
13 | index fc38393..a79f8bf 100644 | ||
14 | --- a/Makefile | ||
15 | +++ b/Makefile | ||
16 | @@ -57,8 +57,8 @@ idn_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) - | ||
17 | idn_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_IDN $(PKG_CONFIG) --libs libidn` | ||
18 | ct_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack` | ||
19 | ct_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack` | ||
20 | -lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.1` | ||
21 | -lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1` | ||
22 | +lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua` | ||
23 | +lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua` | ||
24 | nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags nettle hogweed` | ||
25 | nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --libs nettle hogweed` | ||
26 | gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --copy -lgmp` | ||
27 | -- | ||
28 | 1.7.9.5 | ||
29 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq/parallel-make.patch b/meta-networking/recipes-support/dnsmasq/dnsmasq/parallel-make.patch new file mode 100644 index 000000000..6d5b722ea --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq/parallel-make.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | The dnsmasq target depends on .configured and $(objs). .configured does an rm | ||
2 | -f *.o. Yet the only thing telling make to build the .configured target before | ||
3 | the $(objs) target was the order of the dependencies of the dnsmasq target. We | ||
4 | can't rely on that order when doing a paralllel make build, so add an explicit | ||
5 | rule to enforce that order. | ||
6 | |||
7 | Signed-off-by: Christopher Larson <chris_larson@mentor.com> | ||
8 | Upstream-status: Pending | ||
9 | |||
10 | --- dnsmasq-2.68.orig/Makefile | ||
11 | +++ dnsmasq-2.68/Makefile | ||
12 | @@ -139,6 +139,8 @@ bloatcheck : $(BUILDDIR)/dnsmasq_baselin | ||
13 | @rm -f *.o | ||
14 | @touch $@ | ||
15 | |||
16 | +$(objs): .configured | ||
17 | + | ||
18 | $(objs:.o=.c) $(hdrs): | ||
19 | ln -s $(top)/$(SRC)/$@ . | ||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.71.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.71.bb new file mode 100644 index 000000000..ccc567e7f --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.71.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | require dnsmasq.inc | ||
2 | |||
3 | SRC_URI += "\ | ||
4 | file://parallel-make.patch \ | ||
5 | file://lua.patch \ | ||
6 | " | ||
7 | |||
8 | SRC_URI[dnsmasq-2.71.md5sum] = "15a68f7f6cc0119e843f67d2f79598f1" | ||
9 | SRC_URI[dnsmasq-2.71.sha256sum] = "7d8c64f66a396442e01b639df3ea6b4e02ba88cbe206c80be8de68b6841634c4" | ||
10 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf new file mode 100755 index 000000000..1a198a379 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf | |||
@@ -0,0 +1,293 @@ | |||
1 | # Configuration file for dnsmasq. | ||
2 | # | ||
3 | # Format is one option per line, legal options are the same | ||
4 | # as the long options legal on the command line. See | ||
5 | # "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details. | ||
6 | |||
7 | # Change these lines if you want dnsmasq to serve MX records. | ||
8 | # Only one of mx-host and mx-target need be set, the other defaults | ||
9 | # to the name of the host running dnsmasq. | ||
10 | #mx-host= | ||
11 | #mx-target= | ||
12 | #selfmx | ||
13 | #localmx | ||
14 | |||
15 | # The following two options make you a better netizen, since they | ||
16 | # tell dnsmasq to filter out queries which the public DNS cannot | ||
17 | # answer, and which load the servers (especially the root servers) | ||
18 | # uneccessarily. If you have a dial-on-demand link they also stop | ||
19 | # these requests from bringing up the link uneccessarily. | ||
20 | |||
21 | # Never forward plain names (with a dot or domain part) | ||
22 | domain-needed | ||
23 | # Never forward addresses in the non-routed address spaces. | ||
24 | bogus-priv | ||
25 | |||
26 | |||
27 | # Uncomment this to filter useless windows-originated DNS requests | ||
28 | # which can trigger dial-on-demand links needlessly. | ||
29 | # Note that (amongst other things) this blocks all SRV requests, | ||
30 | # so don't use it if you use eg Kerberos. | ||
31 | #filterwin2k | ||
32 | |||
33 | # Change this line if you want dns to get its upstream servers from | ||
34 | # somewhere other that /etc/resolv.conf | ||
35 | #resolv-file= | ||
36 | |||
37 | # By default, dnsmasq will send queries to any of the upstream | ||
38 | # servers it knows about and tries to favour servers to are known | ||
39 | # to be up. Uncommenting this forces dnsmasq to try each query | ||
40 | # with each server strictly in the order they appear in | ||
41 | # /etc/resolv.conf | ||
42 | #strict-order | ||
43 | |||
44 | # If you don't want dnsmasq to read /etc/resolv.conf or any other | ||
45 | # file, getting its servers for this file instead (see below), then | ||
46 | # uncomment this | ||
47 | #no-resolv | ||
48 | |||
49 | # If you don't want dnsmasq to poll /etc/resolv.conf or other resolv | ||
50 | # files for changes and re-read them then uncomment this. | ||
51 | #no-poll | ||
52 | |||
53 | # Add other name servers here, with domain specs if they are for | ||
54 | # non-public domains. | ||
55 | #server=/localnet/192.168.0.1 | ||
56 | |||
57 | # Add local-only domains here, queries in these domains are answered | ||
58 | # from /etc/hosts or DHCP only. | ||
59 | #local=/localnet/ | ||
60 | |||
61 | # Add domains which you want to force to an IP address here. | ||
62 | # The example below send any host in doubleclick.net to a local | ||
63 | # webserver. | ||
64 | #address=/doubleclick.net/127.0.0.1 | ||
65 | |||
66 | # You no longer (as of version 1.7) need to set these to enable | ||
67 | # dnsmasq to read /etc/ppp/resolv.conf since dnsmasq now uses the | ||
68 | # "dip" group to achieve this. | ||
69 | #user= | ||
70 | #group= | ||
71 | |||
72 | # If you want dnsmasq to listen for requests only on specified interfaces | ||
73 | # (and the loopback) give the name of the interface (eg eth0) here. | ||
74 | # Repeat the line for more than one interface. | ||
75 | #interface= | ||
76 | # Or you can specify which interface _not_ to listen on | ||
77 | #except-interface= | ||
78 | # Or which to listen on by address (remember to include 127.0.0.1 if | ||
79 | # you use this.) | ||
80 | #listen-address= | ||
81 | |||
82 | # On systems which support it, dnsmasq binds the wildcard address, | ||
83 | # even when it is listening on only some interfaces. It then discards | ||
84 | # requests that it shouldn't reply to. This has the advantage of | ||
85 | # working even when interfaces come and go and change address. If you | ||
86 | # want dnsmasq to really bind only the interfaces it is listening on, | ||
87 | # uncomment this option. About the only time you may need this is when | ||
88 | # running another nameserver on the same machine. | ||
89 | #bind-interfaces | ||
90 | |||
91 | # If you don't want dnsmasq to read /etc/hosts, uncomment the | ||
92 | # following line. | ||
93 | #no-hosts | ||
94 | # or if you want it to read another file, as well as /etc/hosts, use | ||
95 | # this. | ||
96 | #addn-hosts=/etc/banner_add_hosts | ||
97 | |||
98 | # Set this (and domain: see below) if you want to have a domain | ||
99 | # automatically added to simple names in a hosts-file. | ||
100 | #expand-hosts | ||
101 | |||
102 | # Set the domain for dnsmasq. this is optional, but if it is set, it | ||
103 | # does the following things. | ||
104 | # 1) Allows DHCP hosts to have fully qualified domain names, as long | ||
105 | # as the domain part matches this setting. | ||
106 | # 2) Sets the "domain" DHCP option thereby potentially setting the | ||
107 | # domain of all systems configured by DHCP | ||
108 | # 3) Provides the domain part for "expand-hosts" | ||
109 | #domain=thekelleys.org.uk | ||
110 | |||
111 | # Uncomment this to enable the integrated DHCP server, you need | ||
112 | # to supply the range of addresses available for lease and optionally | ||
113 | # a lease time. If you have more than one network, you will need to | ||
114 | # repeat this for each network on which you want to supply DHCP | ||
115 | # service. | ||
116 | #dhcp-range=192.168.0.50,192.168.0.150,12h | ||
117 | dhcp-range=10.0.0.10,10.0.0.200,2h | ||
118 | |||
119 | # This is an example of a DHCP range where the netmask is given. This | ||
120 | # is needed for networks we reach the dnsmasq DHCP server via a relay | ||
121 | # agent. If you don't know what a DHCP relay agent is, you probably | ||
122 | # don't need to worry about this. | ||
123 | #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h | ||
124 | |||
125 | # This is an example of a DHCP range with a network-id, so that | ||
126 | # some DHCP options may be set only for this network. | ||
127 | #dhcp-range=red,192.168.0.50,192.168.0.150 | ||
128 | |||
129 | # Supply parameters for specified hosts using DHCP. There are lots | ||
130 | # of valid alternatives, so we will give examples of each. Note that | ||
131 | # IP addresses DO NOT have to be in the range given above, they just | ||
132 | # need to be on the same network. The order of the parameters in these | ||
133 | # do not matter, it's permissble to give name,adddress and MAC in any order | ||
134 | |||
135 | # Always allocate the host with ethernet address 11:22:33:44:55:66 | ||
136 | # The IP address 192.168.0.60 | ||
137 | #dhcp-host=11:22:33:44:55:66,192.168.0.60 | ||
138 | |||
139 | # Always set the name of the host with hardware address | ||
140 | # 11:22:33:44:55:66 to be "fred" | ||
141 | #dhcp-host=11:22:33:44:55:66,fred | ||
142 | |||
143 | # Always give the host with ethernet address 11:22:33:44:55:66 | ||
144 | # the name fred and IP address 192.168.0.60 and lease time 45 minutes | ||
145 | #dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m | ||
146 | |||
147 | # Give the machine which says it's name is "bert" IP address | ||
148 | # 192.168.0.70 and an infinite lease | ||
149 | #dhcp-host=bert,192.168.0.70,infinite | ||
150 | |||
151 | # Always give the host with client identifier 01:02:02:04 | ||
152 | # the IP address 192.168.0.60 | ||
153 | #dhcp-host=id:01:02:02:04,192.168.0.60 | ||
154 | |||
155 | # Always give the host with client identifier "marjorie" | ||
156 | # the IP address 192.168.0.60 | ||
157 | #dhcp-host=id:marjorie,192.168.0.60 | ||
158 | |||
159 | # Enable the address given for "judge" in /etc/hosts | ||
160 | # to be given to a machine presenting the name "judge" when | ||
161 | # it asks for a DHCP lease. | ||
162 | #dhcp-host=judge | ||
163 | |||
164 | # Never offer DHCP service to a machine whose ethernet | ||
165 | # address is 11:22:33:44:55:66 | ||
166 | #dhcp-host=11:22:33:44:55:66,ignore | ||
167 | |||
168 | # Ignore any client-id presented by the machine with ethernet | ||
169 | # address 11:22:33:44:55:66. This is useful to prevent a machine | ||
170 | # being treated differently when running under different OS's or | ||
171 | # between PXE boot and OS boot. | ||
172 | #dhcp-host=11:22:33:44:55:66,id:* | ||
173 | |||
174 | # Send extra options which are tagged as "red" to | ||
175 | # the machine with ethernet address 11:22:33:44:55:66 | ||
176 | #dhcp-host=11:22:33:44:55:66,net:red | ||
177 | |||
178 | # Send extra options which are tagged as "red" to any machine whose | ||
179 | # DHCP vendorclass string includes the substring "Linux" | ||
180 | #dhcp-vendorclass=red,Linux | ||
181 | |||
182 | # Send extra options which are tagged as "red" to any machine one | ||
183 | # of whose DHCP userclass strings includes the substring "accounts" | ||
184 | #dhcp-userclass=red,accounts | ||
185 | |||
186 | # If this line is uncommented, dnsmasq will read /etc/ethers and act | ||
187 | # on the ethernet-address/IP pairs found there just as if they had | ||
188 | # been given as --dhcp-host options. Useful if you keep | ||
189 | # MAC-address/host mappings there for other purposes. | ||
190 | #read-ethers | ||
191 | |||
192 | # Send options to hosts which ask for a DHCP lease. | ||
193 | # See RFC 2132 for details of available options. | ||
194 | # Note that all the common settings, such as netmask and | ||
195 | # broadcast address, DNS server and default route, are given | ||
196 | # sane defaults by dnsmasq. You very likely will not need any | ||
197 | # any dhcp-options. If you use Windows clients and Samba, there | ||
198 | # are some options which are recommended, they are detailed at the | ||
199 | # end of this section. | ||
200 | # For reference, the common options are: | ||
201 | # subnet mask - 1 | ||
202 | # default router - 3 | ||
203 | # DNS server - 6 | ||
204 | # broadcast address - 28 | ||
205 | |||
206 | # Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5 | ||
207 | #dhcp-option=42,192.168.0.4,10.10.0.5 | ||
208 | |||
209 | # Set the NTP time server address to be the same machine as | ||
210 | # is running dnsmasq | ||
211 | #dhcp-option=42,0.0.0.0 | ||
212 | |||
213 | # Set the NIS domain name to "welly" | ||
214 | #dhcp-option=40,welly | ||
215 | |||
216 | # Set the default time-to-live to 50 | ||
217 | #dhcp-option=23,50 | ||
218 | |||
219 | # Set the "all subnets are local" flag | ||
220 | #dhcp-option=27,1 | ||
221 | |||
222 | # Send the etherboot magic flag and then etherboot options (a string). | ||
223 | #dhcp-option=128,e4:45:74:68:00:00 | ||
224 | #dhcp-option=129,NIC=eepro100 | ||
225 | |||
226 | # Specify an option which will only be sent to the "red" network | ||
227 | # (see dhcp-range for the declaration of the "red" network) | ||
228 | #dhcp-option=red,42,192.168.1.1 | ||
229 | |||
230 | # The following DHCP options set up dnsmasq in the same way as is specified | ||
231 | # for the ISC dhcpcd in | ||
232 | # http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt | ||
233 | # adapted for a typical dnsmasq installation where the host running | ||
234 | # dnsmasq is also the host running samba. | ||
235 | # you may want to uncomment them if you use Windows clients and Samba. | ||
236 | #dhcp-option=19,0 # option ip-forwarding off | ||
237 | #dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s) | ||
238 | #dhcp-option=45,0.0.0.0 # netbios datagram distribution server | ||
239 | #dhcp-option=46,8 # netbios node type | ||
240 | #dhcp-option=47 # empty netbios scope. | ||
241 | |||
242 | |||
243 | # Set the boot filename and tftpd server name and address | ||
244 | # for BOOTP. You will only need this is you want to | ||
245 | # boot machines over the network. | ||
246 | #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3 | ||
247 | |||
248 | # Set the limit on DHCP leases, the default is 150 | ||
249 | #dhcp-lease-max=150 | ||
250 | |||
251 | # The DHCP server needs somewhere on disk to keep its lease database. | ||
252 | # This defaults to a sane location, but if you want to change it, use | ||
253 | # the line below. | ||
254 | #dhcp-leasefile=/var/lib/misc/dnsmasq.leases | ||
255 | |||
256 | # Set the cachesize here. | ||
257 | #cache-size=150 | ||
258 | |||
259 | # If you want to disable negative caching, uncomment this. | ||
260 | #no-negcache | ||
261 | |||
262 | # Normally responses which come form /etc/hosts and the DHCP lease | ||
263 | # file have Time-To-Live set as zero, which conventionally means | ||
264 | # do not cache further. If you are happy to trade lower load on the | ||
265 | # server for potentially stale date, you can set a time-to-live (in | ||
266 | # seconds) here. | ||
267 | #local-ttl= | ||
268 | |||
269 | # If you want dnsmasq to detect attempts by Verisign to send queries | ||
270 | # to unregistered .com and .net hosts to its sitefinder service and | ||
271 | # have dnsmasq instead return the correct NXDOMAIN response, uncomment | ||
272 | # this line. You can add similar lines to do the same for other | ||
273 | # registries which have implemented wildcard A records. | ||
274 | #bogus-nxdomain=64.94.110.11 | ||
275 | |||
276 | # If you want to fix up DNS results from upstream servers, use the | ||
277 | # alias option. This only works for IPv4. | ||
278 | # This alias makes a result of 1.2.3.4 appear as 5.6.7.8 | ||
279 | #alias=1.2.3.4,5.6.7.8 | ||
280 | # and this maps 1.2.3.x to 5.6.7.x | ||
281 | #alias=1.2.3.0,5.6.7.0,255.255.255.0 | ||
282 | |||
283 | # For debugging purposes, log each DNS query as it passes through | ||
284 | # dnsmasq. | ||
285 | #log-queries | ||
286 | |||
287 | # Include a another lot of configuration options. | ||
288 | #conf-file=/etc/dnsmasq.more.conf | ||
289 | |||
290 | |||
291 | |||
292 | |||
293 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service new file mode 100644 index 000000000..549e15e2b --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=DNS forwarder and DHCP server | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/run/dnsmasq.pid | ||
8 | ExecStart=/usr/bin/dnsmasq -x /run/dnsmasq.pid | ||
9 | ExecReload=/bin/kill -HUP $(/bin/cat /run/dnsmasq.pid) | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
13 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/files/init b/meta-networking/recipes-support/dnsmasq/files/init new file mode 100644 index 000000000..d1aa9e517 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/init | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/bin/dnsmasq | ||
3 | NAME=dnsmasq | ||
4 | DESC="DNS forwarder and DHCP server" | ||
5 | ARGS="-7 /etc/dnsmasq.d" | ||
6 | |||
7 | test -f $DAEMON || exit 0 | ||
8 | |||
9 | set -e | ||
10 | |||
11 | case "$1" in | ||
12 | start) | ||
13 | echo -n "starting $DESC: $NAME... " | ||
14 | test -d /var/lib/misc/ || mkdir /var/lib/misc/ | ||
15 | start-stop-daemon -S -x $DAEMON -- $ARGS | ||
16 | echo "done." | ||
17 | ;; | ||
18 | stop) | ||
19 | echo -n "stopping $DESC: $NAME... " | ||
20 | start-stop-daemon -K -x $DAEMON | ||
21 | echo "done." | ||
22 | ;; | ||
23 | status) | ||
24 | echo -n "dnsmasq " | ||
25 | start-stop-daemon -q -K -t -x $DAEMON | ||
26 | RET=$? | ||
27 | if [ "$RET" = "0" ]; then | ||
28 | PID=`cat /var/run/dnsmasq.pid` | ||
29 | echo "($PID) is running" | ||
30 | else | ||
31 | echo "is not running" | ||
32 | exit $RET | ||
33 | fi | ||
34 | ;; | ||
35 | restart) | ||
36 | echo "restarting $DESC: $NAME... " | ||
37 | $0 stop | ||
38 | $0 start | ||
39 | echo "done." | ||
40 | ;; | ||
41 | reload) | ||
42 | echo -n "reloading $DESC: $NAME... " | ||
43 | killall -HUP $(basename ${DAEMON}) | ||
44 | echo "done." | ||
45 | ;; | ||
46 | *) | ||
47 | echo "Usage: $0 {start|stop|status|restart|reload}" | ||
48 | exit 1 | ||
49 | ;; | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||
diff --git a/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch b/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch new file mode 100644 index 000000000..6f5c279be --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 483f120603ada8db680085e3f462396da937e036 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Wed, 8 Jan 2014 09:30:36 +0100 | ||
4 | Subject: [PATCH] configure.ac: convert AC_TRY_RUN to AC_TRY_LINK statements | ||
5 | |||
6 | This is not completely safe, but it's the least invasive fix. | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
9 | Upstream-status: Inappropriate | ||
10 | --- | ||
11 | configure.ac | 23 +++++++---------------- | ||
12 | 1 file changed, 7 insertions(+), 16 deletions(-) | ||
13 | |||
14 | diff --git a/configure.ac b/configure.ac | ||
15 | index 95984bb..dff1f87 100644 | ||
16 | --- a/configure.ac | ||
17 | +++ b/configure.ac | ||
18 | @@ -499,13 +499,10 @@ have_ioloop=no | ||
19 | |||
20 | if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then | ||
21 | AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[ | ||
22 | - AC_TRY_RUN([ | ||
23 | + AC_TRY_LINK([ | ||
24 | #include <sys/epoll.h> | ||
25 | - | ||
26 | - int main() | ||
27 | - { | ||
28 | - return epoll_create(5) < 1; | ||
29 | - } | ||
30 | + ], [ | ||
31 | + epoll_create(5) < 1; | ||
32 | ], [ | ||
33 | i_cv_epoll_works=yes | ||
34 | ], [ | ||
35 | @@ -551,15 +548,13 @@ have_notify=none | ||
36 | if test "$notify" = "" || test "$notify" = "inotify" ; then | ||
37 | dnl * inotify? | ||
38 | AC_CACHE_CHECK([whether we can use inotify],i_cv_inotify_works,[ | ||
39 | - AC_TRY_RUN([ | ||
40 | + AC_TRY_LINK([ | ||
41 | #define _GNU_SOURCE | ||
42 | #include <sys/ioctl.h> | ||
43 | #include <fcntl.h> | ||
44 | #include <sys/inotify.h> | ||
45 | #include <stdio.h> | ||
46 | - | ||
47 | - int main() | ||
48 | - { | ||
49 | + ], [ | ||
50 | int wd, fd; | ||
51 | char * fn = "/tmp"; | ||
52 | |||
53 | @@ -581,8 +576,6 @@ if test "$notify" = "" || test "$notify" = "inotify" ; then | ||
54 | inotify_rm_watch (fd, wd); | ||
55 | |||
56 | close (fd); | ||
57 | - return 0; | ||
58 | - } | ||
59 | ], [ | ||
60 | i_cv_inotify_works=yes | ||
61 | ], [ | ||
62 | @@ -670,7 +663,7 @@ fi | ||
63 | dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. | ||
64 | dnl * It may also be broken in AIX. | ||
65 | AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
66 | - AC_TRY_RUN([ | ||
67 | + AC_TRY_LINK([ | ||
68 | #define _XOPEN_SOURCE 600 | ||
69 | #include <stdio.h> | ||
70 | #include <stdlib.h> | ||
71 | @@ -679,7 +672,7 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
72 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7) | ||
73 | possibly broken posix_fallocate | ||
74 | #endif | ||
75 | - int main() { | ||
76 | + ], [ | ||
77 | int fd = creat("conftest.temp", 0600); | ||
78 | int ret; | ||
79 | if (fd == -1) { | ||
80 | @@ -688,8 +681,6 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
81 | } | ||
82 | ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0; | ||
83 | unlink("conftest.temp"); | ||
84 | - return ret; | ||
85 | - } | ||
86 | ], [ | ||
87 | i_cv_posix_fallocate_works=yes | ||
88 | ], [ | ||
89 | -- | ||
90 | 1.8.4.2 | ||
91 | |||
diff --git a/meta-networking/recipes-support/dovecot/dovecot/building-rquota_xdr.c-depend-on-rquota.h.patch b/meta-networking/recipes-support/dovecot/dovecot/building-rquota_xdr.c-depend-on-rquota.h.patch new file mode 100644 index 000000000..11d9d8c0d --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot/building-rquota_xdr.c-depend-on-rquota.h.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | [PATCH] building rquota_xdr.c depends on rquota.h | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | rquota.h is generated automatically, and building rquota_xdr.c | ||
6 | needs rquota.h, so add the dependency on rquota.h for rquota_xdr.c | ||
7 | |||
8 | Signed-off-by: rongqing li <rli2@yow-blade4.wrs.com> | ||
9 | --- | ||
10 | src/plugins/quota/Makefile.am | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/src/plugins/quota/Makefile.am b/src/plugins/quota/Makefile.am | ||
14 | index 8a6988d..3626d79 100644 | ||
15 | --- a/src/plugins/quota/Makefile.am | ||
16 | +++ b/src/plugins/quota/Makefile.am | ||
17 | @@ -70,7 +70,7 @@ RQUOTA_XDR = rquota_xdr.c | ||
18 | RQUOTA_XDR_LO = rquota_xdr.lo | ||
19 | #RQUOTA_X = /usr/include/rpcsvc/rquota.x | ||
20 | RQUOTA_X = $(srcdir)/rquota.x | ||
21 | -rquota_xdr.c: Makefile $(RQUOTA_X) | ||
22 | +rquota_xdr.c: Makefile $(RQUOTA_X) rquota.h | ||
23 | if [ "$(top_srcdir)" != "$(top_builddir)" ]; then \ | ||
24 | cp $(RQUOTA_X) $(top_builddir)/src/plugins/quota/; \ | ||
25 | fi; \ | ||
26 | -- | ||
27 | 1.8.2.1 | ||
28 | |||
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb new file mode 100644 index 000000000..f733a7832 --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SUMMARY = "Dovecot is an open source IMAP and POP3 email server" | ||
2 | DESCRIPTION = "Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory." | ||
3 | |||
4 | LICENSE = "LGPLv2.1 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b" | ||
6 | |||
7 | SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \ | ||
8 | file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \ | ||
9 | file://building-rquota_xdr.c-depend-on-rquota.h.patch \ | ||
10 | " | ||
11 | SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c" | ||
12 | SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b" | ||
13 | |||
14 | DEPENDS = "openssl xz zlib bzip2 libcap" | ||
15 | |||
16 | inherit autotools pkgconfig | ||
17 | |||
18 | PACKAGECONFIG ??= " \ | ||
19 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
20 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
21 | " | ||
22 | |||
23 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
24 | PACKAGECONFIG[ldap] = "--with-ldap=plugin,--without-ldap,openldap," | ||
25 | |||
26 | # From native build in armv7a-hf/eglibc | ||
27 | CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \ | ||
28 | i_cv_gmtime_max_time_t=32 \ | ||
29 | i_cv_signed_time_t=yes \ | ||
30 | i_cv_mmap_plays_with_write=yes \ | ||
31 | i_cv_fd_passing=yes \ | ||
32 | i_cv_c99_vsnprintf=yes \ | ||
33 | lib_cv___va_copy=yes \ | ||
34 | lib_cv_va_copy=yes \ | ||
35 | lib_cv_va_val_copy=yes \ | ||
36 | " | ||
37 | |||
38 | # hardcode epoll() to avoid running unsafe tests | ||
39 | # BSD needs kqueue and uclibc poll() | ||
40 | EXTRA_OECONF = " --with-ioloop=epoll" | ||
41 | |||
42 | FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a" | ||
43 | FILES_${PN}-dev += "${libdir}/dovecot/*.so" | ||
44 | FILES_${PN}-dbg += "${libdir}/dovecot/*/.debug" | ||
45 | |||
diff --git a/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb b/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb new file mode 100644 index 000000000..a45f74699 --- /dev/null +++ b/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Fetchmail retrieves mail from remote mail servers and forwards it via SMTP" | ||
2 | DESCRIPTION = "Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and IPSEC." | ||
3 | |||
4 | LICENSE = "GPLv2 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fbb509e0303f5ded1cbfc0cc8705f28c" | ||
6 | |||
7 | DEPENDS = "openssl" | ||
8 | |||
9 | SRC_URI = "http://download.berlios.de/fetchmail/fetchmail-${PV}.tar.xz" | ||
10 | SRC_URI[md5sum] = "61b66faad044afa26e142bb1791aa2b3" | ||
11 | SRC_URI[sha256sum] = "79b4c54cdbaf02c1a9a691d9948fcb1a77a1591a813e904283a8b614b757e850" | ||
12 | |||
13 | inherit autotools gettext python-dir pythonnative | ||
14 | |||
15 | EXTRA_OECONF = "--with-ssl=${STAGING_DIR_HOST}${prefix}" | ||
16 | |||
17 | PACKAGES =+ "fetchmail-python" | ||
18 | FILES_fetchmail-python = "${libdir}/${PYTHON_DIR}/*" | ||
diff --git a/meta-networking/recipes-support/fping/fping_3.5.bb b/meta-networking/recipes-support/fping/fping_3.5.bb new file mode 100644 index 000000000..fe8893405 --- /dev/null +++ b/meta-networking/recipes-support/fping/fping_3.5.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "sends ICMP ECHO_REQUEST packets to network hosts" | ||
2 | DESCRIPTION = "fping is a ping like program which uses the Internet Control \ | ||
3 | Message Protocol (ICMP) echo request to determine if a target host is \ | ||
4 | responding. fping differs from ping in that you can specify any number of \ | ||
5 | targets on the command line, or specify a file containing the lists of \ | ||
6 | targets to ping. Instead of sending to one target until it times out or \ | ||
7 | replies, fping will send out a ping packet and move on to the next target \ | ||
8 | in a round-robin fashion." | ||
9 | HOMEPAGE = "http://www.fping.org/" | ||
10 | SECTION = "console/tools" | ||
11 | LICENSE = "BSD" | ||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=09d77789fe32be35acde9637a5ee39b1" | ||
13 | |||
14 | SRC_URI = "http://www.fping.org/dist/fping-${PV}.tar.gz" | ||
15 | SRC_URI[md5sum] = "2e17cb655aa4eb59b5a4a38a89e746ed" | ||
16 | SRC_URI[sha256sum] = "09b8960e235341bae6000085d38106357eae656a79e0119bd27e816c9003656a" | ||
17 | |||
18 | S = "${WORKDIR}/fping-${PV}" | ||
19 | |||
20 | inherit autotools | ||
21 | |||
22 | EXTRA_OECONF = "--enable-ipv4" | ||
23 | |||
24 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}" | ||
25 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | ||
diff --git a/meta-networking/recipes-support/ifenslave/ifenslave_1.1.0.bb b/meta-networking/recipes-support/ifenslave/ifenslave_1.1.0.bb new file mode 100644 index 000000000..58dca8624 --- /dev/null +++ b/meta-networking/recipes-support/ifenslave/ifenslave_1.1.0.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Configure network interfaces for parallel routing" | ||
2 | HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding" | ||
3 | SECTION = "network" | ||
4 | |||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://ifenslave.c;beginline=8;endline=12;md5=a9f0bd2324cdc1b36d1f44f0e643a62a" | ||
7 | |||
8 | SRC_URI = "http://ftp.debian.org/debian/pool/main/i/${BPN}-2.6/${BPN}-2.6_${PV}.orig.tar.gz" | ||
9 | SRC_URI[md5sum] = "56126cd1013cefe0ce6f81613e677bdd" | ||
10 | SRC_URI[sha256sum] = "7917bf34de80a2492eb225adf9168c83a4854ac8a008ed0fd5b3fd147ccd3041" | ||
11 | |||
12 | do_compile() { | ||
13 | ${CC} ifenslave.c -o ifenslave | ||
14 | } | ||
15 | do_install() { | ||
16 | install -d "${D}${sbindir}" | ||
17 | install -m 755 "${S}/ifenslave" "${D}${sbindir}/" | ||
18 | } | ||
diff --git a/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb b/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb new file mode 100644 index 000000000..cc1f8b046 --- /dev/null +++ b/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "iftop does for network usage what top(1) does for CPU usage" | ||
2 | HOMEPAGE = "http://www.ex-parrot.com/pdw/iftop/" | ||
3 | |||
4 | DEPENDS = "libpcap ncurses" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
8 | |||
9 | SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz" | ||
10 | SRC_URI[md5sum] = "fef521a49ec0122458d02c64212af3c5" | ||
11 | SRC_URI[sha256sum] = "1b193037bb3019afae88cd94c87468aac4b045d81ab816ed8d2f489716b14027" | ||
12 | |||
13 | inherit autotools-brokensep | ||
14 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch new file mode 100644 index 000000000..d5602c03d --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 738a9857be9c92ad2f70be88ccee238e3154a936 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe.macdonald@windriver.com> | ||
3 | Date: Wed, 2 Oct 2013 14:20:37 -0400 | ||
4 | Subject: [PATCH] racoon/pfkey: avoid potential null-pointer dereference | ||
5 | |||
6 | Building with -Werror=maybe-uninitialized revealed that 'remote' from | ||
7 | pk_recvmigrate() could be used with uninitialized data in | ||
8 | migrate_sp_ike_addresses(). Ensure it is always at a minimum assigned | ||
9 | NULL. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> | ||
14 | --- | ||
15 | src/racoon/pfkey.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/racoon/pfkey.c b/src/racoon/pfkey.c | ||
19 | index d00b166..e0dc1db 100644 | ||
20 | --- a/src/racoon/pfkey.c | ||
21 | +++ b/src/racoon/pfkey.c | ||
22 | @@ -3352,7 +3352,7 @@ pk_recvmigrate(mhp) | ||
23 | struct sockaddr *old_saddr, *new_saddr; | ||
24 | struct sockaddr *old_daddr, *new_daddr; | ||
25 | struct sockaddr *old_local, *old_remote; | ||
26 | - struct sockaddr *local, *remote; | ||
27 | + struct sockaddr *local, *remote = NULL; | ||
28 | struct sadb_x_kmaddress *kmaddr; | ||
29 | struct sadb_x_policy *xpl; | ||
30 | struct sadb_x_ipsecrequest *xisr_list; | ||
31 | -- | ||
32 | 1.7.9.5 | ||
33 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch new file mode 100644 index 000000000..13e9d73fc --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | From e48b9097dce7bc2bfbb9e9c542124d3b5cebab39 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Barker <paul@paulbarker.me.uk> | ||
3 | Date: Wed, 5 Mar 2014 13:39:14 +0000 | ||
4 | Subject: [PATCH] Don't link against libfl | ||
5 | |||
6 | We can remove all references to yywrap by adding "%option noyywrap" statements | ||
7 | to each flex source file that doesn't override yywrap. After this, we no longer | ||
8 | need to link against libfl and so no longer get errors about undefined | ||
9 | references to yylex. | ||
10 | |||
11 | Signed-off-by: Paul Barker <paul@paulbarker.me.uk> | ||
12 | Upstream-status: Submitted 2014-03-11 | ||
13 | see http://sourceforge.net/p/ipsec-tools/mailman/ipsec-tools-devel/thread/CANyK_8ewmxGA3vBVJW6s1APXPmxPR%2BDFWZ61EL8pCt288aKQ6w%40mail.gmail.com/#msg32088797 | ||
14 | --- | ||
15 | src/libipsec/Makefile.am | 1 - | ||
16 | src/racoon/Makefile.am | 2 +- | ||
17 | src/racoon/cftoken.l | 2 ++ | ||
18 | src/setkey/Makefile.am | 1 - | ||
19 | src/setkey/token.l | 2 ++ | ||
20 | 5 files changed, 5 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/src/libipsec/Makefile.am b/src/libipsec/Makefile.am | ||
23 | index 6a4e3b3..df1e106 100644 | ||
24 | --- a/src/libipsec/Makefile.am | ||
25 | +++ b/src/libipsec/Makefile.am | ||
26 | @@ -26,7 +26,6 @@ libipsec_la_SOURCES = \ | ||
27 | # version is current:revision:age. | ||
28 | # See: http://www.gnu.org/manual/libtool-1.4.2/html_chapter/libtool_6.html#SEC32 | ||
29 | libipsec_la_LDFLAGS = -version-info 0:1:0 | ||
30 | -libipsec_la_LIBADD = $(LEXLIB) | ||
31 | |||
32 | noinst_HEADERS = ipsec_strerror.h | ||
33 | |||
34 | diff --git a/src/racoon/Makefile.am b/src/racoon/Makefile.am | ||
35 | index dbaded9..0662957 100644 | ||
36 | --- a/src/racoon/Makefile.am | ||
37 | +++ b/src/racoon/Makefile.am | ||
38 | @@ -38,7 +38,7 @@ racoon_SOURCES = \ | ||
39 | cftoken.l cfparse.y prsa_tok.l prsa_par.y | ||
40 | EXTRA_racoon_SOURCES = isakmp_xauth.c isakmp_cfg.c isakmp_unity.c throttle.c \ | ||
41 | isakmp_frag.c nattraversal.c security.c $(MISSING_ALGOS) | ||
42 | -racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(LEXLIB) \ | ||
43 | +racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) \ | ||
44 | $(SECCTX_OBJS) vmbuf.o sockmisc.o misc.o ../libipsec/libipsec.la | ||
45 | racoon_DEPENDENCIES = \ | ||
46 | $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(SECCTX_OBJS) \ | ||
47 | diff --git a/src/racoon/cftoken.l b/src/racoon/cftoken.l | ||
48 | index 490242c..1701922 100644 | ||
49 | --- a/src/racoon/cftoken.l | ||
50 | +++ b/src/racoon/cftoken.l | ||
51 | @@ -106,6 +106,8 @@ static int incstackp = 0; | ||
52 | static int yy_first_time = 1; | ||
53 | %} | ||
54 | |||
55 | +%option noyywrap | ||
56 | + | ||
57 | /* common seciton */ | ||
58 | nl \n | ||
59 | ws [ \t]+ | ||
60 | diff --git a/src/setkey/Makefile.am b/src/setkey/Makefile.am | ||
61 | index 746c1f1..389e6cf 100644 | ||
62 | --- a/src/setkey/Makefile.am | ||
63 | +++ b/src/setkey/Makefile.am | ||
64 | @@ -13,7 +13,6 @@ setkey_SOURCES = \ | ||
65 | |||
66 | setkey_LDFLAGS = ../libipsec/libipsec.la | ||
67 | setkey_DEPENDENCIES = ../libipsec/libipsec.la | ||
68 | -setkey_LDADD = $(LEXLIB) | ||
69 | |||
70 | noinst_HEADERS = vchar.h extern.h | ||
71 | man8_MANS = setkey.8 | ||
72 | diff --git a/src/setkey/token.l b/src/setkey/token.l | ||
73 | index ad3d843..eb23b76 100644 | ||
74 | --- a/src/setkey/token.l | ||
75 | +++ b/src/setkey/token.l | ||
76 | @@ -88,6 +88,8 @@ | ||
77 | #endif | ||
78 | %} | ||
79 | |||
80 | +%option noyywrap | ||
81 | + | ||
82 | /* common section */ | ||
83 | nl \n | ||
84 | ws [ \t]+ | ||
85 | -- | ||
86 | 1.9.0 | ||
87 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch new file mode 100644 index 000000000..8d270a62b --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: ipsec-tools-0.8.1/configure.ac | ||
2 | =================================================================== | ||
3 | --- ipsec-tools-0.8.1.orig/configure.ac 2013-01-08 12:43:29.000000000 +0000 | ||
4 | +++ ipsec-tools-0.8.1/configure.ac 2014-07-18 07:51:30.045555880 +0000 | ||
5 | @@ -6,7 +6,7 @@ | ||
6 | AC_CONFIG_SRCDIR([configure.ac]) | ||
7 | AC_CONFIG_HEADERS(config.h) | ||
8 | |||
9 | -AM_INIT_AUTOMAKE(dist-bzip2) | ||
10 | +AM_INIT_AUTOMAKE([foreign dist-bzip2]) | ||
11 | |||
12 | AC_ENABLE_SHARED(no) | ||
13 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch new file mode 100644 index 000000000..36efc4917 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | squahes below warning | ||
2 | warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" | ||
3 | |||
4 | Seen with glibc 2.20 | ||
5 | |||
6 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
7 | Upstream-Status: Pending | ||
8 | Index: ipsec-tools-0.8.2/src/include-glibc/glibc-bugs.h | ||
9 | =================================================================== | ||
10 | --- ipsec-tools-0.8.2.orig/src/include-glibc/glibc-bugs.h 2006-09-09 09:22:08.000000000 -0700 | ||
11 | +++ ipsec-tools-0.8.2/src/include-glibc/glibc-bugs.h 2014-09-03 22:27:22.551563888 -0700 | ||
12 | @@ -4,7 +4,11 @@ | ||
13 | #define __GLIBC_BUGS_H__ 1 | ||
14 | |||
15 | #define _XOPEN_SOURCE 500 | ||
16 | +/* Legacy feature macro.*/ | ||
17 | #define _BSD_SOURCE | ||
18 | +/* New feature macro that provides everything _BSD_SOURCE and | ||
19 | + * _SVID_SOURCE provided and possibly more. */ | ||
20 | +#define _DEFAULT_SOURCE | ||
21 | |||
22 | #include <features.h> | ||
23 | #include <sys/types.h> | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch new file mode 100644 index 000000000..e82db087c --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch | |||
@@ -0,0 +1,220 @@ | |||
1 | racoon: Resend UPDATE message when received EINTR message | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | While kernel is processing the UPDATE message which is sent from racoon, | ||
6 | it maybe interrupted by system signal and if this case happens, | ||
7 | kernel responds with an EINTR message to racoon and kernel fails to | ||
8 | establish the corresponding SA. | ||
9 | Fix this problem by resend the UPDATE message when EINTR(Interrupted | ||
10 | system call) error happens. | ||
11 | |||
12 | Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> | ||
13 | --- | ||
14 | --- a/src/libipsec/libpfkey.h | ||
15 | +++ b/src/libipsec/libpfkey.h | ||
16 | @@ -92,6 +92,12 @@ | ||
17 | u_int16_t ctxstrlen; /* length of security context string */ | ||
18 | }; | ||
19 | |||
20 | +struct update_msg_info { | ||
21 | + struct sadb_msg *update_msg; | ||
22 | + int so; | ||
23 | + int len; | ||
24 | +}; | ||
25 | + | ||
26 | /* The options built into libipsec */ | ||
27 | extern int libipsec_opt; | ||
28 | #define LIBIPSEC_OPT_NATT 0x01 | ||
29 | --- a/src/libipsec/pfkey.c | ||
30 | +++ b/src/libipsec/pfkey.c | ||
31 | @@ -1219,7 +1219,8 @@ | ||
32 | } | ||
33 | #endif | ||
34 | |||
35 | - | ||
36 | +struct update_msg_info update_msg_send = {NULL, 0, 0}; | ||
37 | + | ||
38 | /* sending SADB_ADD or SADB_UPDATE message to the kernel */ | ||
39 | static int | ||
40 | pfkey_send_x1(struct pfkey_send_sa_args *sa_parms) | ||
41 | @@ -1483,10 +1484,24 @@ | ||
42 | |||
43 | /* send message */ | ||
44 | len = pfkey_send(sa_parms->so, newmsg, len); | ||
45 | - free(newmsg); | ||
46 | |||
47 | - if (len < 0) | ||
48 | - return -1; | ||
49 | + if (newmsg->sadb_msg_type == SADB_UPDATE) { | ||
50 | + if (update_msg_send.update_msg) | ||
51 | + free(update_msg_send.update_msg); | ||
52 | + update_msg_send.update_msg = newmsg; | ||
53 | + update_msg_send.so = sa_parms->so; | ||
54 | + update_msg_send.len = len; | ||
55 | + | ||
56 | + if (len < 0) { | ||
57 | + free(update_msg_send.update_msg); | ||
58 | + update_msg_send.update_msg = NULL; | ||
59 | + return -1; | ||
60 | + } | ||
61 | + } else { | ||
62 | + free(newmsg); | ||
63 | + if (len < 0) | ||
64 | + return -1; | ||
65 | + } | ||
66 | |||
67 | __ipsec_errcode = EIPSEC_NO_ERROR; | ||
68 | return len; | ||
69 | --- a/src/racoon/session.c | ||
70 | +++ b/src/racoon/session.c | ||
71 | @@ -100,6 +100,8 @@ | ||
72 | |||
73 | #include "sainfo.h" | ||
74 | |||
75 | +extern struct update_msg_info update_msg_send; | ||
76 | + | ||
77 | struct fd_monitor { | ||
78 | int (*callback)(void *ctx, int fd); | ||
79 | void *ctx; | ||
80 | @@ -348,6 +350,11 @@ | ||
81 | close_sockets(); | ||
82 | backupsa_clean(); | ||
83 | |||
84 | + if (update_msg_send.update_msg) { | ||
85 | + free(update_msg_send.update_msg); | ||
86 | + update_msg_send.update_msg = NULL; | ||
87 | + } | ||
88 | + | ||
89 | plog(LLV_INFO, LOCATION, NULL, "racoon process %d shutdown\n", getpid()); | ||
90 | |||
91 | exit(0); | ||
92 | --- a/src/racoon/pfkey.c | ||
93 | +++ b/src/racoon/pfkey.c | ||
94 | @@ -103,10 +103,12 @@ | ||
95 | #include "crypto_openssl.h" | ||
96 | #include "grabmyaddr.h" | ||
97 | +#include "../libipsec/libpfkey.h" | ||
98 | |||
99 | #if defined(SADB_X_EALG_RIJNDAELCBC) && !defined(SADB_X_EALG_AESCBC) | ||
100 | #define SADB_X_EALG_AESCBC SADB_X_EALG_RIJNDAELCBC | ||
101 | #endif | ||
102 | |||
103 | +extern struct update_msg_info update_msg_send; | ||
104 | /* prototype */ | ||
105 | static u_int ipsecdoi2pfkey_aalg __P((u_int)); | ||
106 | static u_int ipsecdoi2pfkey_ealg __P((u_int)); | ||
107 | @@ -253,6 +255,13 @@ | ||
108 | s_pfkey_type(msg->sadb_msg_type), | ||
109 | strerror(msg->sadb_msg_errno)); | ||
110 | |||
111 | + if (msg->sadb_msg_errno == EINTR && | ||
112 | + update_msg_send.update_msg) { | ||
113 | + plog(LLV_DEBUG, LOCATION, NULL, | ||
114 | + "pfkey update resend\n"); | ||
115 | + send(update_msg_send.so, (void *)update_msg_send.update_msg, (socklen_t)update_msg_send.len, 0); | ||
116 | + } | ||
117 | + | ||
118 | goto end; | ||
119 | } | ||
120 | |||
121 | @@ -498,6 +507,11 @@ | ||
122 | { | ||
123 | flushsp(); | ||
124 | |||
125 | + if (update_msg_send.update_msg) { | ||
126 | + free(update_msg_send.update_msg); | ||
127 | + update_msg_send.update_msg = NULL; | ||
128 | + } | ||
129 | + | ||
130 | if (pfkey_send_spddump(lcconf->sock_pfkey) < 0) { | ||
131 | plog(LLV_ERROR, LOCATION, NULL, | ||
132 | "libipsec sending spddump failed: %s\n", | ||
133 | @@ -1295,6 +1309,8 @@ | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | +int update_received = 0; | ||
138 | + | ||
139 | static int | ||
140 | pk_recvupdate(mhp) | ||
141 | caddr_t *mhp; | ||
142 | @@ -1307,6 +1323,13 @@ | ||
143 | int incomplete = 0; | ||
144 | struct saproto *pr; | ||
145 | |||
146 | + update_received = 1; | ||
147 | + | ||
148 | + if (update_msg_send.update_msg) { | ||
149 | + free(update_msg_send.update_msg); | ||
150 | + update_msg_send.update_msg = NULL; | ||
151 | + } | ||
152 | + | ||
153 | /* ignore this message because of local test mode. */ | ||
154 | if (f_local) | ||
155 | return 0; | ||
156 | @@ -4163,3 +4186,8 @@ | ||
157 | |||
158 | return buf; | ||
159 | } | ||
160 | + | ||
161 | +int receive_from_isakmp() | ||
162 | +{ | ||
163 | + return pfkey_handler(NULL, lcconf->sock_pfkey); | ||
164 | +} | ||
165 | --- a/src/racoon/pfkey.h | ||
166 | +++ b/src/racoon/pfkey.h | ||
167 | @@ -71,5 +71,6 @@ | ||
168 | extern u_int32_t pk_getseq __P((void)); | ||
169 | extern const char *sadbsecas2str | ||
170 | __P((struct sockaddr *, struct sockaddr *, int, u_int32_t, int)); | ||
171 | +extern int receive_from_isakmp __P((void)); | ||
172 | |||
173 | #endif /* _PFKEY_H */ | ||
174 | --- a/src/racoon/isakmp_quick.c | ||
175 | +++ b/src/racoon/isakmp_quick.c | ||
176 | @@ -774,6 +774,8 @@ | ||
177 | return error; | ||
178 | } | ||
179 | |||
180 | +extern int update_received; | ||
181 | + | ||
182 | /* | ||
183 | * send to responder | ||
184 | * HDR*, HASH(3) | ||
185 | @@ -892,6 +894,11 @@ | ||
186 | } | ||
187 | plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n"); | ||
188 | |||
189 | + while (!update_received) | ||
190 | + receive_from_isakmp(); | ||
191 | + | ||
192 | + update_received = 0; | ||
193 | + | ||
194 | /* Do ADD for responder */ | ||
195 | if (pk_sendadd(iph2) < 0) { | ||
196 | plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n"); | ||
197 | @@ -1035,6 +1042,11 @@ | ||
198 | } | ||
199 | plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n"); | ||
200 | |||
201 | + while (!update_received) | ||
202 | + receive_from_isakmp(); | ||
203 | + | ||
204 | + update_received = 0; | ||
205 | + | ||
206 | /* Do ADD for responder */ | ||
207 | if (pk_sendadd(iph2) < 0) { | ||
208 | plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n"); | ||
209 | @@ -1989,6 +2001,11 @@ | ||
210 | } | ||
211 | plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n"); | ||
212 | |||
213 | + while (!update_received) | ||
214 | + receive_from_isakmp(); | ||
215 | + | ||
216 | + update_received = 0; | ||
217 | + | ||
218 | /* Do ADD for responder */ | ||
219 | if (pk_sendadd(iph2) < 0) { | ||
220 | plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n"); | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch new file mode 100644 index 000000000..e272bc20f --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Subject: [PATCH] ipsec-tools: racoon: check several invalid ivm | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Add checking for invalid ivm, or it will crash racoon. | ||
6 | |||
7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
8 | --- | ||
9 | isakmp_cfg.c | 5 +++++ | ||
10 | 1 file changed, 5 insertions(+) | ||
11 | |||
12 | diff -urpN a/src/racoon/isakmp_cfg.c b/src/racoon/isakmp_cfg.c | ||
13 | --- a/src/racoon/isakmp_cfg.c | ||
14 | +++ b/src/racoon/isakmp_cfg.c | ||
15 | @@ -171,6 +171,11 @@ isakmp_cfg_r(iph1, msg) | ||
16 | iph1->mode_cfg->last_msgid != packet->msgid ) | ||
17 | iph1->mode_cfg->ivm = | ||
18 | isakmp_cfg_newiv(iph1, packet->msgid); | ||
19 | + if(iph1->mode_cfg->ivm == NULL) { | ||
20 | + plog(LLV_ERROR, LOCATION, NULL, | ||
21 | + "failed to create new IV\n"); | ||
22 | + return; | ||
23 | + } | ||
24 | ivm = iph1->mode_cfg->ivm; | ||
25 | |||
26 | dmsg = oakley_do_decrypt(iph1, msg, ivm->iv, ivm->ive); | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch new file mode 100644 index 000000000..de1bdb407 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | Subject: [PATCH] ipsec-tools: racoon: check several invalid pointers | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Add checking for invalid pointers, or it will crash racoon. | ||
6 | |||
7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
8 | --- | ||
9 | ipsec_doi.c | 5 +++-- | ||
10 | isakmp_cfg.c | 7 +++++++ | ||
11 | isakmp_quick.c | 6 ++++-- | ||
12 | 3 files changed, 14 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff -urpN a/src/racoon/ipsec_doi.c b/src/racoon/ipsec_doi.c | ||
15 | --- a/src/racoon/ipsec_doi.c | ||
16 | +++ b/src/racoon/ipsec_doi.c | ||
17 | @@ -3374,8 +3374,9 @@ ipsecdoi_chkcmpids( idt, ids, exact ) | ||
18 | |||
19 | /* handle wildcard IDs */ | ||
20 | |||
21 | - if (idt == NULL || ids == NULL) | ||
22 | - { | ||
23 | + if (idt == NULL || ids == NULL || | ||
24 | + idt->v == NULL || idt->l == 0 || | ||
25 | + ids->v == NULL || ids->l == 0) { | ||
26 | if( !exact ) | ||
27 | { | ||
28 | plog(LLV_DEBUG, LOCATION, NULL, | ||
29 | diff -urpN a/src/racoon/isakmp_cfg.c b/src/racoon/isakmp_cfg.c | ||
30 | --- a/src/racoon/isakmp_cfg.c | ||
31 | +++ b/src/racoon/isakmp_cfg.c | ||
32 | @@ -1138,6 +1138,13 @@ isakmp_cfg_newiv(iph1, msgid) | ||
33 | return NULL; | ||
34 | } | ||
35 | |||
36 | + if (iph1->ivm == NULL || iph1->ivm->iv == NULL || | ||
37 | + iph1->ivm->iv->v == NULL || iph1->ivm->iv->l == 0) { | ||
38 | + plog(LLV_ERROR, LOCATION, NULL, | ||
39 | + "isakmp_cfg_newiv called with invalid IV management\n"); | ||
40 | + return NULL; | ||
41 | + } | ||
42 | + | ||
43 | if (ics->ivm != NULL) | ||
44 | oakley_delivm(ics->ivm); | ||
45 | |||
46 | diff -urpN a/src/racoon/isakmp_quick.c b/src/racoon/isakmp_quick.c | ||
47 | --- a/src/racoon/isakmp_quick.c | ||
48 | +++ b/src/racoon/isakmp_quick.c | ||
49 | @@ -2243,8 +2243,10 @@ get_proposal_r(iph2) | ||
50 | int error = ISAKMP_INTERNAL_ERROR; | ||
51 | |||
52 | /* check the existence of ID payload */ | ||
53 | - if ((iph2->id_p != NULL && iph2->id == NULL) | ||
54 | - || (iph2->id_p == NULL && iph2->id != NULL)) { | ||
55 | + if ((iph2->id_p != NULL && | ||
56 | + (iph2->id == NULL || iph2->id->v == NULL || iph2->id->l == 0)) || | ||
57 | + (iph2->id != NULL && | ||
58 | + (iph2->id_p == NULL || iph2->id_p->v == NULL || iph2->id_p->l == 0))) { | ||
59 | plog(LLV_ERROR, LOCATION, NULL, | ||
60 | "Both IDs wasn't found in payload.\n"); | ||
61 | return ISAKMP_NTYPE_INVALID_ID_INFORMATION; | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch new file mode 100644 index 000000000..f77fa8638 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | Subject: [PATCH] ipsec-tools: racoonctl buildfix | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | building ipsec-tools failed building/linking racoonctl with some errors: | ||
6 | - missing "yylex" error | ||
7 | - some linking errors for variables defined in racoon but not racoonctl | ||
8 | - some symbols from nattraversal.c where not found as it wasn't linked | ||
9 | when building with NAT support. | ||
10 | |||
11 | Signed-off-by: Liviu Gheorghisan <liviu.gheorghisan@enea.com> | ||
12 | Signed-off-by: Daniel BORNAZ <daniel.bornaz@enea.com> | ||
13 | --- | ||
14 | diff -rupN a/src/racoon/Makefile.am b/src/racoon/Makefile.am | ||
15 | --- a/src/racoon/Makefile.am 2014-03-05 12:16:52.907101044 +0100 | ||
16 | +++ b/src/racoon/Makefile.am 2014-03-05 12:17:10.946320064 +0100 | ||
17 | @@ -44,7 +44,17 @@ racoon_DEPENDENCIES = \ | ||
18 | $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(SECCTX_OBJS) \ | ||
19 | vmbuf.o sockmisc.o misc.o | ||
20 | |||
21 | -racoonctl_SOURCES = racoonctl.c str2val.c | ||
22 | +racoonctl_SOURCES = \ | ||
23 | + session.c isakmp.c handler.c \ | ||
24 | + isakmp_ident.c isakmp_agg.c isakmp_base.c \ | ||
25 | + isakmp_quick.c isakmp_inf.c isakmp_newg.c \ | ||
26 | + gssapi.c dnssec.c getcertsbyname.c privsep.c \ | ||
27 | + pfkey.c admin.c evt.c ipsec_doi.c oakley.c grabmyaddr.c vendorid.c \ | ||
28 | + policy.c localconf.c remoteconf.c crypto_openssl.c algorithm.c \ | ||
29 | + proposal.c sainfo.c strnames.c nattraversal.c \ | ||
30 | + plog.c logger.c schedule.c str2val.c \ | ||
31 | + safefile.c backupsa.c genlist.c rsalist.c \ | ||
32 | + cftoken.l cfparse.y prsa_tok.l prsa_par.y racoonctl.c | ||
33 | racoonctl_LDADD = libracoon.la ../libipsec/libipsec.la | ||
34 | |||
35 | libracoon_la_SOURCES = kmpstat.c vmbuf.c sockmisc.c misc.c | ||
36 | |||
37 | diff -rupN a/src/racoon/racoonctl.c b/src/racoon/racoonctl.c | ||
38 | --- a/src/racoon/racoonctl.c 2014-03-05 12:16:52.915100698 +0100 | ||
39 | +++ b/src/racoon/racoonctl.c 2014-03-05 12:17:17.906018754 +0100 | ||
40 | @@ -247,6 +247,9 @@ usage() | ||
41 | #error "Incompatible racoonctl interface" | ||
42 | #endif | ||
43 | |||
44 | +int f_local = 0; /* local test mode. behave like a wall. */ | ||
45 | +int dump_config =0; | ||
46 | + | ||
47 | int | ||
48 | main(ac, av) | ||
49 | int ac; | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch new file mode 100644 index 000000000..da1169218 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | --- ipsec-tools-0.8.1.old/configure.ac 2014-03-04 16:24:57.431207664 +0100 | ||
2 | +++ ipsec-tools-0.8.1/configure.ac 2014-03-04 16:26:00.372461304 +0100 | ||
3 | @@ -171,9 +171,9 @@ if test $with_readline != "no"; then | ||
4 | fi | ||
5 | |||
6 | |||
7 | -AC_MSG_CHECKING(if --with-flex option is specified) | ||
8 | +AC_MSG_CHECKING(if --with-flexdir option is specified) | ||
9 | AC_ARG_WITH(flexdir, | ||
10 | - [AC_HELP_STRING([--with-flex], [use directiory (default: no)])], | ||
11 | + [AC_HELP_STRING([--with-flexdir], [use directory (default: no)])], | ||
12 | [flexdir="$withval"]) | ||
13 | AC_MSG_RESULT(${flexdir-dirdefault}) | ||
14 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb b/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb new file mode 100644 index 000000000..4653a9aba --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb | |||
@@ -0,0 +1,66 @@ | |||
1 | DESCRIPTION = "IPsec-Tools is a port of KAME's IPsec utilities to the \ | ||
2 | Linux-2.6 IPsec implementation." | ||
3 | HOMEPAGE = "http://ipsec-tools.sourceforge.net/" | ||
4 | SECTION = "console/network" | ||
5 | LICENSE = "BSD" | ||
6 | LIC_FILES_CHKSUM = "file://src/libipsec/pfkey.c;beginline=6;endline=31;md5=bc9b7ff40beff19fe6bc6aef26bd2b24" | ||
7 | |||
8 | DEPENDS = "virtual/kernel openssl readline flex-native bison-native" | ||
9 | |||
10 | SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV}.tar.bz2 \ | ||
11 | file://0002-Don-t-link-against-libfl.patch \ | ||
12 | file://configure.patch \ | ||
13 | file://racoonctl-build-fix.patch \ | ||
14 | file://with-flexdir.patch \ | ||
15 | file://0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch \ | ||
16 | file://racoon-check-invalid-pointers.patch \ | ||
17 | file://racoon-check-invalid-ivm.patch \ | ||
18 | file://glibc-2.20.patch \ | ||
19 | file://racoon-Resend-UPDATE-message-when-received-EINTR-message.patch \ | ||
20 | " | ||
21 | SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41" | ||
22 | SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d" | ||
23 | |||
24 | inherit autotools | ||
25 | |||
26 | # Options: | ||
27 | # --enable-adminport enable admin port | ||
28 | # --enable-rc5 enable RC5 encryption (patented) | ||
29 | # --enable-idea enable IDEA encryption (patented) | ||
30 | # --enable-gssapi enable GSS-API authentication | ||
31 | # --enable-hybrid enable hybrid, both mode-cfg and xauth support | ||
32 | # --enable-frag enable IKE fragmentation payload support | ||
33 | # --enable-stats enable statistics logging function | ||
34 | # --enable-dpd enable dead peer detection | ||
35 | # --enable-samode-unspec enable to use unspecified a mode of SA | ||
36 | # --disable-ipv6 disable ipv6 support | ||
37 | # --enable-natt enable NAT-Traversal (yes/no/kernel) | ||
38 | # --enable-natt-versions=list list of supported NAT-T versions delimited by coma. | ||
39 | # --with-kernel-headers=/lib/modules/<uname>/build/include | ||
40 | # where your Linux Kernel headers are installed | ||
41 | # --with-readline support readline input (yes by default) | ||
42 | # --with-flex use directiory (default: no) | ||
43 | # --with-flexlib=<LIB> specify flex library. | ||
44 | # --with-openssl=DIR specify OpenSSL directory | ||
45 | # --with-libradius=DIR specify libradius path (like/usr/pkg) | ||
46 | # --with-libpam=DIR specify libpam path (like/usr/pkg) | ||
47 | # | ||
48 | # Note: if you give it the actual kernel headers it won't build, it actually | ||
49 | # needs to point at the linux-libc-headers version of the kernel headers. | ||
50 | # | ||
51 | EXTRA_OECONF = "--with-kernel-headers=${STAGING_INCDIR} \ | ||
52 | --with-readline \ | ||
53 | --with-openssl=${STAGING_LIBDIR}/.. \ | ||
54 | --without-libradius \ | ||
55 | --disable-security-context \ | ||
56 | --enable-shared \ | ||
57 | --enable-dpd \ | ||
58 | --enable-natt=yes \ | ||
59 | ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6=yes', '', d)}" | ||
60 | |||
61 | # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530527 | ||
62 | CFLAGS += "-fno-strict-aliasing" | ||
63 | |||
64 | PACKAGECONFIG ??= "" | ||
65 | PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam," | ||
66 | PACKAGECONFIG[selinux] = "--enable-security-context,--disable-security-context,libselinux," | ||
diff --git a/meta-networking/recipes-support/libmemcached/files/crosscompile.patch b/meta-networking/recipes-support/libmemcached/files/crosscompile.patch new file mode 100644 index 000000000..63511bff5 --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/files/crosscompile.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | libmemcached/backtrace.cc | 3 ++- | ||
2 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
3 | |||
4 | --- libmemcached-1.0.15.orig/libmemcached/backtrace.cc | ||
5 | +++ libmemcached-1.0.15/libmemcached/backtrace.cc | ||
6 | @@ -75,10 +75,11 @@ void custom_backtrace(void) | ||
7 | { | ||
8 | for (int x= 0; x < stack_frames; x++) | ||
9 | { | ||
10 | bool was_demangled= false; | ||
11 | |||
12 | +#if USE_DEMANGLE == 1 | ||
13 | if (USE_DEMANGLE) | ||
14 | { | ||
15 | #ifdef HAVE_DLFCN_H | ||
16 | Dl_info dlinfo; | ||
17 | if (dladdr(backtrace_buffer[x], &dlinfo)) | ||
18 | @@ -107,11 +108,11 @@ void custom_backtrace(void) | ||
19 | dlinfo.dli_fname); | ||
20 | } | ||
21 | } | ||
22 | #endif | ||
23 | } | ||
24 | - | ||
25 | +#endif | ||
26 | if (was_demangled == false) | ||
27 | { | ||
28 | fprintf(stderr, "?%d %p in %s\n", x, backtrace_buffer[x], symbollist[x]); | ||
29 | } | ||
30 | } | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached.inc b/meta-networking/recipes-support/libmemcached/libmemcached.inc new file mode 100644 index 000000000..50ef4d606 --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached.inc | |||
@@ -0,0 +1,13 @@ | |||
1 | DESCRIPTION = "open source C/C++ client library and tools for the memcached server" | ||
2 | DEPENDS = "libevent util-linux" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=865490941c91ba790f0ea78dec93bd60" | ||
5 | |||
6 | SRC_URI = "http://launchpad.net/libmemcached/1.0/${PV}/+download/libmemcached-${PV}.tar.gz" | ||
7 | |||
8 | TARGET_LDFLAGS += "-luuid" | ||
9 | |||
10 | PACKAGECONFIG ??= "" | ||
11 | PACKAGECONFIG[sasl] = "--enable-sasl,--disable-sasl,cyrus-sasl" | ||
12 | |||
13 | inherit autotools gettext pkgconfig | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb new file mode 100644 index 000000000..18232b4ce --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require libmemcached.inc | ||
2 | |||
3 | SRC_URI += "file://crosscompile.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "616297a1aedefc52b3f6922eda5d559a" | ||
6 | SRC_URI[sha256sum] = "dd7e9560029835bddf761a5b4c2339d9e5c7374558659b6c11b2c95e7d3a4325" | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb new file mode 100644 index 000000000..cdf8415ff --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require libmemcached.inc | ||
2 | |||
3 | SRC_URI[md5sum] = "d59a462a92d296f76bff2d9bc72b2516" | ||
4 | SRC_URI[sha256sum] = "3efa86c9733eaad55d7119cb16769424e2aa6c22b3392e8f973946fce6678d81" | ||
diff --git a/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.16.bb b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.16.bb new file mode 100644 index 000000000..ded6d08a7 --- /dev/null +++ b/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.16.bb | |||
@@ -0,0 +1,49 @@ | |||
1 | SUMMARY = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project" | ||
2 | SECTION = "libs" | ||
3 | LICENSE = "LGPLv2" | ||
4 | |||
5 | LIC_FILES_CHKSUM = " \ | ||
6 | file://COPYING.lib;md5=0a1b79af951c42a9c8573533fbba9a92 \ | ||
7 | file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \ | ||
8 | " | ||
9 | |||
10 | SRC_URI = "${SOURCEFORGE_MIRROR}/lksctp/${BP}.tar.gz" | ||
11 | |||
12 | SRC_URI[md5sum] = "708bb0b5a6806ad6e8d13c55b067518e" | ||
13 | SRC_URI[sha256sum] = "0903dd526b7f30a89d5031aa2c82757612becc38ed7bc6e4f972f8deae351f26" | ||
14 | |||
15 | #| arm-oe-linux-gnueabi-libtool: link: arm-oe-linux-gnueabi-gcc -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -shared -fPIC -DPIC .libs/bindx.o .libs/connectx.o .libs/peeloff.o .libs/opt_info.o .libs/addrs.o .libs/sendmsg.o .libs/recvmsg.o -march=armv5te -marm -mthumb-interwork --sysroot=/home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/qemuarm -O2 -Wl,--version-script=/home/jenkins/oe/world/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/lksctp-tools/1.0.16-r0/lksctp-tools-1.0.16/src/lib/Versions.map -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-soname -Wl,libsctp.so.1 -o .libs/libsctp.so.1.0.16 | ||
16 | #| /home/jenkins/oe/world/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.9.0/ld: error: symbol sctp_connectx has undefined version | ||
17 | #| collect2: error: ld returned 1 exit status | ||
18 | #| make[4]: *** [libsctp.la] Error 1 | ||
19 | PNBLACKLIST[lksctp-tools] ?= "BROKEN: fails to link against sctp_connectx symbol" | ||
20 | |||
21 | S = "${WORKDIR}/${BP}" | ||
22 | |||
23 | BBCLASSEXTEND = "native" | ||
24 | |||
25 | inherit autotools pkgconfig binconfig | ||
26 | |||
27 | SOLIBVERSION="${PV}" | ||
28 | SOLIBMAJORVERSION="1" | ||
29 | |||
30 | PACKAGES =+ "${PN}-withsctp ${PN}-utils" | ||
31 | |||
32 | FILES_${PN} = " \ | ||
33 | ${libdir}/libsctp.so.${SOLIBVERSION} \ | ||
34 | " | ||
35 | |||
36 | FILES_${PN}-withsctp = " \ | ||
37 | ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBVERSION} \ | ||
38 | " | ||
39 | |||
40 | FILES_${PN}-dev += " \ | ||
41 | ${libdir}/libsctp.so.${SOLIBMAJORVERSION} \ | ||
42 | ${libdir}/libsctp.so \ | ||
43 | ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBMAJORVERSION} \ | ||
44 | ${libdir}/lksctp-tools/libwithsctp.so \ | ||
45 | ${datadir}/lksctp-tools/*.c \ | ||
46 | ${datadir}/lksctp-tools/*.h \ | ||
47 | " | ||
48 | |||
49 | FILES_${PN}-utils = "${bindir}/*" | ||
diff --git a/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch b/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch new file mode 100644 index 000000000..9ecd707b4 --- /dev/null +++ b/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | Disable building manpages so that make install doesn't fail due to lack of help2man | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
8 | index 46c4017..d6ed312 100644 | ||
9 | --- a/src/Makefile.am | ||
10 | +++ b/src/Makefile.am | ||
11 | @@ -9,11 +9,6 @@ izcoordinator_DESC = "simple coordinator for IEEE 802.15.4 network" | ||
12 | iz_DESC = "configure an IEEE 802.15.4 interface" | ||
13 | izchat_DESC = "simple chat program using IEEE 802.15.4" | ||
14 | |||
15 | -if MANPAGES | ||
16 | -dist_man_MANS = $(manpages) | ||
17 | -endif | ||
18 | -EXTRA_DIST = $(manpages) | ||
19 | - | ||
20 | izattach_SOURCES = serial.c | ||
21 | |||
22 | iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c | ||
23 | @@ -27,18 +22,6 @@ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB) | ||
24 | iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE | ||
25 | iz_LDADD = $(LDADD) $(NL_LIBS) | ||
26 | |||
27 | -izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac | ||
28 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(izattach_DESC) $(builddir)/izattach | ||
29 | - | ||
30 | -izcoordinator.8: $(izcoordinator_SOURCES) $(top_srcdir)/configure.ac | ||
31 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(izcoordinator_DESC) $(builddir)/izcoordinator | ||
32 | - | ||
33 | -iz.8: $(iz_SOURCES) $(top_srcdir)/configure.ac | ||
34 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(iz_DESC) $(builddir)/iz | ||
35 | - | ||
36 | -izchat.1: $(izchat_SOURCES) $(top_srcdir)/configure.ac | ||
37 | - -$(HELP2MAN) -o $@ -s 1 -N -n $(izchat_DESC) $(builddir)/izchat | ||
38 | - | ||
39 | install-data-hook: | ||
40 | $(mkinstalldirs) $(DESTDIR)`dirname $(leasefile)` | ||
41 | $(mkinstalldirs) $(DESTDIR)`dirname $(pidfile)` | ||
diff --git a/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb b/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb new file mode 100644 index 000000000..ca1026229 --- /dev/null +++ b/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "Utilities for managing the Linux LoWPAN stack" | ||
2 | DESCRIPTION = "This is a set of utils to manage the Linux LoWPAN stack. \ | ||
3 | The LoWPAN stack aims for IEEE 802.15.4-2003 (and for lesser extent IEEE 802.15.4-2006) compatibility." | ||
4 | |||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
7 | |||
8 | DEPENDS = "libnl python" | ||
9 | |||
10 | PV = "0.3.1+git${SRCPV}" | ||
11 | SRC_URI = "git://git.code.sf.net/p/linux-zigbee/linux-zigbee \ | ||
12 | file://no-help2man.patch" | ||
13 | SRCREV = "38f42dbfce9e13629263db3bd3b81f14c69bb733" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | inherit autotools python-dir pkgconfig | ||
18 | |||
19 | CACHED_CONFIGUREVARS += "am_cv_python_pythondir=${PYTHON_SITEPACKAGES_DIR}/lowpan-tools" | ||
20 | |||
21 | do_install_append() { | ||
22 | rmdir ${D}${localstatedir}/run | ||
23 | } | ||
24 | |||
25 | FILES_${PN}-dbg += "${libexecdir}/lowpan-tools/.debug/" | ||
26 | |||
27 | PACKAGES =+ "${PN}-python" | ||
28 | FILES_${PN}-python = "${libdir}/python*" | ||
diff --git a/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb b/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb new file mode 100644 index 000000000..b97e9d1fc --- /dev/null +++ b/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | SUMMARY = "Tool to view/change network interface MAC addresses" | ||
2 | DESCRIPTION = "A GNU/Linux utility for viewing/manipulating the MAC address of network interfaces." | ||
3 | HOMEPAGE = "http://www.alobbs.com/macchanger" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | |||
8 | SRC_URI = "${GNU_MIRROR}/macchanger/${BPN}-${PV}.tar.gz" | ||
9 | |||
10 | SRC_URI[md5sum] = "79b7cdaeca3d8ebafa764c4b0dd03ab7" | ||
11 | SRC_URI[sha256sum] = "d44bfa27cb29c5a718627cb3ef3aa42eb5130426545eb2031120826cd73fa8fe" | ||
12 | |||
13 | FILES_${PN} = " \ | ||
14 | ${bindir}/${BPN} \ | ||
15 | ${datadir}/${BPN}/wireless.list \ | ||
16 | ${datadir}/${BPN}/OUI.list \ | ||
17 | " | ||
18 | |||
19 | FILES_${PN}-doc = " \ | ||
20 | ${datadir}/info \ | ||
21 | ${datadir}/man \ | ||
22 | " | ||
23 | |||
24 | inherit autotools | ||
diff --git a/meta-networking/recipes-support/memcached/memcached/configure.patch b/meta-networking/recipes-support/memcached/memcached/configure.patch new file mode 100644 index 000000000..7001a0ed6 --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached/configure.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | Index: memcached-1.4.17/configure.ac | ||
2 | =================================================================== | ||
3 | --- memcached-1.4.17.orig/configure.ac 2013-12-20 21:44:49.000000000 +0000 | ||
4 | +++ memcached-1.4.17/configure.ac 2014-07-18 07:17:00.593499483 +0000 | ||
5 | @@ -4,7 +4,7 @@ | ||
6 | AC_INIT(memcached, VERSION_NUMBER, memcached@googlegroups.com) | ||
7 | AC_CANONICAL_SYSTEM | ||
8 | AC_CONFIG_SRCDIR(memcached.c) | ||
9 | -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) | ||
10 | +AM_INIT_AUTOMAKE([foreign]) | ||
11 | AM_CONFIG_HEADER(config.h) | ||
12 | |||
13 | AC_PROG_CC | ||
diff --git a/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch b/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch new file mode 100644 index 000000000..544b840fe --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | memcached: add knob to detect whether hugetlbfs are checked | ||
2 | |||
3 | Add knob to detect whether hugetlbfs are checked or not. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Chong Lu <Chong.Lu@windriver.com> | ||
8 | --- | ||
9 | configure.ac | 7 ++++++- | ||
10 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/configure.ac b/configure.ac | ||
13 | index 7f22f21..21691b9 100644 | ||
14 | --- a/configure.ac | ||
15 | +++ b/configure.ac | ||
16 | @@ -314,7 +314,12 @@ fi | ||
17 | dnl ---------------------------------------------------------------------------- | ||
18 | |||
19 | AC_SEARCH_LIBS(umem_cache_create, umem) | ||
20 | -AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs) | ||
21 | +AC_ARG_ENABLE(hugetlbfs, | ||
22 | + [AS_HELP_STRING([--enable-hugetlbfs],[Enable hugetlbfs])]) | ||
23 | + | ||
24 | +if test "x$enable_hugetlbfs" = "xyes"; then | ||
25 | + AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs) | ||
26 | +fi | ||
27 | |||
28 | AC_HEADER_STDBOOL | ||
29 | AH_BOTTOM([#if HAVE_STDBOOL_H | ||
30 | -- | ||
31 | 1.8.3.4 | ||
32 | |||
diff --git a/meta-networking/recipes-support/memcached/memcached_1.4.17.bb b/meta-networking/recipes-support/memcached/memcached_1.4.17.bb new file mode 100644 index 000000000..4d93f041e --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached_1.4.17.bb | |||
@@ -0,0 +1,53 @@ | |||
1 | SUMMARY = "A high-performance memory object caching system" | ||
2 | DESCRIPTION = "\ | ||
3 | memcached optimizes specific high-load serving applications that are designed \ | ||
4 | to take advantage of its versatile no-locking memory access system. Clients \ | ||
5 | are available in several different programming languages, to suit the needs \ | ||
6 | of the specific application. Traditionally this has been used in mod_perl \ | ||
7 | apps to avoid storing large chunks of data in Apache memory, and to share \ | ||
8 | this burden across several machines." | ||
9 | |||
10 | HOMEPAGE = "http://memcached.org/" | ||
11 | LICENSE = "BSD-3-Clause" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff" | ||
14 | |||
15 | inherit autotools | ||
16 | |||
17 | DEPENDS += "libevent" | ||
18 | RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \ | ||
19 | perl-module-tie-hash bash \ | ||
20 | " | ||
21 | |||
22 | SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ | ||
23 | file://configure.patch \ | ||
24 | file://memcached-add-hugetlbfs-check.patch" | ||
25 | |||
26 | # set the same COMPATIBLE_HOST as libhugetlbfs | ||
27 | COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64|arm).*-linux' | ||
28 | |||
29 | SRC_URI[md5sum] = "46402dfbd7faadf6182283dbbd18b1a6" | ||
30 | SRC_URI[sha256sum] = "d9173ef6d99ba798c982ea4566cb4f0e64eb23859fdbf9926a89999d8cdc0458" | ||
31 | |||
32 | python __anonymous () { | ||
33 | endianness = d.getVar('SITEINFO_ENDIANNESS', True) | ||
34 | if endianness == 'le': | ||
35 | d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little") | ||
36 | else: | ||
37 | d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big") | ||
38 | } | ||
39 | |||
40 | PACKAGECONFIG ??= "" | ||
41 | PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs" | ||
42 | |||
43 | inherit update-rc.d | ||
44 | |||
45 | INITSCRIPT_NAME = "memcached" | ||
46 | INITSCRIPT_PARAMS = "defaults" | ||
47 | |||
48 | do_install_append() { | ||
49 | install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached | ||
50 | mkdir -p ${D}/usr/share/memcached/scripts | ||
51 | install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts | ||
52 | install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts | ||
53 | } | ||
diff --git a/meta-networking/recipes-support/mtr/files/configure.patch b/meta-networking/recipes-support/mtr/files/configure.patch new file mode 100644 index 000000000..c978b879e --- /dev/null +++ b/meta-networking/recipes-support/mtr/files/configure.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | Index: mtr-0.82/configure.in | ||
2 | =================================================================== | ||
3 | --- mtr-0.82.orig/configure.in 2014-07-16 19:52:56.306026346 +0000 | ||
4 | +++ mtr-0.82/configure.in 2014-07-17 21:59:03.208587150 +0000 | ||
5 | @@ -1,5 +1,5 @@ | ||
6 | -AC_INIT(mtr.c) | ||
7 | -AM_INIT_AUTOMAKE(mtr, 0.82) | ||
8 | +AC_INIT(mtr.c, 0.82) | ||
9 | +AM_INIT_AUTOMAKE([foreign]) | ||
10 | |||
11 | |||
12 | AC_SUBST(GTK_OBJ) | ||
diff --git a/meta-networking/recipes-support/mtr/files/no-gtk.patch b/meta-networking/recipes-support/mtr/files/no-gtk.patch new file mode 100644 index 000000000..0dbeb7a29 --- /dev/null +++ b/meta-networking/recipes-support/mtr/files/no-gtk.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Disable gtk check that breaks with current autotools | ||
2 | |||
3 | Ideally we would have a proper fix for this and send that upstream instead. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
8 | |||
9 | diff --git a/configure.in b/configure.in | ||
10 | index 8474543..5118565 100644 | ||
11 | --- a/configure.in | ||
12 | +++ b/configure.in | ||
13 | @@ -48,16 +48,8 @@ AC_ARG_ENABLE(ipv6, | ||
14 | [ --disable-ipv6 Do not enable IPv6], | ||
15 | WANTS_IPV6=$enableval, WANTS_IPV6=yes) | ||
16 | |||
17 | -if test "x$WANTS_GTK" = "xyes"; then | ||
18 | - AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
19 | - LIBS="$LIBS $GTK_LIBS -lm", | ||
20 | - AC_MSG_WARN(Building without GTK2 display support) | ||
21 | - AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) | ||
22 | - GTK_OBJ="") | ||
23 | -else | ||
24 | - AC_DEFINE(NO_GTK) | ||
25 | - GTK_OBJ="" | ||
26 | -fi | ||
27 | +AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) | ||
28 | +GTK_OBJ="" | ||
29 | |||
30 | AC_CHECK_FUNC(socket, , | ||
31 | AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(No socket library found))) | ||
diff --git a/meta-networking/recipes-support/mtr/mtr_0.82.bb b/meta-networking/recipes-support/mtr/mtr_0.82.bb new file mode 100644 index 000000000..b9a1ea286 --- /dev/null +++ b/meta-networking/recipes-support/mtr/mtr_0.82.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Combined traceroute and ping utility" | ||
2 | DESCRIPTION = "mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool." | ||
3 | HOMEPAGE = "http://www.bitwizard.nl/mtr/" | ||
4 | DEPENDS = "ncurses" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
8 | file://mtr.c;beginline=5;endline=16;md5=56e390ced194aff352eefab404883057" | ||
9 | |||
10 | SRC_URI = "ftp://ftp.bitwizard.nl/mtr/mtr-${PV}.tar.gz \ | ||
11 | file://configure.patch \ | ||
12 | file://no-gtk.patch" | ||
13 | |||
14 | SRC_URI[md5sum] = "10601ea543fda3e51545c4bce195b64c" | ||
15 | SRC_URI[sha256sum] = "f3b457c9623ae03565688a7ffd49d4843a5e2505ccaf3ba8d9fbd86e3ce9b6a0" | ||
16 | |||
17 | inherit autotools | ||
18 | |||
19 | EXTRA_OECONF = "--without-gtk" | ||
20 | |||
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb b/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb new file mode 100644 index 000000000..a0e37e17a --- /dev/null +++ b/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb | |||
@@ -0,0 +1,59 @@ | |||
1 | SECTION = "console/network" | ||
2 | DESCRIPTION = "This package includes some useful diagnostics tools for \ | ||
3 | IPv6 networks, including ndisc6, rdisc6, tcptraceroute6 and traceroute6." | ||
4 | SECTION = "console/network" | ||
5 | HOMEPAGE = "http://www.remlab.net/ndisc6/" | ||
6 | LICENSE = "GPL-2.0" | ||
7 | |||
8 | # The tcptraceroute6 and tracert6 commands depend on rltraceroute6 to | ||
9 | # perform the actual trace operation. | ||
10 | RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6" | ||
11 | RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6" | ||
12 | RDEPENDS_${PN}-misc += "perl" | ||
13 | |||
14 | SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \ | ||
15 | " | ||
16 | SRC_URI[md5sum] = "50cb4c19606cf6ff2b7388e71832f579" | ||
17 | SRC_URI[sha256sum] = "6acec8a0cb9efa3ac98456f46c3016aeec0598b0c7557c95242b5228ad62ca7a" | ||
18 | |||
19 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
20 | |||
21 | inherit autotools gettext | ||
22 | |||
23 | ALLOW_EMPTY_${PN} = "1" | ||
24 | |||
25 | # Split into seperate packages since we normal don't want them all | ||
26 | # The main package is left empty and therefore not created. | ||
27 | PACKAGES += "${PN}-ndisc6 ${PN}-tcpspray6 ${PN}-rdisc6 \ | ||
28 | ${PN}-tcptraceroute6 ${PN}-rltraceroute6 \ | ||
29 | ${PN}-tracert6 ${PN}-rdnssd ${PN}-misc" | ||
30 | FILES_${PN} = "" | ||
31 | FILES_${PN}-ndisc6 = "${bindir}/ndisc6" | ||
32 | FILES_${PN}-tcpspray6 = "${bindir}/tcpspray6" | ||
33 | FILES_${PN}-rdisc6 = "${bindir}/rdisc6" | ||
34 | FILES_${PN}-tcptraceroute6 = "${bindir}/tcptraceroute6" | ||
35 | FILES_${PN}-rltraceroute6 = "${bindir}/rltraceroute6" | ||
36 | FILES_${PN}-tracert6 = "${bindir}/tracert6" | ||
37 | FILES_${PN}-rdnssd = "${sbindir}/rdnssd ${sysconfdir}/rdnssd" | ||
38 | FILES_${PN}-misc = "${bindir}/dnssort ${bindir}/name2addr ${bindir}/tcpspray ${bindir}/addr2name" | ||
39 | |||
40 | DESCRIPTION_${PN}-ndisc6 = "ICMPv6 Neighbor Discovery tool. \ | ||
41 | Performs IPv6 neighbor discovery in userland. Replaces arping from the \ | ||
42 | IPv4 world." | ||
43 | DESCRIPTION_${PN}-rdisc6 = "ICMPv6 Router Discovery tool. \ | ||
44 | Queries IPv6 routers on the network for advertised prefixes. Can be used \ | ||
45 | to detect rogue IPv6 routers, monitor legitimate IPv6 routers." | ||
46 | DESCRITPION_${PN}-tcpspray6 = "Performs bandwidth measurements of TCP \ | ||
47 | sessions between the local system and a remote echo server in either IPv6 \ | ||
48 | or IPv4." | ||
49 | |||
50 | DESCRITPION_${PN}-rdnssd = "Daemon to autoconfigure the list of DNS \ | ||
51 | servers through slateless IPv6 autoconfiguration." | ||
52 | |||
53 | do_install_append () { | ||
54 | rm -rf ${D}${localstatedir} | ||
55 | # Enable SUID bit for applications that need it | ||
56 | chmod 4555 ${D}${bindir}/rltraceroute6 | ||
57 | chmod 4555 ${D}${bindir}/ndisc6 | ||
58 | chmod 4555 ${D}${bindir}/rdisc6 | ||
59 | } | ||
diff --git a/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb b/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb new file mode 100644 index 000000000..4237dc4c5 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb | |||
@@ -0,0 +1,40 @@ | |||
1 | require netcat.inc | ||
2 | SUMMARY = "OpenBSD Netcat" | ||
3 | HOMEPAGE = "http://ftp.debian.org" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | |||
6 | DEPENDS += "glib-2.0 libbsd" | ||
7 | |||
8 | SRC_URI = "${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz;name=netcat \ | ||
9 | ${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz;name=netcat-patch" | ||
10 | |||
11 | SRC_URI[netcat.md5sum] = "7e67b22f1ad41a1b7effbb59ff28fca1" | ||
12 | SRC_URI[netcat.sha256sum] = "40653fe66c1516876b61b07e093d826e2a5463c5d994f1b7e6ce328f3edb211e" | ||
13 | SRC_URI[netcat-patch.md5sum] = "e914f8eb7eda5c75c679dd77787ac76b" | ||
14 | SRC_URI[netcat-patch.sha256sum] = "eee759327ffea293e81d0dde67921b7fcfcad279ffd7a2c9d037bbc8f882b363" | ||
15 | |||
16 | S = "${WORKDIR}/${BPN}-${PV}" | ||
17 | |||
18 | do_configure[noexec] = "1" | ||
19 | |||
20 | netcat_do_patch() { | ||
21 | cd ${S} | ||
22 | while read line; do patch -p1 < ${WORKDIR}/debian/patches/$line; done < ${WORKDIR}/debian/patches/series | ||
23 | } | ||
24 | |||
25 | python do_patch() { | ||
26 | bb.build.exec_func('netcat_do_patch', d) | ||
27 | bb.build.exec_func('patch_do_patch', d) | ||
28 | } | ||
29 | |||
30 | do_compile() { | ||
31 | cd ${S} | ||
32 | pkgrel=4 | ||
33 | oe_runmake CFLAGS="$CFLAGS -DDEBIAN_VERSION=\"\\\"${pkgrel}\\\"\"" | ||
34 | } | ||
35 | |||
36 | do_install() { | ||
37 | install -d ${D}${bindir} | ||
38 | install -m 755 ${S}/nc ${D}${bindir}/nc.${BPN} | ||
39 | } | ||
40 | ALTERNATIVE_PRIORITY = "50" | ||
diff --git a/meta-networking/recipes-support/netcat/netcat.inc b/meta-networking/recipes-support/netcat/netcat.inc new file mode 100644 index 000000000..6c815d97e --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat.inc | |||
@@ -0,0 +1,5 @@ | |||
1 | SECTION = "console/network" | ||
2 | inherit update-alternatives gettext | ||
3 | |||
4 | ALTERNATIVE_${PN} = "nc" | ||
5 | |||
diff --git a/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch b/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch new file mode 100644 index 000000000..dd1938a99 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | Make netcat_flag_count() return positive value | ||
2 | |||
3 | C language has 3 distinct char types: | ||
4 | char | ||
5 | unsigned char | ||
6 | signed char | ||
7 | A char has the same range of values as signed char on X86, | ||
8 | but same as unsigned char on PPC which made netcat_flag_count | ||
9 | return a negative value, now we force variable c as signed char | ||
10 | to make netcat_flag_count return positive value. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
15 | --- | ||
16 | src/flagset.c | 2 +- | ||
17 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
18 | |||
19 | diff --git a/src/flagset.c b/src/flagset.c | ||
20 | index 442b634..54ac898 100644 | ||
21 | --- a/src/flagset.c | ||
22 | +++ b/src/flagset.c | ||
23 | @@ -134,7 +134,7 @@ unsigned short netcat_flag_next(unsigned short port) | ||
24 | |||
25 | int netcat_flag_count(void) | ||
26 | { | ||
27 | - register char c; | ||
28 | + register signed char c; | ||
29 | register int i; | ||
30 | int ret = 0; | ||
31 | |||
32 | -- | ||
33 | 1.7.5.4 | ||
34 | |||
diff --git a/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch b/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch new file mode 100644 index 000000000..5cbcb08e8 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Apparently somewhere along the line HAVE_LOCALE_H was changed to | ||
2 | HAVE_LC_MESSAGES. Adjust netcat to match. | ||
3 | |||
4 | Upstream-Status: Pending | ||
5 | |||
6 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
7 | |||
8 | Index: netcat-0.7.1/src/intl.h | ||
9 | =================================================================== | ||
10 | --- netcat-0.7.1.orig/src/intl.h | ||
11 | +++ netcat-0.7.1/src/intl.h | ||
12 | @@ -25,11 +25,11 @@ | ||
13 | #ifdef ENABLE_NLS | ||
14 | #include <libintl.h> | ||
15 | |||
16 | -#ifdef HAVE_LOCALE_H | ||
17 | +#if defined(HAVE_LC_MESSAGES) || defined(HAVE_LOCALE_H) | ||
18 | #include <locale.h> | ||
19 | #else | ||
20 | #error You must have locale.h in your system | ||
21 | -#endif /* HAVE_LOCALE_H */ | ||
22 | +#endif /* HAVE_LC_MESSAGES || HAVE_LOCALE_H */ | ||
23 | |||
24 | /* Our dear (and very common) gettext macros */ | ||
25 | #define _(String) gettext(String) | ||
diff --git a/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch b/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch new file mode 100644 index 000000000..9b0ed58d6 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Replace obsoleted AM_CONFIG_HEADER flagged by autoconf 2.69 | ||
2 | locale.h check was picked from old gettext macros but with new aclocal | ||
3 | it picks the right 0.18 gettext.m4 and does not get the check | ||
4 | therefore we explicitly add it to configure.ac | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | Index: netcat-0.7.1/configure.ac | ||
11 | =================================================================== | ||
12 | --- netcat-0.7.1.orig/configure.ac 2013-01-18 01:30:01.928069739 -0800 | ||
13 | +++ netcat-0.7.1/configure.ac 2013-01-18 01:32:50.568073009 -0800 | ||
14 | @@ -26,8 +26,7 @@ | ||
15 | AC_PREREQ(2.53) | ||
16 | |||
17 | dnl without this order in this file, automake will be confused! | ||
18 | -AM_CONFIG_HEADER(config.h) | ||
19 | - | ||
20 | +AC_CONFIG_HEADERS(config.h) | ||
21 | dnl check for programs. first the c compiler. | ||
22 | AC_PROG_CC | ||
23 | AC_PROG_CPP | ||
24 | @@ -56,7 +55,7 @@ | ||
25 | AC_LBL_LIBRARY_NET | ||
26 | |||
27 | dnl Fortunately we have Solaris... | ||
28 | -AC_CHECK_HEADERS(sys/sockio.h) | ||
29 | +AC_CHECK_HEADERS(sys/sockio.h locale.h) | ||
30 | |||
31 | AC_CHECK_FUNCS(srandom random) | ||
32 | if test $ac_cv_func_srandom = no; then | ||
diff --git a/meta-networking/recipes-support/netcat/netcat_0.7.1.bb b/meta-networking/recipes-support/netcat/netcat_0.7.1.bb new file mode 100644 index 000000000..8710c3646 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat_0.7.1.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | require netcat.inc | ||
2 | SUMMARY = "GNU Netcat" | ||
3 | HOMEPAGE = "http://netcat.sourceforge.net" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | PR = "r3" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/netcat/netcat-${PV}.tar.bz2 \ | ||
10 | file://obsolete_autoconf_macros.patch \ | ||
11 | file://netcat-locale_h.patch \ | ||
12 | file://make-netcat_flag_count_work.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI[md5sum] = "0a29eff1736ddb5effd0b1ec1f6fe0ef" | ||
16 | SRC_URI[sha256sum] = "b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb" | ||
17 | |||
18 | inherit autotools | ||
19 | |||
20 | do_install_append() { | ||
21 | install -d ${D}${bindir} | ||
22 | mv ${D}${bindir}/nc ${D}${bindir}/nc.${BPN} | ||
23 | } | ||
24 | ALTERNATIVE_PRIORITY = "100" | ||
diff --git a/meta-networking/recipes-support/netcf/gnulib_git.bb b/meta-networking/recipes-support/netcf/gnulib_git.bb new file mode 100644 index 000000000..1da6c83ed --- /dev/null +++ b/meta-networking/recipes-support/netcf/gnulib_git.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "The GNU portability library" | ||
2 | DESCRIPTION = "A collection of software subroutines which are designed to \ | ||
3 | be usable on many operating systems. The goal of the project \ | ||
4 | is to make it easy for free software authors to make their \ | ||
5 | software run on many operating systems. Since source is designed \ | ||
6 | to be copied from gnulib, it is not a library per-se, as much \ | ||
7 | as a collection of portable idioms to be used in other projects." | ||
8 | |||
9 | HOMEPAGE = "http://www.gnu.org/software/gnulib/" | ||
10 | SECTION = "libs" | ||
11 | LICENSE = "LGPLv2+" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=e4cf3810f33a067ea7ccd2cd889fed21" | ||
14 | SRCREV = "24379a9217fa4bd62685795aaaa010fd90ced9e3" | ||
15 | SRC_URI = "git://git.sv.gnu.org/gnulib;protocol=git \ | ||
16 | " | ||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | do_install () { | ||
20 | cd ${S} | ||
21 | git checkout master | ||
22 | git clone ${S} ${D}/${datadir}/gnulib | ||
23 | } | ||
24 | |||
25 | do_patch[noexec] = "1" | ||
26 | do_configure[noexec] = "1" | ||
27 | do_compile[noexec] = "1" | ||
28 | do_package[noexec] = "1" | ||
29 | do_packagedata[noexec] = "1" | ||
30 | do_package_write_ipk[noexec] = "1" | ||
31 | do_package_write_deb[noexec] = "1" | ||
32 | do_package_write_rpm[noexec] = "1" | ||
diff --git a/meta-networking/recipes-support/netcf/netcf_git.bb b/meta-networking/recipes-support/netcf/netcf_git.bb new file mode 100644 index 000000000..979e45b60 --- /dev/null +++ b/meta-networking/recipes-support/netcf/netcf_git.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "netcf" | ||
2 | DESCRIPTION = "netcf is a cross-platform network configuration library." | ||
3 | HOMEPAGE = "https://fedorahosted.org/netcf/" | ||
4 | SECTION = "console/tools" | ||
5 | LICENSE = "LGPLv2.1" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff" | ||
8 | |||
9 | SRCREV = "b8a19dc860b38c97c42115d8a559b78853452a4b" | ||
10 | PV = "0.2.3+git${SRCPV}" | ||
11 | |||
12 | SRC_URI = "git://git.fedorahosted.org/netcf.git;protocol=git \ | ||
13 | " | ||
14 | |||
15 | DEPENDS += "augeas libnl libxslt libxml2 gnulib" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | inherit gettext autotools-brokensep pkgconfig | ||
20 | |||
21 | EXTRA_OECONF_append_class-target = " --with-driver=redhat" | ||
22 | do_configure_prepend() { | ||
23 | cd ${S} | ||
24 | rm -f .gitmodules | ||
25 | ./bootstrap --gnulib-srcdir=${STAGING_DATADIR}/gnulib | ||
26 | } | ||
27 | |||
28 | do_install_append() { | ||
29 | mv ${D}${sysconfdir}/rc.d/init.d/ ${D}${sysconfdir} | ||
30 | rm -rf ${D}${sysconfdir}/rc.d/ | ||
31 | } | ||
diff --git a/meta-networking/recipes-support/netperf/files/cpu_set.patch b/meta-networking/recipes-support/netperf/files/cpu_set.patch new file mode 100644 index 000000000..434b79049 --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/cpu_set.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Subject: [PATCH] netperf: fix CPU_SETSIZE to build with eglibc | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
6 | --- | ||
7 | src/netlib.c | 7 ++++++- | ||
8 | 1 files changed, 6 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/src/netlib.c b/src/netlib.c | ||
11 | index 206e002..e33aae6 100644 | ||
12 | --- a/src/netlib.c | ||
13 | +++ b/src/netlib.c | ||
14 | @@ -2265,7 +2265,12 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map) | ||
15 | fall-back on what we had before, which is to use just the size of | ||
16 | an unsigned long. raj 2006-09-14 */ | ||
17 | |||
18 | -#if defined(__CPU_SETSIZE) | ||
19 | +#if defined(CPU_SETSIZE) | ||
20 | +#define NETPERF_CPU_SETSIZE CPU_SETSIZE | ||
21 | +#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp) | ||
22 | +#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp) | ||
23 | + typedef cpu_set_t netperf_cpu_set_t; | ||
24 | +#elif defined(__CPU_SETSIZE) | ||
25 | #define NETPERF_CPU_SETSIZE __CPU_SETSIZE | ||
26 | #if defined(__CPU_SET_S) | ||
27 | #define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp) | ||
28 | -- | ||
29 | 1.7.1.1 | ||
30 | |||
diff --git a/meta-networking/recipes-support/netperf/files/init b/meta-networking/recipes-support/netperf/files/init new file mode 100644 index 000000000..8ba2a6373 --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/init | |||
@@ -0,0 +1,62 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # | ||
4 | # Written by Miquel van Smoorenburg <miquels@cistron.nl>. | ||
5 | # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>. | ||
6 | # Modified for Debian by Christoph Lameter <clameter@debian.org> | ||
7 | # Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
8 | |||
9 | ### BEGIN INIT INFO | ||
10 | # Provides: netperf | ||
11 | # Required-Start: $remote_fs $local_fs $time | ||
12 | # Required-Stop: $remote_fs $local_fs $time | ||
13 | # Should-Start: $network $named | ||
14 | # Should-Stop: $network $named | ||
15 | # Default-Start: 2 3 4 5 | ||
16 | # Default-Stop: 0 1 6 | ||
17 | # Short-Description: network benchmark | ||
18 | ### END INIT INFO | ||
19 | |||
20 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
21 | DAEMON=/usr/sbin/netserver | ||
22 | |||
23 | test -f $DAEMON || exit 0 | ||
24 | |||
25 | case "$1" in | ||
26 | start) | ||
27 | echo -n "Starting network benchmark server: netserver" | ||
28 | start-stop-daemon -S -x $DAEMON > /dev/null 2>&1 | ||
29 | echo "." | ||
30 | ;; | ||
31 | stop) | ||
32 | echo -n "Stopping network benchmark server: netserver" | ||
33 | start-stop-daemon -K -x $DAEMON | ||
34 | echo "." | ||
35 | ;; | ||
36 | #reload) | ||
37 | # | ||
38 | # If the daemon can reload its config files on the fly | ||
39 | # for example by sending it SIGHUP, do it here. | ||
40 | # | ||
41 | # If the daemon responds to changes in its config file | ||
42 | # directly anyway, make this a do-nothing entry. | ||
43 | # | ||
44 | # start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON | ||
45 | # ;; | ||
46 | restart|force-reload) | ||
47 | # | ||
48 | # If the "reload" option is implemented, move the "force-reload" | ||
49 | # option to the "reload" entry above. If not, "force-reload" is | ||
50 | # just the same as "restart". | ||
51 | # | ||
52 | start-stop-daemon -K -x $DAEMON | ||
53 | sleep 1 | ||
54 | start-stop-daemon -S -x $DAEMON | ||
55 | ;; | ||
56 | *) | ||
57 | echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}" | ||
58 | exit 1 | ||
59 | ;; | ||
60 | esac | ||
61 | |||
62 | exit 0 | ||
diff --git a/meta-networking/recipes-support/netperf/files/vfork.patch b/meta-networking/recipes-support/netperf/files/vfork.patch new file mode 100644 index 000000000..eff98bfde --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/vfork.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Subject: [PATCH] netperf: fix vfork/fork | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
6 | --- | ||
7 | src/netserver.c | 12 ++++++++++-- | ||
8 | 1 files changed, 10 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/src/netserver.c b/src/netserver.c | ||
11 | index 379a106..f6a8b09 100644 | ||
12 | --- a/src/netserver.c | ||
13 | +++ b/src/netserver.c | ||
14 | @@ -1020,7 +1020,7 @@ process_requests() | ||
15 | void | ||
16 | spawn_child() { | ||
17 | |||
18 | -#if defined(HAVE_FORK) | ||
19 | +#if defined(HAVE_FORK) || defined(HAVE_VFORK) | ||
20 | |||
21 | if (debug) { | ||
22 | fprintf(where, | ||
23 | @@ -1038,7 +1038,11 @@ spawn_child() { | ||
24 | |||
25 | signal(SIGCLD,SIG_IGN); | ||
26 | |||
27 | +#if defined(HAVE_FORK) | ||
28 | switch (fork()) { | ||
29 | +#else | ||
30 | + switch (vfork()) { | ||
31 | +#endif | ||
32 | case -1: | ||
33 | fprintf(where, | ||
34 | "%s: fork() error %s (errno %d)\n", | ||
35 | @@ -1405,7 +1409,7 @@ scan_netserver_args(int argc, char *argv[]) { | ||
36 | |||
37 | void | ||
38 | daemonize() { | ||
39 | -#if defined(HAVE_FORK) | ||
40 | +#if defined(HAVE_FORK) || defined(HAVE_VFORK) | ||
41 | |||
42 | if (debug) { | ||
43 | fprintf(where, | ||
44 | @@ -1419,7 +1423,11 @@ daemonize() { | ||
45 | fflush(stdout); | ||
46 | fflush(stderr); | ||
47 | |||
48 | +#if defined(HAVE_FORK) | ||
49 | switch (fork()) { | ||
50 | +#else | ||
51 | + switch (vfork()) { | ||
52 | +#endif | ||
53 | case -1: | ||
54 | fprintf(stderr, | ||
55 | "%s: fork() error %s (errno %d)\n", | ||
56 | -- | ||
57 | 1.7.1.1 | ||
58 | |||
diff --git a/meta-networking/recipes-support/netperf/netperf_2.6.0.bb b/meta-networking/recipes-support/netperf/netperf_2.6.0.bb new file mode 100644 index 000000000..146210c93 --- /dev/null +++ b/meta-networking/recipes-support/netperf/netperf_2.6.0.bb | |||
@@ -0,0 +1,66 @@ | |||
1 | SUMMARY = "A networking benchmarking tool" | ||
2 | DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more." | ||
3 | SECTION = "console/network" | ||
4 | HOMEPAGE = "http://www.netperf.org/" | ||
5 | LICENSE = "netperf" | ||
6 | LICENSE_FLAGS = "non-commercial" | ||
7 | |||
8 | |||
9 | SRC_URI="ftp://ftp.netperf.org/netperf/archive/netperf-${PV}.tar.bz2 \ | ||
10 | file://cpu_set.patch \ | ||
11 | file://vfork.patch \ | ||
12 | file://init" | ||
13 | SRC_URI[md5sum] = "9654ffdfd4c4f2c93ce3733cd9ed9236" | ||
14 | SRC_URI[sha256sum] = "cd8dac710d4273d29f70e8dbd09353a6362ac58a11926e0822233c0cb230323a" | ||
15 | |||
16 | LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6" | ||
17 | |||
18 | inherit update-rc.d autotools | ||
19 | |||
20 | S = "${WORKDIR}/netperf-${PV}" | ||
21 | |||
22 | # cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros | ||
23 | CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE" | ||
24 | |||
25 | # set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files | ||
26 | # larger than 2GB | ||
27 | CFLAGS_append = "${@base_contains('DISTRO_FEATURES', 'largefile', \ | ||
28 | ' -D_FILE_OFFSET_BITS=64', '', d)}" | ||
29 | |||
30 | PACKAGECONFIG ??= "" | ||
31 | PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools," | ||
32 | |||
33 | # autotools.bbclass attends to include m4 files with path depth <= 2 by | ||
34 | # "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4. | ||
35 | do_configure_prepend() { | ||
36 | test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files | ||
37 | } | ||
38 | |||
39 | do_install() { | ||
40 | sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init | ||
41 | |||
42 | install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d | ||
43 | install -m 4755 src/netperf ${D}${bindir} | ||
44 | install -m 4755 src/netserver ${D}${sbindir} | ||
45 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf | ||
46 | |||
47 | # man | ||
48 | install -d ${D}${mandir}/man1/ | ||
49 | install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1 | ||
50 | install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1 | ||
51 | |||
52 | # move scripts to examples directory | ||
53 | install -d ${D}${docdir}/netperf/examples | ||
54 | install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/ | ||
55 | |||
56 | # docs .. | ||
57 | install -m 0644 ${S}/COPYING ${D}${docdir}/netperf | ||
58 | install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf | ||
59 | install -m 0644 ${S}/README ${D}${docdir}/netperf | ||
60 | install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf | ||
61 | } | ||
62 | |||
63 | RRECOMMENDS_${PN} += "${@base_contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}" | ||
64 | |||
65 | INITSCRIPT_NAME="netperf" | ||
66 | INITSCRIPT_PARAMS="defaults" | ||
diff --git a/meta-networking/recipes-support/nis/files/libdl.patch b/meta-networking/recipes-support/nis/files/libdl.patch new file mode 100644 index 000000000..605af319f --- /dev/null +++ b/meta-networking/recipes-support/nis/files/libdl.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- pwdutils-2.6/configure.in.orig 2005-04-19 20:22:36.603052192 -0700 | ||
2 | +++ pwdutils-2.6/configure.in 2005-04-19 21:09:45.308023672 -0700 | ||
3 | @@ -178,6 +178,9 @@ | ||
4 | AC_CHECK_LIB(ldap, main, LDAP_LIBS="-lldap $LDAP_LIBS" found_ldap_lib=yes,,$LDAP_LIBS) | ||
5 | fi | ||
6 | |||
7 | + dnl this always needs dl | ||
8 | + AC_CHECK_LIB(dl, dlopen, LDAP_LIBS="$LDAP_LIBS -ldl") | ||
9 | + | ||
10 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then | ||
11 | AC_CHECK_LIB(ldap50, main, LDAP_LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4" found_ldap_lib=yes need_pthread=true,, -lpthread) | ||
12 | fi | ||
diff --git a/meta-networking/recipes-support/nis/files/no-selinux.patch b/meta-networking/recipes-support/nis/files/no-selinux.patch new file mode 100644 index 000000000..71da3e393 --- /dev/null +++ b/meta-networking/recipes-support/nis/files/no-selinux.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | --- pwdutils-2.6/lib/copy_xattr.c.orig 2005-04-16 17:15:52.916660880 -0700 | ||
2 | +++ pwdutils-2.6/lib/copy_xattr.c 2005-04-16 17:18:10.345768480 -0700 | ||
3 | @@ -127,8 +127,11 @@ | ||
4 | |||
5 | if (lsetxattr (to, name, value, size, 0) != 0) | ||
6 | { | ||
7 | - if (strcmp (name, "security.selinux") == 0 && | ||
8 | - is_selinux_enabled() == 0) | ||
9 | + if (strcmp (name, "security.selinux") == 0 | ||
10 | +#if defined(WITH_SELINUX) | ||
11 | + && is_selinux_enabled() == 0 | ||
12 | +#endif | ||
13 | + ) | ||
14 | fprintf (stderr, | ||
15 | _("SELinux not enabled, ignore attribute %s for `%s'.\n"), | ||
16 | name, to); | ||
diff --git a/meta-networking/recipes-support/nis/files/ypbind-yocto.init b/meta-networking/recipes-support/nis/files/ypbind-yocto.init new file mode 100644 index 000000000..5f50a530e --- /dev/null +++ b/meta-networking/recipes-support/nis/files/ypbind-yocto.init | |||
@@ -0,0 +1,99 @@ | |||
1 | #! /bin/sh | ||
2 | # Copyright (c) 2004 Author: Thorsten Kukuk <kukuk@suse.de> | ||
3 | # | ||
4 | # /etc/init.d/ypbind | ||
5 | # | ||
6 | # and symbolic its link | ||
7 | # | ||
8 | # /usr/sbin/rcypbind | ||
9 | # | ||
10 | # System startup script for the ypbind daemon | ||
11 | # | ||
12 | ### BEGIN INIT INFO | ||
13 | # Provides: ypbind | ||
14 | # Required-Start: $remote_fs $portmap | ||
15 | # Should-Start: ypserv slpd | ||
16 | # Required-Stop: portmap | ||
17 | # Default-Start: 3 5 | ||
18 | # Default-Stop: 0 1 2 6 | ||
19 | # Short-Description: Start ypbind (necessary for a NIS client) | ||
20 | # Description: ypbind finds the server for NIS domains and maintains | ||
21 | # the NIS binding information. | ||
22 | ### END INIT INFO | ||
23 | |||
24 | YPBIND_BIN=/usr/sbin/ypbind | ||
25 | pidfile=/var/run/ypbind.pid | ||
26 | |||
27 | [ -f /etc/default/ypbind ] && . /etc/default/ypbind | ||
28 | |||
29 | case "$1" in | ||
30 | start) | ||
31 | echo -n "Starting ypbind" | ||
32 | ## If the domainname is not set, skip starting of ypbind | ||
33 | ## and return with "program not configured" | ||
34 | /bin/ypdomainname &> /dev/null | ||
35 | if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then | ||
36 | if [ -f /etc/defaultdomain ]; then | ||
37 | XDOMAINNAME=`cat /etc/defaultdomain` | ||
38 | /bin/ypdomainname "$XDOMAINNAME" | ||
39 | fi | ||
40 | /bin/ypdomainname &> /dev/null | ||
41 | if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then | ||
42 | # Tell the user this has skipped | ||
43 | echo -n " . . . . . . . . . . No domainname set" | ||
44 | # service is not configured | ||
45 | exit 1 | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | ## If we don't have a /etc/yp.conf file, skip starting of | ||
50 | ## ypbind and return with "program not configured" | ||
51 | ## if you add the -broadcast Option later, comment this out. | ||
52 | if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then | ||
53 | # Tell the user this has skipped | ||
54 | echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}" | ||
55 | # service is not configured | ||
56 | exit 1 | ||
57 | fi | ||
58 | |||
59 | # evaluate the OPTIONS for ypbind-mt | ||
60 | OPTIONS="" | ||
61 | test "$YPBIND_LOCAL_ONLY" = "yes" && OPTIONS="-local-only $OPTIONS" | ||
62 | test "$YPBIND_BROADCAST" = "yes" && OPTIONS="-broadcast $OPTIONS" | ||
63 | test "$YPBIND_BROKEN_SERVER" = "yes" && OPTIONS="-broken-server $OPTIONS" | ||
64 | |||
65 | start-stop-daemon --start --quiet --pidfile $pidfile --exec $YPBIND_BIN -- $YPBIND_OPTIONS $OPTIONS | ||
66 | if [ $? -eq 0 ]; then | ||
67 | notfound=1 | ||
68 | for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do | ||
69 | ypwhich &>/dev/null && { notfound=0 ; break; }; | ||
70 | echo -n " ." | ||
71 | sleep 1; | ||
72 | done | ||
73 | if [ $notfound -eq 1 ]; then | ||
74 | echo -n " ${warn}No NIS server found${norm}"; | ||
75 | fi | ||
76 | else | ||
77 | exit 1 | ||
78 | fi | ||
79 | ;; | ||
80 | stop) | ||
81 | echo -n "Shutting down ypbind" | ||
82 | start-stop-daemon --stop --quiet --pidfile $pidfile | ||
83 | # Remove static data, else glibc will continue to use NIS | ||
84 | rm -f /var/yp/binding/* /var/run/ypbind.pid | ||
85 | ;; | ||
86 | restart) | ||
87 | $0 stop | ||
88 | sleep 1 | ||
89 | $0 start | ||
90 | ;; | ||
91 | reload | force-reload) | ||
92 | echo -n "Reload service ypbind" | ||
93 | start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile | ||
94 | ;; | ||
95 | *) | ||
96 | echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" | ||
97 | exit 1 | ||
98 | ;; | ||
99 | esac | ||
diff --git a/meta-networking/recipes-support/nis/nis.inc b/meta-networking/recipes-support/nis/nis.inc new file mode 100644 index 000000000..075d2756d --- /dev/null +++ b/meta-networking/recipes-support/nis/nis.inc | |||
@@ -0,0 +1,31 @@ | |||
1 | # This include file contains global definitions for the | ||
2 | # various NIS packages. | ||
3 | # | ||
4 | # These packages will only function correctly with glibc - | ||
5 | # the rpcsvc functionality is not present in uclibc | ||
6 | DESCRIPTION = "NIS Server and Tools" | ||
7 | HOMEPAGE = "http://www.linux-nis.org/nis/" | ||
8 | SECTION = "console/network" | ||
9 | LICENSE = "GPL-2.0" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
11 | |||
12 | inherit autotools gettext pkgconfig | ||
13 | |||
14 | # install is broken because src/Makefile heroically adds '-s' | ||
15 | # to the install flags - passing -s to the build /usr/bin/install! | ||
16 | # install-strip gets it right but installs ypbind -m <default>, | ||
17 | # not -m 555. In an OE build this is not, so far as I can see, | ||
18 | # a security problem (and this fix to the build problem is *much* | ||
19 | # easier and more maintainable.) | ||
20 | do_install() { | ||
21 | oe_runmake 'DESTDIR=${D}' install-strip | ||
22 | } | ||
23 | |||
24 | # An attempt to build on uclibc will fail, causing annoyance, | ||
25 | # so force the package to be skipped here (this will cause a | ||
26 | # 'nothing provides' error) | ||
27 | python () { | ||
28 | os = bb.data.getVar("TARGET_OS", d, 1) | ||
29 | if os == "linux-uclibc": | ||
30 | raise bb.parse.SkipPackage("NIS functionality requires rpcsvc/yp.h, uClibC does not provide this") | ||
31 | } | ||
diff --git a/meta-networking/recipes-support/nis/yp-tools/domainname.service b/meta-networking/recipes-support/nis/yp-tools/domainname.service new file mode 100644 index 000000000..21aa92cb3 --- /dev/null +++ b/meta-networking/recipes-support/nis/yp-tools/domainname.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=NIS Domainname | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | EnvironmentFile=/etc/nisdomainname | ||
7 | ExecStart=/usr/bin/domainname $NISDOMAINNAME | ||
8 | RemainAfterExit=true | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
12 | |||
diff --git a/meta-networking/recipes-support/nis/yp-tools_2.12.bb b/meta-networking/recipes-support/nis/yp-tools_2.12.bb new file mode 100644 index 000000000..001784550 --- /dev/null +++ b/meta-networking/recipes-support/nis/yp-tools_2.12.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | # This package builds tools to manage NIS | ||
2 | # The source package is utils/net/NIS/yp-tools | ||
3 | # | ||
4 | PR = "r3" | ||
5 | DESCRIPTION="\ | ||
6 | Network Information Service tools. \ | ||
7 | This package contains ypcat, ypmatch, ypset, \ | ||
8 | ypwhich, yppasswd, domainname, nisdomainname \ | ||
9 | and ypdomainname." | ||
10 | |||
11 | require nis.inc | ||
12 | SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \ | ||
13 | file://domainname.service \ | ||
14 | " | ||
15 | |||
16 | SRC_URI[md5sum] = "ce1e06d86caa285fa8cd76fdf103f51e" | ||
17 | SRC_URI[sha256sum] = "6ae8321666eea7837da343eea90ea30273fb74943ad111d5a4befd2afb252063" | ||
18 | |||
19 | CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true" | ||
20 | |||
21 | inherit systemd | ||
22 | |||
23 | RPROVIDES_${PN} += "${PN}-systemd" | ||
24 | RREPLACES_${PN} += "${PN}-systemd" | ||
25 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
26 | SYSTEMD_SERVICE_${PN} = "domainname.service" | ||
27 | |||
28 | do_install_append() { | ||
29 | install -d ${D}${systemd_unitdir}/system | ||
30 | install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system | ||
31 | } | ||
diff --git a/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service new file mode 100644 index 000000000..1f8df42af --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=YP Bind | ||
3 | Requires=domainname.service | ||
4 | After=domainname.service network.target | ||
5 | Before=systemd-user-sessions.service | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | PIDFile=/var/run/ypbind.pid | ||
10 | ExecStart=/usr/sbin/ypbind | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
14 | |||
diff --git a/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb new file mode 100644 index 000000000..35ef16a89 --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb | |||
@@ -0,0 +1,52 @@ | |||
1 | # This package builds the NIS ypbind daemon | ||
2 | # The source package is utils/net/NIS/ypbind-mt | ||
3 | # | ||
4 | PR = "r3" | ||
5 | DESCRIPTION="\ | ||
6 | Multithreaded NIS bind service (ypbind-mt). \ | ||
7 | ypbind-mt is a complete new implementation of a NIS \ | ||
8 | binding daemon for Linux. It has the following \ | ||
9 | features. Supports ypbind protocol V1 and V2. \ | ||
10 | Uses threads for better response. Supports multiple \ | ||
11 | domain bindings. Supports /var/yp/binding/* file \ | ||
12 | for Linux libc 4/5 and glibc 2.x. Supports a list \ | ||
13 | of known secure NIS server (/etc/yp.conf) Binds to \ | ||
14 | the server which answered as first." | ||
15 | HOMEPAGE="http://www.linux-nis.org/nis/ypbind-mt/index.html" | ||
16 | |||
17 | require nis.inc | ||
18 | |||
19 | LIC_FILES_CHKSUM = "file://COPYING;md5=082c9a0886c7c3db1bc862b5b62ffe08" | ||
20 | |||
21 | SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \ | ||
22 | file://ypbind-yocto.init \ | ||
23 | file://ypbind.service \ | ||
24 | " | ||
25 | SRC_URI[md5sum] = "135834db97d78ff6d79fdee2810b4056" | ||
26 | SRC_URI[sha256sum] = "0eff76c1849f4b38ea1a60280d8397c4240369c641fe5402ce57edf1a90958c7" | ||
27 | |||
28 | # ypbind-mt now provides all the functionality of ypbind | ||
29 | # and is used in place of it. | ||
30 | PROVIDES += "ypbind" | ||
31 | |||
32 | CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true" | ||
33 | |||
34 | do_install_append () { | ||
35 | install -d ${D}${sysconfdir}/init.d | ||
36 | install -d ${D}${sysconfdir}/rcS.d | ||
37 | |||
38 | install -m 0755 ${WORKDIR}/ypbind-yocto.init ${D}${sysconfdir}/init.d/ypbind | ||
39 | |||
40 | # TODO, use update-rc.d | ||
41 | ln -s ../init.d/ypbind ${D}${sysconfdir}/rcS.d/S44ypbind | ||
42 | |||
43 | install -d ${D}${systemd_unitdir}/system | ||
44 | install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system | ||
45 | } | ||
46 | |||
47 | inherit systemd | ||
48 | |||
49 | RPROVIDES_${PN} += "${PN}-systemd" | ||
50 | RREPLACES_${PN} += "${PN}-systemd" | ||
51 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
52 | SYSTEMD_SERVICE_${PN} = "ypbind.service" | ||
diff --git a/meta-networking/recipes-support/ntp/files/CVE-2013-5211.patch b/meta-networking/recipes-support/ntp/files/CVE-2013-5211.patch new file mode 100644 index 000000000..ddcb044e6 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/CVE-2013-5211.patch | |||
@@ -0,0 +1,112 @@ | |||
1 | ntp: fix CVE-2013-5211 | ||
2 | |||
3 | Upstream-status: Backport | ||
4 | |||
5 | The monlist feature in ntp_request.c in ntpd in NTP before | ||
6 | 4.2.7p26 allows remote attackers to cause a denial of service | ||
7 | (traffic amplification) via forged (1) REQ_MON_GETLIST or | ||
8 | (2) REQ_MON_GETLIST_1 requests, as exploited in the wild | ||
9 | in December 2013. | ||
10 | |||
11 | Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com> | ||
12 | |||
13 | --- a/ntpd/ntp_request.c | ||
14 | +++ b/ntpd/ntp_request.c | ||
15 | @@ -1912,44 +1912,11 @@ mon_getlist_0( | ||
16 | struct req_pkt *inpkt | ||
17 | ) | ||
18 | { | ||
19 | - register struct info_monitor *im; | ||
20 | - register struct mon_data *md; | ||
21 | - extern struct mon_data mon_mru_list; | ||
22 | - extern int mon_enabled; | ||
23 | - | ||
24 | #ifdef DEBUG | ||
25 | if (debug > 2) | ||
26 | printf("wants monitor 0 list\n"); | ||
27 | #endif | ||
28 | - if (!mon_enabled) { | ||
29 | - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); | ||
30 | - return; | ||
31 | - } | ||
32 | - im = (struct info_monitor *)prepare_pkt(srcadr, inter, inpkt, | ||
33 | - v6sizeof(struct info_monitor)); | ||
34 | - for (md = mon_mru_list.mru_next; md != &mon_mru_list && im != 0; | ||
35 | - md = md->mru_next) { | ||
36 | - im->lasttime = htonl((u_int32)((current_time - | ||
37 | - md->firsttime) / md->count)); | ||
38 | - im->firsttime = htonl((u_int32)(current_time - md->lasttime)); | ||
39 | - im->restr = htonl((u_int32)md->flags); | ||
40 | - im->count = htonl((u_int32)(md->count)); | ||
41 | - if (IS_IPV6(&md->rmtadr)) { | ||
42 | - if (!client_v6_capable) | ||
43 | - continue; | ||
44 | - im->addr6 = SOCK_ADDR6(&md->rmtadr); | ||
45 | - im->v6_flag = 1; | ||
46 | - } else { | ||
47 | - im->addr = NSRCADR(&md->rmtadr); | ||
48 | - if (client_v6_capable) | ||
49 | - im->v6_flag = 0; | ||
50 | - } | ||
51 | - im->port = md->rmtport; | ||
52 | - im->mode = md->mode; | ||
53 | - im->version = md->version; | ||
54 | - im = (struct info_monitor *)more_pkt(); | ||
55 | - } | ||
56 | - flush_pkt(); | ||
57 | + req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); | ||
58 | } | ||
59 | |||
60 | /* | ||
61 | @@ -1962,50 +1929,7 @@ mon_getlist_1( | ||
62 | struct req_pkt *inpkt | ||
63 | ) | ||
64 | { | ||
65 | - register struct info_monitor_1 *im; | ||
66 | - register struct mon_data *md; | ||
67 | - extern struct mon_data mon_mru_list; | ||
68 | - extern int mon_enabled; | ||
69 | - | ||
70 | - if (!mon_enabled) { | ||
71 | - req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); | ||
72 | - return; | ||
73 | - } | ||
74 | - im = (struct info_monitor_1 *)prepare_pkt(srcadr, inter, inpkt, | ||
75 | - v6sizeof(struct info_monitor_1)); | ||
76 | - for (md = mon_mru_list.mru_next; md != &mon_mru_list && im != 0; | ||
77 | - md = md->mru_next) { | ||
78 | - im->lasttime = htonl((u_int32)((current_time - | ||
79 | - md->firsttime) / md->count)); | ||
80 | - im->firsttime = htonl((u_int32)(current_time - md->lasttime)); | ||
81 | - im->restr = htonl((u_int32)md->flags); | ||
82 | - im->count = htonl((u_int32)md->count); | ||
83 | - if (IS_IPV6(&md->rmtadr)) { | ||
84 | - if (!client_v6_capable) | ||
85 | - continue; | ||
86 | - im->addr6 = SOCK_ADDR6(&md->rmtadr); | ||
87 | - im->v6_flag = 1; | ||
88 | - im->daddr6 = SOCK_ADDR6(&md->interface->sin); | ||
89 | - } else { | ||
90 | - im->addr = NSRCADR(&md->rmtadr); | ||
91 | - if (client_v6_capable) | ||
92 | - im->v6_flag = 0; | ||
93 | - if (MDF_BCAST == md->cast_flags) | ||
94 | - im->daddr = NSRCADR(&md->interface->bcast); | ||
95 | - else if (md->cast_flags) { | ||
96 | - im->daddr = NSRCADR(&md->interface->sin); | ||
97 | - if (!im->daddr) | ||
98 | - im->daddr = NSRCADR(&md->interface->bcast); | ||
99 | - } else | ||
100 | - im->daddr = 4; | ||
101 | - } | ||
102 | - im->flags = htonl(md->cast_flags); | ||
103 | - im->port = md->rmtport; | ||
104 | - im->mode = md->mode; | ||
105 | - im->version = md->version; | ||
106 | - im = (struct info_monitor_1 *)more_pkt(); | ||
107 | - } | ||
108 | - flush_pkt(); | ||
109 | + req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA); | ||
110 | } | ||
111 | |||
112 | /* | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch new file mode 100644 index 000000000..cb1e2f734 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | --- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400 | ||
2 | +++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400 | ||
3 | @@ -14,6 +14,14 @@ | ||
4 | # include <sys/timex.h> | ||
5 | #endif | ||
6 | |||
7 | +#if defined(ADJ_NANO) && !defined(MOD_NANO) | ||
8 | +#define MOD_NANO ADJ_NANO | ||
9 | +#endif | ||
10 | + | ||
11 | +#if defined(ADJ_TAI) && !defined(MOD_TAI) | ||
12 | +#define MOD_TAI ADJ_TAI | ||
13 | +#endif | ||
14 | + | ||
15 | #ifndef NTP_SYSCALLS_LIBC | ||
16 | #ifdef NTP_SYSCALLS_STD | ||
17 | # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9293.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9293.patch new file mode 100644 index 000000000..667b705ea --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9293.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | CVE-2014-9293 ntp: automatic generation of weak default key in config_auth() | ||
2 | |||
3 | Upstream-Status: Backport [Debian] | ||
4 | |||
5 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
6 | |||
7 | Index: git/ntpd/ntp_config.c | ||
8 | =================================================================== | ||
9 | --- git.orig/ntpd/ntp_config.c 2014-12-20 18:45:45.232872120 +0100 | ||
10 | +++ git/ntpd/ntp_config.c 2014-12-20 18:45:47.672921968 +0100 | ||
11 | @@ -1866,13 +1866,16 @@ | ||
12 | req_hashlen = digest_len; | ||
13 | #endif | ||
14 | } else { | ||
15 | - int rankey; | ||
16 | + unsigned char rankey[16]; | ||
17 | + | ||
18 | + if (ntp_crypto_random_buf(rankey, sizeof (rankey))) { | ||
19 | + msyslog(LOG_ERR, "ntp_crypto_random_buf() failed."); | ||
20 | + exit(1); | ||
21 | + } | ||
22 | |||
23 | - rankey = ntp_random(); | ||
24 | req_keytype = NID_md5; | ||
25 | req_hashlen = 16; | ||
26 | - MD5auth_setkey(req_keyid, req_keytype, | ||
27 | - (u_char *)&rankey, sizeof(rankey)); | ||
28 | + MD5auth_setkey(req_keyid, req_keytype, rankey, sizeof(rankey)); | ||
29 | authtrust(req_keyid, 1); | ||
30 | } | ||
31 | |||
32 | Index: git/ntpd/ntpd.c | ||
33 | =================================================================== | ||
34 | --- git.orig/ntpd/ntpd.c 2014-12-20 18:45:45.232872120 +0100 | ||
35 | +++ git/ntpd/ntpd.c 2014-12-20 18:45:47.672921968 +0100 | ||
36 | @@ -597,6 +597,7 @@ | ||
37 | get_systime(&now); | ||
38 | |||
39 | ntp_srandom((int)(now.l_i * now.l_uf)); | ||
40 | + ntp_crypto_srandom(); | ||
41 | |||
42 | #if !defined(VMS) | ||
43 | # ifndef NODETACH | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9294.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9294.patch new file mode 100644 index 000000000..67e532b9d --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9294.patch | |||
@@ -0,0 +1,128 @@ | |||
1 | CVE-2014-9294 ntp: ntp-keygen uses weak random number generator and seed when generating MD5 keys | ||
2 | |||
3 | Upstream-Status: Backport [Debian] | ||
4 | |||
5 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
6 | |||
7 | Index: ntp-4.2.6p5/include/ntp_random.h | ||
8 | =================================================================== | ||
9 | --- ntp-4.2.6p5.orig/include/ntp_random.h | ||
10 | +++ ntp-4.2.6p5/include/ntp_random.h | ||
11 | @@ -1,6 +1,9 @@ | ||
12 | |||
13 | #include <ntp_types.h> | ||
14 | |||
15 | +void ntp_crypto_srandom(void); | ||
16 | +int ntp_crypto_random_buf(void *buf, size_t nbytes); | ||
17 | + | ||
18 | long ntp_random (void); | ||
19 | void ntp_srandom (unsigned long); | ||
20 | void ntp_srandomdev (void); | ||
21 | Index: ntp-4.2.6p5/libntp/ntp_random.c | ||
22 | =================================================================== | ||
23 | --- ntp-4.2.6p5.orig/libntp/ntp_random.c | ||
24 | +++ ntp-4.2.6p5/libntp/ntp_random.c | ||
25 | @@ -481,3 +481,74 @@ ntp_random( void ) | ||
26 | } | ||
27 | return(i); | ||
28 | } | ||
29 | + | ||
30 | +/* | ||
31 | + * Crypto-quality random number functions | ||
32 | + * | ||
33 | + * Author: Harlan Stenn, 2014 | ||
34 | + * | ||
35 | + * This file is Copyright (c) 2014 by Network Time Foundation. | ||
36 | + * BSD terms apply: see the file COPYRIGHT in the distribution root for details. | ||
37 | + */ | ||
38 | + | ||
39 | +#ifdef OPENSSL | ||
40 | +#include <openssl/err.h> | ||
41 | +#include <openssl/rand.h> | ||
42 | + | ||
43 | +int crypto_rand_init = 0; | ||
44 | +#endif | ||
45 | + | ||
46 | +/* | ||
47 | + * ntp_crypto_srandom: | ||
48 | + * | ||
49 | + * Initialize the random number generator, if needed by the underlying | ||
50 | + * crypto random number generation mechanism. | ||
51 | + */ | ||
52 | + | ||
53 | +void | ||
54 | +ntp_crypto_srandom( | ||
55 | + void | ||
56 | + ) | ||
57 | +{ | ||
58 | +#ifdef OPENSSL | ||
59 | + if (!crypto_rand_init) { | ||
60 | + RAND_poll(); | ||
61 | + crypto_rand_init = 1; | ||
62 | + } | ||
63 | +#else | ||
64 | + /* No initialization needed for arc4random() */ | ||
65 | +#endif | ||
66 | +} | ||
67 | + | ||
68 | +/* | ||
69 | + * ntp_crypto_random_buf: | ||
70 | + * | ||
71 | + * Returns 0 on success, -1 on error. | ||
72 | + */ | ||
73 | +int | ||
74 | +ntp_crypto_random_buf( | ||
75 | + void *buf, | ||
76 | + size_t nbytes | ||
77 | + ) | ||
78 | +{ | ||
79 | +#ifdef OPENSSL | ||
80 | + int rc; | ||
81 | + | ||
82 | + rc = RAND_bytes(buf, nbytes); | ||
83 | + if (1 != rc) { | ||
84 | + unsigned long err; | ||
85 | + char *err_str; | ||
86 | + | ||
87 | + err = ERR_get_error(); | ||
88 | + err_str = ERR_error_string(err, NULL); | ||
89 | + /* XXX: Log the error */ | ||
90 | + | ||
91 | + return -1; | ||
92 | + } | ||
93 | + return 0; | ||
94 | +#else | ||
95 | + arc4random_buf(buf, nbytes); | ||
96 | + return 0; | ||
97 | +#endif | ||
98 | +} | ||
99 | + | ||
100 | Index: ntp-4.2.6p5/util/ntp-keygen.c | ||
101 | =================================================================== | ||
102 | --- ntp-4.2.6p5.orig/util/ntp-keygen.c | ||
103 | +++ ntp-4.2.6p5/util/ntp-keygen.c | ||
104 | @@ -261,6 +261,8 @@ main( | ||
105 | ssl_check_version(); | ||
106 | #endif /* OPENSSL */ | ||
107 | |||
108 | + ntp_crypto_srandom(); | ||
109 | + | ||
110 | /* | ||
111 | * Process options, initialize host name and timestamp. | ||
112 | */ | ||
113 | @@ -727,7 +729,14 @@ gen_md5( | ||
114 | int temp; | ||
115 | |||
116 | while (1) { | ||
117 | - temp = ntp_random() & 0xff; | ||
118 | + int rc; | ||
119 | + | ||
120 | + rc = ntp_crypto_random_buf(&temp, 1); | ||
121 | + if (-1 == rc) { | ||
122 | + fprintf(stderr, "ntp_crypto_random_buf() failed.\n"); | ||
123 | + exit (-1); | ||
124 | + } | ||
125 | + temp &= 0xff; | ||
126 | if (temp == '#') | ||
127 | continue; | ||
128 | |||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9295.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9295.patch new file mode 100644 index 000000000..6143f26e9 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9295.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | CVE-2014-9295 ntp: Multiple buffer overflows via specially-crafted packets | ||
2 | |||
3 | Upstream-Status: Backport [Debian] | ||
4 | |||
5 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
6 | |||
7 | 2014-12-12 11:06:03+00:00, stenn@psp-fb1.ntp.org +12 -3 | ||
8 | [Sec 2667] buffer overflow in crypto_recv() | ||
9 | 2014-12-12 11:13:40+00:00, stenn@psp-fb1.ntp.org +16 -1 | ||
10 | [Sec 2668] buffer overflow in ctl_putdata() | ||
11 | 2014-12-12 11:19:37+00:00, stenn@psp-fb1.ntp.org +14 -0 | ||
12 | [Sec 2669] buffer overflow in configure() | ||
13 | |||
14 | Index: git/ntpd/ntp_crypto.c | ||
15 | =================================================================== | ||
16 | --- git.orig/ntpd/ntp_crypto.c 2014-12-20 18:45:44.208851199 +0100 | ||
17 | +++ git/ntpd/ntp_crypto.c 2014-12-20 18:45:56.425100776 +0100 | ||
18 | @@ -789,15 +789,24 @@ | ||
19 | * errors. | ||
20 | */ | ||
21 | if (vallen == (u_int)EVP_PKEY_size(host_pkey)) { | ||
22 | + u_int32 *cookiebuf = malloc( | ||
23 | + RSA_size(host_pkey->pkey.rsa)); | ||
24 | + if (!cookiebuf) { | ||
25 | + rval = XEVNT_CKY; | ||
26 | + break; | ||
27 | + } | ||
28 | + | ||
29 | if (RSA_private_decrypt(vallen, | ||
30 | (u_char *)ep->pkt, | ||
31 | - (u_char *)&temp32, | ||
32 | + (u_char *)cookiebuf, | ||
33 | host_pkey->pkey.rsa, | ||
34 | - RSA_PKCS1_OAEP_PADDING) <= 0) { | ||
35 | + RSA_PKCS1_OAEP_PADDING) != 4) { | ||
36 | rval = XEVNT_CKY; | ||
37 | + free(cookiebuf); | ||
38 | break; | ||
39 | } else { | ||
40 | - cookie = ntohl(temp32); | ||
41 | + cookie = ntohl(*cookiebuf); | ||
42 | + free(cookiebuf); | ||
43 | } | ||
44 | } else { | ||
45 | rval = XEVNT_CKY; | ||
46 | Index: git/ntpd/ntp_control.c | ||
47 | =================================================================== | ||
48 | --- git.orig/ntpd/ntp_control.c 2014-12-20 18:45:44.208851199 +0100 | ||
49 | +++ git/ntpd/ntp_control.c 2014-12-20 18:45:56.429100859 +0100 | ||
50 | @@ -486,6 +486,10 @@ | ||
51 | static char *reqpt; | ||
52 | static char *reqend; | ||
53 | |||
54 | +#ifndef MIN | ||
55 | +#define MIN(a, b) (((a) <= (b)) ? (a) : (b)) | ||
56 | +#endif | ||
57 | + | ||
58 | /* | ||
59 | * init_control - initialize request data | ||
60 | */ | ||
61 | @@ -995,6 +999,7 @@ | ||
62 | ) | ||
63 | { | ||
64 | int overhead; | ||
65 | + unsigned int currentlen; | ||
66 | |||
67 | overhead = 0; | ||
68 | if (!bin) { | ||
69 | @@ -1018,12 +1023,22 @@ | ||
70 | /* | ||
71 | * Save room for trailing junk | ||
72 | */ | ||
73 | - if (dlen + overhead + datapt > dataend) { | ||
74 | + while (dlen + overhead + datapt > dataend) { | ||
75 | /* | ||
76 | * Not enough room in this one, flush it out. | ||
77 | */ | ||
78 | + currentlen = MIN(dlen, dataend - datapt); | ||
79 | + | ||
80 | + memcpy(datapt, dp, currentlen); | ||
81 | + | ||
82 | + datapt += currentlen; | ||
83 | + dp += currentlen; | ||
84 | + dlen -= currentlen; | ||
85 | + datalinelen += currentlen; | ||
86 | + | ||
87 | ctl_flushpkt(CTL_MORE); | ||
88 | } | ||
89 | + | ||
90 | memmove((char *)datapt, dp, (unsigned)dlen); | ||
91 | datapt += dlen; | ||
92 | datalinelen += dlen; | ||
93 | @@ -2492,6 +2507,20 @@ | ||
94 | |||
95 | /* Initialize the remote config buffer */ | ||
96 | data_count = reqend - reqpt; | ||
97 | + | ||
98 | + if (data_count > sizeof(remote_config.buffer) - 2) { | ||
99 | + snprintf(remote_config.err_msg, | ||
100 | + sizeof(remote_config.err_msg), | ||
101 | + "runtime configuration failed: request too long"); | ||
102 | + ctl_putdata(remote_config.err_msg, | ||
103 | + strlen(remote_config.err_msg), 0); | ||
104 | + ctl_flushpkt(0); | ||
105 | + msyslog(LOG_NOTICE, | ||
106 | + "runtime config from %s rejected: request too long", | ||
107 | + stoa(&rbufp->recv_srcadr)); | ||
108 | + return; | ||
109 | + } | ||
110 | + | ||
111 | memcpy(remote_config.buffer, reqpt, data_count); | ||
112 | if (data_count > 0 | ||
113 | && '\n' != remote_config.buffer[data_count - 1]) | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9296.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9296.patch new file mode 100644 index 000000000..a85f65d2a --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.6p5-cve-2014-9296.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | CVE-2014-9296 ntp: receive() missing return on error | ||
2 | |||
3 | Upstream-Status: Backport [Debian] | ||
4 | |||
5 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
6 | |||
7 | 2014-12-12 11:24:22+00:00, stenn@psp-fb1.ntp.org +1 -0 | ||
8 | [Sec 2670] Missing return; from error clause | ||
9 | |||
10 | Index: git/ntpd/ntp_proto.c | ||
11 | =================================================================== | ||
12 | --- git.orig/ntpd/ntp_proto.c 2014-12-20 18:45:42.760821618 +0100 | ||
13 | +++ git/ntpd/ntp_proto.c 2014-12-20 18:46:00.153176945 +0100 | ||
14 | @@ -947,6 +947,7 @@ | ||
15 | fast_xmit(rbufp, MODE_ACTIVE, 0, | ||
16 | restrict_mask); | ||
17 | sys_restricted++; | ||
18 | + return; | ||
19 | } | ||
20 | } | ||
21 | |||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch b/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch new file mode 100644 index 000000000..f576e2ee8 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-keygen_no_openssl.patch | |||
@@ -0,0 +1,108 @@ | |||
1 | Fix ntp-keygen build without OpenSSL | ||
2 | |||
3 | Patch borrowed from Gentoo, originally from upstream | ||
4 | Added --enable-libenvent to config since this version | ||
5 | does not have local libevent support but we need the | ||
6 | functions from the lib. | ||
7 | |||
8 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
9 | |||
10 | Upstream-Status: Backport | ||
11 | |||
12 | Upstream commit: | ||
13 | http://bk1.ntp.org/ntp-stable/?PAGE=patch&REV=5497b345z5MNTuNvJWuqPSje25NQTg | ||
14 | Gentoo bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=533238 | ||
15 | |||
16 | Signed-off-by: Markos Chandras <hwoarang@gentoo.org> | ||
17 | |||
18 | Index: ntp-4.2.6p5/libntp/ntp_random.c | ||
19 | =================================================================== | ||
20 | --- ntp-4.2.6p5.orig/libntp/ntp_random.c | ||
21 | +++ ntp-4.2.6p5/libntp/ntp_random.c | ||
22 | @@ -498,6 +498,21 @@ ntp_random( void ) | ||
23 | int crypto_rand_init = 0; | ||
24 | #endif | ||
25 | |||
26 | +#ifndef HAVE_ARC4RANDOM_BUF | ||
27 | +static void | ||
28 | +arc4random_buf(void *buf, size_t nbytes); | ||
29 | + | ||
30 | +void | ||
31 | +evutil_secure_rng_get_bytes(void *buf, size_t nbytes); | ||
32 | + | ||
33 | +static void | ||
34 | +arc4random_buf(void *buf, size_t nbytes) | ||
35 | +{ | ||
36 | + evutil_secure_rng_get_bytes(buf, nbytes); | ||
37 | + return; | ||
38 | +} | ||
39 | +#endif | ||
40 | + | ||
41 | /* | ||
42 | * ntp_crypto_srandom: | ||
43 | * | ||
44 | Index: ntp-4.2.6p5/util/Makefile.am | ||
45 | =================================================================== | ||
46 | --- ntp-4.2.6p5.orig/util/Makefile.am | ||
47 | +++ ntp-4.2.6p5/util/Makefile.am | ||
48 | @@ -21,6 +21,7 @@ AM_CPPFLAGS= -I$(top_srcdir)/include -I$ | ||
49 | LDADD= ../libntp/libntp.a | ||
50 | ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h | ||
51 | ntp_keygen_LDADD= version.o $(LIBOPTS_LDADD) ../libntp/libntp.a @LCRYPTO@ | ||
52 | +ntp_keygen_LDADD += $(LDADD_LIBEVENT) | ||
53 | |||
54 | ETAGS_ARGS= Makefile.am | ||
55 | #EXTRA_DIST= README TAGS | ||
56 | Index: ntp-4.2.6p5/configure.ac | ||
57 | =================================================================== | ||
58 | --- ntp-4.2.6p5.orig/configure.ac | ||
59 | +++ ntp-4.2.6p5/configure.ac | ||
60 | @@ -376,6 +376,8 @@ AC_CHECK_FUNC([openlog], , | ||
61 | AC_SEARCH_LIBS([MD5Init], [md5 md]) | ||
62 | AC_CHECK_FUNCS(MD5Init) | ||
63 | |||
64 | +AC_CHECK_FUNC([arc4random_buf]) | ||
65 | + | ||
66 | NTP_LINEEDITLIBS | ||
67 | |||
68 | dnl Digital UNIX V4.0 and Solaris 7 have POSIX.1c functions in -lrt | ||
69 | @@ -5205,6 +5207,39 @@ AC_MSG_RESULT([$ntp_use_dev_clockctl]) | ||
70 | |||
71 | AC_CHECK_HEADERS([sys/capability.h sys/prctl.h]) | ||
72 | |||
73 | +AC_MSG_CHECKING([if we have libevent capabilities (libevent)]) | ||
74 | + | ||
75 | +case "$ac_cv_header_event2_event-config_h" in | ||
76 | + yes) | ||
77 | + case "$host" in | ||
78 | + *) ntp_have_linuxcaps=yes | ||
79 | + ;; | ||
80 | + esac | ||
81 | + ;; | ||
82 | + *) | ||
83 | + ntp_have_linuxcaps=no | ||
84 | + ;; | ||
85 | +esac | ||
86 | + | ||
87 | +AC_ARG_ENABLE( | ||
88 | + [libevent], | ||
89 | + [AS_HELP_STRING( | ||
90 | + [--enable-libevent], | ||
91 | + [+ Use libevent capabilities for arc4random] | ||
92 | + )], | ||
93 | + [ntp_have_libevent=$enableval] | ||
94 | +) | ||
95 | + | ||
96 | +AC_MSG_RESULT([$ntp_have_libevent]) | ||
97 | + | ||
98 | +case "$ntp_have_libevent" in | ||
99 | + yes) | ||
100 | + AC_DEFINE([HAVE_LIBEVENT], [1], | ||
101 | + [Do we have libevent capabilities?]) | ||
102 | + LIBS="$LIBS -levent" | ||
103 | +esac | ||
104 | + | ||
105 | + | ||
106 | AC_MSG_CHECKING([if we have linux capabilities (libcap)]) | ||
107 | |||
108 | case "$ac_cv_header_sys_capability_h$ac_cv_header_sys_prctl_h" in | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp.conf b/meta-networking/recipes-support/ntp/files/ntp.conf new file mode 100644 index 000000000..676e18645 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | # This is the most basic ntp configuration file | ||
2 | # The driftfile must remain in a place specific to this | ||
3 | # machine - it records the machine specific clock error | ||
4 | driftfile /var/lib/ntp/drift | ||
5 | # This should be a server that is close (in IP terms) | ||
6 | # to the machine. Add other servers as required. | ||
7 | # Unless you un-comment the line below ntpd will sync | ||
8 | # only against the local system clock. | ||
9 | # | ||
10 | # server time.server.example.com | ||
11 | # | ||
12 | # Using local hardware clock as fallback | ||
13 | # Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself | ||
14 | server 127.127.1.0 | ||
15 | fudge 127.127.1.0 stratum 14 | ||
16 | # Defining a default security setting | ||
17 | restrict default | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd new file mode 100755 index 000000000..d1b9c4907 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpd | |||
@@ -0,0 +1,84 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: ntp | ||
5 | # Required-Start: $network $remote_fs $syslog | ||
6 | # Required-Stop: $network $remote_fs $syslog | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: | ||
9 | # Short-Description: Start NTP daemon | ||
10 | ### END INIT INFO | ||
11 | |||
12 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
13 | |||
14 | DAEMON=/usr/sbin/ntpd | ||
15 | PIDFILE=/var/run/ntpd.pid | ||
16 | |||
17 | # ntpd init.d script for ntpdc from ntp.isc.org | ||
18 | test -x $DAEMON -a -r /etc/ntp.conf || exit 0 | ||
19 | |||
20 | # rcS contains TICKADJ | ||
21 | test -r /etc/default/rcS && . /etc/default/rcS | ||
22 | |||
23 | # Source function library. | ||
24 | . /etc/init.d/functions | ||
25 | |||
26 | # Functions to do individual actions | ||
27 | settick(){ | ||
28 | # If TICKADJ is set we *must* adjust it before we start, because the | ||
29 | # driftfile relies on the correct setting | ||
30 | test -n "$TICKADJ" -a -x /usr/sbin/tickadj && { | ||
31 | echo -n "Setting tick to $TICKADJ: " | ||
32 | /usr/sbin/tickadj "$TICKADJ" | ||
33 | echo "done" | ||
34 | } | ||
35 | } | ||
36 | startdaemon(){ | ||
37 | # The -g option allows ntpd to step the time to correct it just | ||
38 | # once. The daemon will exit if the clock drifts too much after | ||
39 | # this. If ntpd seems to disappear after a while assume TICKADJ | ||
40 | # above is set to a totally incorrect value. | ||
41 | echo -n "Starting ntpd: " | ||
42 | start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@" | ||
43 | echo "done" | ||
44 | } | ||
45 | stopdaemon(){ | ||
46 | echo -n "Stopping ntpd: " | ||
47 | start-stop-daemon --stop --quiet --oknodo -p $PIDFILE | ||
48 | echo "done" | ||
49 | } | ||
50 | |||
51 | case "$1" in | ||
52 | start) | ||
53 | settick | ||
54 | startdaemon -g | ||
55 | ;; | ||
56 | stop) | ||
57 | stopdaemon | ||
58 | ;; | ||
59 | force-reload) | ||
60 | stopdaemon | ||
61 | settick | ||
62 | startdaemon -g | ||
63 | ;; | ||
64 | restart) | ||
65 | # Don't reset the tick here | ||
66 | stopdaemon | ||
67 | startdaemon -g | ||
68 | ;; | ||
69 | reload) | ||
70 | # Must do this by hand, but don't do -g | ||
71 | stopdaemon | ||
72 | startdaemon | ||
73 | ;; | ||
74 | status) | ||
75 | status /usr/sbin/ntpd; | ||
76 | exit $? | ||
77 | ;; | ||
78 | *) | ||
79 | echo "Usage: ntpd { start | stop | status | restart | reload }" >&2 | ||
80 | exit 1 | ||
81 | ;; | ||
82 | esac | ||
83 | |||
84 | exit 0 | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate b/meta-networking/recipes-support/ntp/files/ntpdate new file mode 100755 index 000000000..17b64d133 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
4 | |||
5 | test -x /usr/sbin/ntpdate || exit 0 | ||
6 | |||
7 | if test -f /etc/default/ntpdate ; then | ||
8 | . /etc/default/ntpdate | ||
9 | fi | ||
10 | |||
11 | if [ "$NTPSERVERS" = "" ] ; then | ||
12 | if [ "$METHOD" = "" -a "$1" != "silent" ] ; then | ||
13 | echo "Please set NTPSERVERS in /etc/default/ntpdate" | ||
14 | exit 1 | ||
15 | else | ||
16 | exit 0 | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | # This is a heuristic: The idea is that if a static interface is brought | ||
21 | # up, that is a major event, and we can put in some extra effort to fix | ||
22 | # the system time. Feel free to change this, especially if you regularly | ||
23 | # bring up new network interfaces. | ||
24 | if [ "$METHOD" = static ]; then | ||
25 | OPTS="-b" | ||
26 | fi | ||
27 | |||
28 | if [ "$METHOD" = loopback ]; then | ||
29 | exit 0 | ||
30 | fi | ||
31 | |||
32 | ( | ||
33 | |||
34 | LOCKFILE=/var/lock/ntpdate | ||
35 | |||
36 | # Avoid running more than one at a time | ||
37 | if [ -x /usr/bin/lockfile-create ]; then | ||
38 | lockfile-create $LOCKFILE | ||
39 | lockfile-touch $LOCKFILE & | ||
40 | LOCKTOUCHPID="$!" | ||
41 | fi | ||
42 | |||
43 | if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then | ||
44 | if [ "$UPDATE_HWCLOCK" = "yes" ]; then | ||
45 | hwclock --systohc || : | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | if [ -x /usr/bin/lockfile-create ] ; then | ||
50 | kill $LOCKTOUCHPID | ||
51 | lockfile-remove $LOCKFILE | ||
52 | fi | ||
53 | |||
54 | ) & | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate.default b/meta-networking/recipes-support/ntp/files/ntpdate.default new file mode 100644 index 000000000..486b6e07d --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate.default | |||
@@ -0,0 +1,7 @@ | |||
1 | # Configuration script used by ntpdate-sync script | ||
2 | |||
3 | NTPSERVERS="" | ||
4 | |||
5 | # Set to "yes" to write time to hardware clock on success | ||
6 | UPDATE_HWCLOCK="no" | ||
7 | |||
diff --git a/meta-networking/recipes-support/ntp/files/openssl-check.patch b/meta-networking/recipes-support/ntp/files/openssl-check.patch new file mode 100644 index 000000000..8b4a6733c --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/openssl-check.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Hack OpenSSL check to work when libssl and libcrypto aren't in same dir | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | --- | ||
7 | configure | 4 ++-- | ||
8 | m4/ntp_openssl.m4 | 4 ++-- | ||
9 | sntp/configure | 4 ++-- | ||
10 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
11 | |||
12 | diff --git a/configure b/configure | ||
13 | index aae2c01..6a3c15e 100755 | ||
14 | --- a/configure | ||
15 | +++ b/configure | ||
16 | @@ -22868,8 +22868,8 @@ case "$ans" in | ||
17 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
18 | ;; | ||
19 | *) | ||
20 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
21 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
22 | + test -f $i/libssl.so && break | ||
23 | + test -f $i/libssl.a && break | ||
24 | ;; | ||
25 | esac | ||
26 | done | ||
27 | diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4 | ||
28 | index 7d9f477..67bdd55 100644 | ||
29 | --- a/m4/ntp_openssl.m4 | ||
30 | +++ b/m4/ntp_openssl.m4 | ||
31 | @@ -41,8 +41,8 @@ case "$ans" in | ||
32 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
33 | ;; | ||
34 | *) | ||
35 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
36 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
37 | + test -f $i/libssl.so && break | ||
38 | + test -f $i/libssl.a && break | ||
39 | ;; | ||
40 | esac | ||
41 | done | ||
42 | diff --git a/sntp/configure b/sntp/configure | ||
43 | index 7782c29..55e82d9 100755 | ||
44 | --- a/sntp/configure | ||
45 | +++ b/sntp/configure | ||
46 | @@ -14810,8 +14810,8 @@ case "$ans" in | ||
47 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
48 | ;; | ||
49 | *) | ||
50 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
51 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
52 | + test -f $i/libssl.so && break | ||
53 | + test -f $i/libssl.a && break | ||
54 | ;; | ||
55 | esac | ||
56 | done | ||
57 | -- | ||
58 | 1.7.1 | ||
59 | |||
diff --git a/meta-networking/recipes-support/ntp/files/tickadj.c.patch b/meta-networking/recipes-support/ntp/files/tickadj.c.patch new file mode 100644 index 000000000..9ef9de9e1 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/tickadj.c.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c | ||
2 | =================================================================== | ||
3 | --- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100 | ||
4 | +++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200 | ||
5 | @@ -21,7 +21,8 @@ | ||
6 | # include <unistd.h> | ||
7 | #endif /* HAVE_UNISTD_H */ | ||
8 | |||
9 | -#ifdef HAVE___ADJTIMEX /* Linux */ | ||
10 | +/* proper handling here has been moved to upstream ntp bugzilla */ | ||
11 | +#ifdef linux | ||
12 | |||
13 | #include <sys/timex.h> | ||
14 | struct timex txc; | ||
15 | @@ -91,7 +92,7 @@ | ||
16 | } | ||
17 | |||
18 | if (!errflg) { | ||
19 | - if (__adjtimex(&txc) < 0) | ||
20 | + if (adjtimex(&txc) < 0) | ||
21 | perror("adjtimex"); | ||
22 | else if (!quiet) | ||
23 | printf("tick = %ld\ntick_adj = %d\n", | ||
24 | @@ -146,7 +147,7 @@ | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | - if (__adjtimex(&txc) < 0) | ||
29 | + if (adjtimex(&txc) < 0) | ||
30 | { | ||
31 | perror("adjtimex"); | ||
32 | } | ||
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc new file mode 100644 index 000000000..ab7bd9c53 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp.inc | |||
@@ -0,0 +1,158 @@ | |||
1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | ||
3 | synchronize the time of a computer client or server to \ | ||
4 | another server or reference time source, such as a radio \ | ||
5 | or satellite receiver or modem." | ||
6 | HOMEPAGE = "http://support.ntp.org" | ||
7 | SECTION = "console/network" | ||
8 | LICENSE = "NTP" | ||
9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" | ||
10 | |||
11 | DEPENDS = "pps-tools" | ||
12 | |||
13 | INC_PR = "r6" | ||
14 | |||
15 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ | ||
16 | file://tickadj.c.patch \ | ||
17 | file://ntp-4.2.4_p6-nano.patch \ | ||
18 | file://openssl-check.patch \ | ||
19 | file://ntpd \ | ||
20 | file://ntp.conf \ | ||
21 | file://ntpdate \ | ||
22 | file://ntpdate.default \ | ||
23 | file://ntpdate.service \ | ||
24 | file://ntpd.service \ | ||
25 | file://sntp.service \ | ||
26 | file://sntp \ | ||
27 | file://ntpd.list \ | ||
28 | file://CVE-2013-5211.patch \ | ||
29 | file://ntp-4.2.6p5-cve-2014-9293.patch \ | ||
30 | file://ntp-4.2.6p5-cve-2014-9294.patch \ | ||
31 | file://ntp-4.2.6p5-cve-2014-9295.patch \ | ||
32 | file://ntp-4.2.6p5-cve-2014-9296.patch \ | ||
33 | file://ntp-keygen_no_openssl.patch \ | ||
34 | " | ||
35 | |||
36 | inherit autotools update-rc.d useradd systemd | ||
37 | |||
38 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | ||
39 | # readline or curses | ||
40 | EXTRA_OECONF += "--with-net-snmp-config=no \ | ||
41 | --without-ntpsnmpd \ | ||
42 | ac_cv_header_readline_history_h=no \ | ||
43 | --with-binsubdir=sbin" | ||
44 | |||
45 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | ||
46 | |||
47 | USERADD_PACKAGES = "${PN}" | ||
48 | NTP_USER_HOME ?= "/var/lib/ntp" | ||
49 | USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ | ||
50 | --no-create-home \ | ||
51 | --shell /bin/false --user-group ntp" | ||
52 | |||
53 | # NB: debug is default-enabled by NTP; keep it default-enabled here. | ||
54 | PACKAGECONFIG ??= "event cap debug" | ||
55 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
56 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
57 | --with-crypto, \ | ||
58 | --without-openssl --without-crypto, \ | ||
59 | openssl" | ||
60 | PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" | ||
61 | PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" | ||
62 | PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" | ||
63 | PACKAGECONFIG[event] = "--enable-libevent,--disable-libevent, libevent" | ||
64 | |||
65 | do_install_append() { | ||
66 | install -d ${D}${sysconfdir}/init.d | ||
67 | install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} | ||
68 | install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
69 | install -d ${D}${bindir} | ||
70 | install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync | ||
71 | |||
72 | install -m 755 -d ${D}${NTP_USER_HOME} | ||
73 | chown ntp:ntp ${D}${NTP_USER_HOME} | ||
74 | |||
75 | # Fix hardcoded paths in scripts | ||
76 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
77 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
78 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
79 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
80 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync | ||
81 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace | ||
82 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace | ||
83 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait | ||
84 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait | ||
85 | |||
86 | install -d ${D}/${sysconfdir}/default | ||
87 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate | ||
88 | install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ | ||
89 | |||
90 | install -d ${D}/${sysconfdir}/network/if-up.d | ||
91 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d | ||
92 | |||
93 | install -d ${D}${systemd_unitdir}/system | ||
94 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ | ||
95 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | ||
96 | install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
97 | |||
98 | install -d ${D}${systemd_unitdir}/ntp-units.d | ||
99 | install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list | ||
100 | } | ||
101 | |||
102 | PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils" | ||
103 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | ||
104 | |||
105 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | ||
106 | # with wonky clocks (e.g. OpenSlug) | ||
107 | RDEPENDS_${PN} = "${PN}-tickadj libbsd" | ||
108 | # Handle move from bin to utils package | ||
109 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
110 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
111 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
112 | |||
113 | SYSTEMD_PACKAGES = "${PN} ntpdate sntp" | ||
114 | SYSTEMD_SERVICE_${PN} = "ntpd.service" | ||
115 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" | ||
116 | SYSTEMD_SERVICE_sntp = "sntp.service" | ||
117 | |||
118 | RPROVIDES_${PN} += "${PN}-systemd" | ||
119 | RREPLACES_${PN} += "${PN}-systemd" | ||
120 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
121 | |||
122 | RPROVIDES_ntpdate += "ntpdate-systemd" | ||
123 | RREPLACES_ntpdate += "ntpdate-systemd" | ||
124 | RCONFLICTS_ntpdate += "ntpdate-systemd" | ||
125 | |||
126 | RSUGGESTS_${PN} = "iana-etc" | ||
127 | |||
128 | FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \ | ||
129 | ${NTP_USER_HOME} \ | ||
130 | ${systemd_unitdir}/ntp-units.d/60-ntpd.list \ | ||
131 | " | ||
132 | FILES_${PN}-tickadj = "${sbindir}/tickadj" | ||
133 | FILES_${PN}-utils = "${sbindir}" | ||
134 | FILES_ntpdate = "${sbindir}/ntpdate \ | ||
135 | ${sysconfdir}/network/if-up.d/ntpdate-sync \ | ||
136 | ${bindir}/ntpdate-sync \ | ||
137 | ${sysconfdir}/default/ntpdate \ | ||
138 | ${systemd_unitdir}/system/ntpdate.service \ | ||
139 | " | ||
140 | FILES_sntp = "${sbindir}/sntp \ | ||
141 | ${sysconfdir}/default/sntp \ | ||
142 | " | ||
143 | |||
144 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
145 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" | ||
146 | |||
147 | INITSCRIPT_NAME = "ntpd" | ||
148 | # No dependencies, so just go in at the standard level (20) | ||
149 | INITSCRIPT_PARAMS = "defaults" | ||
150 | |||
151 | pkg_postinst_ntpdate() { | ||
152 | if ! grep -q -s ntpdate $D/var/spool/cron/root; then | ||
153 | echo "adding crontab" | ||
154 | test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron | ||
155 | echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root | ||
156 | fi | ||
157 | } | ||
158 | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.list b/meta-networking/recipes-support/ntp/ntp/ntpd.list new file mode 100644 index 000000000..d1fe6b7e2 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.list | |||
@@ -0,0 +1 @@ | |||
ntpd.service | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-networking/recipes-support/ntp/ntp/ntpd.service new file mode 100644 index 000000000..b7c426864 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/run/ntpd.pid | ||
8 | ExecStart=/usr/sbin/ntpd -p /run/ntpd.pid -g | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpdate.service b/meta-networking/recipes-support/ntp/ntp/ntpdate.service new file mode 100644 index 000000000..10cbd70f9 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpdate.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service (one-shot ntpdate mode) | ||
3 | Before=ntpd.service | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | ExecStart=/usr/bin/ntpdate-sync silent | ||
8 | RemainAfterExit=yes | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp b/meta-networking/recipes-support/ntp/ntp/sntp new file mode 100644 index 000000000..f8c5895b7 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp | |||
@@ -0,0 +1 @@ | |||
NTPSERVER="ntpserver.example.org" | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-networking/recipes-support/ntp/ntp/sntp.service new file mode 100644 index 000000000..4898b8a70 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Time Service Client | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | EnvironmentFile=-/etc/default/sntp | ||
8 | ExecStart=/usr/sbin/sntp -s $NTPSERVER | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb new file mode 100644 index 000000000..588a1b03c --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require ntp.inc | ||
2 | |||
3 | PR = "${INC_PR}.0" | ||
4 | |||
5 | SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc" | ||
6 | SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c" | ||
diff --git a/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb b/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb new file mode 100644 index 000000000..b931d0470 --- /dev/null +++ b/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | # Copyright (C) 2013 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | SUMMARY = "network performance measurement tool" | ||
5 | DESCRIPTION = "nuttcp is a network performance measurement tool intended for use by network \ | ||
6 | and system managers. Its most basic usage is to determine the raw TCP (or UDP) \ | ||
7 | network layer throughput by transferring memory buffers from a source system \ | ||
8 | across an interconnecting network to a destination system, either transferring \ | ||
9 | data for a specified time interval, or alternatively transferring a specified \ | ||
10 | number of bytes." | ||
11 | HOMEPAGE = "http://www.nuttcp.net/nuttcp/Welcome%20Page.html" | ||
12 | LICENSE = "GPL-2.0" | ||
13 | SECTION = "net" | ||
14 | LIC_FILES_CHKSUM = "file://nuttcp-${PV}.c;beginline=4;endline=30;md5=ae7045c3c3616092e07d87f04ba0d960" | ||
15 | |||
16 | SRC_URI = "http://lcp.nrl.navy.mil/nuttcp/beta/nuttcp-${PV}.c" | ||
17 | SRC_URI[md5sum] = "1ebf4a08bad2a295a8155f02995e8754" | ||
18 | SRC_URI[sha256sum] = "c6e33810ccce67260f8d5d627f60e429d44f532365c58ed5673d035e2a59c4db" | ||
19 | |||
20 | S = "${WORKDIR}" | ||
21 | |||
22 | do_compile () { | ||
23 | ${CC} ${CFLAGS} -o nuttcp nuttcp-${PV}.c | ||
24 | } | ||
25 | |||
26 | do_install () { | ||
27 | install -d ${D}${bindir} | ||
28 | install -m 0755 nuttcp ${D}${bindir} | ||
29 | } | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn/openvpn b/meta-networking/recipes-support/openvpn/openvpn/openvpn new file mode 100755 index 000000000..a3cd6a2f4 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn/openvpn | |||
@@ -0,0 +1,104 @@ | |||
1 | #!/bin/sh -e | ||
2 | # | ||
3 | # Original version by Robert Leslie | ||
4 | # <rob@mars.org>, edited by iwj and cs | ||
5 | # Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as> | ||
6 | # Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net> | ||
7 | |||
8 | test $DEBIAN_SCRIPT_DEBUG && set -v -x | ||
9 | |||
10 | DAEMON=/usr/sbin/openvpn | ||
11 | CONFIG_DIR=/etc/openvpn | ||
12 | test -x $DAEMON || exit 0 | ||
13 | test -d $CONFIG_DIR || exit 0 | ||
14 | |||
15 | start_vpn () { | ||
16 | modprobe tun >/dev/null 2>&1 || true | ||
17 | $DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \ | ||
18 | --config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->" | ||
19 | echo -n " $NAME" | ||
20 | } | ||
21 | stop_vpn () { | ||
22 | kill `cat $PIDFILE` || true | ||
23 | rm $PIDFILE | ||
24 | } | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | echo -n "Starting openvpn:" | ||
29 | |||
30 | if test -z $2 ; then | ||
31 | for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do | ||
32 | NAME=${CONFIG%%.conf} | ||
33 | start_vpn | ||
34 | done | ||
35 | else | ||
36 | if test -e $CONFIG_DIR/$2.conf ; then | ||
37 | NAME=$2 | ||
38 | start_vpn | ||
39 | else | ||
40 | echo -n " No such VPN: $2" | ||
41 | fi | ||
42 | fi | ||
43 | echo "." | ||
44 | |||
45 | ;; | ||
46 | stop) | ||
47 | echo -n "Stopping openvpn:" | ||
48 | |||
49 | if test -z $2 ; then | ||
50 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
51 | NAME=`echo $PIDFILE | cut -c18-` | ||
52 | NAME=${NAME%%.pid} | ||
53 | stop_vpn | ||
54 | echo -n " $NAME" | ||
55 | done | ||
56 | else | ||
57 | if test -e /var/run/openvpn.$2.pid ; then | ||
58 | PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null` | ||
59 | NAME=`echo $PIDFILE | cut -c18-` | ||
60 | NAME=${NAME%%.pid} | ||
61 | stop_vpn | ||
62 | echo -n " $NAME" | ||
63 | else | ||
64 | echo -n " No such VPN: $2" | ||
65 | fi | ||
66 | fi | ||
67 | echo "." | ||
68 | ;; | ||
69 | # We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'. | ||
70 | reload|force-reload) | ||
71 | echo -n "Reloading openvpn:" | ||
72 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
73 | NAME=`echo $PIDFILE | cut -c18-` | ||
74 | NAME=${NAME%%.pid} | ||
75 | # If openvpn if running under a different user than root we'll need to restart | ||
76 | if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then | ||
77 | stop_vpn | ||
78 | sleep 1 | ||
79 | start_vpn | ||
80 | echo -n "(restarted)" | ||
81 | else | ||
82 | kill -HUP `cat $PIDFILE` || true | ||
83 | # start-stop-daemon --stop --signal HUP --quiet --oknodo \ | ||
84 | # --exec $DAEMON --pidfile $PIDFILE | ||
85 | echo -n " $NAME" | ||
86 | fi | ||
87 | done | ||
88 | echo "." | ||
89 | ;; | ||
90 | |||
91 | restart) | ||
92 | $0 stop $2 | ||
93 | sleep 1 | ||
94 | $0 start $2 | ||
95 | ;; | ||
96 | *) | ||
97 | echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2 | ||
98 | exit 1 | ||
99 | ;; | ||
100 | esac | ||
101 | |||
102 | exit 0 | ||
103 | |||
104 | # vim:set ai et sts=2 sw=2 tw=0: | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn_2.3.4.bb b/meta-networking/recipes-support/openvpn/openvpn_2.3.4.bb new file mode 100644 index 000000000..1fb722a44 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn_2.3.4.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "A full-featured SSL VPN solution via tun device." | ||
2 | HOMEPAGE = "http://openvpn.sourceforge.net" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=5aac200199fde47501876cba7263cb0c" | ||
6 | DEPENDS = "lzo openssl iproute2 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
7 | |||
8 | inherit autotools | ||
9 | |||
10 | SRC_URI = "http://swupdate.openvpn.org/community/releases/openvpn-${PV}.tar.gz \ | ||
11 | file://openvpn" | ||
12 | |||
13 | SRC_URI[md5sum] = "04d47237907faabe9d046970ffe44b2e" | ||
14 | SRC_URI[sha256sum] = "af506d5f48568fa8d2f2435cb3fad35f9a9a8f263999ea6df3ba296960cec85a" | ||
15 | |||
16 | CFLAGS += "-fno-inline" | ||
17 | |||
18 | # I want openvpn to be able to read password from file (hrw) | ||
19 | EXTRA_OECONF += "--enable-password-save --enable-iproute2" | ||
20 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}" | ||
21 | |||
22 | # Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host. | ||
23 | EXTRA_OECONF += "IPROUTE=/sbin/ip" | ||
24 | |||
25 | do_install_append() { | ||
26 | install -d ${D}/${sysconfdir}/init.d | ||
27 | install -d ${D}/${sysconfdir}/openvpn | ||
28 | install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d | ||
29 | } | ||
30 | |||
31 | RRECOMMENDS_${PN} = "kernel-module-tun" | ||
32 | |||
33 | FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug" | ||
diff --git a/meta-networking/recipes-support/pimd/pimd_2.1.8.bb b/meta-networking/recipes-support/pimd/pimd_2.1.8.bb new file mode 100644 index 000000000..f0323618d --- /dev/null +++ b/meta-networking/recipes-support/pimd/pimd_2.1.8.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "pimd is a lightweight stand-alone PIM-SM v2 multicast routing daemon." | ||
2 | HOMEPAGE = "http://troglobit.com/pimd.html" | ||
3 | LICENSE = "BSD-3-Clause" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94f108f91fab720d62425770b70dd790" | ||
5 | |||
6 | SRC_URI = "ftp://troglobit.com/pimd/${BP}.tar.bz2" | ||
7 | SRC_URI[md5sum] = "a12448bc7c9bfcebf51a13ebf1ffa962" | ||
8 | SRC_URI[sha256sum] = "01016940543a0a6131d4e6c91b595d47e187012c59a298eec14c3dbc38564b3a" | ||
9 | |||
10 | CFLAGS += "-I ${S}/include " | ||
11 | |||
12 | do_install() { | ||
13 | unset datadir | ||
14 | unset mandir | ||
15 | oe_runmake 'DESTDIR=${D}' install | ||
16 | } | ||
17 | |||
diff --git a/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb b/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb new file mode 100644 index 000000000..06d6d28fa --- /dev/null +++ b/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb | |||
@@ -0,0 +1,10 @@ | |||
1 | SUMMARY = "ssmping is a tool for checking whether one can receive SSM from a given host" | ||
2 | HOMEPAGE = "http://www.venaas.no/multicast/ssmping/" | ||
3 | LICENSE = "ISC" | ||
4 | LIC_FILES_CHKSUM = "file://asmping.c;beginline=2;endline=11;md5=1ca8d1a1ca931e5cfe604ebf20a78b71" | ||
5 | |||
6 | SRC_URI = "http://www.venaas.no/multicast/ssmping/${BP}.tar.gz" | ||
7 | SRC_URI[md5sum] = "ad8e3d13f6d72918f73be7e7975d7fad" | ||
8 | SRC_URI[sha256sum] = "22103a37eaa28489169a0927bc01e0596c3485fc4d29fc8456c07fd2c70fca6d" | ||
9 | |||
10 | CFLAGS += "-D_GNU_SOURCE " | ||
diff --git a/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch b/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch new file mode 100644 index 000000000..da96983e6 --- /dev/null +++ b/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch | |||
@@ -0,0 +1,98 @@ | |||
1 | fix the function parameter | ||
2 | |||
3 | Upstream-Status: pending | ||
4 | |||
5 | Original openssl_diffie_hellman_create has three parameters, but | ||
6 | it is reassigned a function pointer which has one parameter, and | ||
7 | is called with one parameter, which will lead to segment fault | ||
8 | on PPC, Now we simply correct the number of parameters. | ||
9 | |||
10 | #0 0x484d4aa0 in __GI_raise (sig=6) | ||
11 | at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 | ||
12 | #1 0x484d9930 in __GI_abort () at abort.c:91 | ||
13 | #2 0x10002064 in segv_handler (signal=11) at charon.c:224 | ||
14 | #3 <signal handler called> | ||
15 | #4 0x48d89630 in openssl_diffie_hellman_create (group=MODP_1024_BIT, g=..., | ||
16 | p=<error reading variable: Cannot access memory at address 0x0>) | ||
17 | at openssl_diffie_hellman.c:143 | ||
18 | #5 0x482c54f8 in create_dh (this=0x11ac6e68, group=MODP_1024_BIT) | ||
19 | at crypto/crypto_factory.c:358 | ||
20 | #6 0x48375884 in create_dh (this=<optimized out>, group=<optimized out>) | ||
21 | at sa/keymat.c:132 | ||
22 | #7 0x483843b8 in process_payloads (this=0x51400a78, message=<optimized | ||
23 | out>) | ||
24 | at sa/tasks/ike_init.c:200 | ||
25 | #8 0x483844d0 in process_r (this=0x51400a78, message=0x51500778) | ||
26 | at sa/tasks/ike_init.c:319 | ||
27 | #9 0x48374c9c in process_request (message=0x51500778, this=0x51400d20) | ||
28 | at sa/task_manager.c:870 | ||
29 | #10 process_message (this=0x51400d20, msg=0x51500778) at | ||
30 | sa/task_manager.c:925 | ||
31 | #11 0x4836c378 in process_message (this=0x514005f0, message=0x51500778) | ||
32 | at sa/ike_sa.c:1317 | ||
33 | #12 0x48362270 in execute (this=0x515008d0) | ||
34 | at processing/jobs/process_message_job.c:74 | ||
35 | |||
36 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
37 | --- | ||
38 | src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | 8 +++++++- | ||
39 | src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | 4 +++- | ||
40 | src/libstrongswan/plugins/openssl/openssl_plugin.c | 1 + | ||
41 | 3 files changed, 11 insertions(+), 2 deletions(-) | ||
42 | |||
43 | diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
44 | index ff33824..bd21446 100644 | ||
45 | --- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
46 | +++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
47 | @@ -142,7 +142,7 @@ METHOD(diffie_hellman_t, destroy, void, | ||
48 | /* | ||
49 | * Described in header. | ||
50 | */ | ||
51 | -openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
52 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom( | ||
53 | diffie_hellman_group_t group, chunk_t g, chunk_t p) | ||
54 | { | ||
55 | private_openssl_diffie_hellman_t *this; | ||
56 | @@ -197,5 +197,11 @@ openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
57 | |||
58 | return &this->public; | ||
59 | } | ||
60 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create( diffie_hellman_group_t group) | ||
61 | +{ | ||
62 | + chunk_t g; | ||
63 | + chunk_t p; | ||
64 | + openssl_diffie_hellman_create_custom(group, g, p); | ||
65 | +} | ||
66 | |||
67 | #endif /* OPENSSL_NO_DH */ | ||
68 | diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
69 | index 53dc59c..eb69eaa 100644 | ||
70 | --- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
71 | +++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
72 | @@ -44,8 +44,10 @@ struct openssl_diffie_hellman_t { | ||
73 | * @param p custom prime, if MODP_CUSTOM | ||
74 | * @return openssl_diffie_hellman_t object, NULL if not supported | ||
75 | */ | ||
76 | -openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
77 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom( | ||
78 | diffie_hellman_group_t group, chunk_t g, chunk_t p); | ||
79 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
80 | + diffie_hellman_group_t group); | ||
81 | |||
82 | #endif /** OPENSSL_DIFFIE_HELLMAN_H_ @}*/ | ||
83 | |||
84 | diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
85 | index ff25086..c76873d 100644 | ||
86 | --- a/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
87 | +++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
88 | @@ -388,6 +388,7 @@ METHOD(plugin_t, get_features, int, | ||
89 | PLUGIN_PROVIDE(DH, MODP_1024_BIT), | ||
90 | PLUGIN_PROVIDE(DH, MODP_1024_160), | ||
91 | PLUGIN_PROVIDE(DH, MODP_768_BIT), | ||
92 | + PLUGIN_REGISTER(DH, openssl_diffie_hellman_create_custom), | ||
93 | PLUGIN_PROVIDE(DH, MODP_CUSTOM), | ||
94 | #endif | ||
95 | #ifndef OPENSSL_NO_RSA | ||
96 | -- | ||
97 | 1.8.3 | ||
98 | |||
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.2.0.bb b/meta-networking/recipes-support/strongswan/strongswan_5.2.0.bb new file mode 100644 index 000000000..0997fd03c --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan_5.2.0.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \ | ||
2 | Linux operating system." | ||
3 | SUMMARY = "strongSwan is an OpenSource IPsec implementation" | ||
4 | HOMEPAGE = "http://www.strongswan.org" | ||
5 | SECTION = "console/network" | ||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
8 | DEPENDS = "gmp openssl flex-native flex bison-native" | ||
9 | |||
10 | SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \ | ||
11 | file://fix-funtion-parameter.patch \ | ||
12 | " | ||
13 | |||
14 | SRC_URI[md5sum] = "5cee4ee1a6ccb74400758b3ace54d46e" | ||
15 | SRC_URI[sha256sum] = "b00c30bd2e60ff2e5fc85f54bbad54fe246585812fdf212dbe777a5258da26ce" | ||
16 | |||
17 | EXTRA_OECONF = "--enable-gmp \ | ||
18 | --enable-openssl \ | ||
19 | --without-lib-prefix \ | ||
20 | " | ||
21 | |||
22 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | ||
23 | |||
24 | PACKAGECONFIG ??= "sqlite3 curl \ | ||
25 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
26 | " | ||
27 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3," | ||
28 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap," | ||
29 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl," | ||
30 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4," | ||
31 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," | ||
32 | |||
33 | inherit autotools systemd pkgconfig | ||
34 | |||
35 | RRECOMMENDS_${PN} = "kernel-module-ipsec" | ||
36 | |||
37 | FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so" | ||
38 | FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug" | ||
39 | FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la" | ||
40 | FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a" | ||
41 | |||
42 | RPROVIDES_${PN} += "${PN}-systemd" | ||
43 | RREPLACES_${PN} += "${PN}-systemd" | ||
44 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
45 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" | ||
diff --git a/meta-networking/recipes-support/stunnel/stunnel_4.56.bb b/meta-networking/recipes-support/stunnel/stunnel_4.56.bb new file mode 100644 index 000000000..74f2234f0 --- /dev/null +++ b/meta-networking/recipes-support/stunnel/stunnel_4.56.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | SUMMARY = "Program for providing universal TLS/SSL tunneling service" | ||
2 | DESCRIPTION = "SSL encryption wrapper between remote client and local (inetd-startable) or remote server." | ||
3 | SECTION = "net" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=f41ebed8571077706fee0b860c4d6666" | ||
6 | DEPENDS = "openssl zlib tcp-wrappers" | ||
7 | |||
8 | RDEPENDS_${PN} += "perl" | ||
9 | |||
10 | SRC_URI = "https://www.stunnel.org/downloads/archive/4.x/${BP}.tar.gz" | ||
11 | |||
12 | SRC_URI[md5sum] = "ac4c4a30bd7a55b6687cbd62d864054c" | ||
13 | SRC_URI[sha256sum] = "9cae2cfbe26d87443398ce50d7d5db54e5ea363889d5d2ec8d2778a01c871293" | ||
14 | |||
15 | inherit autotools | ||
16 | |||
17 | EXTRA_OECONF += "--with-ssl='${STAGING_EXECPREFIXDIR}' --disable-fips" | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/add-ptest.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/add-ptest.patch new file mode 100644 index 000000000..358f6050f --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/add-ptest.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 7b259580800e259d232229dc89f97058b56e2fe8 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Hongjun.Yang" <hongjun.yang@windriver.com> | ||
3 | Date: Wed, 22 Oct 2014 10:02:48 +0800 | ||
4 | Subject: [PATCH] Add ptest for tcpdump | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com> | ||
9 | --- | ||
10 | Makefile.in | 10 +++++++++- | ||
11 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/Makefile.in b/Makefile.in | ||
14 | index 8c35a45..4fb8ae6 100644 | ||
15 | --- a/Makefile.in | ||
16 | +++ b/Makefile.in | ||
17 | @@ -428,9 +428,17 @@ distclean: | ||
18 | tests/failure-outputs.txt | ||
19 | rm -rf autom4te.cache tests/DIFF tests/NEW | ||
20 | |||
21 | -check: tcpdump | ||
22 | +buildtest-TESTS: tcpdump | ||
23 | + | ||
24 | +runtest-PTEST: | ||
25 | (cd tests && ./TESTrun.sh) | ||
26 | |||
27 | +install-ptest: | ||
28 | + cp -r tests $(DESTDIR) | ||
29 | + cp -r config.h $(DESTDIR) | ||
30 | + install -m 0755 Makefile $(DESTDIR) | ||
31 | + ln -sf /usr/sbin/tcpdump $(DESTDIR)/tcpdump | ||
32 | + | ||
33 | tags: $(TAGFILES) | ||
34 | ctags -wtd $(TAGFILES) | ||
35 | |||
36 | -- | ||
37 | 1.9.1 | ||
38 | |||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/configure.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/configure.patch new file mode 100644 index 000000000..3697420fd --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/configure.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- | ||
2 | aclocal.m4 | 1 - | ||
3 | configure.in | 1 + | ||
4 | 2 files changed, 1 insertions(+), 1 deletions(-) | ||
5 | |||
6 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
7 | index 40b5866..0c662b0 100644 | ||
8 | --- a/aclocal.m4 | ||
9 | +++ b/aclocal.m4 | ||
10 | @@ -40,7 +40,6 @@ dnl | ||
11 | AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC, | ||
12 | [AC_PREREQ(2.50) | ||
13 | AC_BEFORE([$0], [AC_LBL_C_INIT]) | ||
14 | - AC_BEFORE([$0], [AC_PROG_CC]) | ||
15 | AC_BEFORE([$0], [AC_LBL_FIXINCLUDES]) | ||
16 | AC_BEFORE([$0], [AC_LBL_DEVEL]) | ||
17 | AC_ARG_WITH(gcc, [ --without-gcc don't use gcc]) | ||
18 | diff --git a/configure.in b/configure.in | ||
19 | index 11257c9..7f9591c 100644 | ||
20 | --- a/configure.in | ||
21 | +++ b/configure.in | ||
22 | @@ -19,6 +19,7 @@ AC_REVISION($Revision: 1.204 $) | ||
23 | AC_PREREQ(2.50) | ||
24 | AC_INIT(tcpdump.c) | ||
25 | |||
26 | +AC_PROG_CC | ||
27 | AC_CANONICAL_HOST | ||
28 | |||
29 | AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS) | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/run-ptest b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/run-ptest new file mode 100755 index 000000000..c03a8b8ef --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/run-ptest | |||
@@ -0,0 +1,5 @@ | |||
1 | #!/bin/sh | ||
2 | make -k runtest-PTEST | sed -e '/: passed/ s/^/PASS: /g' \ | ||
3 | -e '/: failed/ s/^/FAIL: /g' \ | ||
4 | -e 's/: passed//g' \ | ||
5 | -e 's/: failed//g' | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-configure-dlpi.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-configure-dlpi.patch new file mode 100644 index 000000000..50e2d5439 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-configure-dlpi.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | [PATCH] tcpdump: cross-compiling not check dlpi. | ||
2 | |||
3 | For cross-compiling on Linux platforms, we do not need to check libdlpi | ||
4 | since it is only placed on Solaris. | ||
5 | Also, checking libdlpi in native /lib would cause do_qa_configure fail. | ||
6 | |||
7 | Upstream-Status: Pending. | ||
8 | |||
9 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
10 | --- | ||
11 | configure.in | 4 +++- | ||
12 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/configure.in b/configure.in | ||
15 | index 7f9591c..ca277c0 100644 | ||
16 | --- a/configure.in | ||
17 | +++ b/configure.in | ||
18 | @@ -716,7 +716,9 @@ don't.]) | ||
19 | fi | ||
20 | |||
21 | # libdlpi is needed for Solaris 11 and later. | ||
22 | -AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib) | ||
23 | +if test "$cross_compiling" != yes; then | ||
24 | + AC_CHECK_LIB(dlpi, dlpi_walk, LIBS="$LIBS -ldlpi" LDFLAGS="-L/lib $LDFLAGS", ,-L/lib) | ||
25 | +fi | ||
26 | |||
27 | dnl portability macros for getaddrinfo/getnameinfo | ||
28 | dnl | ||
29 | -- | ||
30 | 1.7.5.4 | ||
31 | |||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-cross-getaddrinfo.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-cross-getaddrinfo.patch new file mode 100644 index 000000000..b414b72e9 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/tcpdump-cross-getaddrinfo.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Fix getaddinfo check when cross compiling | ||
2 | |||
3 | Upstream-Status: Pending. | ||
4 | |||
5 | AC_TRY_RUN defaults to td_cv_buggygetaddrinfo=yes when | ||
6 | cross-compiling. So this change indicates that we | ||
7 | are cross-compiling. | ||
8 | |||
9 | Signed-of-by: Aws Ismail <aws.ismail@windriver.com> | ||
10 | |||
11 | diff --git a/configure.in b/configure.in | ||
12 | index ca277c0..283035e 100644 | ||
13 | --- a/configure.in | ||
14 | +++ b/configure.in | ||
15 | @@ -434,7 +434,7 @@ main() | ||
16 | ], | ||
17 | td_cv_buggygetaddrinfo=no, | ||
18 | td_cv_buggygetaddrinfo=yes, | ||
19 | - td_cv_buggygetaddrinfo=yes)]) | ||
20 | + td_cv_buggygetaddrinfo=cross)]) | ||
21 | if test "$td_cv_buggygetaddrinfo" = no; then | ||
22 | AC_MSG_RESULT(good) | ||
23 | else | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/unnecessary-to-check-libpcap.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/unnecessary-to-check-libpcap.patch new file mode 100644 index 000000000..d7a3ac23b --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.6.1/unnecessary-to-check-libpcap.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | unnecessary to check libpcap | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | since the check of libpcap did not consider the cross-compile, lead to the | ||
6 | below error: | ||
7 | This autoconf log indicates errors, it looked at host include and/or | ||
8 | library paths while determining system capabilities. | ||
9 | |||
10 | In fact, the libpcap has been added into the tcpdump's DEPENDS, not need to | ||
11 | check if libpcap existed. | ||
12 | |||
13 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
14 | --- | ||
15 | configure.in | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/configure.in b/configure.in | ||
19 | index 06fade1..9125de7 100644 | ||
20 | --- a/configure.in | ||
21 | +++ b/configure.in | ||
22 | @@ -567,7 +567,7 @@ AC_SEARCH_LIBS(getrpcbynumber, nsl, | ||
23 | dnl AC_CHECK_LIB(z, uncompress) | ||
24 | dnl AC_CHECK_HEADERS(zlib.h) | ||
25 | |||
26 | -AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) | ||
27 | +#AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS) | ||
28 | |||
29 | # | ||
30 | # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate | ||
31 | -- | ||
32 | 1.7.9.5 | ||
33 | |||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump_4.6.1.bb b/meta-networking/recipes-support/tcpdump/tcpdump_4.6.1.bb new file mode 100644 index 000000000..1fdaf308d --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump_4.6.1.bb | |||
@@ -0,0 +1,51 @@ | |||
1 | SUMMARY = "A sophisticated network protocol analyzer" | ||
2 | HOMEPAGE = "http://www.tcpdump.org/" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867" | ||
5 | SECTION = "console/network" | ||
6 | DEPENDS = "libpcap" | ||
7 | |||
8 | SRC_URI = " \ | ||
9 | http://www.tcpdump.org/release/${BP}.tar.gz \ | ||
10 | file://configure.patch \ | ||
11 | file://unnecessary-to-check-libpcap.patch \ | ||
12 | file://tcpdump-configure-dlpi.patch \ | ||
13 | file://tcpdump-cross-getaddrinfo.patch \ | ||
14 | file://add-ptest.patch \ | ||
15 | file://run-ptest \ | ||
16 | " | ||
17 | SRC_URI[md5sum] = "dab267ec30216a069747d10314079ec7" | ||
18 | SRC_URI[sha256sum] = "4c88c2a9aeb4047074f344fc9b2b6577b219972d359e192f6d12ccf983a13fd7" | ||
19 | export LIBS=" -lpcap" | ||
20 | |||
21 | inherit autotools-brokensep ptest | ||
22 | CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}" | ||
23 | |||
24 | PACKAGECONFIG ??= "openssl ipv6" | ||
25 | PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl" | ||
26 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6," | ||
27 | |||
28 | EXTRA_AUTORECONF += " -I m4" | ||
29 | |||
30 | do_configure_prepend() { | ||
31 | mkdir -p ${S}/m4 | ||
32 | if [ -f aclocal.m4 ]; then | ||
33 | mv aclocal.m4 ${S}/m4 | ||
34 | fi | ||
35 | # AC_CHECK_LIB(dlpi.. was looking to host /lib | ||
36 | sed -i 's:-L/lib::g' ./configure.in | ||
37 | } | ||
38 | do_configure_append() { | ||
39 | sed -i 's:-L/usr/lib::' ./Makefile | ||
40 | sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile | ||
41 | sed -i 's:-I/usr/include::' ./Makefile | ||
42 | } | ||
43 | |||
44 | do_install_append() { | ||
45 | # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0 | ||
46 | rm -f ${D}${sbindir}/tcpdump.${PV} | ||
47 | } | ||
48 | |||
49 | do_compile_ptest() { | ||
50 | oe_runmake buildtest-TESTS | ||
51 | } | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch new file mode 100644 index 000000000..386b7f83a --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] | ||
2 | |||
3 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
4 | |||
5 | --- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200 | ||
6 | +++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200 | ||
7 | @@ -53,7 +53,7 @@ | ||
8 | /* Size of a packet header in bytes; easier than typing the sizeof() all | ||
9 | * the time ... | ||
10 | */ | ||
11 | -#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr )) | ||
12 | +#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr )) | ||
13 | |||
14 | extern int snaplen; | ||
15 | |||
16 | @@ -111,16 +111,24 @@ | ||
17 | static void | ||
18 | extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr ) | ||
19 | { | ||
20 | - memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr)); | ||
21 | + struct pcap_sf_pkthdr hdri; | ||
22 | + | ||
23 | + memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr)); | ||
24 | |||
25 | if ( pcap_is_swapped( p ) ) | ||
26 | { | ||
27 | - hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec); | ||
28 | - hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec); | ||
29 | - hdr->len = SWAPLONG(hdr->len); | ||
30 | - hdr->caplen = SWAPLONG(hdr->caplen); | ||
31 | + hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec); | ||
32 | + hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec); | ||
33 | + hdr->len = SWAPLONG(hdri.len); | ||
34 | + hdr->caplen = SWAPLONG(hdri.caplen); | ||
35 | + } | ||
36 | + else | ||
37 | + { | ||
38 | + hdr->ts.tv_sec = hdri.ts.tv_sec; | ||
39 | + hdr->ts.tv_usec = hdri.ts.tv_usec; | ||
40 | + hdr->len = hdri.len; | ||
41 | + hdr->caplen = hdri.caplen; | ||
42 | } | ||
43 | - | ||
44 | /* | ||
45 | * From bpf/libpcap/savefile.c: | ||
46 | * | ||
47 | --- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100 | ||
48 | +++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200 | ||
49 | @@ -20,6 +20,26 @@ | ||
50 | */ | ||
51 | |||
52 | |||
53 | +#include <time.h> | ||
54 | +/* #include <net/bpf.h> */ | ||
55 | + | ||
56 | +/* | ||
57 | + * This is a timeval as stored in disk in a dumpfile. | ||
58 | + * It has to use the same types everywhere, independent of the actual | ||
59 | + * `struct timeval' | ||
60 | + */ | ||
61 | + | ||
62 | +struct pcap_timeval { | ||
63 | + bpf_int32 tv_sec; /* seconds */ | ||
64 | + bpf_int32 tv_usec; /* microseconds */ | ||
65 | +}; | ||
66 | + | ||
67 | +struct pcap_sf_pkthdr { | ||
68 | + struct pcap_timeval ts; /* time stamp */ | ||
69 | + bpf_u_int32 caplen; /* length of portion present */ | ||
70 | + bpf_u_int32 len; /* length this packet (off wire) */ | ||
71 | +}; | ||
72 | + | ||
73 | time_t gwtm2secs( struct tm *tm ); | ||
74 | |||
75 | int sf_find_end( struct pcap *p, struct timeval *first_timestamp, | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch new file mode 100644 index 000000000..0a7359311 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm] | ||
2 | |||
3 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
4 | diff -ur tcpdump-3.8.1/tcpslice/tcpslice.c tcpdump-3.8.1.new/tcpslice/tcpslice.c | ||
5 | --- tcpslice/tcpslice.c 2004-01-15 17:35:53.000000000 +0100 | ||
6 | +++ tcpslice/tcpslice.c 2004-01-15 16:12:57.000000000 +0100 | ||
7 | @@ -35,7 +35,7 @@ | ||
8 | #include <sys/file.h> | ||
9 | #include <sys/stat.h> | ||
10 | |||
11 | -#include <net/bpf.h> | ||
12 | +/* #include <net/bpf.h> */ | ||
13 | |||
14 | #include <ctype.h> | ||
15 | #ifdef HAVE_FCNTL_H | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb b/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb new file mode 100644 index 000000000..203d143b5 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "tcpslice" | ||
2 | DESCRIPTION = "A tool for extracting parts of a tcpdump packet trace." | ||
3 | HOMEPAGE = "http://www.tcpdump.org/related.html" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | LICENSE = "BSD-4-Clause" | ||
7 | LIC_FILES_CHKSUM = "file://tcpslice.c;endline=20;md5=99519e2e5234d1662a4ce16baa62c64e" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.ee.lbl.gov/${BP}.tar.gz \ | ||
10 | file://tcpslice-1.2a3-time.patch \ | ||
11 | file://tcpslice-CVS.20010207-bpf.patch \ | ||
12 | " | ||
13 | SRC_URI[md5sum] = "e329cbeb7e589f132d92c3447c477190" | ||
14 | SRC_URI[sha256sum] = "4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840" | ||
15 | |||
16 | inherit autotools-brokensep | ||
17 | |||
18 | DEPENDS += "libpcap" | ||
19 | |||
20 | # We do not want to autoreconf. We must specify srcdir as ".". | ||
21 | # We have to set the ac_cv_* cache variables as well as pass the normal | ||
22 | # cross-compilation options to configure! | ||
23 | # | ||
24 | do_configure () { | ||
25 | oe_runconf \ | ||
26 | --srcdir="." \ | ||
27 | ac_cv_build=${BUILD_SYS} \ | ||
28 | ac_cv_host=${HOST_SYS} \ | ||
29 | ac_cv_target=${HOST_SYS} | ||
30 | } | ||
31 | |||
32 | do_install_prepend () { | ||
33 | mkdir -p ${D}/usr/sbin | ||
34 | } | ||
35 | |||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch new file mode 100755 index 000000000..a856b1809 --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | --- a/configure.ac | ||
6 | +++ b/configure.ac | ||
7 | @@ -402,7 +402,6 @@ | ||
8 | |||
9 | dnl 0.9.6 (which is still thinks it is 0.9.5 due to a bug) introduces an important | ||
10 | dnl fix for OSX. See: http://tcpreplay.synfin.net/trac/ticket/167 | ||
11 | -libpcap_version_096=no | ||
12 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
13 | #include <string.h> | ||
14 | #include <stdlib.h> | ||
15 | @@ -419,11 +418,12 @@ | ||
16 | exit(0); | ||
17 | |||
18 | exit(1); | ||
19 | -]]), [ | ||
20 | - libpcap_version_096=yes | ||
21 | -]) | ||
22 | +]]), | ||
23 | + [libpcap_version_096=yes], | ||
24 | + [libpcap_version_096=no], | ||
25 | + [libpcap_version_096=yes] | ||
26 | +) | ||
27 | |||
28 | -libpcap_ver8=no | ||
29 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
32 | @@ -444,13 +444,12 @@ | ||
33 | exit(0); | ||
34 | |||
35 | exit(1); | ||
36 | -]]), [ | ||
37 | - libpcap_ver8=yes | ||
38 | -], [ | ||
39 | - libpcap_ver8=no | ||
40 | -]) | ||
41 | +]]), | ||
42 | + [libpcap_ver8=yes], | ||
43 | + [libpcap_ver8=no], | ||
44 | + [libpcap_ver8=yes] | ||
45 | +) | ||
46 | |||
47 | -libpcap_ver7=no | ||
48 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
49 | #include <string.h> | ||
50 | #include <stdlib.h> | ||
51 | @@ -469,11 +468,11 @@ | ||
52 | exit(0); | ||
53 | |||
54 | exit(1); | ||
55 | -]]), [ | ||
56 | - libpcap_ver7=yes | ||
57 | -], [ | ||
58 | - libpcap_ver7=no | ||
59 | -]) | ||
60 | +]]), | ||
61 | + [libpcap_ver7=yes], | ||
62 | + [libpcap_ver7=no], | ||
63 | + [libpcap_ver7=yes] | ||
64 | +) | ||
65 | |||
66 | if test x$libpcap_ver8 = xyes ; then | ||
67 | AC_MSG_RESULT(>= 0.8.0) | ||
68 | @@ -761,8 +760,8 @@ | ||
69 | |||
70 | have_bpf=no | ||
71 | dnl Check for BSD's BPF | ||
72 | -AC_MSG_CHECKING(for BPF device sending support) | ||
73 | -AC_TRY_RUN([ | ||
74 | +AC_CACHE_CHECK([for BPF device sending support], ac_cv_have_bpf, | ||
75 | +[AC_TRY_RUN([ | ||
76 | #include <stdio.h> | ||
77 | #include <stdlib.h> | ||
78 | #include <sys/types.h> | ||
79 | @@ -796,8 +795,11 @@ | ||
80 | [Do we have BPF device support?]) | ||
81 | AC_MSG_RESULT(yes) | ||
82 | have_bpf=yes | ||
83 | -],[ | ||
84 | - AC_MSG_RESULT(no) | ||
85 | +], | ||
86 | +[AC_MSG_RESULT(no)], | ||
87 | +[AC_MSG_ERROR([cross-compiling, | ||
88 | + presetting ac_cv_have_bpf=(yes|no) will help])] | ||
89 | +) | ||
90 | ]) | ||
91 | |||
92 | |||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch new file mode 100644 index 000000000..5f36c68c9 --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | Index: tcpreplay-3.4.4/configure.ac | ||
6 | =================================================================== | ||
7 | --- tcpreplay-3.4.4.orig/configure.ac | ||
8 | +++ tcpreplay-3.4.4/configure.ac | ||
9 | @@ -389,7 +389,7 @@ CFLAGS="$CFLAGS -I$LPCAPINCDIR" | ||
10 | AC_SEARCH_LIBS([pcap_close], [pcap], | ||
11 | LPCAPLIB="$LIBS", | ||
12 | AC_ERROR([Unable to link libpcap in ${foundpcap}]), | ||
13 | - -lnl) | ||
14 | + -lnl-3) | ||
15 | |||
16 | AC_SUBST(LPCAPINC) | ||
17 | AC_SUBST(LPCAPLIB) | ||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch new file mode 100644 index 000000000..3c11c922b --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | --- a/configure.ac | ||
6 | +++ b/configure.ac | ||
7 | @@ -758,6 +758,8 @@ | ||
8 | AC_MSG_RESULT(no) | ||
9 | ]) | ||
10 | |||
11 | +ac_cv_have_bpf=no | ||
12 | + | ||
13 | have_bpf=no | ||
14 | dnl Check for BSD's BPF | ||
15 | AC_CACHE_CHECK([for BPF device sending support], ac_cv_have_bpf, | ||
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb b/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb new file mode 100644 index 000000000..4bce270e4 --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "Use previously captured traffic to test network devices" | ||
2 | |||
3 | HOMEPAGE = "http://tcpreplay.synfin.net/" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | LICENSE = "GPLv3" | ||
7 | LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=c33cccf72cc1603e8a72a84811ae3ac8" | ||
8 | |||
9 | SRC_URI = "http://prdownloads.sourceforge.net/tcpreplay/${PV}/tcpreplay-${PV}.tar.gz \ | ||
10 | file://tcpreplay-3.4.4-cross-compile.patch \ | ||
11 | file://tcpreplay-3.4.4-no-bfp-support.patch \ | ||
12 | file://tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch \ | ||
13 | " | ||
14 | SRC_URI[md5sum] = "22725feb9b2590809f9350308ec65180" | ||
15 | SRC_URI[sha256sum] = "7a809c58ddec86407fd6e5597ac883d7874a19bea81d716bb2b1c6e3b0e7b58f" | ||
16 | |||
17 | DEPENDS = "libpcap" | ||
18 | |||
19 | EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr" | ||
20 | |||
21 | inherit siteinfo autotools-brokensep | ||
22 | |||
diff --git a/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch b/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch new file mode 100644 index 000000000..1bda576bc --- /dev/null +++ b/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | [PATCH] Update configure.ac and Makefile.am to resolve warnings/errors | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure.ac | 2 ++ | ||
8 | libnetbsd/Makefile.am | 2 +- | ||
9 | 2 files changed, 3 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/configure.ac b/configure.ac | ||
12 | index a96d2ab..b3b3069 100644 | ||
13 | --- a/configure.ac | ||
14 | +++ b/configure.ac | ||
15 | @@ -71,9 +71,11 @@ AH_TEMPLATE([WITH_SSL], | ||
16 | # | ||
17 | # Checks for programs. | ||
18 | # | ||
19 | +AM_PROG_AR() | ||
20 | AC_PROG_CC() | ||
21 | AC_PROG_AWK() | ||
22 | AC_PROG_LIBTOOL() | ||
23 | +AM_PROG_CC_C_O() | ||
24 | |||
25 | # | ||
26 | # Checks for tool features. | ||
27 | diff --git a/libnetbsd/Makefile.am b/libnetbsd/Makefile.am | ||
28 | index 3e5c3ce..39bb12d 100644 | ||
29 | --- a/libnetbsd/Makefile.am | ||
30 | +++ b/libnetbsd/Makefile.am | ||
31 | @@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libnetbsd.la | ||
32 | libnetbsd_la_SOURCES = | ||
33 | |||
34 | |||
35 | -CPPFLAGS = \ | ||
36 | +AM_CPPFLAGS = \ | ||
37 | -I$(srcdir) \ | ||
38 | -I$(top_srcdir) \ | ||
39 | -I$(top_builddir) | ||
40 | -- | ||
41 | 1.7.10.4 | ||
42 | |||
diff --git a/meta-networking/recipes-support/tnftp/tnftp_20130505.bb b/meta-networking/recipes-support/tnftp/tnftp_20130505.bb new file mode 100644 index 000000000..eda9d5c0f --- /dev/null +++ b/meta-networking/recipes-support/tnftp/tnftp_20130505.bb | |||
@@ -0,0 +1,36 @@ | |||
1 | SUMMARY = "Enhanced NetBSD ftp client" | ||
2 | DESCRIPTION = "tnftp (formerly known as lukemftp) is a port of the NetBSD FTP client \ | ||
3 | to other systems. It offers many enhancements over the traditional \ | ||
4 | BSD FTP client, including command-line editing, command-line fetches \ | ||
5 | of FTP and HTTP URLs (including via proxies), command-line uploads of \ | ||
6 | FTP URLs, context-sensitive word completion, dynamic progress bar, \ | ||
7 | IPv6 support, modification time preservation, paging of local and \ | ||
8 | remote files, passive mode support (with fallback to active mode), \ | ||
9 | SOCKS support, TIS FWTK gate-ftp server support, and transfer rate \ | ||
10 | throttling." | ||
11 | |||
12 | SECTION = "console/network" | ||
13 | LICENSE = "BSD-4-Clause" | ||
14 | |||
15 | DEPENDS = "ncurses" | ||
16 | |||
17 | SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/${BPN}-${PV}.tar.gz \ | ||
18 | file://tnftp-autotools.patch \ | ||
19 | " | ||
20 | |||
21 | inherit autotools update-alternatives pkgconfig | ||
22 | |||
23 | ALTERNATIVE_PRIORITY = "100" | ||
24 | |||
25 | ALTERNATIVE_${PN} = "ftp" | ||
26 | ALTERNATIVE_LINK_NAME_${PN} = "${bindir}/ftp" | ||
27 | ALTERNATIVE_TARGET_${PN} = "${bindir}/tnftp" | ||
28 | |||
29 | FILES_${PN} = "${bindir}/tnftp" | ||
30 | |||
31 | LIC_FILES_CHKSUM = "file://COPYING;md5=6d6796cb166a9bb050958241dad9479e" | ||
32 | SRC_URI[md5sum] = "66e218d02ec7d9fc39ab70ba2900305a" | ||
33 | SRC_URI[sha256sum] = "6f650e25f6fd51538f677b789b49379f367ae9f1dee74c94cfe24d92abc2cffb" | ||
34 | |||
35 | PACKAGECONFIG ?= "openssl" | ||
36 | PACKAGECONFIG[openssl] = "--enable-ssl, --disable-ssl --with-ssl=no, openssl" | ||
diff --git a/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch b/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch new file mode 100644 index 000000000..2c030b55d --- /dev/null +++ b/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From e273e0ebc753645555909bcc4874c72458b17891 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Fri, 17 Jan 2014 03:17:44 -0500 | ||
4 | Subject: [PATCH] Make.rules: filter-out the patches from subdirs | ||
5 | |||
6 | The $(subdirs) contains all the dirs under the ${B}, and this one: | ||
7 | |||
8 | do_unpack[cleandirs] = "${S}/patches" | ||
9 | |||
10 | will create a "patches" dir, then there will be compile errors, filter | ||
11 | out the patches will fix the problem. | ||
12 | |||
13 | Note: poky doesn't have this problem since it separates the ${S} and | ||
14 | ${B} | ||
15 | |||
16 | Upstream-Status: Inappropriate [OE specific] | ||
17 | |||
18 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
19 | --- | ||
20 | Make.rules | 4 ++-- | ||
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/Make.rules b/Make.rules | ||
24 | index b077cd5..0bfce2d 100644 | ||
25 | --- a/Make.rules | ||
26 | +++ b/Make.rules | ||
27 | @@ -97,7 +97,7 @@ endif | ||
28 | subdirs := $(filter-out $(SKIPDIRS), $(subdirs)) | ||
29 | endif | ||
30 | |||
31 | -install install-%: subdirs := $(filter-out $(SKIPINSTALL), $(subdirs)) | ||
32 | +install install-%: subdirs := $(filter-out $(SKIPINSTALL) patches, $(subdirs)) | ||
33 | |||
34 | |||
35 | override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared) | ||
36 | @@ -106,7 +106,7 @@ override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared) | ||
37 | INCLUDEDIRS := $(filter $(INCLUDEDIRS), $(subdirs)) | ||
38 | LIBDIRS := $(filter $(LIBDIRS), $(subdirs)) | ||
39 | MODDIRS := $(filter $(MODDIRS), $(subdirs)) | ||
40 | -EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS), $(subdirs)) | ||
41 | +EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS) patches, $(subdirs)) | ||
42 | MODUSERS := $(filter $(MODUSERS), $(subdirs)) | ||
43 | SBINUSERS := $(filter $(SBINUSERS), $(subdirs)) | ||
44 | |||
45 | -- | ||
46 | 1.7.10.4 | ||
47 | |||
diff --git a/meta-networking/recipes-support/traceroute/traceroute_2.0.20.bb b/meta-networking/recipes-support/traceroute/traceroute_2.0.20.bb new file mode 100644 index 000000000..4b49c7686 --- /dev/null +++ b/meta-networking/recipes-support/traceroute/traceroute_2.0.20.bb | |||
@@ -0,0 +1,42 @@ | |||
1 | SUMMARY = "A new modern implementation of traceroute(8) utility for Linux systems" | ||
2 | DESCRIPTION = "The traceroute utility displays the route used by IP packets on \ | ||
3 | their way to a specified network (or Internet) host. Traceroute displays \ | ||
4 | the IP number and host name (if possible) of the machines along the \ | ||
5 | route taken by the packets. Traceroute is used as a network debugging \ | ||
6 | tool. If you're having network connectivity problems, traceroute will \ | ||
7 | show you where the trouble is coming from along the route." | ||
8 | SECTION = "console/network" | ||
9 | HOMEPAGE = "http://traceroute.sourceforge.net/" | ||
10 | LICENSE = "GPL-2.0 LGPL-2.1" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
12 | file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" | ||
13 | |||
14 | inherit update-alternatives | ||
15 | |||
16 | SRC_URI = "${SOURCEFORGE_MIRROR}/traceroute/traceroute/${BP}/${BP}.tar.gz \ | ||
17 | file://filter-out-the-patches-from-subdirs.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI[md5sum] = "559f104e155e0e14ee0c717776a745fa" | ||
21 | SRC_URI[sha256sum] = "2facba9525c95428d7bff3a313fc6ecfd8c529c678ae666c73015558a0edc271" | ||
22 | |||
23 | do_compile() { | ||
24 | export LDFLAGS="${TARGET_LDFLAGS} -L${S}/libsupp" | ||
25 | oe_runmake "env=yes" | ||
26 | } | ||
27 | |||
28 | do_install() { | ||
29 | install -d ${D}${bindir} | ||
30 | install -m755 ${BPN}/${BPN} ${D}${bindir} | ||
31 | |||
32 | install -m755 wrappers/tcptraceroute ${D}${bindir} | ||
33 | |||
34 | install -d ${D}${mandir} | ||
35 | install -p -m644 ${BPN}/${BPN}.8 ${D}${mandir} | ||
36 | ln -s ${BPN}.8 ${D}${mandir}/${BPN}6.8 | ||
37 | ln -s ${BPN}.8 ${D}${mandir}/tcptraceroute.8 | ||
38 | |||
39 | } | ||
40 | |||
41 | ALTERNATIVE_${PN} = "traceroute" | ||
42 | ALTERNATIVE_LINK_NAME[traceroute] = "${bindir}/traceroute" | ||
diff --git a/meta-networking/recipes-support/tunctl/tunctl.inc b/meta-networking/recipes-support/tunctl/tunctl.inc new file mode 100644 index 000000000..e95cfa523 --- /dev/null +++ b/meta-networking/recipes-support/tunctl/tunctl.inc | |||
@@ -0,0 +1,15 @@ | |||
1 | SUMMARY = "Tool for controlling the Linux TUN/TAP driver" | ||
2 | SECTION = "net" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://tunctl.c;beginline=1;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999" | ||
5 | |||
6 | SRC_URI = "${SOURCEFORGE_MIRROR}/tunctl/tunctl-${PV}.tar.gz" | ||
7 | |||
8 | do_compile() { | ||
9 | oe_runmake tunctl | ||
10 | } | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}/${sbindir} | ||
14 | install -m 755 tunctl ${D}/${sbindir} | ||
15 | } | ||
diff --git a/meta-networking/recipes-support/tunctl/tunctl_1.5.bb b/meta-networking/recipes-support/tunctl/tunctl_1.5.bb new file mode 100644 index 000000000..dd265612f --- /dev/null +++ b/meta-networking/recipes-support/tunctl/tunctl_1.5.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require tunctl.inc | ||
2 | |||
3 | SRC_URI[md5sum] = "fdbedc263b3e85bb0e087cd567414607" | ||
4 | SRC_URI[sha256sum] = "aa2a6c4cc6bfacb11e0d9f62334a6638a0d435475c61230116f00b6af8b14fff" | ||
diff --git a/meta-networking/recipes-support/wireshark/README b/meta-networking/recipes-support/wireshark/README new file mode 100644 index 000000000..63b5b7263 --- /dev/null +++ b/meta-networking/recipes-support/wireshark/README | |||
@@ -0,0 +1,45 @@ | |||
1 | # | ||
2 | Wireshark - Notes | ||
3 | |||
4 | URL: http://www.wireshark.org/ | ||
5 | User Guide: http://www.wireshark.org/docs/wsug_html_chunked/ | ||
6 | Secruity advisories: http://www.wireshark.org/security/ | ||
7 | |||
8 | Wireshark is slowly moving away from gtk and towards QT as their graphical stack. | ||
9 | Currently gtk is supported with this release and I plan on integrating QT. | ||
10 | |||
11 | |||
12 | |||
13 | Adding the wireshark to your build | ||
14 | ======================================== | ||
15 | |||
16 | via local.conf | ||
17 | IMAGE_INSTALL_append = " wireshark" | ||
18 | |||
19 | Adding the wireshark to your graphical build | ||
20 | ======================================== | ||
21 | via local.conf | ||
22 | IMAGE_INSTALL_append = " wireshark" | ||
23 | |||
24 | and one of: | ||
25 | |||
26 | EXTRA_IMAGE_FEATURES += "x11-base" | ||
27 | |||
28 | or use the "core-image-x11" | ||
29 | |||
30 | |||
31 | Maintenance | ||
32 | ----------- | ||
33 | |||
34 | Send patches, comments or questions to openembedded-devel@lists.openembedded.org | ||
35 | |||
36 | When sending single patches, please use something like: | ||
37 | |||
38 | git send-email -1 -M \ | ||
39 | --to openembedded-devel@lists.openembedded.org \ | ||
40 | --cc akuster@mvista.com \ | ||
41 | --subject-prefix=meta-networking][PATCH | ||
42 | |||
43 | Maintainer: Armin Kuster <akuster@mvista.com> | ||
44 | |||
45 | |||
diff --git a/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch b/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch new file mode 100644 index 000000000..64a08add7 --- /dev/null +++ b/meta-networking/recipes-support/wireshark/files/Do-not-set-CC_FOR_BUILD-flags.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | [PATCH] Do not set CC_FOR_BUILD flags | ||
2 | |||
3 | Upstream-status: Pending | ||
4 | |||
5 | AC_WIRESHARK_COMPILER_FLAGS_CHECK() is checking which options CC is supported, | ||
6 | and put the supported options into CFLAGS, but it should not put them into | ||
7 | CFLAGS_FOR_BUILD. since CC and BUILD_CC can be different, CFLAGS_FOR_BUILD is | ||
8 | used by BUILD_CC | ||
9 | |||
10 | BUILD_CC is used to generated host tools, do not use the gcc's optimised options, | ||
11 | do not effect the running of host tools. so do not set CC_FOR_BUILD flags. | ||
12 | |||
13 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
14 | --- | ||
15 | acinclude.m4 | 8 -------- | ||
16 | 1 file changed, 8 deletions(-) | ||
17 | |||
18 | diff --git a/acinclude.m4 b/acinclude.m4 | ||
19 | index 136fc27..8d3d360 100644 | ||
20 | --- a/acinclude.m4 | ||
21 | +++ b/acinclude.m4 | ||
22 | @@ -1755,10 +1755,6 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then | ||
23 | # just the new option. | ||
24 | # | ||
25 | CFLAGS="$CFLAGS_saved $GCC_OPTION" | ||
26 | - # | ||
27 | - # Add it to the flags we use when building build tools. | ||
28 | - # | ||
29 | - CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION" | ||
30 | ], | ||
31 | [ | ||
32 | AC_MSG_RESULT(yes) | ||
33 | @@ -1771,10 +1767,6 @@ if test "x$ac_supports_gcc_flags" = "xyes" ; then | ||
34 | # just the new option. | ||
35 | # | ||
36 | CFLAGS="$CFLAGS_saved $GCC_OPTION" | ||
37 | - # | ||
38 | - # Add it to the flags we use when building build tools. | ||
39 | - # | ||
40 | - CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD $GCC_OPTION" | ||
41 | fi | ||
42 | ], | ||
43 | [ | ||
44 | -- | ||
45 | 1.9.1 | ||
46 | |||
diff --git a/meta-networking/recipes-support/wireshark/wireshark_1.12.4.bb b/meta-networking/recipes-support/wireshark/wireshark_1.12.4.bb new file mode 100644 index 000000000..683321657 --- /dev/null +++ b/meta-networking/recipes-support/wireshark/wireshark_1.12.4.bb | |||
@@ -0,0 +1,57 @@ | |||
1 | DESCRIPTION = "wireshark - a popular network protocol analyzer" | ||
2 | HOMEPAGE = "http://www.wireshark.org" | ||
3 | SECTION = "network" | ||
4 | LICENSE = "GPL-2.0" | ||
5 | LIC_FILES_CHKSUM = "file://README.linux;md5=631e077455b7972172eb149195e065b0" | ||
6 | |||
7 | DEPENDS = "perl-native pcre expat glib-2.0 sbc" | ||
8 | |||
9 | SRC_URI = " \ | ||
10 | http://wiresharkdownloads.riverbed.com/wireshark/src/wireshark-${PV}.tar.bz2 \ | ||
11 | file://Do-not-set-CC_FOR_BUILD-flags.patch \ | ||
12 | " | ||
13 | |||
14 | PE = "1" | ||
15 | |||
16 | SRC_URI[md5sum] = "acfa156fd35cb66c867b1ace992e4b5b" | ||
17 | SRC_URI[sha256sum] = "de804e98e252e4b795d28d6ac2d48d7f5aacd9b046ee44d44266983795ebc312" | ||
18 | |||
19 | inherit autotools pkgconfig | ||
20 | |||
21 | ARM_INSTRUCTION_SET = "arm" | ||
22 | |||
23 | # Works with either gtk+ or gtk3. | ||
24 | WHICH_GTK = "gtk3" | ||
25 | |||
26 | PACKAGECONFIG ??= "libcap gnutls libnl" | ||
27 | PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "x11", "${WHICH_GTK} graphics", "", d)}" | ||
28 | PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)}" | ||
29 | |||
30 | PACKAGECONFIG[libcap] = "--with-libcap=${STAGING_DIR_HOST}, --with-libcap=no, libcap" | ||
31 | PACKAGECONFIG[libsmi] = "--with-libsmi=yes, --with-libsmi=no, libsmi" | ||
32 | PACKAGECONFIG[libnl] = "--with-libnl=yes, --with-libnl=no, libnl" | ||
33 | PACKAGECONFIG[portaudio] = "--with-portaudio=yes, --with-portaudio=no, portaudio-v19" | ||
34 | PACKAGECONFIG[gtk2] = "--with-gtk2=yes, --with-gtk2=no, gtk+" | ||
35 | PACKAGECONFIG[gtk3] = "--with-gtk3=yes, --with-gtk3=no, gtk+3" | ||
36 | PACKAGECONFIG[graphics] = "--enable-wireshark, --disable-wireshark," | ||
37 | PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6," | ||
38 | PACKAGECONFIG[gnutls] = "--with-gnutls=yes, --with-gnutls=no, gnutls" | ||
39 | PACKAGECONFIG[gcrypt] = "--with-gcrypt=yes, --with-gcrypt=no, libgcrypt" | ||
40 | PACKAGECONFIG[krb5] = "--with-krb5=yes, --with-krb5=no, krb5" | ||
41 | PACKAGECONFIG[lua] = "--with-lua=yes, --with-lua=no, lua" | ||
42 | PACKAGECONFIG[zlib] = "--with-zlib=yes, --with-zlib=no, zlib" | ||
43 | PACKAGECONFIG[geoip] = "--with-geoip=yes, --with-geoip=no, geoip" | ||
44 | |||
45 | # these next two options require addional layers | ||
46 | PACKAGECONFIG[adns] = "--with-adns=yes, --with-adns=no, adns" | ||
47 | PACKAGECONFIG[c-ares] = "--with-c-ares=yes, --with-c-ares=no, c-ares" | ||
48 | |||
49 | EXTRA_OECONF += "--with-qt=no --enable-usr-local=no --enable-tshark --with-pcap=no --enable-pcap-ng-default" | ||
50 | |||
51 | do_configure_prepend() { | ||
52 | # force to use fallback | ||
53 | sed -i -e '/^glib_prefix/s/=.*$/=""/' ${S}/aclocal-flags | ||
54 | } | ||
55 | |||
56 | ALLOW_EMPTY_${PN} = "1" | ||
57 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||