summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-networking
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openembedded/meta-networking')
-rw-r--r--meta-openembedded/meta-networking/COPYING.MIT17
-rw-r--r--meta-openembedded/meta-networking/MAINTAINERS35
-rw-r--r--meta-openembedded/meta-networking/README40
-rw-r--r--meta-openembedded/meta-networking/classes/waf-samba.bbclass119
-rw-r--r--meta-openembedded/meta-networking/conf/layer.conf26
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/README3
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt39
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64_be.txt39
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt39
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt40
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-riscv64.txt39
-rw-r--r--meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt39
-rw-r--r--meta-openembedded/meta-networking/licenses/DMTF34
-rw-r--r--meta-openembedded/meta-networking/licenses/copyleft-next-0.3.0219
-rw-r--r--meta-openembedded/meta-networking/licenses/netperf43
-rw-r--r--meta-openembedded/meta-networking/licenses/radvd37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch11
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch57
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb36
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/daq/files/disable-run-test-program-while-cross-compiling.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.5.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch14
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch18
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch13
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius110
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch197
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch70
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch61
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch236
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch55
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch160
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf2
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd3
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb222
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/0001-rcp-fix-to-work-with-large-files.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch83
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch14
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rexec.xinetd.inetutils20
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rlogin.xinetd.inetutils23
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rsh.xinetd.inetutils21
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/telnet.xinetd.inetutils13
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/tftpd.xinetd.inetutils19
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/version.patch17
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb206
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/lftp/files/fix-gcc-6-conflicts-signbit.patch44
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb34
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.8.0.bb42
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb39
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch77
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch53
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch72
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch77
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb143
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb13
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb21
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch75
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch147
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch2087
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch142
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch79
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch59
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch14
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch85
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb17
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch57
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch64
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch87
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch37
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba3
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb318
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb33
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-fix-do_package-failed-since-snort-2.9.7.0.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-flow-id.patch60
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-verdict-retry.patch60
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch85
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init109
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb105
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0001-optimize-boot.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0002-lp1044361.patch118
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0003-fix-typeerror-on-error.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0005-lp1191197.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-add-an-option-to-specify-iptables-location.patch107
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch77
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw_0.33.bb56
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/no-HOME-includes.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb38
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch66
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch36
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf19
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/long-help168
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb59
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb20
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch45
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch43
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb64
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch163
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch152
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init37
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch53
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch63
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch118
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb77
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch46
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff14
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb96
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch56
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch283
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service19
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb113
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian119
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator4
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service15
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service13
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb117
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d128
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch1288
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch28
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init230
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service11
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest5
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb115
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch123
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch122
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb67
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch64
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb20
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh13
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch93
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf105
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch116
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix94
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc262
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch112
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init220
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb138
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf7
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb58
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb22
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default1
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init135
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc67
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb5
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch46
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch118
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch65
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch61
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb114
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch81
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default3
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init105
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch60
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch165
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd18
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service10
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket8
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb91
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf2
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init193
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb51
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch62
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init50
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd1
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf139
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers15
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service9
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list20
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch43
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch52
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch89
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb112
-rw-r--r--meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/run-ptest21
-rw-r--r--meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch90
-rw-r--r--meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl_0.22.bb39
-rw-r--r--meta-openembedded/meta-networking/recipes-devtools/python/python-ldap_2.4.41.bb29
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb79
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch36
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb51
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch108
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch475
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch85
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch327
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch67
-rw-r--r--meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb64
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb36
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover77
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/init87
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch45
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch75
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch69
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch67
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch216
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch50
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save43
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common163
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init26
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch43
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb103
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch255
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch1229
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch382
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch264
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb17
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb17
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb15
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb19
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch110
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch403
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb25
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch2949
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch514
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb17
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb15
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch323
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch147
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch62
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch65
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch98
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch84
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch86
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/files/fix-to-generate-ntf.8.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb34
-rw-r--r--meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20171221.bb31
-rw-r--r--meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20171221.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc17
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/Add_ARG_MAX_define.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb47
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch51
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/gcc4.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb44
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fix-host-variable.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fixup_wait3_api_change.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/netkit-rsh-0.17-rexec-ipv6.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/no_pam_build_fix.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.pam10
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.xinetd.netkit20
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.pam12
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.xinetd.netkit23
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh-redone_link_order_file.patch77
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.pam10
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.xinetd.netkit21
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb102
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers/rpc.rusersd-Makefile-fix-parallel-build-issue.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers_0.17.bb70
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch46
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch71
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod71
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod.default2
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb85
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch66
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/To-aviod-buffer-overflow-in-telnet.patch1217
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/Warning-fix-in-the-step-of-install.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/cross-compile.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/telnet-xinetd14
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb61
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/tftp.conf11
-rw-r--r--meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb55
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb49
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch223
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freeDiameter.conf250
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.init72
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/install_test.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch72
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/files/run-ptest11
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb138
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch167
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/mdns/files/mdns.service15
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb90
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init66
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf422
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf18
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch45
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Remove-U64-typedef.patch2524
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_libs2-Error-Fix.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch186
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/dont-return-incompletely-parsed-varbinds.patch131
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-agentx-crash.patch75
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch34
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest4
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service13
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service13
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch1652
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb244
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb23
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc37
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch64
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch59
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_1.0.bb4
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb9
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch29
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch36
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch106
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-obey-LDFLAGS.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/fix_linux_4.15_compile.patch44
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch49
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service17
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest97
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb99
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/0001-include-missing-sys-types.h.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/options.pptp30
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.9.0.bb31
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service14
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default12
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init200
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam13
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga3
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default12
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init64
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service17
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc232
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb4
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch84
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/config-site.radiusclient-ng-0.5.61
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb36
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.in-Error-fix.patch57
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure_in_cross.patch153
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/discard-use-of-dnl-in-Makefile.am.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/dont-swallow-errors.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.default22
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.init59
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-src-restrictions.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/top-autoconf.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/update-config.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb77
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb28
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc41
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb7
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb8
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch69
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf51
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default17
-rw-r--r--meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/makefile-add-ldflags.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-support/aoetools/aoetools_36.bb26
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch79
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch77
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service16
-rw-r--r--meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb39
-rw-r--r--meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch40
-rw-r--r--meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch51
-rw-r--r--meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch105
-rw-r--r--meta-openembedded/meta-networking/recipes-support/c-ares/c-ares_1.13.0.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/chrony/chrony/arm_eabi.patch63
-rw-r--r--meta-openembedded/meta-networking/recipes-support/chrony/chrony/chrony.conf44
-rw-r--r--meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd58
-rw-r--r--meta-openembedded/meta-networking/recipes-support/chrony/chrony_3.2.bb134
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cifs/files/0001-mount.cifs-Remove-data_blob.h-include.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-exper_2.50.0.bb29
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-final_2.40.0.bb34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema.inc9
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema/files/LICENSE34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/cim-schema/files/LICENSE34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/01-support-cross-compile-for-linux-os.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/02-link-rep_snprintf-for-ltdbtool.patch17
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/service-ensure-the-PID-directory-is-created.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb57
-rw-r--r--meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb33
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc83
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq_2.78.bb8
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/files/99_dnsmasq1
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-noresolvconf.service15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper62
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf.service17
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf298
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.resolvconf84
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnsmasq/files/init117
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dnssec-conf/dnssec-conf_2.02.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch66
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-doveadm-Fix-parallel-build.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.service14
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket14
-rw-r--r--meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.33.bb71
-rw-r--r--meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-fix-permission-bits-for-drbd.service.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb46
-rw-r--r--meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/esmtp/esmtp_1.2.bb45
-rw-r--r--meta-openembedded/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/files/run-ptest11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl/run-ptest15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl_1.50.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoip_1.6.11.bb90
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/GeoIP.conf11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/geoipupdate.cron5
-rw-r--r--meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate_2.5.0.bb33
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.9.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb14
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc/0001-Makefile-pass-extra-linker-flags.patch31
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc_0.2.2.bb21
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-build-with-clang.patch115
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch249
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch87
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch13
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2015-4047.patch36
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2016-10396.patch207
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch23
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch220
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch61
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf8
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample40
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb96
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch97
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch63
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch39
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/include-topdir.patch48
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/snprintf.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp_1.0.6.bb38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch13
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libldb/libldb/options-1.3.1.patch193
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.3.1.bb63
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/files/crosscompile.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb10
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb4
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch20
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/options-2.1.10.patch184
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.11.bb49
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/do-not-check-xsltproc-manpages.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/tdb-Add-configure-options-for-packages.patch184
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.15.bb44
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/options-0.9.36.patch176
-rw-r--r--meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb44
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-fix-compile-error-with-linux-kernel-v4.8.patch74
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/install-from-buildir.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/link-with-ldflags.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/run-ptest5
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v4test.sh11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v6test.sh11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb62
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch44
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb36
-rw-r--r--meta-openembedded/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.5.0.bb52
-rw-r--r--meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nbd/nbd_3.11.bb19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb31
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch124
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6_git.bb76
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch379
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb56
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcat/netcat_0.7.1.bb22
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netcf/netcf_0.2.8.bb71
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netperf/files/cpu_set.patch30
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netperf/files/init62
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netperf/files/vfork.patch58
-rw-r--r--meta-openembedded/meta-networking/recipes-support/netperf/netperf_git.bb66
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nghttp2/nghttp2_1.26.0.bb13
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/files/ypbind.init107
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/nis.inc31
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/yp-tools/domainname.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/yp-tools_2.14.bb34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/yp-tools_4.2.3.bb47
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch67
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service14
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb62
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntimed/ntimed/use-ldflags.patch16
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb40
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop.service15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch164
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch21
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_init.patch228
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop/use-static-inline.patch32
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntop/ntop_5.0.1.bb137
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch27
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf17
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd84
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list1
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service11
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate54
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default7
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp1
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service11
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p11.bb172
-rw-r--r--meta-openembedded/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb29
-rw-r--r--meta-openembedded/meta-networking/recipes-support/open-isns/open-isns/0001-util.h-endian.h-is-available-on-musl-on-linux.patch38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb40
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/0001-lanserv-Rename-struct-parameter-printf-for-namespace.patch618
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch22
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/include_sys_types.patch17
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch41
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi.service12
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-helper512
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch26
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch50
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openipmi/openipmi_2.0.24.bb110
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn104
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf1
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn@.service12
-rw-r--r--meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.4.4.bb67
-rw-r--r--meta-openembedded/meta-networking/recipes-support/phytool/phytool.bb15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/pimd/pimd/0001-configure-Dont-use-uname-to-determine-target-OS.patch28
-rw-r--r--meta-openembedded/meta-networking/recipes-support/pimd/pimd_2.3.2.bb20
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch33
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch122
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb25
-rw-r--r--meta-openembedded/meta-networking/recipes-support/smcroute/smcroute_2.0.0.bb13
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmping/files/0001-Makefile-tweak-install-dir.patch35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb17
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch17
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/ssmtp-bug584162-fix.patch126
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch74
-rw-r--r--meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb35
-rw-r--r--meta-openembedded/meta-networking/recipes-support/strongswan/files/0001-memory.h-Include-stdint.h-for-uintptr_t.patch24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch99
-rw-r--r--meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.6.2.bb132
-rw-r--r--meta-openembedded/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch54
-rw-r--r--meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb24
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch36
-rwxr-xr-xmeta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest5
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch34
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb51
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch75
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch15
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb36
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.2.6.bb19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch37
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service14
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb38
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch42
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb39
-rw-r--r--meta-openembedded/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch47
-rw-r--r--meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb45
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tunctl/tunctl.inc17
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tunctl/tunctl/makefile-add-ldflags.patch19
-rw-r--r--meta-openembedded/meta-networking/recipes-support/tunctl/tunctl_1.5.bb4
-rw-r--r--meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb16
-rw-r--r--meta-openembedded/meta-networking/recipes-support/wireshark/README45
-rw-r--r--meta-openembedded/meta-networking/recipes-support/wireshark/files/libgcrypt.patch53
-rw-r--r--meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.4.6.bb73
-rw-r--r--meta-openembedded/meta-networking/recipes-support/wpan-tools/wpan-tools_git.bb18
-rw-r--r--meta-openembedded/meta-networking/site/endian-big2
-rw-r--r--meta-openembedded/meta-networking/site/endian-little2
814 files changed, 55847 insertions, 0 deletions
diff --git a/meta-openembedded/meta-networking/COPYING.MIT b/meta-openembedded/meta-networking/COPYING.MIT
new file mode 100644
index 000000000..fb950dc69
--- /dev/null
+++ b/meta-openembedded/meta-networking/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/meta-openembedded/meta-networking/MAINTAINERS b/meta-openembedded/meta-networking/MAINTAINERS
new file mode 100644
index 000000000..bbb2d1b5b
--- /dev/null
+++ b/meta-openembedded/meta-networking/MAINTAINERS
@@ -0,0 +1,35 @@
+This file contains a list of maintainers for the meta-networking layer.
+
+Please submit any patches against meta-networking to the OpenEmbedded
+development mailing list (openembedded-devel@lists.openembedded.org) with
+'[meta-networking]' in the subject.
+
+When sending single patches, please use something like:
+
+ git send-email -1 -M \
+ --to openembedded-devel@lists.openembedded.org \
+ --subject-prefix=meta-networking][PATCH
+
+You may also contact the maintainers directly.
+
+Descriptions of section entries:
+
+ M: Mail patches to: FullName <address@domain>
+ F: Files and directories with wildcard patterns.
+ A trailing slash includes all files and subdirectory files.
+ F: recipes-devtools/ all files in and below recipes-devtools
+ F: recipes-selinux/* all files in recipes-selinux, but not below
+ One pattern per line. Multiple F: lines acceptable.
+
+Please keep this list in alphabetical order.
+
+Maintainers List (try to look for most precise areas first)
+
+COMMON
+M: Joe MacDonald <joe_macdonald@mentor.com>
+F: conf
+F: recipes-*
+
+NETKIT
+M: Armin Kuster <akuster808@gmail.com>
+F: recipes-netkit
diff --git a/meta-openembedded/meta-networking/README b/meta-openembedded/meta-networking/README
new file mode 100644
index 000000000..e1ba27d83
--- /dev/null
+++ b/meta-openembedded/meta-networking/README
@@ -0,0 +1,40 @@
+meta-networking
+===============
+
+This layer is intended to be a central point for networking-related
+packages and configuration. It should be useful directly on top of
+oe-core and compliments meta-openembedded. It should be primarily useful
+to the following groups:
+
+ - Anyone building a small networking device (eg. a home router /
+ bridge / switch).
+
+ - Anyone wanting to add network services to their device (eg.
+ anything that might benefit from a small ftp/tftp server)
+
+Dependencies
+------------
+
+This layer depends on:
+
+URI: git://github.com/openembedded/openembedded-core.git
+branch: master
+revision: HEAD
+
+For some recipes, the meta-oe layer is required:
+
+URI: git://github.com/openembedded/meta-openembedded.git
+subdirectory: meta-oe
+branch: master
+revision: HEAD
+
+URI: git://github.com/openembedded/meta-openembedded.git
+subdirectory: meta-python
+branch: master
+revision: HEAD
+
+Maintenance
+-----------
+
+Please see the MAINTAINERS file for information on contacting the
+maintainers of this layer, as well as instructions for submitting patches.
diff --git a/meta-openembedded/meta-networking/classes/waf-samba.bbclass b/meta-openembedded/meta-networking/classes/waf-samba.bbclass
new file mode 100644
index 000000000..1632c3c60
--- /dev/null
+++ b/meta-openembedded/meta-networking/classes/waf-samba.bbclass
@@ -0,0 +1,119 @@
+# waf is a build system which is used by samba related project.
+# Obtain details from https://wiki.samba.org/index.php/Waf
+#
+inherit qemu pythonnative
+
+DEPENDS += "qemu-native libxslt-native docbook-xsl-stylesheets-native python"
+
+CONFIGUREOPTS = " --prefix=${prefix} \
+ --bindir=${bindir} \
+ --sbindir=${sbindir} \
+ --libexecdir=${libexecdir} \
+ --datadir=${datadir} \
+ --sysconfdir=${sysconfdir} \
+ --sharedstatedir=${sharedstatedir} \
+ --localstatedir=${localstatedir} \
+ --libdir=${libdir} \
+ --includedir=${includedir} \
+ --oldincludedir=${oldincludedir} \
+ --infodir=${infodir} \
+ --mandir=${mandir} \
+ ${PACKAGECONFIG_CONFARGS} \
+ "
+
+# avoids build breaks when using no-static-libs.inc
+DISABLE_STATIC = ""
+
+def get_waf_parallel_make(d):
+ pm = d.getVar('PARALLEL_MAKE')
+ if pm:
+ # look for '-j' and throw other options (e.g. '-l') away
+ # because they might have different meaning in bjam
+ pm = pm.split()
+ while pm:
+ opt = pm.pop(0)
+ if opt == '-j':
+ v = pm.pop(0)
+ elif opt.startswith('-j'):
+ v = opt[2:].strip()
+ else:
+ continue
+
+ v = min(64, int(v))
+ return '-j' + str(v)
+
+ return ""
+
+# Three methods for waf cross compile:
+# 1. answers:
+# Only --cross-answers - try the cross-answers file, and if
+# there's no corresponding answer, add to the file and mark
+# the configure process as unfinished.
+# 2. exec:
+# Only --cross-execute - get the answer from cross-execute,
+# an emulator (qemu) is used to run cross-compiled binaries.
+# 3. both:
+# (notes: not supported in lower version of some packages,
+# please check buildtools/wafsamba/samba_cross.py in the
+# package source)
+# Try the cross-answers file first, and if there is no
+# corresponding answer, use cross-execute to get an answer,
+# and add that answer to the file.
+#
+# The first one is preferred since it may fail with 2 or 3 if
+# the target board is not suported by qemu, but we can use 2 or 3
+# to help generate the cross answer when adding new board support.
+CROSS_METHOD ?= "answer"
+
+do_configure() {
+
+ # Prepare the cross-answers file
+ WAF_CROSS_ANSWERS_PATH="${THISDIR}/../../files/waf-cross-answers"
+ CROSS_ANSWERS="${B}/cross-answers-${TARGET_ARCH}.txt"
+ if [ -e ${CROSS_ANSWERS} ]; then
+ rm -f ${CROSS_ANSWERS}
+ fi
+ echo 'Checking uname machine type: "${TARGET_ARCH}"' >> ${CROSS_ANSWERS}
+ echo 'Checking uname release type: "${OLDEST_KERNEL}"' >> ${CROSS_ANSWERS}
+ cat ${WAF_CROSS_ANSWERS_PATH}/cross-answers-${TARGET_ARCH}.txt >> ${CROSS_ANSWERS}
+
+ qemu_binary="${@qemu_target_binary(d)}"
+ if [ "${qemu_binary}" = "qemu-allarch" ]; then
+ qemu_binary="qemuwrapper"
+ fi
+
+ libdir_qemu="${STAGING_DIR_HOST}/${libdir}"
+ base_libdir_qemu="${STAGING_DIR_HOST}/${base_libdir}"
+
+ CROSS_EXEC="${qemu_binary} \
+ ${QEMU_OPTIONS} \
+ -L ${STAGING_DIR_HOST} \
+ -E LD_LIBRARY_PATH=${libdir_qemu}:${base_libdir_qemu}"
+
+ export BUILD_ARCH=${BUILD_ARCH}
+ export HOST_ARCH=${HOST_ARCH}
+ export STAGING_LIBDIR=${STAGING_LIBDIR}
+ export STAGING_INCDIR=${STAGING_INCDIR}
+ export PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+
+ CONFIG_CMD="./configure ${CONFIGUREOPTS} ${EXTRA_OECONF} --cross-compile"
+ if [ "${CROSS_METHOD}" = "answer" ]; then
+ ${CONFIG_CMD} --cross-answers="${CROSS_ANSWERS}"
+ elif [ "${CROSS_METHOD}" = "exec" ]; then
+ ${CONFIG_CMD} --cross-exec="${CROSS_EXEC}"
+ elif [ "${CROSS_METHOD}" = "both" ]; then
+ ${CONFIG_CMD} --cross-answers="${CROSS_ANSWERS}" --cross-exec="${CROSS_EXEC}"
+ else
+ echo "ERROR: ${CROSS_METHOD} is not valid for cross-compile!"
+ exit 1
+ fi
+}
+
+do_compile[progress] = "outof:^\[\s*(\d+)/\s*(\d+)\]\s+"
+do_compile () {
+ python ./buildtools/bin/waf ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/meta-openembedded/meta-networking/conf/layer.conf b/meta-openembedded/meta-networking/conf/layer.conf
new file mode 100644
index 000000000..e594b7b95
--- /dev/null
+++ b/meta-openembedded/meta-networking/conf/layer.conf
@@ -0,0 +1,26 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a packages directory, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
+ ${LAYERDIR}/recipes-*/*/*.bbappend"
+
+BBFILE_COLLECTIONS += "networking-layer"
+BBFILE_PATTERN_networking-layer := "^${LAYERDIR}/"
+BBFILE_PRIORITY_networking-layer = "5"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_networking-layer = "1"
+
+LAYERDEPENDS_networking-layer = "core"
+LAYERDEPENDS_networking-layer += "openembedded-layer"
+LAYERDEPENDS_networking-layer += "meta-python"
+
+LAYERSERIES_COMPAT_networking-layer = "sumo"
+
+LICENSE_PATH += "${LAYERDIR}/licenses"
+
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
+ wireguard-tools->wireguard-module \
+"
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/README b/meta-openembedded/meta-networking/files/waf-cross-answers/README
new file mode 100644
index 000000000..dda45c508
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/README
@@ -0,0 +1,3 @@
+The files in this directory are cross answers files
+used by waf-samba.bbclass, please see waf-samba.bbclass
+for details about how they are used.
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt
new file mode 100644
index 000000000..1023f6aff
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64.txt
@@ -0,0 +1,39 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64_be.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64_be.txt
new file mode 100644
index 000000000..1023f6aff
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-aarch64_be.txt
@@ -0,0 +1,39 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt
new file mode 100644
index 000000000..a5cd9981a
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-arm.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt
new file mode 100644
index 000000000..a5cd9981a
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i586.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt
new file mode 100644
index 000000000..a5cd9981a
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-i686.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials with 32-bit system calls: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt
new file mode 100644
index 000000000..3e239e727
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "128"
+Checking value of _NSIG: "128"
+Checking value of SIGRTMAX: "127"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt
new file mode 100644
index 000000000..82e694fda
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mips64.txt
@@ -0,0 +1,39 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: OK
+Checking value of NSIG: "128"
+Checking value of _NSIG: "128"
+Checking value of SIGRTMAX: "127"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt
new file mode 100644
index 000000000..3e239e727
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-mipsel.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "128"
+Checking value of _NSIG: "128"
+Checking value of SIGRTMAX: "127"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt
new file mode 100644
index 000000000..27b9378a4
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: NO
+Checking for -D_FILE_OFFSET_BITS=64: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: NO
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt
new file mode 100644
index 000000000..7fd3092cb
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-powerpc64.txt
@@ -0,0 +1,40 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: (255, "")
+Checking if can we convert from IBM850 to UCS-2LE: (255, "")
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-riscv64.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-riscv64.txt
new file mode 100644
index 000000000..1023f6aff
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-riscv64.txt
@@ -0,0 +1,39 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt
new file mode 100644
index 000000000..1023f6aff
--- /dev/null
+++ b/meta-openembedded/meta-networking/files/waf-cross-answers/cross-answers-x86_64.txt
@@ -0,0 +1,39 @@
+Checking uname sysname type: "Linux"
+Checking uname version type: "# Wed May 20 10:34:39 UTC 2015"
+Checking simple C program: "hello world"
+rpath library support: OK
+-Wl,--version-script support: OK
+Checking getconf LFS_CFLAGS: NO
+Checking correct behavior of strtoll: NO
+Checking for working strptime: OK
+Checking for C99 vsnprintf: "1"
+Checking for HAVE_SHARED_MMAP: OK
+Checking for HAVE_MREMAP: OK
+Checking for HAVE_SECURE_MKSTEMP: OK
+Checking for HAVE_IFACE_GETIFADDRS: NO
+Checking for HAVE_IFACE_IFCONF: NO
+Checking for HAVE_IFACE_IFREQ: NO
+Checking for large file support without additional flags: OK
+Checking for HAVE_INCOHERENT_MMAP: NO
+Checking value of NSIG: "65"
+Checking value of _NSIG: "65"
+Checking value of SIGRTMAX: "64"
+Checking value of SIGRTMIN: "34"
+Checking whether the WRFILE -keytab is supported: OK
+Checking for kernel change notify support: OK
+Checking for Linux kernel oplocks: OK
+Checking for kernel share modes: OK
+Checking whether POSIX capabilities are available: OK
+Checking if can we convert from CP850 to UCS-2LE: OK
+Checking if can we convert from UTF-8 to UCS-2LE: OK
+vfs_fileid checking for statfs() and struct statfs.f_fsid: OK
+Checking whether we can use Linux thread-specific credentials: OK
+Checking whether fcntl locking is available: OK
+Checking for the maximum value of the 'time_t' type: OK
+Checking whether the realpath function allows a NULL argument: OK
+Checking for ftruncate extend: OK
+getcwd takes a NULL argument: OK
+Checking for small off_t: NO
+Checking whether blkcnt_t is 32 bit: NO
+Checking whether blkcnt_t is 64 bit: OK
+Checking whether fcntl lock supports open file description locks: OK
diff --git a/meta-openembedded/meta-networking/licenses/DMTF b/meta-openembedded/meta-networking/licenses/DMTF
new file mode 100644
index 000000000..54a28120e
--- /dev/null
+++ b/meta-openembedded/meta-networking/licenses/DMTF
@@ -0,0 +1,34 @@
+// Copyright 1998-2008 Distributed Management Task Force, Inc. (DMTF).
+// All rights reserved.
+// DMTF is a not-for-profit association of industry members dedicated
+// to promoting enterprise and systems management and interoperability.
+// DMTF specifications and documents may be reproduced by
+// members and non-members, provided that correct attribution is given.
+// As DMTF specifications may be revised from time to time,
+// the particular version and release date should always be noted.
+//
+// Implementation of certain elements of this standard or proposed
+// standard may be subject to third party patent rights, including
+// provisional patent rights (herein "patent rights"). DMTF makes
+// no representations to users of the standard as to the existence
+// of such rights, and is not responsible to recognize, disclose, or
+// identify any or all such third party patent right, owners or
+// claimants, nor for any incomplete or inaccurate identification or
+// disclosure of such rights, owners or claimants. DMTF shall have no
+// liability to any party, in any manner or circumstance, under any
+// legal theory whatsoever, for failure to recognize, disclose, or
+// identify any such third party patent rights, or for such party's
+// reliance on the standard or incorporation thereof in its product,
+// protocols or testing procedures. DMTF shall have no liability to
+// any party implementing such standard, whether such implementation
+// is foreseeable or not, nor to any patent owner or claimant, and shall
+// have no liability or responsibility for costs or losses incurred if
+// a standard is withdrawn or modified after publication, and shall be
+// indemnified and held harmless by any party implementing the
+// standard from any and all claims of infringement by a patent owner
+// for such implementations.
+//
+// For information about patents held by third-parties which have
+// notified the DMTF that, in their opinion, such patent may relate to
+// or impact implementations of DMTF standards, visit
+// http://www.dmtf.org/about/policies/disclosures.php.
diff --git a/meta-openembedded/meta-networking/licenses/copyleft-next-0.3.0 b/meta-openembedded/meta-networking/licenses/copyleft-next-0.3.0
new file mode 100644
index 000000000..a66d5bf5e
--- /dev/null
+++ b/meta-openembedded/meta-networking/licenses/copyleft-next-0.3.0
@@ -0,0 +1,219 @@
+ copyleft-next 0.3.0 ("this License")
+ Release date: 2013-05-16
+
+1. License Grants; No Trademark License
+
+ Subject to the terms of this License, I grant You:
+
+ a) A non-exclusive, worldwide, perpetual, royalty-free, irrevocable
+ copyright license, to reproduce, Distribute, prepare derivative works
+ of, publicly perform and publicly display My Work.
+
+ b) A non-exclusive, worldwide, perpetual, royalty-free, irrevocable
+ patent license under Licensed Patents to make, have made, use, sell,
+ offer for sale, and import Covered Works.
+
+ This License does not grant any rights in My name, trademarks, service
+ marks, or logos.
+
+2. Distribution: General Conditions
+
+ You may Distribute Covered Works, provided that You (i) inform
+ recipients how they can obtain a copy of this License; (ii) satisfy the
+ applicable conditions of sections 3 through 6; and (iii) preserve all
+ Legal Notices contained in My Work (to the extent they remain
+ pertinent). "Legal Notices" means copyright notices, license notices,
+ license texts, and author attributions, but does not include logos,
+ other graphical images, trademarks or trademark legends.
+
+3. Conditions for Distributing Derived Works; Outbound GPL Compatibility
+
+ If You Distribute a Derived Work, You must license the entire Derived
+ Work as a whole under this License, with prominent notice of such
+ licensing. This condition may not be avoided through such means as
+ separate Distribution of portions of the Derived Work. You may
+ additionally license the Derived Work under the GPL, so that the
+ recipient may further Distribute the Derived Work under either this
+ License or the GPL.
+
+4. Condition Against Further Restrictions; Inbound License Compatibility
+
+ When Distributing a Covered Work, You may not impose further
+ restrictions on the exercise of rights in the Covered Work granted under
+ this License. This condition is not excused merely because such
+ restrictions result from Your compliance with conditions or obligations
+ extrinsic to this License (such as a court order or an agreement with a
+ third party).
+
+ However, You may Distribute a Covered Work incorporating material
+ governed by a license that is both OSI-Approved and FSF-Free as of the
+ release date of this License, provided that Your Distribution complies
+ with such other license.
+
+5. Conditions for Distributing Object Code
+
+ You may Distribute an Object Code form of a Covered Work, provided that
+ you accompany the Object Code with a URL through which the Corresponding
+ Source is made available, at no charge, by some standard or customary
+ means of providing network access to source code.
+
+ If you Distribute the Object Code in a physical product or tangible
+ storage medium ("Product"), the Corresponding Source must be available
+ through such URL for two years from the date of Your most recent
+ Distribution of the Object Code in the Product. However, if the Product
+ itself contains or is accompanied by the Corresponding Source (made
+ available in a customarily accessible manner), You need not also comply
+ with the first paragraph of this section.
+
+ Each recipient of the Covered Work from You is an intended third-party
+ beneficiary of this License solely as to this section 5, with the right
+ to enforce its terms.
+
+6. Symmetrical Licensing Condition for Upstream Contributions
+
+ If You Distribute a work to Me specifically for inclusion in or
+ modification of a Covered Work (a "Patch"), and no explicit licensing
+ terms apply to the Patch, You license the Patch under this License, to
+ the extent of Your copyright in the Patch. This condition does not
+ negate the other conditions of this License, if applicable to the Patch.
+
+7. Nullification of Copyleft/Proprietary Dual Licensing
+
+ If I offer to license, for a fee, a Covered Work under terms other than
+ a license that is OSI-Approved or FSF-Free as of the release date of this
+ License or a numbered version of copyleft-next released by the
+ Copyleft-Next Project, then the license I grant You under section 1 is no
+ longer subject to the conditions in sections 2 through 5.
+
+8. Copyleft Sunset
+
+ The conditions in sections 2 through 5 no longer apply once fifteen
+ years have elapsed from the date of My first Distribution of My Work
+ under this License.
+
+9. Pass-Through
+
+ When You Distribute a Covered Work, the recipient automatically receives
+ a license to My Work from Me, subject to the terms of this License.
+
+10. Termination
+
+ Your license grants under section 1 are automatically terminated if You
+
+ a) fail to comply with the conditions of this License, unless You cure
+ such noncompliance within thirty days after becoming aware of it, or
+
+ b) initiate a patent infringement litigation claim (excluding
+ declaratory judgment actions, counterclaims, and cross-claims)
+ alleging that any part of My Work directly or indirectly infringes
+ any patent.
+
+ Termination of Your license grants extends to all copies of Covered
+ Works You subsequently obtain. Termination does not terminate the
+ rights of those who have received copies or rights from You subject to
+ this License.
+
+ To the extent permission to make copies of a Covered Work is necessary
+ merely for running it, such permission is not terminable.
+
+11. Later License Versions
+
+ The Copyleft-Next Project may release new versions of copyleft-next,
+ designated by a distinguishing version number ("Later Versions").
+ Unless I explicitly remove the option of Distributing Covered Works
+ under Later Versions, You may Distribute Covered Works under any Later
+ Version.
+
+** 12. No Warranty **
+** **
+** My Work is provided "as-is", without warranty. You bear the risk **
+** of using it. To the extent permitted by applicable law, each **
+** Distributor of My Work excludes the implied warranties of title, **
+** merchantability, fitness for a particular purpose and **
+** non-infringement. **
+
+** 13. Limitation of Liability **
+** **
+** To the extent permitted by applicable law, in no event will any **
+** Distributor of My Work be liable to You for any damages **
+** whatsoever, whether direct, indirect, special, incidental, or **
+** consequential damages, whether arising under contract, tort **
+** (including negligence), or otherwise, even where the Distributor **
+** knew or should have known about the possibility of such damages. **
+
+14. Severability
+
+ The invalidity or unenforceability of any provision of this License
+ does not affect the validity or enforceability of the remainder of
+ this License. Such provision is to be reformed to the minimum extent
+ necessary to make it valid and enforceable.
+
+15. Definitions
+
+ "Copyleft-Next Project" means the project that maintains the source
+ code repository at <https://gitorious.org/copyleft-next/> as of the
+ release date of this License.
+
+ "Corresponding Source" of a Covered Work in Object Code form means (i)
+ the Source Code form of the Covered Work; (ii) all scripts,
+ instructions and similar information that are reasonably necessary for
+ a skilled developer to generate such Object Code from the Source Code
+ provided under (i); and (iii) a list clearly identifying all Separate
+ Works (other than those provided in compliance with (ii)) that were
+ specifically used in building and (if applicable) installing the
+ Covered Work (for example, a specified proprietary compiler including
+ its version number). Corresponding Source must be machine-readable.
+
+ "Covered Work" means My Work or a Derived Work.
+
+ "Derived Work" means a work of authorship that copies from, modifies,
+ adapts, is based on, is a derivative work of, transforms, translates or
+ contains all or part of My Work, such that copyright permission is
+ required. The following are not Derived Works: (i) Mere Aggregation;
+ (ii) a mere reproduction of My Work; and (iii) if My Work fails to
+ explicitly state an expectation otherwise, a work that merely makes
+ reference to My Work.
+
+ "Distribute" means to distribute, transfer or make a copy available to
+ someone else, such that copyright permission is required.
+
+ "Distributor" means Me and anyone else who Distributes a Covered Work.
+
+ "FSF-Free" means classified as 'free' by the Free Software Foundation.
+
+ "GPL" means a version of the GNU General Public License or the GNU
+ Affero General Public License.
+
+ "I"/"Me"/"My" refers to the individual or legal entity that places My
+ Work under this License. "You"/"Your" refers to the individual or legal
+ entity exercising rights in My Work under this License. A legal entity
+ includes each entity that controls, is controlled by, or is under
+ common control with such legal entity. "Control" means (a) the power to
+ direct the actions of such legal entity, whether by contract or
+ otherwise, or (b) ownership of more than fifty percent of the
+ outstanding shares or beneficial ownership of such legal entity.
+
+ "Licensed Patents" means all patent claims licensable royalty-free by
+ Me, now or in the future, that are necessarily infringed by making,
+ using, or selling My Work, and excludes claims that would be infringed
+ only as a consequence of further modification of My Work.
+
+ "Mere Aggregation" means an aggregation of a Covered Work with a
+ Separate Work.
+
+ "My Work" means the particular work of authorship I license to You
+ under this License.
+
+ "Object Code" means any form of a work that is not Source Code.
+
+ "OSI-Approved" means approved as 'Open Source' by the Open Source
+ Initiative.
+
+ "Separate Work" means a work that is separate from and independent of a
+ particular Covered Work and is not by its nature an extension or
+ enhancement of the Covered Work, and/or a runtime library, standard
+ library or similar component that is used to generate an Object Code
+ form of a Covered Work.
+
+ "Source Code" means the preferred form of a work for making
+ modifications to it.
diff --git a/meta-openembedded/meta-networking/licenses/netperf b/meta-openembedded/meta-networking/licenses/netperf
new file mode 100644
index 000000000..3f3ceb2fc
--- /dev/null
+++ b/meta-openembedded/meta-networking/licenses/netperf
@@ -0,0 +1,43 @@
+
+
+ Copyright (C) 1993 Hewlett-Packard Company
+ ALL RIGHTS RESERVED.
+
+ The enclosed software and documentation includes copyrighted works
+ of Hewlett-Packard Co. For as long as you comply with the following
+ limitations, you are hereby authorized to (i) use, reproduce, and
+ modify the software and documentation, and to (ii) distribute the
+ software and documentation, including modifications, for
+ non-commercial purposes only.
+
+ 1. The enclosed software and documentation is made available at no
+ charge in order to advance the general development of
+ high-performance networking products.
+
+ 2. You may not delete any copyright notices contained in the
+ software or documentation. All hard copies, and copies in
+ source code or object code form, of the software or
+ documentation (including modifications) must contain at least
+ one of the copyright notices.
+
+ 3. The enclosed software and documentation has not been subjected
+ to testing and quality control and is not a Hewlett-Packard Co.
+ product. At a future time, Hewlett-Packard Co. may or may not
+ offer a version of the software and documentation as a product.
+
+ 4. THE SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS".
+ HEWLETT-PACKARD COMPANY DOES NOT WARRANT THAT THE USE,
+ REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR
+ DOCUMENTATION WILL NOT INFRINGE A THIRD PARTY'S INTELLECTUAL
+ PROPERTY RIGHTS. HP DOES NOT WARRANT THAT THE SOFTWARE OR
+ DOCUMENTATION IS ERROR FREE. HP DISCLAIMS ALL WARRANTIES,
+ EXPRESS AND IMPLIED, WITH REGARD TO THE SOFTWARE AND THE
+ DOCUMENTATION. HP SPECIFICALLY DISCLAIMS ALL WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+ 5. HEWLETT-PACKARD COMPANY WILL NOT IN ANY EVENT BE LIABLE FOR ANY
+ DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
+ (INCLUDING LOST PROFITS) RELATED TO ANY USE, REPRODUCTION,
+ MODIFICATION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION.
+
+
diff --git a/meta-openembedded/meta-networking/licenses/radvd b/meta-openembedded/meta-networking/licenses/radvd
new file mode 100644
index 000000000..03db0b6ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/licenses/radvd
@@ -0,0 +1,37 @@
+The author(s) grant permission for redistribution and use in source and
+binary forms, with or without modification, of the software and documentation
+provided that the following conditions are met:
+
+0. If you receive a version of the software that is specifically labelled
+ as not being for redistribution (check the version message and/or README),
+ you are not permitted to redistribute that version of the software in any
+ way or form.
+1. All terms of all other applicable copyrights and licenses must be
+ followed.
+2. Redistributions of source code must retain the authors' copyright
+ notice(s), this list of conditions, and the following disclaimer.
+3. Redistributions in binary form must reproduce the authors' copyright
+ notice(s), this list of conditions, and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+4. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement with the name(s) of the
+ authors as specified in the copyright notice(s) substituted where
+ indicated:
+
+ This product includes software developed by the authors which are
+ mentioned at the start of the source files and other contributors.
+
+5. Neither the name(s) of the author(s) nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
new file mode 100644
index 000000000..16800d506
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/0001-Makefile-respect-LDFLAGS-for-libreg.patch
@@ -0,0 +1,29 @@
+From 1e1a78b7b4fa1662b4447aa19c15b1e839b7e9db Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20M=C3=BCller-Klieser?= <s.mueller-klieser@phytec.de>
+Date: Wed, 24 Aug 2016 10:58:45 +0200
+Subject: [PATCH] Makefile: respect LDFLAGS for libreg
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 2879896..1650db8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
+
+ $(LIBREG): regdb.h reglib.h reglib.c
+ $(NQ) ' CC ' $@
+- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
++ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
+
+ install-libreg-headers:
+ $(NQ) ' INSTALL libreg-headers'
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
new file mode 100644
index 000000000..3ef35ee54
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/do-not-run-ldconfig-if-destdir-is-set.patch
@@ -0,0 +1,21 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 23 Aug 2014 12:27:34 -0700
+Subject: crda: Do not run ldconfig if DESTDIR is set
+
+Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126028.html]
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+--- a/Makefile
++++ b/Makefile
+@@ -132,7 +132,9 @@ install-libreg:
+ $(NQ) ' INSTALL libreg'
+ $(Q)mkdir -p $(DESTDIR)/$(LIBDIR)
+ $(Q)cp $(LIBREG) $(DESTDIR)/$(LIBDIR)/
++ifndef DESTDIR
+ $(Q)ldconfig
++endif
+
+ %.o: %.c regdb.h $(LIBREG)
+ $(NQ) ' CC ' $@
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
new file mode 100644
index 000000000..747804d34
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-gcc-6-unused-variables.patch
@@ -0,0 +1,11 @@
+--- crda-3.18/utils/key2pub.py.orig 2016-06-18 09:54:23.671326113 -0400
++++ crda-3.18/utils/key2pub.py 2016-06-18 09:54:34.387326300 -0400
+@@ -115,7 +115,7 @@
+ .n = _n, .len_n = sizeof(_n), \
+ }
+
+-static const struct key_params keys[] = {
++static const struct key_params keys[] __attribute__((unused))= {
+ ''')
+ for n in xrange(n + 1):
+ output.write(' KEYS(e_%d, n_%d),\n' % (n, n))
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
new file mode 100644
index 000000000..1bb5c638f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
@@ -0,0 +1,58 @@
+From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Wed, 30 Nov 2016 10:27:36 +0800
+Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
+
+Fxed the below issues if configured with 'USE_OPENSSL=1':
+a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
+ to build failures:
+ keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
+ static BN_ULONG e_0[1] = {
+
+b. The large unqualified constants also break building:
+ keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
+ 0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
+
+c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
+ static struct pubkey keys[] = {
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 401d58a..3ae00b8 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
+ for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
+ if not idx:
+ output.write('\t')
+- output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
++ output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
+ idx += 1
+ if idx == 2:
+ idx = 0
+@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
+ def print_ssl(output, name, val):
+ import os
+ output.write('#include <stdint.h>\n')
++ output.write('#include <openssl/bn.h>\n')
+ if os.getenv('TARGET_BITS') == '64':
+ return print_ssl_64(output, name, val)
+ else:
+@@ -78,7 +79,7 @@ struct pubkey {
+
+ #define KEYS(e,n) { KEY(e), KEY(n), }
+
+-static struct pubkey keys[] = {
++static struct pubkey keys[] __attribute__((unused))= {
+ ''')
+ for n in xrange(n + 1):
+ output.write(' KEYS(e_%d, n_%d),\n' % (n, n))
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
new file mode 100644
index 000000000..812e98379
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/fix-linking-of-libraries-used-by-reglib.patch
@@ -0,0 +1,57 @@
+From 890f5bf2654b695a866262d72bfa9750af921a3b Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 23 Aug 2014 12:26:37 -0700
+Subject: [PATCH] Fix linking of libraries used by libreg
+
+The math and crypto libraries are called by and need to be linked to
+libreg.so, not to the executables.
+
+Upstream-Status: Backport [http://www.spinics.net/lists/linux-wireless/msg126027.html]
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ Makefile | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a3ead30..da2dcc3 100644
+--- a/Makefile
++++ b/Makefile
+@@ -30,7 +30,7 @@ CFLAGS += -std=gnu99 -Wall -Werror -pedantic
+ CFLAGS += -Wall -g
+ LDLIBREG += -lreg
+ LDLIBS += $(LDLIBREG)
+-LDLIBS += -lm
++LIBREGLDLIBS += -lm
+ LIBREG += libreg.so
+ LDFLAGS += -L ./
+
+@@ -40,13 +40,13 @@ all_noverify: $(LIBREG) crda intersect regdbdump db2rd optimize
+
+ ifeq ($(USE_OPENSSL),1)
+ CFLAGS += -DUSE_OPENSSL -DPUBKEY_DIR=\"$(RUNTIME_PUBKEY_DIR)\" `pkg-config --cflags openssl`
+-LDLIBS += `pkg-config --libs openssl`
++LIBREGLDLIBS += `pkg-config --libs openssl`
+
+ $(LIBREG): keys-ssl.c
+
+ else
+ CFLAGS += -DUSE_GCRYPT
+-LDLIBS += -lgcrypt
++LIBREGLDLIBS += -lgcrypt
+
+ $(LIBREG): keys-gcrypt.c
+
+@@ -116,7 +116,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
+
+ $(LIBREG): regdb.h reglib.h reglib.c
+ $(NQ) ' CC ' $@
+- $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^
++ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LIBREGLDLIBS)
+
+ install-libreg-headers:
+ $(NQ) ' INSTALL libreg-headers'
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch
new file mode 100644
index 000000000..0b737852c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/make.patch
@@ -0,0 +1,25 @@
+These headers are not related to any Make rule but they do appear in
+compiling of libreg.so, specifying .h files in compiler cmdline is flagged
+as error by clang
+
+| clang-4.0: error: cannot specify -o when generating multiple output files
+| make: *** [libreg.so] Error 1
+
+This is how we see headers in cmdline
+-O2 -fpic -std=gnu
+99 -Wall -Werror -pedantic -Wall -g -DUSE_GCRYPT -DCONFIG_LIBNL30 `pkg-config --cflags libnl-3.0` -o libreg.so -shared -Wl,-soname,libreg.so
+regdb.h reglib.h reglib.c keys-gcrypt.c -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -L ./ -lm -lgcrypt
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/Makefile.kk 2016-11-15 04:54:53.338670000 +0000
++++ a/Makefile 2016-11-15 04:55:07.718670000 +0000
+@@ -114,7 +114,7 @@ keys-%.c: utils/key2pub.py $(wildcard $(
+ $(NQ) ' Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
+ $(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
+
+-$(LIBREG): regdb.h reglib.h reglib.c
++$(LIBREG): reglib.c
+ $(NQ) ' CC ' $@
+ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -shared -Wl,-soname,$(LIBREG) $^ $(LDFLAGS) $(LIBREGLDLIBS)
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
new file mode 100644
index 000000000..100b765f2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
@@ -0,0 +1,34 @@
+From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Fri, 25 Nov 2016 16:48:01 +0800
+Subject: [PATCH] crda: Use target word size instead of host's.
+
+In key2pub.py, the codes check the wordsize
+of the host machine but not the target's, this fix
+fetches the wordsize of target from the build system.
+
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 3e84cd2..401d58a 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
+ output.write('};\n\n')
+
+ def print_ssl(output, name, val):
+- import struct
++ import os
+ output.write('#include <stdint.h>\n')
+- if len(struct.pack('@L', 0)) == 8:
++ if os.getenv('TARGET_BITS') == '64':
+ return print_ssl_64(output, name, val)
+ else:
+ return print_ssl_32(output, name, val)
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
new file mode 100644
index 000000000..82a297b33
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/crda/crda_3.18.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Wireless Central Regulatory Domain Agent"
+HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
+SECTION = "net"
+LICENSE = "copyleft-next-0.3.0"
+LIC_FILES_CHKSUM = "file://copyleft-next-0.3.0;md5=8743a2c359037d4d329a31e79eabeffe"
+
+DEPENDS = "python-m2crypto-native python-typing-native python-native libgcrypt libnl openssl"
+
+SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz \
+ file://do-not-run-ldconfig-if-destdir-is-set.patch \
+ file://fix-linking-of-libraries-used-by-reglib.patch \
+ file://fix-gcc-6-unused-variables.patch \
+ file://0001-Makefile-respect-LDFLAGS-for-libreg.patch \
+ file://make.patch \
+ file://use-target-word-size-instead-of-host-s.patch \
+ file://fix-issues-when-USE_OPENSSL-1.patch \
+"
+SRC_URI[md5sum] = "0431fef3067bf503dfb464069f06163a"
+SRC_URI[sha256sum] = "43fcb9679f8b75ed87ad10944a506292def13e4afb194afa7aa921b01e8ecdbf"
+
+inherit python-dir pythonnative
+# Recursive make problem
+EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D} LIBDIR=${libdir}/crda LDLIBREG='-Wl,-rpath,${libdir}/crda -lreg'"
+EXTRA_OEMAKE_append = " USE_OPENSSL=1"
+TARGET_BITS = "${SITEINFO_BITS}"
+export TARGET_BITS
+
+do_compile() {
+ oe_runmake all_noverify
+}
+
+do_install() {
+ oe_runmake SBINDIR=${sbindir}/ install
+}
+
+RDEPENDS_${PN} = "udev wireless-regdb"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb b/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
new file mode 100644
index 000000000..ec35175a0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
@@ -0,0 +1,35 @@
+SUMMARY = "The dump DAQ test the various inline mode features "
+HOMEPAGE = "http://www.snort.org"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f9ce51a65dd738dc1ae631d8b21c40e0"
+
+PARALLEL_MAKE = ""
+
+DEPENDS = "libpcap libpcre libdnet"
+
+SRC_URI = "http://fossies.org/linux/misc/daq-${PV}.tar.gz \
+ file://disable-run-test-program-while-cross-compiling.patch \
+ file://0001-correct-the-location-of-unistd.h.patch \
+ "
+
+# these 2 create undeclared dependency on libdnet and libnetfilter-queue from meta-networking
+# this error from test-dependencies script:
+# daq/daq/latest lost dependency on libdnet libmnl libnetfilter-queue libnfnetlink
+#
+# never look to /usr/local lib while cross compiling
+
+EXTRA_OECONF = "--disable-nfq-module --disable-ipq-module --includedir=${includedir} \
+ --with-libpcap-includes=${STAGING_INCDIR} --with-dnet-includes=${STAGING_LIBDIR}"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+SRC_URI[md5sum] = "2cd6da422a72c129c685fc4bb848c24c"
+SRC_URI[sha256sum] = "b40e1d1273e08aaeaa86e69d4f28d535b7e53bdb3898adf539266b63137be7cb"
+
+inherit autotools
+
+DISABLE_STATIC = ""
+
+BBCLASSEXTEND = "native"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch b/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch
new file mode 100644
index 000000000..4798a77f5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/daq/files/0001-correct-the-location-of-unistd.h.patch
@@ -0,0 +1,29 @@
+From 10e7d4e4bfcb70344d18f0d4ce36068475747f25 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 15:59:43 -0700
+Subject: [PATCH] correct the location of unistd.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ os-daq-modules/daq_ipfw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os-daq-modules/daq_ipfw.c b/os-daq-modules/daq_ipfw.c
+index 016beb0..c2a4175 100644
+--- a/os-daq-modules/daq_ipfw.c
++++ b/os-daq-modules/daq_ipfw.c
+@@ -23,10 +23,10 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <unistd.h>
+
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/daq/files/disable-run-test-program-while-cross-compiling.patch b/meta-openembedded/meta-networking/recipes-connectivity/daq/files/disable-run-test-program-while-cross-compiling.patch
new file mode 100644
index 000000000..a100b7cb8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/daq/files/disable-run-test-program-while-cross-compiling.patch
@@ -0,0 +1,31 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+fix the below error:
+configure: error: cannot run test program while cross compiling
+
+Signed-off-by: Chunrong Guo <B40290@freescale.com>
+
+--- a/m4/sf.m4old 2015-10-28 10:21:20.270557986 +0800
++++ a/m4/sf.m4 2015-10-28 10:23:22.726551974 +0800
+@@ -135,20 +135,7 @@
+ echo
+ exit 1
+ fi
+- AC_CACHE_CHECK([for libpcap version >= $1], [daq_cv_libpcap_version_1x], [
+- AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM(
+- [[
+- #include <pcap.h>
+- #include <string.h>
+- extern char pcap_version[];
+- ]],
+- [[
+- if (strcmp(pcap_version, $1) < 0)
+- return 1;
+- ]])],
+- [daq_cv_libpcap_version_1x="yes"],
+- [daq_cv_libpcap_version_1x="no"])])
++ AC_CACHE_CHECK([for libpcap version >= $1], [daq_cv_libpcap_version_1x])
+ if test "x$daq_cv_libpcap_version_1x" = "xno"; then
+ echo
+ echo " ERROR! Libpcap library version >= $1 not found."
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.5.bb b/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.5.bb
new file mode 100644
index 000000000..885c6c0e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/dhcpcd/dhcpcd_6.11.5.bb
@@ -0,0 +1,24 @@
+SECTION = "console/network"
+SUMMARY = "dhcpcd - a DHCP client"
+DESCRIPTION = "dhcpcd runs on your machine and silently configures your computer to work on the attached networks without trouble and mostly without configuration."
+
+HOMEPAGE = "http://roy.marples.name/projects/dhcpcd/"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://dhcpcd.c;endline=26;md5=77c40d671aff804ca91ea99556da8e9b"
+
+SRC_URI = "http://roy.marples.name/downloads/${BPN}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "2465624b62c1154f0e89dc69c42c849b"
+SRC_URI[sha256sum] = "6f9674dc7e27e936cc787175404a6171618675ecfb6903ab9887b1b66a87d69e"
+
+inherit autotools-brokensep
+
+PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
+
+EXTRA_OECONF = "--enable-ipv4"
+
+FILES_${PN}-dbg += "${libdir}/dhcpcd/dev/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch b/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
new file mode 100644
index 000000000..42d2627a1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
@@ -0,0 +1,48 @@
+Index: git/ClntMessages/ClntMsgRequest.cpp
+===================================================================
+--- git.orig/ClntMessages/ClntMsgRequest.cpp
++++ git/ClntMessages/ClntMsgRequest.cpp
+@@ -142,7 +142,10 @@ TClntMsgRequest::TClntMsgRequest(List(TA
+ IsDone=false;
+ SPtr<TOpt> ptr;
+ ptr = new TOptDUID(OPTION_CLIENTID, ClntCfgMgr().getDUID(), this );
+- Options.push_back( ptr );
++
++ if ( ptr ) {
++ Options.push_back( ptr );
++ }
+
+ if (!srvDUID) {
+ Log(Error) << "Unable to send REQUEST: ServerId not specified.\n" << LogEnd;
+@@ -153,7 +156,9 @@ TClntMsgRequest::TClntMsgRequest(List(TA
+ ptr = new TOptDUID(OPTION_SERVERID, srvDUID,this);
+ // all IAs provided by checkSolicit
+ SPtr<TAddrIA> ClntAddrIA;
+- Options.push_back( ptr );
++ if ( ptr ) {
++ Options.push_back( ptr );
++ }
+
+ IAs.first();
+ while (ClntAddrIA = IAs.get())
+Index: git/Messages/Msg.cpp
+===================================================================
+--- git.orig/Messages/Msg.cpp
++++ git/Messages/Msg.cpp
+@@ -69,10 +69,15 @@ int TMsg::getSize()
+ {
+ int pktsize=0;
+ TOptList::iterator opt;
++ int optionCount = 0;
+ for (opt = Options.begin(); opt!=Options.end(); ++opt)
+ {
+- pktsize += (*opt)->getSize();
++ Log(Info) << "### CPE Debug - Option with index " << optionCount++ << LogEnd ;
++ Log(Info) << "### CPE Debug - Option with type " << (*opt)->getOptType() << LogEnd ;
++ pktsize += (*opt)->getSize();
+ }
++ Log(Info) << "### CPE Debug - Packet size of option (Add 4) " << pktsize << LogEnd ;
++
+ return pktsize + 4;
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb b/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb
new file mode 100644
index 000000000..8890e1431
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/dibbler/dibbler_git.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Dibbler DHCPv6 client"
+DESCRIPTION = "Dibbler is a portable DHCPv6 implementation. It supports stateful as well as stateless autoconfiguration for IPv6."
+HOMEPAGE = "http://klub.com.pl/dhcpv6"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7236695bb6d4461c105d685a8b61c4e3"
+
+SRCREV = "c4b0ed52e751da7823dd9a36e91f93a6310e5525"
+
+SRC_URI = "git://github.com/tomaszmrugalski/dibbler \
+ file://dibbler_fix_getSize_crash.patch \
+ "
+PV = "1.0.1+1.0.2RC1+git${SRCREV}"
+
+S = "${WORKDIR}/git"
+
+PACKAGECONFIG ??= "debug bind-reuse resolvconf dns-update"
+
+PACKAGECONFIG[debug] = "--enable-debug,,,"
+PACKAGECONFIG[efence] = "--enable-efence,,,"
+PACKAGECONFIG[bind-reuse] = "--enable-bind-reuse,,,"
+PACKAGECONFIG[dst-addr-filter] = "--enable-dst-addr-check,,,"
+PACKAGECONFIG[resolvconf] = "--enable-resolvconf,,,"
+PACKAGECONFIG[dns-update] = "--enable-dns-update,,,"
+PACKAGECONFIG[auth] = "--enable-auth,,,"
+PACKAGECONFIG[gtest] = "--enable-gtest-static,,,"
+
+inherit autotools
+
+DEPENDS += "flex-native"
+
+PACKAGES =+ "${PN}-requestor ${PN}-client ${PN}-relay ${PN}-server"
+
+FILES_${PN}-client = "${sbindir}/${PN}-client"
+FILES_${PN}-relay = "${sbindir}/${PN}-relay"
+FILES_${PN}-requestor = "${sbindir}/${PN}-requestor"
+FILES_${PN}-server = "${sbindir}/${PN}-server"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb
new file mode 100644
index 000000000..51e220c9e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/ez-ipupdate_3.0.11b7.bb
@@ -0,0 +1,16 @@
+SUMMARY = "daemon that sends updates when your IP changes"
+HOMEPAGE = "http://sourceforge.net/projects/ez-ipupdate/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7783169b4be06b54e86730eb01bc3a31"
+
+SRC_URI = "http://sourceforge.net/projects/ez-ipupdate/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://Makefile.am.patch \
+ file://cache_file.c.patch \
+ file://conf_file.c.patch \
+ file://wformat.patch \
+ "
+SRC_URI[md5sum] = "525be4550b4461fdf105aed8e753b020"
+SRC_URI[sha256sum] = "a15ec0dc0b78ec7578360987c68e43a67bc8d3591cbf528a323588830ae22c20"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch
new file mode 100644
index 000000000..d80ed3e29
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/Makefile.am.patch
@@ -0,0 +1,14 @@
+Remove EXTRASRC and EXTRAOBJ from obj list
+
+--- ez-ipupdate-3.0.11b7/Makefile.am.orig 2014-07-02 13:47:50.758034983 -0600
++++ ez-ipupdate-3.0.11b7/Makefile.am 2014-07-02 13:48:38.406034650 -0600
+@@ -1,7 +1,7 @@
+
+ bin_PROGRAMS = ez-ipupdate
+-ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h @EXTRASRC@
+-ez_ipupdate_LDADD = @EXTRAOBJ@
++ez_ipupdate_SOURCES = ez-ipupdate.c conf_file.c conf_file.h md5.c md5.h cache_file.c cache_file.h error.h pid_file.c pid_file.h dprintf.h
++ez_ipupdate_LDADD =
+
+ EXTRA_DIST = getpass.c ez-ipupdate.lsm example.conf example-pgpow.conf example-dhs.conf example-dyndns.conf example-ods.conf example-tzo.conf example-gnudip.conf example-easydns.conf example-justlinux.conf example-dyns.conf CHANGELOG mkbinary example-heipv6tb.conf
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch
new file mode 100644
index 000000000..de5eb3a6d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/cache_file.c.patch
@@ -0,0 +1,32 @@
+Dont assume errno type
+
+--- ez-ipupdate-3.0.11b7/cache_file.c.orig 2014-07-02 14:01:07.126029412 -0600
++++ ez-ipupdate-3.0.11b7/cache_file.c 2014-07-02 14:08:27.422026332 -0600
+@@ -43,11 +43,11 @@
+ #include <cache_file.h>
+
+ #if HAVE_STRERROR
+-extern int errno;
++# include <errno.h>
+ # define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++# include <errno.h>
+ # define error_string (sys_errlist[errno])
+ #else
+ # define error_string "error message not found"
+@@ -63,11 +63,11 @@
+ # define dprintf(x)
+ #endif
+ #if HAVE_STRERROR
+-extern int errno;
++# include <errno.h>
+ # define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++# include <errno.h>
+ # define error_string (sys_errlist[errno])
+ #else
+ # define error_string "error message not found"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch
new file mode 100644
index 000000000..02218a39e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/conf_file.c.patch
@@ -0,0 +1,18 @@
+Dont assume errno type
+
+--- ez-ipupdate-3.0.11b7/conf_file.c.orig 2014-07-02 14:01:19.174029328 -0600
++++ ez-ipupdate-3.0.11b7/conf_file.c 2014-07-02 14:08:42.982026223 -0600
+@@ -38,11 +38,11 @@
+ #include <conf_file.h>
+
+ #if HAVE_STRERROR
+-extern int errno;
++# include <errno.h>
+ # define error_string strerror(errno)
+ #elif HAVE_SYS_ERRLIST
+ extern const char *const sys_errlist[];
+-extern int errno;
++# include <errno.h>
+ # define error_string (sys_errlist[errno])
+ #else
+ # define error_string "error message not found"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch
new file mode 100644
index 000000000..1de267f08
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ez-ipupdate/files/wformat.patch
@@ -0,0 +1,13 @@
+Index: ez-ipupdate-3.0.11b7/ez-ipupdate.c
+===================================================================
+--- ez-ipupdate-3.0.11b7.orig/ez-ipupdate.c
++++ ez-ipupdate-3.0.11b7/ez-ipupdate.c
+@@ -798,7 +798,7 @@ void show_message(char *fmt, ...)
+ sprintf(buf, "message incomplete because your OS sucks: %s\n", fmt);
+ #endif
+
+- syslog(LOG_NOTICE, buf);
++ syslog(LOG_NOTICE, "%s", buf);
+ }
+ else
+ {
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch
new file mode 100644
index 000000000..db8caab12
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch
@@ -0,0 +1,28 @@
+From 66e8bcdcca8971b5c43c31755d56d7f675d8b5ff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Jun 2017 20:10:49 -0700
+Subject: [PATCH] rlm_mschap: Use includedir instead of hardcoding /usr/include
+
+OE QA flags it correctly as a voilation of cross compilation
+namespace
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/modules/rlm_mschap/configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: freeradius-server-3.0.14/src/modules/rlm_mschap/configure.ac
+===================================================================
+--- freeradius-server-3.0.14.orig/src/modules/rlm_mschap/configure.ac
++++ freeradius-server-3.0.14/src/modules/rlm_mschap/configure.ac
+@@ -72,7 +72,7 @@ if test x$with_[]modname != xno; then
+ mod_ldflags="-framework DirectoryService"
+ fi
+
+- smart_try_dir="$winbind_include_dir /usr/include/samba-4.0"
++ smart_try_dir="$winbind_include_dir =/usr/include/samba-4.0"
+ FR_SMART_CHECK_INCLUDE(wbclient.h, [#include <stdint.h>
+ #include <stdbool.h>])
+ if test "x$ac_cv_header_wbclient_h" != "xyes"; then
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius
new file mode 100644
index 000000000..fa412e2aa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius
@@ -0,0 +1,110 @@
+#!/bin/sh
+# Start/stop the FreeRADIUS daemon.
+
+### BEGIN INIT INFO
+# Provides: freeradius
+# Required-Start: $remote_fs $network $syslog
+# Should-Start: $time mysql slapd postgresql samba krb5-kdc
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Radius Daemon
+# Description: Extensible, configurable radius daemon
+### END INIT INFO
+
+set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+if [ -f /lib/lsb/init-functions ]; then
+ . /lib/lsb/init-functions
+fi
+
+PROG="radiusd"
+PROGRAM="/usr/sbin/radiusd"
+PIDFILE="/var/run/radiusd/radiusd.pid"
+DESCR="FreeRADIUS daemon"
+
+if [ -r /etc/default/$PROG ]; then
+ . /etc/default/$PROG
+fi
+
+test -f $PROGRAM || exit 0
+
+check_certs() {
+ if [ ! -f /etc/raddb/certs/server.pem ]; then
+ echo -n "Creating certificates for freeradius..."
+ if sudo -u radiusd /etc/raddb/certs/bootstrap 1> /dev/null 2> /dev/null; then
+ echo "done"
+ else
+ echo "failed!"
+ fi
+ fi
+
+}
+
+# /var/run may be a tmpfs
+if [ ! -d /var/run/radiusd ]; then
+ mkdir -p /var/run/radiusd
+ chown radiusd:radiusd /var/run/radiusd
+fi
+
+if [ ! -d /var/log/radius ]; then
+ mkdir -p /var/log/radius
+ touch /var/log/radius/radius.log
+ chown radiusd:radiusd /var/run/radius
+fi
+
+if [ ! -f ${PIDFILE} ]; then
+ touch ${PIDFILE}
+ chown radiusd:radiusd ${PIDFILE}
+fi
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+ret=0
+
+case "$1" in
+ start)
+ check_certs
+ echo -n "Starting $DESCR" "$PROG"
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $PROGRAM -- $FREERADIUS_OPTIONS || ret=$?
+ [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+ exit $ret
+ ;;
+ stop)
+ echo -n "Stopping $DESCR" "$PROG"
+ if [ -f "$PIDFILE" ] ; then
+ start-stop-daemon --stop --retry=TERM/30/KILL/5 --quiet --pidfile $PIDFILE || ret=$?
+ else
+ echo -n "$PIDFILE not found"
+ ret=1
+ fi
+ [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+ ;;
+ status)
+ status $PROGRAM;
+ exit $?
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ reload|force-reload)
+ echo -n "Reloading $DESCR" "$PROG"
+ if [ -f "$PIDFILE" ] ; then
+ start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE || ret=$?
+ else
+ echo -n "$PIDFILE not found"
+ ret=1
+ fi
+ [ "$ret" == 0 ] && echo " Success" || echo " Failed"
+ ;;
+ *)
+ echo "Usage: $0 start|stop|status|restart|force-reload|reload"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch
new file mode 100644
index 000000000..9c997661f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch
@@ -0,0 +1,197 @@
+From dc41591d5ceb18900ec85894f8f7b7bb44bb3bd9 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 4 Jan 2016 01:44:04 -0500
+Subject: [PATCH] avoid searching host dirs
+
+Don't search the hardcoded host dirs to avoid
+host contamination.
+
+Upstream-Status: Inappropriate [cross-compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ acinclude.m4 | 4 ++--
+ src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac | 4 ++--
+ src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac | 4 ++--
+ src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac | 4 ++--
+ src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac | 6 +++---
+ src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac | 2 +-
+ src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac | 4 ++--
+ src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac | 4 ++--
+ 8 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index da48acc..b513ae1 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -178,7 +178,7 @@ if test "x$smart_lib" = "x"; then
+ FR_LOCATE_DIR(smart_lib_dir,[lib$1${libltdl_cv_shlibext}])
+ FR_LOCATE_DIR(smart_lib_dir,[lib$1.a])
+
+- for try in $smart_lib_dir /usr/local/lib /opt/lib; do
++ for try in $smart_lib_dir; do
+ AC_MSG_CHECKING([for $2 in -l$1 in $try])
+ LIBS="-l$1 $old_LIBS"
+ CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
+@@ -218,7 +218,7 @@ ac_safe=`echo "$1" | sed 'y%./+-%__pm%'`
+ old_CPPFLAGS="$CPPFLAGS"
+ smart_include=
+ dnl # The default directories we search in (in addition to the compilers search path)
+-smart_include_dir="/usr/local/include /opt/include"
++smart_include_dir=
+
+ dnl # Our local versions
+ _smart_try_dir=
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
+index 75c851a..a262d71 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
+@@ -57,14 +57,14 @@ if test x$with_[]modname != xno; then
+ esac])
+
+ dnl Check for SQLConnect in -ldb2
+- smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib /usr/IBMdb2/V7.1/lib"
++ smart_try_dir="$ibmdb2_lib_dir"
+ FR_SMART_CHECK_LIB(db2, SQLConnect)
+ if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then
+ fail="$fail libdb2"
+ fi
+
+ dnl Check for sqlcli.h
+- smart_try_dir="$ibmdb2_include_dir /usr/local/db2/include /usr/IBMdb2/V7.1/include"
++ smart_try_dir="$ibmdb2_include_dir"
+ FR_SMART_CHECK_INCLUDE(sqlcli.h)
+ if test "x$ac_cv_header_sqlcli_h" != xyes; then
+ fail="$fail sqlcli.h"
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
+index 4da57b3..752b043 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
+@@ -56,14 +56,14 @@ if test x$with_[]modname != xno; then
+ esac])
+
+ dnl Check for isc_attach_database in -lfbclient
+- smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib"
++ smart_try_dir="$firebird_lib_dir"
+ FR_SMART_CHECK_LIB(fbclient, isc_attach_database)
+ if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then
+ fail="$fail libfbclient"
+ fi
+
+ dnl Check for ibase.h
+- smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include"
++ smart_try_dir="$firebird_include_dir"
+ FR_SMART_CHECK_INCLUDE(ibase.h)
+ if test "x$ac_cv_header_ibase_h" != xyes; then
+ fail="$fail ibase.h"
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
+index ba6304f..3393557 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
+@@ -57,14 +57,14 @@ if test x$with_[]modname != xno; then
+ esac])
+
+ dnl Check for SQLConnect in -liodbc
+- smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc"
++ smart_try_dir="$iodbc_lib_dir"
+ FR_SMART_CHECK_LIB(iodbc, SQLConnect)
+ if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then
+ fail="$fail libiodbc"
+ fi
+
+ dnl Check for isql.h
+- smart_try_dir="$iodbc_include_dir /usr/include /usr/include/iodbc /usr/local/iodbc/include"
++ smart_try_dir="$iodbc_include_dir"
+ FR_SMART_CHECK_INCLUDE(isql.h)
+ if test "x$ac_cv_header_isql_h" != xyes; then
+ fail="$fail isql.h"
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
+index 1401677..2e7db44 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
+@@ -136,7 +136,7 @@ if test x$with_[]modname != xno; then
+
+ dnl # Check for libmysqlclient_r
+ if test "x$have_a_libmysqlclient" != "xyes"; then
+- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
++ smart_try_dir="$mysql_lib_dir"
+ FR_SMART_CHECK_LIB(mysqlclient_r, mysql_init)
+ if test "x$ac_cv_lib_mysqlclient_r_mysql_init" = "xyes"; then
+ have_a_libmysqlclient='yes'
+@@ -145,7 +145,7 @@ if test x$with_[]modname != xno; then
+
+ dnl # Check for libmysqlclient
+ if test "x$have_a_libmysqlclient" != "xyes"; then
+- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
++ smart_try_dir="$mysql_lib_dir"
+ FR_SMART_CHECK_LIB(mysqlclient, mysql_init)
+ if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
+ have_a_libmysqlclient='yes'
+@@ -189,7 +189,7 @@ if test x$with_[]modname != xno; then
+ fi
+
+ if test "x$have_mysql_h" != "xyes"; then
+- smart_try_dir="$mysql_include_dir /usr/local/include /usr/local/mysql/include"
++ smart_try_dir="$mysql_include_dir"
+ FR_SMART_CHECK_INCLUDE(mysql/mysql.h)
+ if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then
+ AC_DEFINE(HAVE_MYSQL_MYSQL_H, [], [Define if you have <mysql/mysql.h>])
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
+index 3178462..5cbc8c2 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
+@@ -63,7 +63,7 @@ if test x$with_[]modname != xno; then
+ dnl # Check for header files
+ dnl ############################################################
+
+- smart_try_dir="$oracle_include_dir /usr/local/instaclient/include"
++ smart_try_dir="$oracle_include_dir"
+
+ if test "x$ORACLE_HOME" != "x"; then
+ smart_try_dir="${smart_try_dir} ${ORACLE_HOME}/include"
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
+index 4f9a890..e1cf811 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
+@@ -41,7 +41,7 @@ if test x$with_[]modname != xno; then
+ esac ]
+ )
+
+- smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql"
++ smart_try_dir="$rlm_sql_postgresql_include_dir"
+ FR_SMART_CHECK_INCLUDE(libpq-fe.h)
+ if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then
+ fail="$fail libpq-fe.h"
+@@ -76,7 +76,7 @@ if test x$with_[]modname != xno; then
+ ])
+ fi
+
+- smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib"
++ smart_try_dir="$rlm_sql_postgresql_lib_dir"
+ FR_SMART_CHECK_LIB(pq, PQconnectdb)
+ if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then
+ fail="$fail libpq"
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
+index 3545387..c543ed4 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
++++ b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
+@@ -57,14 +57,14 @@ if test x$with_[]modname != xno; then
+ esac])
+
+ dnl Check for SQLConnect in -lodbc
+- smart_try_dir="$unixodbc_lib_dir /usr/local/unixodbc/lib"
++ smart_try_dir="$unixodbc_lib_dir"
+ FR_SMART_CHECK_LIB(odbc, SQLConnect)
+ if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then
+ fail="$fail libodbc"
+ fi
+
+ dnl Check for sql.h
+- smart_try_dir="$unixodbc_include_dir /usr/local/unixodbc/include"
++ smart_try_dir="$unixodbc_include_dir"
+ FR_SMART_CHECK_INCLUDE(sql.h)
+ if test "x$ac_cv_header_sql_h" != xyes; then
+ fail="$fail sql.h"
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch
new file mode 100644
index 000000000..71b78090c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch
@@ -0,0 +1,70 @@
+From 74eed61dec8702c89f3e121d577ea9db25c961a4 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 11 Jan 2016 02:52:16 -0500
+Subject: [PATCH] configure.ac: add option for libcap
+
+Upstream-Status: Pending
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 37 ++++++++++++++++++++++++++++---------
+ 1 file changed, 28 insertions(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 066d3d7..6e4266b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -948,6 +948,23 @@ fi
+ dnl Set by FR_SMART_CHECKLIB
+ LIBS="${old_LIBS}"
+
++dnl #
++dnl # extra argument: --with-libcap
++dnl #
++WITH_LIBCAP=yes
++AC_ARG_WITH(libcap,
++[ --with-licap use licap for debugger checks. (default=yes)],
++[ case "$withval" in
++ no)
++ WITH_LIBCAP=no
++ ;;
++ *)
++ WITH_LIBCAP=yes
++ ;;
++ esac ]
++)
++
++
+ dnl Check for cap
+ dnl extra argument: --with-cap-lib-dir=DIR
+ cap_lib_dir=
+@@ -981,15 +998,17 @@ AC_ARG_WITH(cap-include-dir,
+ ;;
+ esac])
+
+-smart_try_dir="$cap_lib_dir"
+-FR_SMART_CHECK_LIB(cap, cap_get_proc)
+-if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then
+- AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.])
+-else
+- AC_DEFINE(HAVE_LIBCAP, 1,
+- [Define to 1 if you have the `cap' library (-lcap).]
+- )
+- HAVE_LIBCAP=1
++if test "x$WITH_LIBCAP" = xyes; then
++ smart_try_dir="$cap_lib_dir"
++ FR_SMART_CHECK_LIB(cap, cap_get_proc)
++ if test "x$ac_cv_lib_cap_cap_get_proc" != "xyes"; then
++ AC_MSG_WARN([cap library not found, debugger checks will not be enabled. Use --with-cap-lib-dir=<path>.])
++ else
++ AC_DEFINE(HAVE_LIBCAP, 1,
++ [Define to 1 if you have the `cap' library (-lcap).]
++ )
++ HAVE_LIBCAP=1
++ fi
+ fi
+
+ VL_LIB_READLINE
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch
new file mode 100644
index 000000000..30497a602
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch
@@ -0,0 +1,31 @@
+Subject: [PATCH] configure.ac: allow cross-compilation
+
+The checking OpenSSL library and header version consistency will
+always fail in cross compiling, skip the check and give a warning
+instead for cross compiling.
+
+Upstream-Status: Inappropriate[embedded specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ src/modules/rlm_krb5/configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/modules/rlm_krb5/configure.ac b/src/modules/rlm_krb5/configure.ac
+index eb43534..113a079 100644
+--- a/src/modules/rlm_krb5/configure.ac
++++ b/src/modules/rlm_krb5/configure.ac
+@@ -137,7 +137,8 @@ if test x$with_[]modname != xno; then
+ FR_SMART_CHECK_LIB(krb5, krb5_is_thread_safe)
+ if test "x$ac_cv_lib_krb5_krb5_is_thread_safe" == xyes; then
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <krb5.h>]], [[return krb5_is_thread_safe() ? 0 : 1]])],
+- [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])])
++ [krb5threadsafe="-DKRB5_IS_THREAD_SAFE"], [AC_MSG_WARN([[libkrb5 is not threadsafe]])],
++ [AC_MSG_WARN(cross compiling: not checking)])
+ fi
+ else
+ krb5threadsafe=""
+--
+2.10.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch
new file mode 100644
index 000000000..4a62bf1fa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch
@@ -0,0 +1,28 @@
+Enable and change user and group of freeradius server to radiusd
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ raddb/radiusd.conf.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/raddb/radiusd.conf.in b/raddb/radiusd.conf.in
+index c62f4ff..0b4a84e 100644
+--- a/raddb/radiusd.conf.in
++++ b/raddb/radiusd.conf.in
+@@ -436,8 +436,8 @@ security {
+ # member. This can allow for some finer-grained access
+ # controls.
+ #
+-# user = radius
+-# group = radius
++ user = radiusd
++ group = radiusd
+
+ # Core dumps are a bad thing. This should only be set to
+ # 'yes' if you're debugging a problem with the server.
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch
new file mode 100644
index 000000000..af1bff051
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch
@@ -0,0 +1,61 @@
+From 5b6d8b14f2696fcf1dca119212f9d0a0fa04defd Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Wed, 18 Jan 2017 14:59:39 +0800
+Subject: [PATCH] fix error for expansion of macro in thread.h
+
+The parameter declaration is missing in expansion of macro
+which cause the build error:
+| In file included from src/freeradius-devel/libradius.h:80:0,
+| from src/lib/log.c:26:
+| src/lib/log.c: In function '__fr_thread_local_destroy_fr_strerror_buffer':
+| src/lib/log.c:37:31: error: 'fr_strerror_buffer' undeclared (first use in this function)
+| fr_thread_local_setup(char *, fr_strerror_buffer) /* macro */
+| ^
+
+Add the missing declaration in macro.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ src/include/threads.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/include/threads.h b/src/include/threads.h
+index e36d81d..2bcb6aa 100644
+--- a/src/include/threads.h
++++ b/src/include/threads.h
+@@ -89,7 +89,7 @@ static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
+ # define fr_thread_local_get(_n) _n
+ #elif defined(HAVE_PTHREAD_H)
+ # include <pthread.h>
+-# define fr_thread_local_setup(_t, _n) \
++# define fr_thread_local_setup(_t, _n) static __thread _t _n;\
+ static pthread_key_t __fr_thread_local_key_##_n;\
+ static pthread_once_t __fr_thread_local_once_##_n = PTHREAD_ONCE_INIT;\
+ static pthread_destructor_t __fr_thread_local_destructor_##_n = NULL;\
+@@ -100,17 +100,17 @@ static void __fr_thread_local_destroy_##_n(UNUSED void *unused)\
+ static void __fr_thread_local_key_init_##_n(void)\
+ {\
+ (void) pthread_key_create(&__fr_thread_local_key_##_n, __fr_thread_local_destroy_##_n);\
+- (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
+ }\
+ static _t __fr_thread_local_init_##_n(pthread_destructor_t func)\
+ {\
+ __fr_thread_local_destructor_##_n = func;\
+ if (_n) return _n; \
+ (void) pthread_once(&__fr_thread_local_once_##_n, __fr_thread_local_key_init_##_n);\
++ (void) pthread_setspecific(__fr_thread_local_key_##_n, &(_n));\
+ return _n;\
+ }
+-# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)
+-# define fr_thread_local_set(_n, _v) __fr_thread_local_set_##_n(_v)
+-# define fr_thread_local_get(_n) __fr_thread_local_get_##_n()
++# define fr_thread_local_init(_n, _f) __fr_thread_local_init_##_n(_f)
++# define fr_thread_local_set(_n, _v) ((int)!((_n = _v) || 1))
++# define fr_thread_local_get(_n) _n
+ #endif
+ #endif
+--
+2.10.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch
new file mode 100644
index 000000000..d29b2ac39
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch
@@ -0,0 +1,236 @@
+From d8e251ef97869ab2c1c82bd374016f402083997c Mon Sep 17 00:00:00 2001
+From: Jorge Pereira <jpereiran@gmail.com>
+Date: Mon, 7 Dec 2015 16:51:07 -0200
+Subject: [PATCH] Fixing issues related to m4 include path
+
+Upstream-Status: Submitted [1]
+
+[1]: https://github.com/FreeRADIUS/freeradius-server/pull/1428
+
+Submmited by: Jorge Pereira <jpereiran@gmail.com>
+---
+ src/modules/rlm_example/config.h.in | 39 ++--------------------
+ src/modules/rlm_ldap/configure | 2 +-
+ src/modules/rlm_pam/config.h.in | 3 ++
+ src/modules/rlm_perl/config.h.in | 3 ++
+ src/modules/rlm_perl/configure.ac | 2 +-
+ src/modules/rlm_radutmp/config.h.in | 3 ++
+ src/modules/rlm_ruby/configure | 1 +
+ src/modules/rlm_ruby/configure.ac | 9 ++---
+ src/modules/rlm_smsotp/config.h.in | 3 ++
+ .../rlm_sql/drivers/rlm_sql_mysql/config.h.in | 3 ++
+ src/modules/rlm_unix/config.h.in | 6 ++++
+ 11 files changed, 32 insertions(+), 42 deletions(-)
+
+diff --git a/src/modules/rlm_example/config.h.in b/src/modules/rlm_example/config.h.in
+index 2a81ef5..f80de9c 100644
+--- a/src/modules/rlm_example/config.h.in
++++ b/src/modules/rlm_example/config.h.in
+@@ -1,38 +1,5 @@
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
+-/* Define to 1 if you have the <inttypes.h> header file. */
+-#undef HAVE_INTTYPES_H
+-
+-/* Define to 1 if you have the <memory.h> header file. */
+-#undef HAVE_MEMORY_H
+-
+-/* Define to 1 if you have the `printf' function. */
+-#undef HAVE_PRINTF
+-
+-/* Define to 1 if you have the <stdint.h> header file. */
+-#undef HAVE_STDINT_H
+-
+-/* Define to 1 if you have the <stdio.h> header file. */
+-#undef HAVE_STDIO_H
+-
+-/* Define to 1 if you have the <stdlib.h> header file. */
+-#undef HAVE_STDLIB_H
+-
+-/* Define to 1 if you have the <strings.h> header file. */
+-#undef HAVE_STRINGS_H
+-
+-/* Define to 1 if you have the <string.h> header file. */
+-#undef HAVE_STRING_H
+-
+-/* Define to 1 if you have the <sys/stat.h> header file. */
+-#undef HAVE_SYS_STAT_H
+-
+-/* Define to 1 if you have the <sys/types.h> header file. */
+-#undef HAVE_SYS_TYPES_H
+-
+-/* Define to 1 if you have the <unistd.h> header file. */
+-#undef HAVE_UNISTD_H
+-
+ /* Define to the address where bug reports for this package should be sent. */
+ #undef PACKAGE_BUGREPORT
+
+@@ -45,8 +12,8 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+-
+-/* Define to 1 if you have the ANSI C header files. */
+-#undef STDC_HEADERS
+diff --git a/src/modules/rlm_ldap/configure b/src/modules/rlm_ldap/configure
+index e0c15d9..cdf96d5 100755
+--- a/src/modules/rlm_ldap/configure
++++ b/src/modules/rlm_ldap/configure
+@@ -3992,7 +3992,7 @@ smart_prefix=
+ $as_echo "#define WITH_SASL 1" >>confdefs.h
+
+ SASL=sasl.c
+- fi
++ fi
+ fi
+
+ targetname=rlm_ldap
+diff --git a/src/modules/rlm_pam/config.h.in b/src/modules/rlm_pam/config.h.in
+index 32ef6ff..1ad20c5 100644
+--- a/src/modules/rlm_pam/config.h.in
++++ b/src/modules/rlm_pam/config.h.in
+@@ -45,6 +45,9 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
+diff --git a/src/modules/rlm_perl/config.h.in b/src/modules/rlm_perl/config.h.in
+index 989ed53..f80de9c 100644
+--- a/src/modules/rlm_perl/config.h.in
++++ b/src/modules/rlm_perl/config.h.in
+@@ -12,5 +12,8 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+diff --git a/src/modules/rlm_perl/configure.ac b/src/modules/rlm_perl/configure.ac
+index 44c5fc9..6b2a043 100644
+--- a/src/modules/rlm_perl/configure.ac
++++ b/src/modules/rlm_perl/configure.ac
+@@ -3,7 +3,7 @@ AC_INIT(rlm_perl.c)
+ AC_REVISION($Revision$)
+ AC_DEFUN(modname,[rlm_perl])
+
+-m4_include([ax_with_prog.m4])
++m4_include([m4/ax_with_prog.m4])
+
+ if test x$with_[]modname != xno; then
+ AC_PROG_CC
+diff --git a/src/modules/rlm_radutmp/config.h.in b/src/modules/rlm_radutmp/config.h.in
+index 9a883cc..750b434 100644
+--- a/src/modules/rlm_radutmp/config.h.in
++++ b/src/modules/rlm_radutmp/config.h.in
+@@ -42,6 +42,9 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
+diff --git a/src/modules/rlm_ruby/configure b/src/modules/rlm_ruby/configure
+index 15868ab..c728af2 100755
+--- a/src/modules/rlm_ruby/configure
++++ b/src/modules/rlm_ruby/configure
+@@ -1875,6 +1875,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
++
+ # ===========================================================================
+ # http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
+ # ===========================================================================
+diff --git a/src/modules/rlm_ruby/configure.ac b/src/modules/rlm_ruby/configure.ac
+index 9306382..f1c8118 100644
+--- a/src/modules/rlm_ruby/configure.ac
++++ b/src/modules/rlm_ruby/configure.ac
+@@ -3,15 +3,16 @@ AC_INIT(rlm_ruby.c)
+ AC_REVISION($Revision: 1.9 $)
+ AC_DEFUN(modname,[rlm_ruby])
+
+-m4_include([ax_with_prog.m4])
++m4_include([m4/ax_with_prog.m4])
+
+ AC_DEFUN([AX_WITH_RUBY],[
+ AX_WITH_PROG([RUBY],[ruby],[not-found],[${PATH}:/usr/bin:/usr/local/bin])
+ ])
+
+-m4_include([ax_compare_version.m4])
+-m4_include([ax_prog_ruby_version.m4])
+-m4_include([ax_ruby_devel.m4])
++
++m4_include([m4/ax_compare_version.m4])
++m4_include([m4/ax_prog_ruby_version.m4])
++m4_include([m4/ax_ruby_devel.m4])
+
+ targetname=modname
+ mod_cflags=
+diff --git a/src/modules/rlm_smsotp/config.h.in b/src/modules/rlm_smsotp/config.h.in
+index 5feaf91..9e69f85 100644
+--- a/src/modules/rlm_smsotp/config.h.in
++++ b/src/modules/rlm_smsotp/config.h.in
+@@ -42,6 +42,9 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
+diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in b/src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in
+index e03d1a9..6262c48 100644
+--- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in
++++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/config.h.in
+@@ -18,5 +18,8 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+diff --git a/src/modules/rlm_unix/config.h.in b/src/modules/rlm_unix/config.h.in
+index dcb9aa2..70b4680 100644
+--- a/src/modules/rlm_unix/config.h.in
++++ b/src/modules/rlm_unix/config.h.in
+@@ -1,5 +1,8 @@
+ /* config.h.in. Generated from configure.ac by autoheader. */
+
++/* Define to 1 if you have the `getpwnam' function. */
++#undef HAVE_GETPWNAM
++
+ /* Define to 1 if you have the `getspnam' function. */
+ #undef HAVE_GETSPNAM
+
+@@ -54,6 +57,9 @@
+ /* Define to the one symbol short name of this package. */
+ #undef PACKAGE_TARNAME
+
++/* Define to the home page for this package. */
++#undef PACKAGE_URL
++
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
+
+--
+2.3.5
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch
new file mode 100644
index 000000000..b0929c4b0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch
@@ -0,0 +1,55 @@
+Fix quoting for BUILD_WITH
+
+The escaped quotes are to make the -D values produce strings which
+can be used to display these values. However, if the values are more
+than one word, with spaces, they also need shell quoting to make them
+into single words.
+
+Upstream-Status: Pending
+
+Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ src/main/libfreeradius-server.mk | 2 +-
+ src/main/unittest.mk | 2 +-
+ src/modules/rlm_eap/radeapclient.mk | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/main/libfreeradius-server.mk b/src/main/libfreeradius-server.mk
+index 4495f72..07c28f1 100644
+--- a/src/main/libfreeradius-server.mk
++++ b/src/main/libfreeradius-server.mk
+@@ -18,5 +18,5 @@ SOURCES := conffile.c \
+ TGT_LDLIBS := $(OPENSSL_LIBS)
+
+ ifneq ($(MAKECMDGOALS),scan)
+-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
++SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
+ endif
+diff --git a/src/main/unittest.mk b/src/main/unittest.mk
+index 09f3938..ed33952 100644
+--- a/src/main/unittest.mk
++++ b/src/main/unittest.mk
+@@ -21,5 +21,5 @@ TGT_PREREQS += libfreeradius-eap.a
+ endif
+
+ ifneq ($(MAKECMDGOALS),scan)
+-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
++SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
+ endif
+diff --git a/src/modules/rlm_eap/radeapclient.mk b/src/modules/rlm_eap/radeapclient.mk
+index 6068f54..7d3c556 100644
+--- a/src/modules/rlm_eap/radeapclient.mk
++++ b/src/modules/rlm_eap/radeapclient.mk
+@@ -23,7 +23,7 @@ SRC_CFLAGS += -DWITH_EAPCLIENT
+ SRC_INCDIRS := ${top_srcdir}/src/modules/rlm_eap/libeap
+
+ ifneq ($(MAKECMDGOALS),scan)
+-SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS=\"$(CPPFLAGS)\" -DBUILT_WITH_CFLAGS=\"$(CFLAGS)\" -DBUILT_WITH_LDFLAGS=\"$(LDFLAGS)\" -DBUILT_WITH_LIBS=\"$(LIBS)\"
++SRC_CFLAGS += -DBUILT_WITH_CPPFLAGS="\"$(CPPFLAGS)\"" -DBUILT_WITH_CFLAGS="\"$(CFLAGS)\"" -DBUILT_WITH_LDFLAGS="\"$(LDFLAGS)\"" -DBUILT_WITH_LIBS="\"$(LIBS)\""
+ endif
+
+ endif
+--
+2.10.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch
new file mode 100644
index 000000000..4eb61ff2e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch
@@ -0,0 +1,89 @@
+From 56ef434e454bcc82c162a83d9bcb076d4fc72b7f Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 9 Jan 2014 14:30:26 +0800
+Subject: [PATCH] Fix libtool detection
+
+Upstream-Status: pending
+
+Use LT_INIT instead of the deprecated AC_PROG_LIBTOOL to detect libtool, so it
+can work with our libtoolize and libtool.
+
+Simplify the detection of ltdl. It will find the ltdl from the sysroot; the
+switch --with-system-libltdl is no longer needed. The code is copied from
+pulseaudio configure.ac, together with the comment paragraph.
+
+Also patch autogen.sh so it uses autoreconf, which handles libtoolize better.
+
+Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ autogen.sh | 5 +----
+ configure.ac | 36 ++++++++++++++++++++++++++++++++++++
+ 2 files changed, 37 insertions(+), 4 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 3418673..e42c3d5 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -5,10 +5,7 @@ parentdir=`dirname $0`
+ cd $parentdir
+ parentdir=`pwd`
+
+-libtoolize -f -c
+-#aclocal
+-autoheader
+-autoconf
++autoreconf -Wcross --verbose --install --force
+
+ mysubdirs="$mysubdirs `find src/modules/ -name configure -print | sed 's%/configure%%'`"
+ mysubdirs=`echo $mysubdirs`
+diff --git a/configure.ac b/configure.ac
+index e73e4ad..066d3d7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -205,6 +205,42 @@ dnl # See if we have Git.
+ dnl #
+ AC_CHECK_PROG(GIT, git, yes, no)
+
++#### libtool stuff ####
++
++dnl set this shit so it doesn't force CFLAGS...
++LTCFLAGS=" "
++
++LT_PREREQ(2.2)
++LT_INIT([dlopen disable-static])
++
++dnl Unfortunately, even up to libtool 2.2.6a there is no way to know
++dnl exactly which version of libltdl is present in the system, so we
++dnl just assume that it's a working version as long as we have the
++dnl library and the header files.
++dnl
++dnl As an extra safety device, check for lt_dladvise_init() which is
++dnl only implemented in libtool 2.x, and refine as we go if we have
++dnl refined requirements.
++dnl
++dnl Check the header files first since the system may have a
++dnl libltdl.so for runtime, but no headers, and we want to bail out as
++dnl soon as possible.
++dnl
++dnl We don't need any special variable for this though, since the user
++dnl can give the proper place to find libltdl through the standard
++dnl variables like LDFLAGS and CPPFLAGS.
++
++AC_CHECK_HEADER([ltdl.h],
++ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
++ [LIBLTDL=])
++
++AS_IF([test "x$LIBLTDL" = "x"],
++ [AC_MSG_ERROR([Unable to find libltdl version 2. Makes sure you have libtool 2.2 or later installed.])])
++AC_SUBST([LIBLTDL])
++LTDL_SUBDIRS=
++INCLTDL=-DWITH_SYSTEM_LTDL
++AC_SUBST(LTDL_SUBDIRS)
++
+ dnl Put this in later, when all distributed modules use autoconf.
+ dnl AC_ARG_WITH(disablemodulefoo,
+ dnl [ --without-rlm_foo Disables module compilation. Module list:]
+--
+1.8.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch
new file mode 100644
index 000000000..1954586b2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch
@@ -0,0 +1,160 @@
+From 16bf899447fc1524ffc3c79e1d35380e5285a552 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 7 Jan 2016 22:37:30 -0800
+Subject: [PATCH] libtool: do not use jlibtool
+
+jlibtool is hardcoded to be used but we need to use
+our libtool, so fix the makfiles to make it compatible
+with our libtool.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ Make.inc.in | 4 ++--
+ scripts/boiler.mk | 2 ++
+ scripts/install.mk | 14 +++++++-------
+ scripts/libtool.mk | 22 ++++++++++++++++------
+ 4 files changed, 27 insertions(+), 15 deletions(-)
+
+diff --git a/Make.inc.in b/Make.inc.in
+index 7a77625..fd8aa3e 100644
+--- a/Make.inc.in
++++ b/Make.inc.in
+@@ -57,7 +57,7 @@ CPPFLAGS = @CPPFLAGS@
+ LIBPREFIX = @LIBPREFIX@
+ EXEEXT = @EXEEXT@
+
+-LIBTOOL = JLIBTOOL
++LIBTOOL = @LIBTOOL@
+ ACLOCAL = @ACLOCAL@
+ AUTOCONF = @AUTOCONF@
+ AUTOHEADER = @AUTOHEADER@
+@@ -163,7 +163,7 @@ ANALYZE.c := @clang_path@
+ #
+ ifeq "$(USE_SHARED_LIBS)" "yes"
+ TESTBINDIR = ./$(BUILD_DIR)/bin/local
+- TESTBIN = FR_LIBRARY_PATH=./build/lib/.libs $(JLIBTOOL) --quiet --mode=execute $(TESTBINDIR)
++ TESTBIN = FR_LIBRARY_PATH=./build/lib/.libs $(LIBTOOL) --quiet --mode=execute $(TESTBINDIR)
+ else
+ TESTBINDIR = ./$(BUILD_DIR)/bin
+ TESTBIN = ./$(BUILD_DIR)/bin
+diff --git a/scripts/boiler.mk b/scripts/boiler.mk
+index bccec5e..926a13e 100644
+--- a/scripts/boiler.mk
++++ b/scripts/boiler.mk
+@@ -266,6 +266,7 @@ define COMPILE_C_CMDS
+ $(Q)$(ECHO) CC $<
+ $(Q)$(strip ${COMPILE.c} -o $@ -c -MD ${CPPFLAGS} ${CFLAGS} ${SRC_CFLAGS} ${INCDIRS} \
+ $(addprefix -I, ${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} $<)
++ ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d
+ endef
+ else
+ #
+@@ -281,6 +282,7 @@ define COMPILE_C_CMDS
+ $(Q)cppcheck --enable=style -q ${CHECKFLAGS} $(filter -isystem%,${SRC_CFLAGS}) \
+ $(filter -I%,${SRC_CFLAGS}) $(filter -D%,${SRC_CFLAGS}) ${INCDIRS} \
+ $(addprefix -I,${SRC_INCDIRS}) ${SRC_DEFS} ${DEFS} --suppress=variableScope --suppress=invalidscanf $<
++ ${Q}mv $(dir $@)/.libs/$(notdir $*.d) ${BUILD_DIR}/objs/$*.d
+ endef
+ endif
+
+diff --git a/scripts/install.mk b/scripts/install.mk
+index 9164115..e38c1ed 100644
+--- a/scripts/install.mk
++++ b/scripts/install.mk
+@@ -46,7 +46,7 @@ define ADD_INSTALL_RULE.exe
+ install: $${${1}_INSTALLDIR}/$(notdir ${1})
+
+ # Install executable ${1}
+- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
++ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
+ @$(ECHO) INSTALL ${1}
+ $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/bin/${1} $${${1}_INSTALLDIR}/
+ $(Q)$${${1}_POSTINSTALL}
+@@ -65,7 +65,7 @@ define ADD_INSTALL_RULE.a
+ install: $${${1}_INSTALLDIR}/$(notdir ${1})
+
+ # Install static library ${1}
+- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} ${1} | $${${1}_INSTALLDIR}
++ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} ${1} | $${${1}_INSTALLDIR}
+ @$(ECHO) INSTALL ${1}
+ $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
+ $(Q)$${${1}_POSTINSTALL}
+@@ -87,9 +87,9 @@ define ADD_INSTALL_RULE.la
+ install: $${${1}_INSTALLDIR}/$(notdir ${1})
+
+ # Install libtool library ${1}
+- $${${1}_INSTALLDIR}/$(notdir ${1}): ${JLIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
++ $${${1}_INSTALLDIR}/$(notdir ${1}): ${LIBTOOL} $${${1}_BUILD}/${1} | $${${1}_INSTALLDIR}
+ @$(ECHO) INSTALL ${1}
+- $(Q)$${PROGRAM_INSTALL} -c -m 755 $${LOCAL_FLAGS_MIN} $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
++ $(Q)$${PROGRAM_INSTALL} -c -m 755 $${BUILD_DIR}/lib/${1} $${${1}_INSTALLDIR}/
+ $(Q)$${${1}_POSTINSTALL}
+
+ endef
+@@ -107,7 +107,7 @@ define ADD_INSTALL_RULE.man
+ install: ${2}/$(notdir ${1})
+
+ # Install manual page ${1}
+- ${2}/$(notdir ${1}): ${JLIBTOOL} ${1} | ${2}
++ ${2}/$(notdir ${1}): ${LIBTOOL} ${1} | ${2}
+ @$(ECHO) INSTALL $(notdir ${1})
+ $(Q)$${PROGRAM_INSTALL} -c -m 644 ${1} ${2}/
+
+@@ -122,9 +122,9 @@ endef
+ define ADD_INSTALL_RULE.dir
+ # Install directory
+ .PHONY: ${1}
+- ${1}: ${JLIBTOOL}
++ ${1}: ${LIBTOOL}
+ @$(ECHO) INSTALL -d -m 755 ${1}
+- $(Q)$${PROGRAM_INSTALL} -d -m 755 ${1}
++ $(Q)$${INSTALL} -d -m 755 ${1}
+ endef
+
+
+diff --git a/scripts/libtool.mk b/scripts/libtool.mk
+index 57915e1..2cb2f7d 100644
+--- a/scripts/libtool.mk
++++ b/scripts/libtool.mk
+@@ -55,7 +55,9 @@ ifeq "${LIBTOOL}" "JLIBTOOL"
+ # Tell GNU Make to use this value, rather than anything specified
+ # on the command line.
+ override LIBTOOL := ${JLIBTOOL}
+-endif # else we're not using jlibtool
++else # else we're not using jlibtool
++ all install: ${LIBTOOL}
++endif
+
+ # When using libtool, it produces a '.libs' directory. Ensure that it
+ # is removed on "make clean", too.
+@@ -69,11 +71,19 @@ clean: .libs_clean
+ # Re-define compilers and linkers
+ #
+ OBJ_EXT = lo
+-COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC}
+-COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX}
+-LINK.c = ${LIBTOOL} --silent --mode=link ${CC}
+-LINK.cxx = ${LIBTOOL} --mode=link ${CXX}
+-PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL}
++ifeq "${LIBTOOL}" "JLIBTOOL"
++ COMPILE.c = ${LIBTOOL} --silent --mode=compile ${CC}
++ COMPILE.cxx = ${LIBTOOL} --mode=compile ${CXX}
++ LINK.c = ${LIBTOOL} --silent --mode=link ${CC}
++ LINK.cxx = ${LIBTOOL} --mode=link ${CXX}
++ PROGRAM_INSTALL = ${LIBTOOL} --silent --mode=install ${INSTALL}
++else
++ COMPILE.c = ${LIBTOOL} --mode=compile --tag=CC ${CC}
++ COMPILE.cxx = ${LIBTOOL} --mode=compile --tag=CC ${CXX}
++ LINK.c = ${LIBTOOL} --mode=link --tag=CC ${CC} -module -export-dynamic
++ LINK.cxx = ${LIBTOOL} --mode=link --tag=CC ${CXX} -module -export-dynamic
++ PROGRAM_INSTALL = ${LIBTOOL} --mode=install ${INSTALL}
++endif
+
+
+ # LIBTOOL_ENDINGS - Given a library ending in ".a" or ".so", replace that
+--
+2.10.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch
new file mode 100644
index 000000000..675940dd6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch
@@ -0,0 +1,33 @@
+From a0bf65e04d2bbd3271cab94bd5ac93f8e877bfc5 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 27 Jan 2016 05:07:19 -0500
+Subject: [PATCH] rlm_python: add PY_INC_DIR in search dir
+
+Upstream-Status: Pending
+
+configure option --with-rlm-python-include-dir is used to set
+PY_INC_DIR which is never used and it fails to find Python.h,
+so add it into search dir to fix it.
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ src/modules/rlm_python/configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/modules/rlm_python/configure.ac b/src/modules/rlm_python/configure.ac
+index 831a33a..c3792d8 100644
+--- a/src/modules/rlm_python/configure.ac
++++ b/src/modules/rlm_python/configure.ac
+@@ -93,7 +93,7 @@ if test x$with_[]modname != xno; then
+
+ old_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $PY_CFLAGS"
+- smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION"
++ smart_try_dir="$PY_PREFIX/include/python$PY_SYS_VERSION $PY_INC_DIR"
+ FR_SMART_CHECK_INCLUDE(Python.h)
+ CFLAGS=$old_CFLAGS
+
+--
+2.10.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf
new file mode 100644
index 000000000..fa6296297
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf
@@ -0,0 +1,2 @@
+d /var/log/radius 0755 radiusd radiusd -
+d /var/run/radiusd 0755 radiusd radiusd -
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
new file mode 100644
index 000000000..899c4e495
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=FreeRADIUS high performance RADIUS server.
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=@STATEDIR@/run/radiusd/radiusd.pid
+ExecStartPre=-@BASE_BINDIR@/chown -R radiusd.radiusd @STATEDIR@/run/radiusd
+ExecStartPre=-@BASE_BINDIR@/sh -c "if [ ! -f @SYSCONFDIR@/raddb/certs/server.pem ]; then sudo -u radiusd @SYSCONFDIR@/raddb/certs/bootstrap; fi"
+ExecStartPre=@SBINDIR@/radiusd -C
+ExecStart=@SBINDIR@/radiusd -d @SYSCONFDIR@/raddb
+ExecReload=@SBINDIR@/radiusd -C
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd
new file mode 100644
index 000000000..8cbdae8a6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d radiusd radiusd 0755 /var/run/radiusd none
+d radiusd radiusd 0755 /var/log/radius none
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb
new file mode 100644
index 000000000..4155a4059
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb
@@ -0,0 +1,222 @@
+DESCRIPTION = "FreeRADIUS is an Internet authentication daemon, which implements the RADIUS \
+protocol, as defined in RFC 2865 (and others). It allows Network Access \
+Servers (NAS boxes) to perform authentication for dial-up users. There are \
+also RADIUS clients available for Web servers, firewalls, Unix logins, and \
+more. Using RADIUS allows authentication and authorization for a network to \
+be centralized, and minimizes the amount of re-configuration which has to be \
+done when adding or deleting new users."
+
+SUMMARY = "High-performance and highly configurable RADIUS server"
+HOMEPAGE = "http://www.freeradius.org/"
+SECTION = "System/Servers"
+LICENSE = "GPLv2 & LGPLv2+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+DEPENDS = "openssl-native openssl libidn libtool libpcap libtalloc"
+
+SRC_URI = "ftp://ftp.freeradius.org/pub/freeradius/freeradius-server-${PV}.tar.bz2 \
+ file://freeradius \
+ file://volatiles.58_radiusd \
+ file://freeradius-enble-user-in-conf.patch \
+ file://freeradius-configure.ac-allow-cross-compilation.patch \
+ file://freeradius-fix-issues-related-to-m4-include-path.patch \
+ file://freeradius-libtool-detection.patch \
+ file://freeradius-configure.ac-add-option-for-libcap.patch \
+ file://freeradius-avoid-searching-host-dirs.patch \
+ file://freeradius-rlm_python-add-PY_INC_DIR.patch \
+ file://freeradius-libtool-do-not-use-jlibtool.patch \
+ file://freeradius-fix-quoting-for-BUILT_WITH.patch \
+ file://freeradius-fix-error-for-expansion-of-macro.patch \
+ file://0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch \
+ file://radiusd.service \
+ file://radiusd-volatiles.conf \
+"
+SRC_URI[md5sum] = "0c81a4464ccf1d04f7ef1218a029d37a"
+SRC_URI[sha256sum] = "23267d8505e7b2909f5bdbf3938ca077c1fe122290dc969304d4f3b594f7e3ba"
+
+PARALLEL_MAKE = ""
+
+S = "${WORKDIR}/freeradius-server-${PV}"
+
+EXTRA_OECONF = " --enable-strict-dependencies \
+ --with-docdir=${docdir}/freeradius-${PV} \
+ --with-openssl-includes=${STAGING_INCDIR} \
+ --with-openssl-libraries=${STAGING_LIBDIR} \
+ --without-rlm_ippool \
+ --without-rlm_cache_memcached \
+ --without-rlm_counter \
+ --without-rlm_couchbase \
+ --without-rlm_dbm \
+ --without-rlm_eap_tnc \
+ --without-rlm_eap_ikev2 \
+ --without-rlm_opendirectory \
+ --without-rlm_redis \
+ --without-rlm_rediswho \
+ --without-rlm_sql_db2 \
+ --without-rlm_sql_firebird \
+ --without-rlm_sql_freetds \
+ --without-rlm_sql_iodbc \
+ --without-rlm_sql_oracle \
+ --without-rlm_sql_sybase \
+ --without-rlm_sqlhpwippool \
+ ac_cv_path_PERL=${bindir}/perl \
+ ax_cv_cc_builtin_choose_expr=no \
+ ax_cv_cc_builtin_types_compatible_p=no \
+ ax_cv_cc_builtin_bswap64=no \
+ ax_cv_cc_bounded_attribute=no \
+"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+ pcre libcap \
+"
+
+PACKAGECONFIG[krb5] = "--with-rlm_krb5,--without-rlm_krb5,krb5"
+PACKAGECONFIG[pam] = "--with-rlm_pam,--without-rlm_pam,libpam"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[ldap] = "--with-rlm_ldap,--without-rlm_ldap,openldap"
+PACKAGECONFIG[mysql] = "--with-rlm_sql_mysql,--without-rlm_sql_mysql,mysql5"
+PACKAGECONFIG[sqlite] = "--with-rlm_sql_sqlite,--without-rlm_sql_sqlite,sqlite3"
+PACKAGECONFIG[unixodbc] = "--with-rlm_sql_unixodbc,--without-rlm_sql_unixodbc,unixodbc"
+PACKAGECONFIG[postgresql] = "--with-rlm_sql_postgresql,--without-rlm_sql_postgresql,postgresql"
+PACKAGECONFIG[pcre] = "--with-pcre,--without-pcre,libpcre"
+PACKAGECONFIG[perl] = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl --with-rlm_perl,--without-rlm_perl,perl-native perl,perl"
+PACKAGECONFIG[python] = "--with-rlm_python --with-rlm-python-bin=${STAGING_BINDIR_NATIVE}/python-native/python --with-rlm-python-include-dir=${STAGING_INCDIR}/${PYTHON_DIR},--without-rlm_python,python-native python"
+PACKAGECONFIG[rest] = "--with-rlm_rest,--without-rlm_rest,curl json-c"
+PACKAGECONFIG[ruby] = "--with-rlm_ruby,--without-rlm_ruby,ruby"
+
+inherit useradd autotools-brokensep update-rc.d systemd
+
+# This is not a cpan or python based package, but it needs some definitions
+# from cpan-base and python-dir bbclasses for building rlm_perl and rlm_python
+# correctly.
+inherit cpan-base python-dir
+
+# The modules subdirs also need to be processed by autoreconf. Use autogen.sh
+# in order to handle the subdirs correctly.
+do_configure () {
+ ./autogen.sh
+
+ # the configure of rlm_perl needs this to get correct
+ # mod_cflags and mod_ldflags
+ if ${@bb.utils.contains('PACKAGECONFIG', 'perl', 'true', 'false', d)}; then
+ export PERL5LIB="${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+ fi
+
+ oe_runconf
+
+ # we don't need dhcpclient
+ sed -i -e 's/dhcpclient.mk//' ${S}/src/modules/proto_dhcp/all.mk
+}
+
+INITSCRIPT_NAME = "radiusd"
+
+SYSTEMD_SERVICE_${PN} = "radiusd.service"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false --user-group radiusd"
+
+do_install() {
+ rm -rf ${D}
+ mkdir -p ${D}/${sysconfdir}/logrotate.d
+ mkdir -p ${D}/${sysconfdir}/pam.d
+ mkdir -p ${D}/${sysconfdir}/init.d
+ mkdir -p ${D}/${localstatedir}/lib/radiusd
+ mkdir -p ${D}${sysconfdir}/default/volatiles
+
+ export LD_LIBRARY_PATH=${D}/${libdir}
+ oe_runmake install R=${D} INSTALLSTRIP=""
+
+ # remove unsupported config files
+ rm -f ${D}/${sysconfdir}/raddb/experimental.conf
+
+ # remove scripts that required Perl(DBI)
+ rm -rf ${D}/${bindir}/radsqlrelay
+
+ cp -f ${WORKDIR}/freeradius ${D}/etc/init.d/radiusd
+ rm -f ${D}/${sbindir}/rc.radiusd
+ chmod +x ${D}/${sysconfdir}/init.d/radiusd
+ rm -rf ${D}/${localstatedir}/run/
+ install -m 0644 ${WORKDIR}/volatiles.58_radiusd ${D}${sysconfdir}/default/volatiles/58_radiusd
+
+ chown -R radiusd:radiusd ${D}/${sysconfdir}/raddb/
+ chown -R radiusd:radiusd ${D}/${localstatedir}/lib/radiusd
+
+ # For systemd
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/radiusd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@STATEDIR@,${localstatedir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/radiusd.service
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d/
+ install -m 0644 ${WORKDIR}/radiusd-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/
+ fi
+}
+
+# This is only needed when we install/update on a running target.
+#
+pkg_postinst_${PN} () {
+ if [ -z "$D" ]; then
+ if command -v systemd-tmpfiles >/dev/null; then
+ # create /var/log/radius, /var/run/radiusd
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/radiusd-volatiles.conf
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+
+ # Fix ownership for /etc/raddb/*, /var/lib/radiusd
+ chown -R radiusd:radiusd ${sysconfdir}/raddb
+ chown -R radiusd:radiusd ${localstatedir}/lib/radiusd
+ fi
+}
+
+# We really need the symlink :(
+INSANE_SKIP_${PN} = "dev-so"
+INSANE_SKIP_${PN}-krb5 = "dev-so"
+INSANE_SKIP_${PN}-ldap = "dev-so"
+INSANE_SKIP_${PN}-mysql = "dev-so"
+INSANE_SKIP_${PN}-perl = "dev-so"
+INSANE_SKIP_${PN}-postgresql = "dev-so"
+INSANE_SKIP_${PN}-python = "dev-so"
+INSANE_SKIP_${PN}-unixodbc = "dev-so"
+
+PACKAGES =+ "${PN}-utils ${PN}-ldap ${PN}-krb5 ${PN}-perl \
+ ${PN}-python ${PN}-mysql ${PN}-postgresql ${PN}-unixodbc"
+
+FILES_${PN}-utils = "${bindir}/*"
+
+FILES_${PN}-ldap = "${libdir}/rlm_ldap.so* \
+ ${sysconfdir}/raddb/mods-available/ldap \
+"
+
+FILES_${PN}-krb5 = "${libdir}/rlm_krb5.so* \
+ ${sysconfdir}/raddb/mods-available/krb5 \
+"
+
+FILES_${PN}-perl = "${libdir}/rlm_perl.so* \
+ ${sysconfdir}/raddb/mods-config/perl \
+ ${sysconfdir}/raddb/mods-available/perl \
+"
+
+FILES_${PN}-python = "${libdir}/rlm_python.so* \
+ ${sysconfdir}/raddb/mods-config/python \
+ ${sysconfdir}/raddb/mods-available/python \
+"
+
+FILES_${PN}-mysql = "${libdir}/rlm_sql_mysql.so* \
+ ${sysconfdir}/raddb/mods-config/sql/*/mysql \
+ ${sysconfdir}/raddb/mods-available/sql \
+"
+
+FILES_${PN}-postgresql = "${libdir}/rlm_sql_postgresql.so* \
+ ${sysconfdir}/raddb/mods-config/sql/*/postgresql \
+"
+
+FILES_${PN}-unixodbc = "${libdir}/rlm_sql_unixodbc.so*"
+
+FILES_${PN} =+ "${libdir}/rlm_*.so* ${libdir}/proto_*so*"
+
+RDEPENDS_${PN} += "perl"
+RDEPENDS_${PN}-utils = "${PN}"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/0001-rcp-fix-to-work-with-large-files.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/0001-rcp-fix-to-work-with-large-files.patch
new file mode 100644
index 000000000..d4764f586
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/0001-rcp-fix-to-work-with-large-files.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+Subject: rcp: fix to work with large files
+
+When we copy file by rcp command, if the file > 2GB, it will fail.
+The cause is that it used incorrect data type on file size in sink() of rcp.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/rcp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/rcp.c b/src/rcp.c
+index 21f55b6..bafa35f 100644
+--- a/src/rcp.c
++++ b/src/rcp.c
+@@ -876,9 +876,9 @@ sink (int argc, char *argv[])
+ enum
+ { YES, NO, DISPLAYED } wrerr;
+ BUF *bp;
+- off_t i, j;
++ off_t i, j, size;
+ int amt, count, exists, first, mask, mode, ofd, omode;
+- int setimes, size, targisdir, wrerrno;
++ int setimes, targisdir, wrerrno;
+ char ch, *cp, *np, *targ, *vect[1], buf[BUFSIZ];
+ const char *why;
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch
new file mode 100644
index 000000000..24c134fca
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch
@@ -0,0 +1,83 @@
+Upstream: http://www.mail-archive.com/bug-inetutils@gnu.org/msg02103.html
+
+Upstream-Status: Pending
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ ping/ping_common.h | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/ping/ping_common.h b/ping/ping_common.h
+index 1dfd1b5..3bfbd12 100644
+--- a/ping/ping_common.h
++++ b/ping/ping_common.h
+@@ -17,10 +17,14 @@
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see `http://www.gnu.org/licenses/'. */
+
++#include <config.h>
++
+ #include <netinet/in_systm.h>
+ #include <netinet/in.h>
+ #include <netinet/ip.h>
++#ifdef HAVE_IPV6
+ #include <netinet/icmp6.h>
++#endif
+ #include <icmp.h>
+ #include <error.h>
+ #include <progname.h>
+@@ -62,7 +66,12 @@ struct ping_stat
+ want to follow the traditional behaviour of ping. */
+ #define DEFAULT_PING_COUNT 0
+
++#ifdef HAVE_IPV6
+ #define PING_HEADER_LEN (USE_IPV6 ? sizeof (struct icmp6_hdr) : ICMP_MINLEN)
++#else
++#define PING_HEADER_LEN (ICMP_MINLEN)
++#endif
++
+ #define PING_TIMING(s) ((s) >= sizeof (struct timeval))
+ #define PING_DATALEN (64 - PING_HEADER_LEN) /* default data length */
+
+@@ -74,13 +83,20 @@ struct ping_stat
+ (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\
+ } while (0)
+
++#ifdef HAVE_IPV6
+ /* FIXME: Adjust IPv6 case for options and their consumption. */
+ #define _PING_BUFLEN(p, u) ((u)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \
+ (MAXIPLEN + (p)->ping_datalen + ICMP_TSLEN))
+
++#else
++#define _PING_BUFLEN(p, u) (MAXIPLEN + (p)->ping_datalen + ICMP_TSLEN)
++#endif
++
++#ifdef HAVE_IPV6
+ typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest,
+ struct sockaddr_in6 * from, struct icmp6_hdr * icmp,
+ int datalen);
++#endif
+
+ typedef int (*ping_efp) (int code,
+ void *closure,
+@@ -89,13 +105,17 @@ typedef int (*ping_efp) (int code,
+ struct ip * ip, icmphdr_t * icmp, int datalen);
+
+ union event {
++#ifdef HAVE_IPV6
+ ping_efp6 handler6;
++#endif
+ ping_efp handler;
+ };
+
+ union ping_address {
+ struct sockaddr_in ping_sockaddr;
++#ifdef HAVE_IPV6
+ struct sockaddr_in6 ping_sockaddr6;
++#endif
+ };
+
+ typedef struct ping_data PING;
+--
+2.8.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch
new file mode 100644
index 000000000..3da4e9f55
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch
@@ -0,0 +1,29 @@
+From 552a7d64ad4a7188a9b7cd89933ae7caf7ebfe90 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier at gentoo.org>
+Date: Thu, 18 Nov 2010 16:59:14 -0500
+Subject: [PATCH gnulib] printf-parse: pull in features.h for __GLIBC__
+
+Upstream-Status: Pending
+
+Signed-off-by: Mike Frysinger <vapier at gentoo.org>
+---
+ lib/printf-parse.h | 3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/lib/printf-parse.h b/lib/printf-parse.h
+index 67a4a2a..3bd6152 100644
+--- a/lib/printf-parse.h
++++ b/lib/printf-parse.h
+@@ -25,6 +25,9 @@
+
+ #include "printf-args.h"
+
++#ifdef HAVE_FEATURES_H
++# include <features.h> /* for __GLIBC__ */
++#endif
+
+ /* Flags */
+ #define FLAG_GROUP 1 /* ' flag */
+--
+1.7.3.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch
new file mode 100644
index 000000000..b13bb9229
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+--- inetutils-1.8/lib/wchar.in.h
++++ inetutils-1.8/lib/wchar.in.h
+@@ -70,6 +70,9 @@
+ /* The include_next requires a split double-inclusion guard. */
+ #if @HAVE_WCHAR_H@
+ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
++#else
++# include <stddef.h>
++# define MB_CUR_MAX 1
+ #endif
+
+ #undef _GL_ALREADY_INCLUDING_WCHAR_H
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
new file mode 100644
index 000000000..2592989a9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
@@ -0,0 +1,26 @@
+inetutils: define PATH_PROCNET_DEV if not already defined
+
+this prevents the following compilation error :
+system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function)
+
+this patch comes from :
+ http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/
+
+Upstream-Status: Inappropriate [not author]
+
+Signed-of-by: Eric Bénard <eric@eukrea.com>
+---
+diff -Naur inetutils-1.9.orig/ifconfig/system/linux.c inetutils-1.9/ifconfig/system/linux.c
+--- inetutils-1.9.orig/ifconfig/system/linux.c 2012-01-04 16:31:36.000000000 -0500
++++ inetutils-1.9/ifconfig/system/linux.c 2012-01-04 16:40:53.000000000 -0500
+@@ -49,6 +49,10 @@
+ #include "../ifconfig.h"
+
+
++#ifndef PATH_PROCNET_DEV
++ #define PATH_PROCNET_DEV "/proc/net/dev"
++#endif
++
+ /* ARPHRD stuff. */
+
+ static void
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch
new file mode 100644
index 000000000..ff3abd86a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch
@@ -0,0 +1,40 @@
+Only check security/pam_appl.h which is provided by package libpam when pam is
+enabled.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/configure.ac b/configure.ac
+index b35e672..e78a751 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -195,6 +195,19 @@ fi
+
+ # See if we have libpam.a. Investigate PAM versus Linux-PAM.
+ if test "$with_pam" = yes ; then
++ AC_CHECK_HEADERS([security/pam_appl.h], [], [], [
++#include <sys/types.h>
++#ifdef HAVE_NETINET_IN_SYSTM_H
++# include <netinet/in_systm.h>
++#endif
++#include <netinet/in.h>
++#ifdef HAVE_NETINET_IP_H
++# include <netinet/ip.h>
++#endif
++#ifdef HAVE_SYS_PARAM_H
++# include <sys/param.h>
++#endif
++])
+ AC_CHECK_LIB(dl, dlopen, LIBDL=-ldl)
+ AC_CHECK_LIB(pam, pam_authenticate, LIBPAM=-lpam)
+ if test "$ac_cv_lib_pam_pam_authenticate" = yes ; then
+@@ -587,7 +600,7 @@ AC_HEADER_DIRENT
+ AC_CHECK_HEADERS([arpa/nameser.h errno.h fcntl.h features.h \
+ glob.h memory.h netinet/ether.h netinet/in_systm.h \
+ netinet/ip.h netinet/ip_icmp.h netinet/ip_var.h \
+- security/pam_appl.h shadow.h \
++ shadow.h \
+ stdarg.h stdlib.h string.h stropts.h sys/tty.h \
+ sys/utsname.h sys/ptyvar.h sys/msgbuf.h sys/filio.h \
+ sys/ioctl_compat.h sys/cdefs.h sys/stream.h sys/mkdev.h \
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rexec.xinetd.inetutils b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rexec.xinetd.inetutils
new file mode 100644
index 000000000..30e81ef45
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rexec.xinetd.inetutils
@@ -0,0 +1,20 @@
+# default: off
+# description:
+# Rexecd is the server for the rexec program. The server provides remote
+# execution facilities with authentication based on user names and
+# passwords.
+#
+service exec
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = @SBINDIR@/tcpd
+ server_args = @SBINDIR@/in.rexecd
+ disable = yes
+}
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rlogin.xinetd.inetutils b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rlogin.xinetd.inetutils
new file mode 100644
index 000000000..21b55da9a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rlogin.xinetd.inetutils
@@ -0,0 +1,23 @@
+# default: off
+# description:
+# Rlogind is a server for the rlogin program. The server provides remote
+# execution with authentication based on privileged port numbers from trusted
+# host
+#
+service login
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = @SBINDIR@/tcpd
+ server_args = @SBINDIR@/in.rlogind -a
+ disable = yes
+}
+
+
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rsh.xinetd.inetutils b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rsh.xinetd.inetutils
new file mode 100644
index 000000000..2b894a74b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/rsh.xinetd.inetutils
@@ -0,0 +1,21 @@
+# default: off
+# description:
+# The rshd server is a server for the rcmd(3) routine and,
+# consequently, for the rsh(1) program. The server provides
+# remote execution facilities with authentication based on
+# privileged port numbers from trusted hosts.
+#
+service shell
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = @SBINDIR@/tcpd
+ server_args = @SBINDIR@/in.rshd -aL
+ disable = yes
+}
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/telnet.xinetd.inetutils b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/telnet.xinetd.inetutils
new file mode 100644
index 000000000..2d9a0408c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/telnet.xinetd.inetutils
@@ -0,0 +1,13 @@
+# default: on
+# description: The telnet server serves telnet sessions; it uses \
+# unencrypted username/password pairs for authentication.
+service telnet
+{
+ disable = no
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = @SBINDIR@/in.telnetd
+ log_on_failure += USERID
+}
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/tftpd.xinetd.inetutils b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/tftpd.xinetd.inetutils
new file mode 100644
index 000000000..67b44c43e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/tftpd.xinetd.inetutils
@@ -0,0 +1,19 @@
+# default: off
+# description:
+# Tftpd is a server which supports the Internet Trivial File Transfer
+# Pro-tocol (RFC 783). The TFTP server operates at the port indicated
+# in the tftp service description; see services(5).
+#
+service tftp
+{
+ disable = yes
+ socket_type = dgram
+ protocol = udp
+ flags = IPv6
+ wait = yes
+ user = root
+ group = root
+ server = @SBINDIR@/in.tftpd
+ server_args = /tftpboot
+}
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/version.patch b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/version.patch
new file mode 100644
index 000000000..532a0e5c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils/version.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+remove m4_esyscmd function
+
+Signed-off-by: Chunrong Guo <b40290@freescale.com>
+--- inetutils-1.9.1/configure.ac 2012-01-06 22:05:05.000000000 +0800
++++ inetutils-1.9.1/configure.ac 2012-11-12 14:01:11.732957019 +0800
+@@ -20,8 +20,7 @@
+
+ AC_PREREQ(2.59)
+
+-AC_INIT([GNU inetutils],
+- m4_esyscmd([build-aux/git-version-gen .tarball-version 's/inetutils-/v/;s/_/./g']),
++AC_INIT([GNU inetutils],[1.9.4],
+ [bug-inetutils@gnu.org])
+
+ AC_CONFIG_SRCDIR([src/inetd.c])
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
new file mode 100644
index 000000000..190cd5f14
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.4.bb
@@ -0,0 +1,206 @@
+DESCRIPTION = "The GNU inetutils are a collection of common \
+networking utilities and servers including ftp, ftpd, rcp, \
+rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \
+talkd, telnet, telnetd, tftp, tftpd, and uucpd."
+HOMEPAGE = "http://www.gnu.org/software/inetutils"
+SECTION = "net"
+DEPENDS = "ncurses netbase readline"
+
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7"
+
+SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \
+ file://version.patch \
+ file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \
+ file://inetutils-1.8-0003-wchar.patch \
+ file://rexec.xinetd.inetutils \
+ file://rlogin.xinetd.inetutils \
+ file://rsh.xinetd.inetutils \
+ file://telnet.xinetd.inetutils \
+ file://tftpd.xinetd.inetutils \
+ file://inetutils-1.9-PATH_PROCNET_DEV.patch \
+ file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \
+ file://0001-rcp-fix-to-work-with-large-files.patch \
+"
+
+SRC_URI[md5sum] = "04852c26c47cc8c6b825f2b74f191f52"
+SRC_URI[sha256sum] = "be8f75eff936b8e41b112462db51adf689715658a1b09e0d6b05d11ec92cc616"
+
+inherit autotools gettext update-alternatives texinfo
+
+acpaths = "-I ./m4"
+
+SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}"
+
+PACKAGECONFIG ??= "ftp uucpd \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6 ping6', '', d)} \
+ "
+PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline"
+PACKAGECONFIG[uucpd] = "--enable-uucpd,--disable-uucpd,readline"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no,"
+PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6,"
+
+EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
+ inetutils_cv_path_login=${base_bindir}/login \
+ --with-libreadline-prefix=${STAGING_LIBDIR} \
+ --enable-rpath=no \
+"
+
+EXTRA_OECONF_append_libc-musl = " --disable-rsh --disable-rcp --disable-rlogin "
+
+do_configure_prepend () {
+ export HELP2MAN='true'
+ cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath
+ rm -f ${S}/glob/configure*
+}
+
+do_install_append () {
+ install -m 0755 -d ${D}${base_sbindir}
+ install -m 0755 -d ${D}${sbindir}
+ install -m 0755 -d ${D}${sysconfdir}/xinetd.d
+ if [ "${base_bindir}" != "${bindir}" ] ; then
+ install -m 0755 -d ${D}${base_bindir}
+ mv ${D}${bindir}/ping* ${D}${base_bindir}/
+ mv ${D}${bindir}/hostname ${D}${base_bindir}/
+ fi
+ mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/
+ mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/
+ mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd
+ mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd
+ mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd
+ if [ -e ${D}${libexecdir}/rlogind ]; then
+ mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind
+ fi
+ if [ -e ${D}${libexecdir}/rshd ]; then
+ mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd
+ fi
+ if [ -e ${D}${libexecdir}/talkd ]; then
+ mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd
+ fi
+ mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd
+ mv ${D}${libexecdir}/* ${D}${bindir}/
+ cp ${WORKDIR}/rexec.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rexec
+ cp ${WORKDIR}/rlogin.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rlogin
+ cp ${WORKDIR}/rsh.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rsh
+ cp ${WORKDIR}/telnet.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/telnet
+ cp ${WORKDIR}/tftpd.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/tftpd
+
+ sed -e 's,@SBINDIR@,${sbindir},g' -i ${D}/${sysconfdir}/xinetd.d/*
+ if [ -e ${D}${libdir}/charset.alias ]; then
+ rm -rf ${D}${libdir}/charset.alias
+ fi
+ rm -rf ${D}${libexecdir}/
+ # remove usr/lib if empty
+ rmdir ${D}${libdir} || true
+}
+
+PACKAGES =+ "${PN}-ping ${PN}-ping6 ${PN}-hostname ${PN}-ifconfig \
+${PN}-tftp ${PN}-logger ${PN}-traceroute ${PN}-syslogd \
+${PN}-ftp ${PN}-ftpd ${PN}-tftpd ${PN}-telnet ${PN}-telnetd ${PN}-inetd \
+${PN}-rsh ${PN}-rshd"
+
+# The packages tftpd, telnetd and rshd conflict with the ones
+# provided by netkit, so add the corresponding -dbg packages
+# for them to avoid the confliction between the dbg package
+# of inetutils and netkit.
+PACKAGES =+ "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg"
+NOAUTOPACKAGEDEBUG = "1"
+
+ALTERNATIVE_PRIORITY = "79"
+ALTERNATIVE_${PN} = "talk whois"
+ALTERNATIVE_LINK_NAME[talkd] = "${sbindir}/in.talkd"
+ALTERNATIVE_LINK_NAME[uucpd] = "${sbindir}/in.uucpd"
+
+ALTERNATIVE_PRIORITY_${PN}-logger = "60"
+ALTERNATIVE_${PN}-logger = "logger"
+ALTERNATIVE_${PN}-syslogd = "syslogd"
+ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
+
+ALTERNATIVE_${PN}-ftp = "ftp"
+ALTERNATIVE_${PN}-ftpd = "ftpd"
+ALTERNATIVE_${PN}-tftp = "tftp"
+ALTERNATIVE_${PN}-tftpd = "tftpd"
+ALTERNATIVE_LINK_NAME[tftpd] = "${sbindir}/tftpd"
+ALTERNATIVE_TARGET[tftpd] = "${sbindir}/in.tftpd"
+
+ALTERNATIVE_${PN}-telnet = "telnet"
+ALTERNATIVE_${PN}-telnetd = "telnetd"
+ALTERNATIVE_LINK_NAME[telnetd] = "${sbindir}/telnetd"
+ALTERNATIVE_TARGET[telnetd] = "${sbindir}/in.telnetd"
+
+ALTERNATIVE_${PN}-rsh = "rcp rexec rlogin rsh"
+ALTERNATIVE_${PN}-rshd = "rshd rexecd rlogind"
+ALTERNATIVE_LINK_NAME[rshd] = "${sbindir}/rshd"
+ALTERNATIVE_TARGET[rshd] = "${sbindir}/in.rshd"
+ALTERNATIVE_LINK_NAME[rexecd] = "${sbindir}/rexecd"
+ALTERNATIVE_TARGET[rexecd] = "${sbindir}/in.rexecd"
+ALTERNATIVE_LINK_NAME[rlogind] = "${sbindir}/rlogind"
+ALTERNATIVE_TARGET[rlogind] = "${sbindir}/in.rlogind"
+
+ALTERNATIVE_${PN}-inetd= "inetd"
+ALTERNATIVE_${PN}-traceroute = "traceroute"
+
+ALTERNATIVE_${PN}-hostname = "hostname"
+ALTERNATIVE_LINK_NAME[hostname] = "${base_bindir}/hostname"
+
+ALTERNATIVE_${PN}-doc = "hostname.1 dnsdomainname.1 logger.1 syslogd.8"
+ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1"
+ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1"
+ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1"
+ALTERNATIVE_LINK_NAME[syslogd.8] = "${mandir}/man8/syslogd.8"
+
+ALTERNATIVE_${PN}-ifconfig = "ifconfig"
+ALTERNATIVE_LINK_NAME[ifconfig] = "${base_sbindir}/ifconfig"
+
+ALTERNATIVE_${PN}-ping = "ping"
+ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
+
+ALTERNATIVE_${PN}-ping6 = "${@bb.utils.filter('PACKAGECONFIG', 'ping6', d)}"
+ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
+
+
+FILES_${PN}-dbg += "${base_bindir}/.debug ${base_sbindir}/.debug ${bindir}/.debug ${sbindir}/.debug"
+FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
+FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
+FILES_${PN}-hostname = "${base_bindir}/hostname.${BPN}"
+FILES_${PN}-ifconfig = "${base_sbindir}/ifconfig.${BPN}"
+FILES_${PN}-traceroute = "${bindir}/traceroute.${BPN}"
+FILES_${PN}-logger = "${bindir}/logger.${BPN}"
+
+FILES_${PN}-syslogd = "${base_sbindir}/syslogd.${BPN}"
+RCONFLICTS_${PN}-syslogd = "rsyslog busybox-syslog sysklogd syslog-ng"
+
+FILES_${PN}-ftp = "${bindir}/ftp.${BPN}"
+
+FILES_${PN}-tftp = "${bindir}/tftp.${BPN}"
+FILES_${PN}-telnet = "${bindir}/telnet.${BPN}"
+FILES_${PN}-rsh = "${bindir}/rsh.${BPN} ${bindir}/rlogin.${BPN} ${bindir}/rexec.${BPN} ${bindir}/rcp.${BPN}"
+
+FILES_${PN}-rshd = "${sbindir}/in.rshd ${sbindir}/in.rlogind ${sbindir}/in.rexecd \
+ ${sysconfdir}/xinetd.d/rsh ${sysconfdir}/xinetd.d/rlogin ${sysconfdir}/xinetd.d/rexec"
+FILES_${PN}-rshd-dbg = "${sbindir}/.debug/in.rshd ${sbindir}/.debug/in.rlogind ${sbindir}/.debug/in.rexecd"
+RDEPENDS_${PN}-rshd += "xinetd tcp-wrappers"
+RCONFLICTS_${PN}-rshd += "netkit-rshd"
+RPROVIDES_${PN}-rshd = "rshd"
+
+FILES_${PN}-ftpd = "${bindir}/ftpd.${BPN}"
+FILES_${PN}-ftpd-dbg = "${bindir}/.debug/ftpd.${BPN}"
+RDEPENDS_${PN}-ftpd += "xinetd"
+
+FILES_${PN}-tftpd = "${sbindir}/in.tftpd ${sysconfdir}/xinetd.d/tftpd"
+FILES_${PN}-tftpd-dbg = "${sbindir}/.debug/in.tftpd"
+RCONFLICTS_${PN}-tftpd += "netkit-tftpd"
+RDEPENDS_${PN}-tftpd += "xinetd"
+
+FILES_${PN}-telnetd = "${sbindir}/in.telnetd ${sysconfdir}/xinetd.d/telnet"
+FILES_${PN}-telnetd-dbg = "${sbindir}/.debug/in.telnetd"
+RCONFLICTS_${PN}-telnetd += "netkit-telnetd"
+RPROVIDES_${PN}-telnetd = "telnetd"
+RDEPENDS_${PN}-telnetd += "xinetd"
+
+FILES_${PN}-inetd = "${bindir}/inetd.${BPN}"
+
+RDEPENDS_${PN} = "xinetd"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/lftp/files/fix-gcc-6-conflicts-signbit.patch b/meta-openembedded/meta-networking/recipes-connectivity/lftp/files/fix-gcc-6-conflicts-signbit.patch
new file mode 100644
index 000000000..952232b7a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/lftp/files/fix-gcc-6-conflicts-signbit.patch
@@ -0,0 +1,44 @@
+--- lftp-4.6.3a/src/NetAccess.cc.orig 2016-06-18 10:25:51.063358981 -0400
++++ lftp-4.6.3a/src/NetAccess.cc 2016-06-18 10:26:04.143359209 -0400
+@@ -21,7 +21,7 @@
+
+ #include <errno.h>
+ #include <assert.h>
+-#include <math.h>
++#include <cmath>
+ #include <sys/types.h>
+
+ #include "NetAccess.h"
+--- lftp-4.6.3a/src/Speedometer.cc.orig 2016-06-18 10:24:58.895358073 -0400
++++ lftp-4.6.3a/src/Speedometer.cc 2016-06-18 10:25:10.879358281 -0400
+@@ -18,7 +18,7 @@
+ */
+
+ #include <config.h>
+-#include <math.h>
++#include <cmath>
+ #include <stdlib.h>
+ #include "Speedometer.h"
+ #include "misc.h"
+--- lftp-4.6.3a/src/FileCopy.cc.orig 2016-06-18 10:24:15.939357325 -0400
++++ lftp-4.6.3a/src/FileCopy.cc 2016-06-18 10:24:24.583357475 -0400
+@@ -36,7 +36,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+-#include <math.h>
++#include <cmath>
+ #include <stddef.h>
+ #include "FileCopy.h"
+ #include "url.h"
+--- lftp-4.6.3a/src/ResMgr.cc.orig 2016-06-18 10:23:31.387356549 -0400
++++ lftp-4.6.3a/src/ResMgr.cc 2016-06-18 10:23:41.771356729 -0400
+@@ -23,7 +23,7 @@
+ #include <ctype.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+-#include <math.h>
++#include <cmath>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <errno.h>
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb b/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb
new file mode 100644
index 000000000..b6b65da73
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/lftp/lftp_4.7.7.bb
@@ -0,0 +1,34 @@
+DESCRIPTION = "LFTP is a sophisticated file transfer program with \
+ command line interface. It supports FTP, HTTP, \
+ FISH, SFTP, HTTPS and FTPS protocols"
+HOMEPAGE = "http://lftp.yar.ru/"
+SECTION = "console/network"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://lftp.yar.ru/ftp/lftp-${PV}.tar.bz2 \
+ file://fix-gcc-6-conflicts-signbit.patch \
+ "
+SRC_URI[md5sum] = "3701e7675baa5619c92622eb141c8301"
+SRC_URI[sha256sum] = "fe441f20a9a317cfb99a8b8e628ba0457df472b6d93964d17374d5b5ebdf9280"
+
+inherit autotools gettext pkgconfig
+
+acpaths = "-I ./m4"
+
+EXTRA_OECONF += "--with-modules"
+
+PACKAGECONFIG ??= "libidn openssl zlib gnutls readline expat"
+PACKAGECONFIG[libidn] = "--with-libidn, --without-libidn, libidn"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_INCDIR}/.., --without-zlib, zlib"
+PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls"
+PACKAGECONFIG[readline] = "--with-readline=${STAGING_INCDIR}/.. --with-readline-inc=${STAGING_INCDIR} --with-readline-lib=-lreadline, --with-readline=no, readline"
+PACKAGECONFIG[expat] = "--with-expat=${STAGING_INCDIR}/.. --with-expat-inc=${STAGING_INCDIR} --with-expat-lib=-lexpat, , expat"
+
+do_install_append() {
+ rm -rf ${D}${libdir}/charset.alias
+}
+
+FILES_${PN}-dbg += "${libdir}/lftp/${PV}/.debug"
+RDEPENDS_${PN} = "perl bash readline"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
new file mode 100644
index 000000000..e579de507
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
@@ -0,0 +1,16 @@
+SUMMARY = "dumb networking library"
+HOMEPAGE = "http://code.google.com/p/libdnet/"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9"
+
+SRC_URI = "git://github.com/dugsong/libdnet.git;nobranch=1"
+SRCREV = "12fca29a6d4e99d1b923d6820887fe7b24226904"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+acpaths = "-I ./config/"
+
+BBCLASSEXTEND = "native"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.8.0.bb b/meta-openembedded/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.8.0.bb
new file mode 100644
index 000000000..736cce1b0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/mbedtls/mbedtls_2.8.0.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Lightweight crypto and SSL/TLS library"
+DESCRIPTION = "mbedtls is a lean open source crypto library \
+for providing SSL and TLS support in your programs. It offers \
+an intuitive API and documented header files, so you can actually \
+understand what the code does. It features: \
+ \
+ - Symmetric algorithms, like AES, Blowfish, Triple-DES, DES, ARC4, \
+ Camellia and XTEA \
+ - Hash algorithms, like SHA-1, SHA-2, RIPEMD-160 and MD5 \
+ - Entropy pool and random generators, like CTR-DRBG and HMAC-DRBG \
+ - Public key algorithms, like RSA, Elliptic Curves, Diffie-Hellman, \
+ ECDSA and ECDH \
+ - SSL v3 and TLS 1.0, 1.1 and 1.2 \
+ - Abstraction layers for ciphers, hashes, public key operations, \
+ platform abstraction and threading \
+"
+
+HOMEPAGE = "https://tls.mbed.org/"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=302d50a6369f5f22efdb674db908167a"
+
+SECTION = "libdevel"
+
+SRC_URI = "https://tls.mbed.org/download/mbedtls-${PV}-apache.tgz"
+
+SRC_URI[md5sum] = "2d4b0e2cb844efde1e73d3bcd9731fef"
+SRC_URI[sha256sum] = "ab8b62b995781bcf22e87a265ed06267f87c3041198e996b44441223d19fa9c3"
+
+inherit cmake
+
+PACKAGECONFIG ??= "shared-libs programs"
+PACKAGECONFIG[shared-libs] = "-DUSE_SHARED_MBEDTLS_LIBRARY=ON,-USE_SHARED_MBEDTLS_LIBRARY=OFF"
+PACKAGECONFIG[programs] = "-DENABLE_PROGRAMS=ON,-DENABLE_PROGRAMS=OFF"
+
+EXTRA_OECMAKE = "-DENABLE_TESTING=OFF -DLIB_INSTALL_DIR:STRING=${libdir}"
+
+PROVIDES += "polarssl"
+RPROVIDES_${PN} = "polarssl"
+
+PACKAGES =+ "${PN}-programs"
+FILES_${PN}-programs = "${bindir}/"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb b/meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
new file mode 100644
index 000000000..c6f36e137
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Lightweight UPnP IGD daemon"
+DESCRIPTION = "The miniUPnP daemon is an UPnP IGD (internet gateway device) \
+which provide NAT traversal services to any UPnP enabled client on \
+the network."
+
+SECTION = "networking"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aa71c78c373ccfe0ff207af0cd966d91"
+
+inherit autotools gettext pkgconfig
+
+DEPENDS += "iptables net-tools util-linux libmnl libnetfilter-conntrack"
+
+SRC_URI = "http://miniupnp.tuxfamily.org/files/download.php?file=${P}.tar.gz;downloadfilename=${P}.tar.gz \
+"
+SRC_URI[md5sum] = "1c07a215dd9b362e75a9efc05e2fb3b4"
+SRC_URI[sha256sum] = "d96aa3a00e0f5490826bba3cb97e68cd27479e5839adac4b9bcb66eae786bfb7"
+
+IPV6 = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--ipv6', '', d)}"
+
+do_compile() {
+ cd ${S}
+ CONFIG_OPTIONS="${IPV6} --leasefile --vendorcfg" oe_runmake -f Makefile.linux
+}
+
+do_install() {
+ install -d ${D}/${sbindir}
+ install ${S}/miniupnpd ${D}/${sbindir}
+ install -d ${D}/${sysconfdir}/${BPN}
+ install ${S}/netfilter/iptables_init.sh ${D}/${sysconfdir}/${BPN}
+ install ${S}/netfilter/iptables_removeall.sh ${D}/${sysconfdir}/${BPN}
+ install ${S}/netfilter/ip6tables_init.sh ${D}/${sysconfdir}/${BPN}
+ install ${S}/netfilter/ip6tables_removeall.sh ${D}/${sysconfdir}/${BPN}
+ install -m 0644 -b ${S}/miniupnpd.conf ${D}/${sysconfdir}/${BPN}
+ install -d ${D}/${sysconfdir}/init.d
+ install ${S}/linux/miniupnpd.init.d.script ${D}/${sysconfdir}/init.d/miniupnpd
+}
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb
new file mode 100644
index 000000000..1b604ad52
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb
@@ -0,0 +1,39 @@
+SUMMARY = "NetworkManager-openvpn-plugin"
+SECTION = "net/misc"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=100d5a599bead70ddcd70dcd73f2e29c"
+
+DEPENDS = "dbus dbus-glib networkmanager openvpn intltool-native glib-2.0-native"
+
+inherit gnomebase useradd gettext systemd
+
+SRC_URI = "${GNOME_MIRROR}/NetworkManager-openvpn/${@gnome_verdir("${PV}")}/NetworkManager-openvpn-${PV}.tar.xz"
+SRC_URI[md5sum] = "9f325be386aa906ff9b0b7c0bdf2a59a"
+SRC_URI[sha256sum] = "3e0b4007f248d96df4b8eb5d0f937536044af7053debbbf525e67c9bc5d30654"
+
+S = "${WORKDIR}/NetworkManager-openvpn-${PV}"
+
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+
+do_install_append () {
+ rm -rf ${D}${libdir}/NetworkManager/*.la
+}
+
+# Create user and group nm-openvpn that are needed since version 1.0.6
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system nm-openvpn"
+
+FILES_${PN} += " \
+ ${libdir}/NetworkManager/*.so \
+ ${nonarch_libdir}/NetworkManager/VPN/nm-openvpn-service.name \
+"
+
+FILES_${PN}-staticdev += " \
+ ${libdir}/NetworkManager/*.a \
+"
+
+RDEPENDS_${PN} = " \
+ networkmanager \
+ openvpn \
+"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
new file mode 100644
index 000000000..719442319
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
@@ -0,0 +1,40 @@
+From 18f71c1b48730b8602826517f2b5b088283ae948 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:48:00 -0700
+Subject: [PATCH 5/7] sd-lldp.h: Remove net/ethernet.h seems to be over
+ specified
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/libsystemd-network/sd-lldp.c | 1 +
+ src/systemd/src/systemd/sd-lldp.h | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/systemd/src/libsystemd-network/sd-lldp.c b/src/systemd/src/libsystemd-network/sd-lldp.c
+index 31e2448..7721cc2 100644
+--- a/src/systemd/src/libsystemd-network/sd-lldp.c
++++ b/src/systemd/src/libsystemd-network/sd-lldp.c
+@@ -21,6 +21,7 @@
+ #include "nm-sd-adapt.h"
+
+ #include <arpa/inet.h>
++#include <net/ethernet.h>
+ #include <linux/sockios.h>
+
+ #include "sd-lldp.h"
+diff --git a/src/systemd/src/systemd/sd-lldp.h b/src/systemd/src/systemd/sd-lldp.h
+index 3f35eeb..61b0e45 100644
+--- a/src/systemd/src/systemd/sd-lldp.h
++++ b/src/systemd/src/systemd/sd-lldp.h
+@@ -22,7 +22,7 @@
+ ***/
+
+ #include <inttypes.h>
+-#include <net/ethernet.h>
++//#include <net/ethernet.h>
+ #include <sys/types.h>
+
+ #include "sd-event.h"
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
new file mode 100644
index 000000000..28848d354
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch
@@ -0,0 +1,25 @@
+From 583f0448fb7e9aba2b410c06eec6f420b41a6a0c Mon Sep 17 00:00:00 2001
+From: Pablo Saavedra <psaavedra@igalia.com>
+Date: Tue, 13 Mar 2018 17:36:20 +0100
+Subject: [PATCH 7/7] Fixed configure.ac: Fix pkgconfig sysroot locations
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 51e5eb6..c9d3e56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -669,7 +669,7 @@ else
+ AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled])
+
+ AC_CHECK_TOOLS(READELF, [eu-readelf readelf])
+- JANSSON_LIBDIR=`$PKG_CONFIG --variable=libdir jansson`
++ JANSSON_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}`$PKG_CONFIG --variable=libdir jansson`
+ JANSSON_SONAME=`$READELF -d $JANSSON_LIBDIR/libjansson.so |sed -n 's/.*SONAME.*\[[\([^]]*\)]]/\1/p'`
+
+ if test "$JANSSON_SONAME" = ""; then
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch
new file mode 100644
index 000000000..92485f044
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Do-not-create-settings-settings-property-documentati.patch
@@ -0,0 +1,77 @@
+From 4f000a4a19975d6aba71427e693cd1ed080abda9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 11:08:30 +0100
+Subject: [PATCH] Do not create settings settings/property documentation
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It was tried to get this work but gi / GirRepository could not be found by
+python. Anyway it is not necessary for us to have the settings/property docs.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ Makefile.am | 18 ++----------------
+ configure.ac | 4 ----
+ 2 files changed, 2 insertions(+), 20 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 639921d..314a61d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -961,9 +961,7 @@ endif
+ if HAVE_INTROSPECTION
+
+ libnm_noinst_data = \
+- libnm/nm-property-docs.xml \
+ libnm/nm-settings-docs-overrides.xml \
+- libnm/nm-settings-docs.xml \
+ libnm/nm-settings-keyfile-docs.xml \
+ libnm/nm-settings-ifcfg-rh-docs.xml
+
+@@ -3317,23 +3315,11 @@ $(clients_common_libnmc_base_la_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
+ $(clients_common_libnmc_base_la_OBJECTS): clients/common/.dirstamp
+
+ clients_common_settings_doc_c = clients/common/settings-docs.c
+-if HAVE_INTROSPECTION
+-$(clients_common_settings_doc_c): clients/common/settings-docs.xsl libnm/nm-property-docs.xml clients/common/.dirstamp
+- $(AM_V_GEN) $(XSLTPROC) --output $@ $< $(word 2,$^)
+-DISTCLEANFILES += $(clients_common_settings_doc_c)
+-check-local-settings-docs: $(clients_common_settings_doc_c)
+- @if test -z "$$NMTST_NO_CHECK_SETTINGS_DOCS" ; then \
+- if ! cmp -s "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)" ; then \
+- echo "The generated file \"$(builddir)/$(clients_common_settings_doc_c)\" differs from the source file \"$(srcdir)/$(clients_common_settings_doc_c).in\". You probably should copy the generated file over to the source file. You can skip this test by setting \$$NMTST_NO_CHECK_SETTINGS_DOCS=yes"; \
+- false; \
+- fi;\
+- fi
+-check_local += check-local-settings-docs
+-else
++
+ $(clients_common_settings_doc_c): $(clients_common_settings_doc_c).in clients/common/.dirstamp
+ $(AM_V_GEN) cp "$(srcdir)/$(clients_common_settings_doc_c).in" "$(builddir)/$(clients_common_settings_doc_c)"
+ check-local-settings-docs:
+-endif
++
+ EXTRA_DIST += \
+ $(clients_common_settings_doc_c) \
+ $(clients_common_settings_doc_c).in
+diff --git a/configure.ac b/configure.ac
+index c9d3e56..407222e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1286,10 +1286,6 @@ GTK_DOC_CHECK(1.0)
+ # check if we can build setting property documentation
+ build_docs=no
+ if test -n "$INTROSPECTION_MAKEFILE"; then
+- # If g-i is installed we know we have python, but we might not have pygobject
+- if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
+- AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
+- fi
+
+ AC_PATH_PROG(PERL, perl)
+ if test -z "$PERL"; then
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch
new file mode 100644
index 000000000..9d208e1fd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0001-musl-basic.patch
@@ -0,0 +1,53 @@
+From e92de7409a3e107f90d108a9c5d49bd0418296dd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 17:54:10 +0100
+Subject: [PATCH 1/4] Usual fix for musl libc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/systemd/src/basic/stdio-util.h | 2 ++
+ src/systemd/src/basic/util.h | 5 +++++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
+index bd1144b..9eafacb 100644
+--- a/src/systemd/src/basic/stdio-util.h
++++ b/src/systemd/src/basic/stdio-util.h
+@@ -19,7 +19,9 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#if defined(__GLIBC__)
+ #include <printf.h>
++#endif
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+diff --git a/src/systemd/src/basic/util.h b/src/systemd/src/basic/util.h
+index b31dfd1..9b7032c 100644
+--- a/src/systemd/src/basic/util.h
++++ b/src/systemd/src/basic/util.h
+@@ -46,6 +46,11 @@
+ #include "missing.h"
+ #include "time-util.h"
+
++#if !defined(__GLIBC__)
++typedef int (*__compar_fn_t) (const void*, const void*);
++typedef __compar_fn_t comparison_fn_t;
++#endif
++
+ size_t page_size(void) _pure_;
+ #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
+
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch
new file mode 100644
index 000000000..548cccb32
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0002-musl-dlopen-configure-ac.patch
@@ -0,0 +1,35 @@
+From 57239fda56b68a8f3e413f7b6af5290ba0d86636 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 18:18:06 +0100
+Subject: [PATCH 2/4] musl: dlopen is included so LD_LIBS="" instead of
+ LD_LIBS="none required"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 487a266..96ae4f7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -305,6 +305,7 @@ dnl
+ dnl Checks for libdl - on certain platforms its part of libc
+ dnl
+ AC_SEARCH_LIBS([dlopen], [dl dld], [], [ac_cv_search_dlopen=])
++AS_IF([test "$ac_cv_search_dlopen" = "none required"],[ac_cv_search_dlopen=""])
+ AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen")
+
+ PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch
new file mode 100644
index 000000000..5dd17b63b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0003-musl-network-support.patch
@@ -0,0 +1,72 @@
+From 714b4731a238653e9c7d885c0dee10677b0a4df3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 18:24:07 +0100
+Subject: [PATCH 3/4] musl: network support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ libnm-core/nm-utils.h | 4 ++++
+ src/platform/wifi/wifi-utils.h | 4 ++++
+ src/systemd/src/basic/socket-util.h | 5 +++++
+ 3 files changed, 13 insertions(+)
+
+diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
+index df9284b..2bcf4b8 100644
+--- a/libnm-core/nm-utils.h
++++ b/libnm-core/nm-utils.h
+@@ -30,7 +30,11 @@
+ #include <netinet/in.h>
+
+ /* For ETH_ALEN and INFINIBAND_ALEN */
++#if defined(__GLIBC__)
+ #include <linux/if_ether.h>
++#else
++#define ETH_ALEN 6 /* Octets in one ethernet addr */
++#endif
+ #include <linux/if_infiniband.h>
+
+ #include "nm-core-enum-types.h"
+diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
+index 705717b..da3edc4 100644
+--- a/src/platform/wifi/wifi-utils.h
++++ b/src/platform/wifi/wifi-utils.h
+@@ -22,7 +22,11 @@
+ #ifndef __WIFI_UTILS_H__
+ #define __WIFI_UTILS_H__
+
++#if defined(__GLIBC__)
+ #include <net/ethernet.h>
++#else /* musl libc */
++#define ETH_ALEN 6 /* Octets in one ethernet addr */
++#endif
+
+ #include "nm-dbus-interface.h"
+
+diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
+index d7e2d85..d109c84 100644
+--- a/src/systemd/src/basic/socket-util.h
++++ b/src/systemd/src/basic/socket-util.h
+@@ -29,6 +29,11 @@
+ #include <linux/netlink.h>
+ #include <linux/if_infiniband.h>
+ #include <linux/if_packet.h>
++#if !defined(__GLIBC__)
++/* SIOCGSTAMPNS from linux/asm-generic.h
++ * for src/systemd/src/libsystemd-network/sd-lldp.c */
++#include <linux/sockios.h>
++#endif
+
+ #include "macro.h"
+ #include "missing.h"
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch
new file mode 100644
index 000000000..fc55ce85f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0004-musl-process-util.patch
@@ -0,0 +1,62 @@
+From d513c8bfc982dbd976617178b040c512c95710b6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Thu, 22 Mar 2018 18:29:00 +0100
+Subject: [PATCH 4/4] musl: process-util
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Stolen from [1] and prettyfied slightly
+
+[1] https://github.com/voidlinux/void-packages/tree/master/srcpkgs/NetworkManager/patches
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/systemd/src/basic/process-util.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/systemd/src/basic/process-util.c b/src/systemd/src/basic/process-util.c
+index 272030d..485f1db 100644
+--- a/src/systemd/src/basic/process-util.c
++++ b/src/systemd/src/basic/process-util.c
+@@ -36,6 +36,9 @@
+ #include <sys/wait.h>
+ #include <syslog.h>
+ #include <unistd.h>
++#ifndef __GLIBC__
++#include <pthread.h>
++#endif
+ #if 0 /* NM_IGNORED */
+ #if HAVE_VALGRIND_VALGRIND_H
+ #include <valgrind/valgrind.h>
+@@ -1015,11 +1018,13 @@ static void reset_cached_pid(void) {
+ cached_pid = CACHED_PID_UNSET;
+ }
+
++#ifdef __GLIBC__
+ /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
+ * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
+ * libpthread, as it is part of glibc anyway. */
+ extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
+ extern void* __dso_handle __attribute__ ((__weak__));
++#endif
+
+ pid_t getpid_cached(void) {
+ pid_t current_value;
+@@ -1042,7 +1047,11 @@ pid_t getpid_cached(void) {
+
+ new_pid = getpid();
+
++#ifdef __GLIBC__
+ if (__register_atfork(NULL, NULL, reset_cached_pid, __dso_handle) != 0) {
++#else
++ if (pthread_atfork(NULL, NULL, reset_cached_pid) != 0) {
++#endif
+ /* OOM? Let's try again later */
+ cached_pid = CACHED_PID_UNSET;
+ return new_pid;
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch
new file mode 100644
index 000000000..752fe4f58
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch
@@ -0,0 +1,77 @@
+From b3b4fe35018c98ad176719b2d9ffb867974fc7c3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Mon, 16 Apr 2018 14:45:44 +0200
+Subject: [PATCH] musl: avoid further conflicts by including net/ethernet.h
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/systemd/src/systemd/sd-dhcp-client.h | 2 ++
+ src/systemd/src/systemd/sd-dhcp-lease.h | 2 ++
+ src/systemd/src/systemd/sd-dhcp6-client.h | 2 ++
+ src/systemd/src/systemd/sd-ipv4ll.h | 2 ++
+ 4 files changed, 8 insertions(+)
+
+diff --git a/src/systemd/src/systemd/sd-dhcp-client.h b/src/systemd/src/systemd/sd-dhcp-client.h
+index 5e46d8d..18a613f 100644
+--- a/src/systemd/src/systemd/sd-dhcp-client.h
++++ b/src/systemd/src/systemd/sd-dhcp-client.h
+@@ -21,7 +21,9 @@
+ ***/
+
+ #include <inttypes.h>
++#if defined(__GLIBC__)
+ #include <net/ethernet.h>
++#endif
+ #include <netinet/in.h>
+ #include <sys/types.h>
+
+diff --git a/src/systemd/src/systemd/sd-dhcp-lease.h b/src/systemd/src/systemd/sd-dhcp-lease.h
+index 7ab99cc..85acdf2 100644
+--- a/src/systemd/src/systemd/sd-dhcp-lease.h
++++ b/src/systemd/src/systemd/sd-dhcp-lease.h
+@@ -22,7 +22,9 @@
+ ***/
+
+ #include <inttypes.h>
++#if defined(__GLIBC__)
+ #include <net/ethernet.h>
++#endif
+ #include <netinet/in.h>
+ #include <sys/types.h>
+
+diff --git a/src/systemd/src/systemd/sd-dhcp6-client.h b/src/systemd/src/systemd/sd-dhcp6-client.h
+index 7819f0d..35f30ee 100644
+--- a/src/systemd/src/systemd/sd-dhcp6-client.h
++++ b/src/systemd/src/systemd/sd-dhcp6-client.h
+@@ -21,7 +21,9 @@
+ ***/
+
+ #include <inttypes.h>
++#if defined(__GLIBC__)
+ #include <net/ethernet.h>
++#endif
+ #include <sys/types.h>
+
+ #include "sd-dhcp6-lease.h"
+diff --git a/src/systemd/src/systemd/sd-ipv4ll.h b/src/systemd/src/systemd/sd-ipv4ll.h
+index 5ba9208..c90eca6 100644
+--- a/src/systemd/src/systemd/sd-ipv4ll.h
++++ b/src/systemd/src/systemd/sd-ipv4ll.h
+@@ -20,7 +20,9 @@
+ along with systemd; If not, see <http://www.gnu.org/licenses/>.
+ ***/
+
++#if defined(__GLIBC__)
+ #include <net/ethernet.h>
++#endif
+ #include <netinet/in.h>
+
+ #include "sd-event.h"
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch
new file mode 100644
index 000000000..8ed7ee64f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/musl/0006-Add-a-strndupa-replacement-for-musl.patch
@@ -0,0 +1,47 @@
+From 6db6596e450062601d18b2ae812a4a58d2e03a53 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Mon, 16 Apr 2018 15:07:20 +0200
+Subject: [PATCH] Add a strndupa replacement for musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Pending
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/systemd/src/basic/in-addr-util.c | 1 +
+ src/systemd/src/basic/string-util.h | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/systemd/src/basic/in-addr-util.c b/src/systemd/src/basic/in-addr-util.c
+index 2a02d90..a57c360 100644
+--- a/src/systemd/src/basic/in-addr-util.c
++++ b/src/systemd/src/basic/in-addr-util.c
+@@ -30,6 +30,7 @@
+ #include "in-addr-util.h"
+ #include "macro.h"
+ #include "parse-util.h"
++#include "string-util.h"
+ #include "util.h"
+
+ bool in4_addr_is_null(const struct in_addr *a) {
+diff --git a/src/systemd/src/basic/string-util.h b/src/systemd/src/basic/string-util.h
+index 4c94b18..a6dc446 100644
+--- a/src/systemd/src/basic/string-util.h
++++ b/src/systemd/src/basic/string-util.h
+@@ -44,6 +44,11 @@
+ #define strcaseeq(a,b) (strcasecmp((a),(b)) == 0)
+ #define strncaseeq(a, b, n) (strncasecmp((a), (b), (n)) == 0)
+
++/* musl does not know strndupa */
++#if !defined(__GLIBC__)
++#define strndupa(x,s) strncpy(alloca(strlen(x)+1),x,s)
++#endif
++
+ int strcmp_ptr(const char *a, const char *b) _pure_;
+
+ static inline bool streq_ptr(const char *a, const char *b) {
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb
new file mode 100644
index 000000000..09c5dbd18
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.10.6.bb
@@ -0,0 +1,143 @@
+SUMMARY = "NetworkManager"
+HOMEPAGE = "https://wiki.gnome.org/Projects/NetworkManager"
+SECTION = "net/misc"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cbbffd568227ada506640fe950a4823b \
+ file://libnm-util/COPYING;md5=1c4fa765d6eb3cd2fbd84344a1b816cd \
+ file://docs/api/html/license.html;md5=77b9e362690c149da196aefe7712db30 \
+"
+
+DEPENDS = " \
+ intltool-native \
+ libxslt-native \
+ libnl \
+ dbus \
+ dbus-glib \
+ dbus-glib-native \
+ libgudev \
+ util-linux \
+ libndp \
+ libnewt \
+ polkit \
+ jansson \
+ curl \
+"
+
+inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection gtk-doc
+
+SRC_URI = " \
+ ${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
+ file://0001-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
+ file://0002-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
+ file://0003-Do-not-create-settings-settings-property-documentati.patch \
+ file://musl/0001-musl-basic.patch \
+ file://musl/0002-musl-dlopen-configure-ac.patch \
+ file://musl/0003-musl-network-support.patch \
+ file://musl/0004-musl-process-util.patch \
+ file://musl/0005-musl-avoid-further-conflicts-by-including-net-ethern.patch \
+ file://musl/0006-Add-a-strndupa-replacement-for-musl.patch \
+"
+SRC_URI[md5sum] = "de3c7147a693da6f80eb22f126086a14"
+SRC_URI[sha256sum] = "6af0b1e856a3725f88791f55c4fbb04105dc0b20dbf182aaec8aad16481fac76"
+
+S = "${WORKDIR}/NetworkManager-${PV}"
+
+EXTRA_OECONF = " \
+ --disable-ifcfg-rh \
+ --disable-ifnet \
+ --disable-ifcfg-suse \
+ --disable-more-warnings \
+ --with-iptables=${sbindir}/iptables \
+ --with-tests \
+ --with-nmtui=yes \
+"
+
+# gobject-introspection related
+GI_DATA_ENABLED_libc-musl = "False"
+
+# stolen from https://github.com/voidlinux/void-packages/blob/master/srcpkgs/NetworkManager/template
+CFLAGS_libc-musl_append = " \
+ -DHAVE_SECURE_GETENV -Dsecure_getenv=getenv \
+ -D__USE_POSIX199309 -DRTLD_DEEPBIND=0 \
+"
+
+do_compile_prepend() {
+ export GIR_EXTRA_LIBS_PATH="${B}/libnm/.libs:${B}/libnm-glib/.libs:${B}/libnm-util/.libs"
+}
+
+PACKAGECONFIG ??= "nss ifupdown netconfig dhclient dnsmasq \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d), d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'wifi', d)} \
+"
+PACKAGECONFIG[systemd] = " \
+ --with-systemdsystemunitdir=${systemd_unitdir}/system --with-session-tracking=systemd --enable-polkit, \
+ --without-systemdsystemunitdir, \
+ polkit \
+"
+PACKAGECONFIG[bluez5] = "--enable-bluez5-dun,--disable-bluez5-dun,bluez5"
+# consolekit is not picked by shlibs, so add it to RDEPENDS too
+PACKAGECONFIG[consolekit] = "--with-session-tracking=consolekit,,consolekit,consolekit"
+PACKAGECONFIG[modemmanager] = "--with-modem-manager-1=yes,--with-modem-manager-1=no,modemmanager"
+PACKAGECONFIG[ppp] = "--enable-ppp,--disable-ppp,ppp,ppp"
+# Use full featured dhcp client instead of internal one
+PACKAGECONFIG[dhclient] = "--with-dhclient=${base_sbindir}/dhclient,,,dhcp-client"
+PACKAGECONFIG[dnsmasq] = "--with-dnsmasq=${bindir}/dnsmasq"
+PACKAGECONFIG[nss] = "--with-crypto=nss,,nss"
+PACKAGECONFIG[gnutls] = "--with-crypto=gnutls,,gnutls"
+PACKAGECONFIG[wifi] = "--enable-wifi=yes,--enable-wifi=no,wireless-tools,wpa-supplicant wireless-tools"
+PACKAGECONFIG[ifupdown] = "--enable-ifupdown,--disable-ifupdown"
+PACKAGECONFIG[netconfig] = "--with-netconfig=yes,--with-netconfig=no"
+PACKAGECONFIG[qt4-x11-free] = "--enable-qt,--disable-qt,qt4-x11-free"
+
+PACKAGES =+ "libnmutil libnmglib libnmglib-vpn \
+ ${PN}-nmtui ${PN}-nmtui-doc \
+ ${PN}-adsl \
+"
+
+FILES_libnmutil += "${libdir}/libnm-util.so.*"
+FILES_libnmglib += "${libdir}/libnm-glib.so.*"
+FILES_libnmglib-vpn += "${libdir}/libnm-glib-vpn.so.*"
+
+FILES_${PN}-adsl = "${libdir}/NetworkManager/libnm-device-plugin-adsl.so"
+
+FILES_${PN} += " \
+ ${libexecdir} \
+ ${libdir}/pppd/*/nm-pppd-plugin.so \
+ ${libdir}/NetworkManager/*.so \
+ ${nonarch_libdir}/NetworkManager/VPN \
+ ${nonarch_libdir}/NetworkManager/conf.d \
+ ${datadir}/polkit-1 \
+ ${datadir}/dbus-1 \
+ ${base_libdir}/udev/* \
+ ${systemd_unitdir}/system \
+"
+
+RRECOMMENDS_${PN} += "iptables \
+ ${@bb.utils.filter('PACKAGECONFIG', 'dnsmasq', d)} \
+"
+RCONFLICTS_${PN} = "connman"
+
+FILES_${PN}-dev += " \
+ ${datadir}/NetworkManager/gdb-cmd \
+ ${libdir}/pppd/*/*.la \
+ ${libdir}/NetworkManager/*.la \
+"
+
+FILES_${PN}-nmtui = " \
+ ${bindir}/nmtui \
+ ${bindir}/nmtui-edit \
+ ${bindir}/nmtui-connect \
+ ${bindir}/nmtui-hostname \
+"
+
+FILES_${PN}-nmtui-doc = " \
+ ${mandir}/man1/nmtui* \
+"
+
+SYSTEMD_SERVICE_${PN} = "NetworkManager.service NetworkManager-dispatcher.service"
+
+do_install_append() {
+ rm -rf ${D}/run ${D}${localstatedir}/run
+}
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb b/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
new file mode 100644
index 000000000..c944144e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Open client for Cisco AnyConnect VPN"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+DEPENDS = "vpnc libxml2 krb5 gettext-native"
+
+PACKAGECONFIG ??= "gnutls lz4 libproxy"
+
+# config defaults
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls,"
+PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy,"
+
+# not config defaults
+PACKAGECONFIG[pcsc-lite] = "--with-libpcsclite,--without-libpcsclite,pcsc-lite,"
+
+PV = "7.08"
+
+SRCREV = "9697bea0e50952cab57063238b43a7099e498cbb"
+SRC_URI = "git://git.infradead.org/users/dwmw2/openconnect.git"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--with-vpnc-script=${SYSROOT_DESTDIR}${sysconfdir}/vpnc/vpnc-script \
+ --disable-static"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb b/meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb
new file mode 100644
index 000000000..4e41aa576
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Easy communication with NetworkManager from Python"
+HOMEPAGE = "https://github.com/seveas/python-networkmanager"
+LICENSE = "Zlib"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8d8bac174bf8422b151200e6cc78ebe4"
+
+SRC_URI[md5sum] = "5fc644a65463031295c6b7dd51a0f1bd"
+SRC_URI[sha256sum] = "bc36507506ad29bfdac941b0987ebd1cc9633c9a9291d7378e229e4515a0a517"
+
+PYPI_PACKAGE = "python-networkmanager"
+inherit pypi setuptools
+
+RDEPENDS_${PN} = "networkmanager python-dbus python-six"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch
new file mode 100644
index 000000000..08ba2c31e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch
@@ -0,0 +1,40 @@
+From e0c690acfcddd3c3421f6eb0182c54815fd70f8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 23:21:08 -0700
+Subject: [PATCH] rdate: define logwtmp on libc != glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/rdate.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/rdate.c b/src/rdate.c
+index 943d481..685b1b8 100644
+--- a/src/rdate.c
++++ b/src/rdate.c
+@@ -41,7 +41,22 @@ static int print_mode = 0; // display the time
+ static int timeout = 10; // timeout for each connection attempt
+ static char *service = DEFAULT_SERVICE;
+
++#ifndef __GLIBC__
++static void logwtmp(const char * line, const char * name, const char * host)
++{
++ struct utmp u;
++ memset(&u, 0, sizeof(u));
++
++ u.ut_pid = getpid();
++ u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS;
++ strncpy(u.ut_line, line, sizeof(u.ut_line));
++ strncpy(u.ut_name, name, sizeof(u.ut_name));
++ strncpy(u.ut_host, host, sizeof(u.ut_host));
++ gettimeofday(&(u.ut_tv), NULL);
+
++ updwtmp(_PATH_WTMP, &u);
++}
++#endif /* __GLIBC__ */
+
+ // Returns string from address info pointer
+ static char*
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch
new file mode 100644
index 000000000..2f6518984
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch
@@ -0,0 +1,33 @@
+From f58bcb43c31d08de58853b088681cbe4df36cbf9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 26 Jun 2017 22:50:56 -0700
+Subject: [PATCH] src/rdate: Fix printf format errors
+
+Fixes
+
+rdate.c:85:41: error: format not a string literal and no format arguments [-Werror=format-security]
+| syslog(is_error?LOG_WARNING:LOG_INFO, buf);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ src/rdate.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/rdate.c b/src/rdate.c
+index 5c3e829..943d481 100644
+--- a/src/rdate.c
++++ b/src/rdate.c
+@@ -82,7 +82,7 @@ write_log(int is_error, char *format, ...)
+ return; /* Error, which we can't report because this _is_ the error
+ reporting mechanism */
+ if(log_mode)
+- syslog(is_error?LOG_WARNING:LOG_INFO, buf);
++ syslog(is_error?LOG_WARNING:LOG_INFO, "%s", buf);
+ if(is_error || print_mode)
+ fprintf(is_error?stderr:stdout, "%s: %s\n", argv0, buf);
+ }
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb
new file mode 100644
index 000000000..cd4db12c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool for getting the date/time from a remote machine."
+DESCRIPTION = "The rdate utility retrieves the date and time from \
+ another machine on your network, using the protocol described in RFC 868. \
+ If you run rdate as root, it will set your machine local time to the \
+ time of the machine that you queried. \
+"
+
+HOMEPAGE= "https://www.aelius.com/njh/rdate/"
+SECTION = "Applications/System"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI = "https://www.aelius.com/njh/${BPN}/${BP}.tar.gz \
+ file://0001-src-rdate-Fix-printf-format-errors.patch \
+ file://0001-rdate-define-logwtmp-on-libc-glibc.patch \
+ "
+SRC_URI[md5sum] = "0a4f612480777fdf25264ac03c57eae6"
+SRC_URI[sha256sum] = "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d"
+
+inherit autotools
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch
new file mode 100644
index 000000000..c95eaf8f5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch
@@ -0,0 +1,75 @@
+From 244861e2c9bb9cc44f4bd246964ba850a7cf1216 Mon Sep 17 00:00:00 2001
+From: Xin Ouyang <Xin.Ouyang@windriver.com>
+Date: Tue, 15 May 2012 15:06:43 +0800
+Subject: [PATCH] rdist: bitbake build
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.local | 8 ++++----
+ doc/Makefile.real | 4 +++-
+ src/Makefile.real | 1 +
+ 3 files changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.local b/Makefile.local
+index 26092b2..389cb84 100644
+--- a/Makefile.local
++++ b/Makefile.local
+@@ -14,7 +14,7 @@
+ # BIN_DIR variable, you would uncomment the following line
+ # or add your own line.
+ #
+-#BIN_DIR = /usr/bin
++BIN_DIR = ${DESTDIR}/${bindir}
+
+ #
+ # Add any local definitions you want pass to the compiler to DEFS_LOCAL
+@@ -46,13 +46,13 @@ LIBS_LOCAL =
+ # Set a site specific install program to use. Must support BSD style
+ # install(1) arguments.
+ #
+-#INSTALL = install
++INSTALL = install
+
+ #
+ # Site specific Man Page configuration.
+ #
+-#MAN_1_DIR = /usr/local/man/man1
+-#MAN_8_DIR = /usr/local/man/man8
++MAN_1_DIR = ${DESTDIR}/${mandir}/man1
++MAN_8_DIR = ${DESTDIR}/${mandir}/man8
+ #MAN_OWNER = bin
+ #MAN_GROUP = bin
+ #MAN_MODE = 644
+diff --git a/doc/Makefile.real b/doc/Makefile.real
+index 42cabec..e32c30b 100644
+--- a/doc/Makefile.real
++++ b/doc/Makefile.real
+@@ -16,9 +16,11 @@ all:
+
+ doc:
+
+-install:
++install: install.man
+
+ install.man: rdist.man rdistd.man
++ test -d ${MAN_1_DIR} || ${INSTALL} -d ${MAN_1_DIR}
++ test -d ${MAN_8_DIR} || ${INSTALL} -d ${MAN_8_DIR}
+ ${INSTALL} ${INSTALL_ARGS} rdist.man ${CLIENT_DEST}
+ ${INSTALL} ${INSTALL_ARGS} rdistd.man ${SERVER_DEST}
+
+diff --git a/src/Makefile.real b/src/Makefile.real
+index 02179e4..9ec551d 100644
+--- a/src/Makefile.real
++++ b/src/Makefile.real
+@@ -52,6 +52,7 @@ clean:
+ $(COMMONOBJS) $(MISSINGOBJS)
+
+ install:
++ test -d $(BIN_DIR) || $(INSTALL) -d $(BIN_DIR)
+ $(INSTALL) ${IN_ARGS} -o $(BIN_OWNER) -m ${RDIST_MODE} \
+ $(CLIENT_BIN) $(BIN_DIR)/$(CLIENT)
+ $(INSTALL) ${IN_ARGS} -o ${BIN_OWNER} -m ${RDISTD_MODE} \
+--
+1.7.5.4
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch
new file mode 100644
index 000000000..435491221
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch
@@ -0,0 +1,147 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/gram.y.bison 1998-11-10 05:10:42.000000000 +0100
++++ rdist-6.1.5/src/gram.y 2003-06-04 16:02:19.000000000 +0200
+@@ -90,10 +90,10 @@
+ struct namelist *namel;
+ }
+
+-%type <optval> OPTION, options
+-%type <string> NAME, STRING
+-%type <subcmd> INSTALL, NOTIFY, EXCEPT, PATTERN, SPECIAL, CMDSPECIAL, cmdlist, cmd
+-%type <namel> namelist, names, opt_namelist nlist
++%type <optval> OPTION options
++%type <string> NAME STRING
++%type <subcmd> INSTALL NOTIFY EXCEPT PATTERN SPECIAL CMDSPECIAL cmdlist cmd
++%type <namel> namelist names opt_namelist nlist
+
+ %%
+
+@@ -101,19 +101,19 @@
+ | file command
+ ;
+
+-command: NAME '=' namelist = {
++command: NAME '=' namelist {
+ (void) lookup($1, INSERT, $3);
+ }
+- | namelist ARROW namelist cmdlist = {
++ | namelist ARROW namelist cmdlist {
+ insert((char *)NULL, $1, $3, $4);
+ }
+- | NAME COLON namelist ARROW namelist cmdlist = {
++ | NAME COLON namelist ARROW namelist cmdlist {
+ insert($1, $3, $5, $6);
+ }
+- | namelist DCOLON NAME cmdlist = {
++ | namelist DCOLON NAME cmdlist {
+ append((char *)NULL, $1, $3, $4);
+ }
+- | NAME COLON namelist DCOLON NAME cmdlist = {
++ | NAME COLON namelist DCOLON NAME cmdlist {
+ append($1, $3, $5, $6);
+ }
+ | error
+@@ -133,10 +133,10 @@
+ }
+ ;
+
+-nlist: NAME = {
++nlist: NAME {
+ $$ = makenl($1);
+ }
+- | '(' names ')' = {
++ | '(' names ')' {
+ $$ = $2;
+ }
+ ;
+@@ -144,7 +144,7 @@
+ names: /* VOID */ {
+ $$ = last_n = NULL;
+ }
+- | names NAME = {
++ | names NAME {
+ if (last_n == NULL)
+ $$ = last_n = makenl($2);
+ else {
+@@ -158,7 +158,7 @@
+ cmdlist: /* VOID */ {
+ $$ = last_sc = NULL;
+ }
+- | cmdlist cmd = {
++ | cmdlist cmd {
+ if (last_sc == NULL)
+ $$ = last_sc = $2;
+ else {
+@@ -169,7 +169,7 @@
+ }
+ ;
+
+-cmd: INSTALL options opt_namelist ';' = {
++cmd: INSTALL options opt_namelist ';' {
+ register struct namelist *nl;
+
+ $1->sc_options = $2 | options;
+@@ -185,17 +185,17 @@
+ }
+ $$ = $1;
+ }
+- | NOTIFY namelist ';' = {
++ | NOTIFY namelist ';' {
+ if ($2 != NULL)
+ $1->sc_args = expand($2, E_VARS);
+ $$ = $1;
+ }
+- | EXCEPT namelist ';' = {
++ | EXCEPT namelist ';' {
+ if ($2 != NULL)
+ $1->sc_args = expand($2, E_ALL);
+ $$ = $1;
+ }
+- | PATTERN namelist ';' = {
++ | PATTERN namelist ';' {
+ struct namelist *nl;
+ char *cp, *re_comp();
+
+@@ -205,13 +205,13 @@
+ $1->sc_args = expand($2, E_VARS);
+ $$ = $1;
+ }
+- | SPECIAL opt_namelist STRING ';' = {
++ | SPECIAL opt_namelist STRING ';' {
+ if ($2 != NULL)
+ $1->sc_args = expand($2, E_ALL);
+ $1->sc_name = $3;
+ $$ = $1;
+ }
+- | CMDSPECIAL opt_namelist STRING ';' = {
++ | CMDSPECIAL opt_namelist STRING ';' {
+ if ($2 != NULL)
+ $1->sc_args = expand($2, E_ALL);
+ $1->sc_name = $3;
+@@ -219,18 +219,18 @@
+ }
+ ;
+
+-options: /* VOID */ = {
++options: /* VOID */ {
+ $$ = 0;
+ }
+- | options OPTION = {
++ | options OPTION {
+ $$ |= $2;
+ }
+ ;
+
+-opt_namelist: /* VOID */ = {
++opt_namelist: /* VOID */ {
+ $$ = NULL;
+ }
+- | namelist = {
++ | namelist {
+ $$ = $1;
+ }
+ ;
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch
new file mode 100644
index 000000000..ed3d7f1b3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch
@@ -0,0 +1,2087 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/gram.y.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/src/gram.y 2003-12-17 11:38:16.000000000 +0100
+@@ -40,7 +40,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: gram.y,v 6.30 1998/11/10 04:10:42 mcooper Exp $";
+
+@@ -170,7 +170,7 @@
+ ;
+
+ cmd: INSTALL options opt_namelist ';' {
+- register struct namelist *nl;
++ struct namelist *nl;
+
+ $1->sc_options = $2 | options;
+ if ($3 != NULL) {
+@@ -240,11 +240,11 @@
+ int yylineno = 1;
+ extern FILE *fin;
+
+-yylex()
++int yylex()
+ {
+ static char yytext[INMAX];
+- register int c;
+- register char *cp1, *cp2;
++ int c;
++ char *cp1, *cp2;
+ static char quotechars[] = "[]{}*?$";
+
+ again:
+@@ -409,8 +409,8 @@
+ * some of the characters we use.
+ */
+ extern int any(c, str)
+- register int c;
+- register char *str;
++ int c;
++ char *str;
+ {
+ while (*str)
+ if (c == *str++)
+@@ -421,13 +421,14 @@
+ /*
+ * Insert or append ARROW command to list of hosts to be updated.
+ */
++void
+ insert(label, files, hosts, subcmds)
+ char *label;
+ struct namelist *files, *hosts;
+ struct subcmd *subcmds;
+ {
+- register struct cmd *c, *prev, *nc;
+- register struct namelist *h, *lasth;
++ struct cmd *c, *prev, *nc;
++ struct namelist *h, *lasth;
+
+ debugmsg(DM_CALL, "insert(%s, %x, %x, %x) start, files = %s",
+ label == NULL ? "(null)" : label,
+@@ -475,13 +476,14 @@
+ * Append DCOLON command to the end of the command list since these are always
+ * executed in the order they appear in the distfile.
+ */
++void
+ append(label, files, stamp, subcmds)
+ char *label;
+ struct namelist *files;
+ char *stamp;
+ struct subcmd *subcmds;
+ {
+- register struct cmd *c;
++ struct cmd *c;
+
+ c = ALLOC(cmd);
+ c->c_type = DCOLON;
+@@ -501,6 +503,7 @@
+ /*
+ * Error printing routine in parser.
+ */
++void
+ yyerror(s)
+ char *s;
+ {
+@@ -530,7 +533,7 @@
+ makenl(name)
+ char *name;
+ {
+- register struct namelist *nl;
++ struct namelist *nl;
+
+ debugmsg(DM_CALL, "makenl(%s)", name == NULL ? "null" : name);
+
+@@ -627,7 +630,7 @@
+ makesubcmd(type)
+ int type;
+ {
+- register struct subcmd *sc;
++ struct subcmd *sc;
+
+ sc = ALLOC(subcmd);
+ sc->sc_type = type;
+--- rdist-6.1.5/src/rdist.c.cleanup 1998-11-10 05:13:50.000000000 +0100
++++ rdist-6.1.5/src/rdist.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: rdist.c,v 6.66 1998/11/10 04:13:49 mcooper Exp $";
+
+@@ -80,7 +80,7 @@
+ char *name;
+ struct namelist **hostlist;
+ {
+- register struct namelist *ptr, *new;
++ struct namelist *ptr, *new;
+
+ if (!name || !hostlist)
+ return;
+@@ -97,14 +97,15 @@
+ *hostlist = new;
+ }
+
++int
+ main(argc, argv, envp)
+ int argc;
+ char *argv[];
+ char **envp;
+ {
+ struct namelist *hostlist = NULL;
+- register int x;
+- register char *cp;
++ int x;
++ char *cp;
+ int cmdargs = 0;
+ int c;
+
+@@ -114,7 +115,7 @@
+ */
+ setprogname(argv);
+
+- if (cp = msgparseopts(localmsglist, TRUE)) {
++ if ((cp = msgparseopts(localmsglist, TRUE))) {
+ error("Bad builtin log option (%s): %s.",
+ localmsglist, cp);
+ usage();
+@@ -158,7 +159,7 @@
+ while ((c = getopt(argc, argv, optchars)) != -1)
+ switch (c) {
+ case 'l':
+- if (cp = msgparseopts(optarg, TRUE)) {
++ if ((cp = msgparseopts(optarg, TRUE))) {
+ error("Bad log option \"%s\": %s.", optarg,cp);
+ usage();
+ }
+@@ -206,7 +207,7 @@
+
+ case 'D':
+ debug = DM_ALL;
+- if (cp = msgparseopts("stdout=all,debug", TRUE)) {
++ if ((cp = msgparseopts("stdout=all,debug", TRUE))) {
+ error("Enable debug messages failed: %s.", cp);
+ usage();
+ }
+@@ -245,7 +246,7 @@
+ error("No path specified to \"-P\".");
+ usage();
+ }
+- if (cp = searchpath(optarg))
++ if ((cp = searchpath(optarg)))
+ path_remsh = strdup(cp);
+ else {
+ error("No component of path \"%s\" exists.",
+@@ -297,7 +298,7 @@
+ else {
+ if (fin == NULL)
+ fin = opendist(distfile);
+- (void) yyparse();
++ yyparse();
+ /*
+ * Need to keep stdin open for child processing later
+ */
+@@ -348,6 +349,7 @@
+ /*
+ * Print usage message and exit.
+ */
++void
+ usage()
+ {
+ char *sopts = "cDFnv";
+@@ -379,12 +381,13 @@
+ /*
+ * rcp like interface for distributing files.
+ */
++void
+ docmdargs(nargs, args)
+ int nargs;
+ char *args[];
+ {
+- register struct namelist *nl, *prev;
+- register char *cp;
++ struct namelist *nl, *prev;
++ char *cp;
+ struct namelist *files, *hosts;
+ struct subcmd *cmds;
+ char *dest;
+@@ -433,10 +436,10 @@
+ * Get a list of NAME blocks (mostly for debugging).
+ */
+ extern char *getnlstr(nl)
+- register struct namelist *nl;
++ struct namelist *nl;
+ {
+ static char buf[16384];
+- register int count = 0, len = 0;
++ int count = 0, len = 0;
+
+ (void) sprintf(buf, "(");
+
+--- rdist-6.1.5/src/client.c.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/src/client.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: client.c,v 6.82 1998/11/10 04:08:47 mcooper Exp $";
+
+@@ -84,7 +84,7 @@
+ int destdir;
+ {
+ extern struct namelist *filelist;
+- register char *lname, *cp;
++ char *lname, *cp;
+ static char buff[BUFSIZ];
+ int srclen, pathlen;
+ char *p;
+@@ -146,7 +146,7 @@
+ struct namelist *list;
+ char *file;
+ {
+- register struct namelist *nl;
++ struct namelist *nl;
+
+ for (nl = list; nl != NULL; nl = nl->n_next)
+ if (strcmp(file, nl->n_name) == 0)
+@@ -163,7 +163,7 @@
+ char *rname;
+ int destdir;
+ {
+- register struct subcmd *sc;
++ struct subcmd *sc;
+ extern struct subcmd *subcmds;
+ char *rfile;
+
+@@ -200,7 +200,7 @@
+ {
+ char *rfile;
+ struct namelist *new;
+- register struct subcmd *sc;
++ struct subcmd *sc;
+ extern struct subcmd *subcmds;
+ int isokay = 0;
+
+@@ -227,7 +227,7 @@
+ */
+ static void freecmdspecialfiles()
+ {
+- register struct namelist *ptr, *save;
++ struct namelist *ptr, *save;
+
+ for (ptr = updfilelist; ptr; ) {
+ if (ptr->n_name) (void) free(ptr->n_name);
+@@ -249,10 +249,8 @@
+ char **filev;
+ opt_t opts;
+ {
+- register struct subcmd *sc;
+- register struct namelist *f;
+- register char **cpp;
+- char *file;
++ struct subcmd *sc;
++ struct namelist *f;
+ int first = TRUE;
+
+ for (sc = cmd->c_cmds; sc != NULL; sc = sc->sc_next) {
+@@ -294,7 +292,7 @@
+ int checkfilename(name)
+ char *name;
+ {
+- register char *cp;
++ char *cp;
+
+ if (strchr(name, '\n')) {
+ for (cp = name; *cp; cp++)
+@@ -501,7 +499,7 @@
+ static int rmchk(opts)
+ opt_t opts;
+ {
+- register u_char *s;
++ u_char *s;
+ struct stat stb;
+ int didupdate = 0;
+ int n;
+@@ -618,7 +616,7 @@
+
+ optarget = ptarget;
+ len = ptarget - target;
+- while (dp = readdir(d)) {
++ while ((dp = readdir(d))) {
+ if (!strcmp(dp->d_name, ".") ||
+ !strcmp(dp->d_name, ".."))
+ continue;
+@@ -631,7 +629,7 @@
+ if (ptarget[-1] != '/')
+ *ptarget++ = '/';
+ cp = dp->d_name;
+- while (*ptarget++ = *cp++)
++ while ((*ptarget++ = *cp++))
+ ;
+ ptarget--;
+ if (sendit(dp->d_name, opts, destdir) > 0)
+@@ -770,13 +768,13 @@
+ opt_t opts;
+ struct stat *statp;
+ {
+- register off_t size;
+- register time_t mtime;
++ off_t size;
++ time_t mtime;
+ unsigned short lmode;
+ unsigned short rmode;
+ char *owner = NULL, *group = NULL;
+ int done, n;
+- u_char *cp;
++ char *cp;
+
+ debugmsg(DM_CALL, "update(%s, 0x%x, 0x%x)\n", rname, opts, statp);
+
+@@ -1035,7 +1033,6 @@
+ int destdir;
+ {
+ static struct stat stb;
+- extern struct subcmd *subcmds;
+ char *user, *group;
+ int u, len;
+ int didupdate = 0;
+@@ -1157,7 +1154,7 @@
+ (void) unlink(statfile);
+ #endif
+
+- if (file = getnotifyfile())
++ if ((file = getnotifyfile()))
+ (void) unlink(file);
+ }
+
+--- rdist-6.1.5/src/child.c.cleanup 1998-11-10 05:18:57.000000000 +0100
++++ rdist-6.1.5/src/child.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: child.c,v 6.29 1998/11/10 04:18:56 mcooper Exp $";
+
+@@ -90,7 +90,7 @@
+ static void removechild(child)
+ CHILD *child;
+ {
+- register CHILD *pc, *prevpc;
++ CHILD *pc, *prevpc;
+
+ debugmsg(DM_CALL, "removechild(%s, %d, %d) start",
+ child->c_name, child->c_pid, child->c_readfd);
+@@ -148,7 +148,7 @@
+ static CHILD *copychild(child)
+ CHILD *child;
+ {
+- register CHILD *newc;
++ CHILD *newc;
+
+ newc = (CHILD *) xmalloc(sizeof(CHILD));
+
+@@ -167,7 +167,7 @@
+ static void addchild(child)
+ CHILD *child;
+ {
+- register CHILD *pc;
++ CHILD *pc;
+
+ debugmsg(DM_CALL, "addchild() start\n");
+
+@@ -280,7 +280,7 @@
+ */
+ static void reap()
+ {
+- register CHILD *pc;
++ CHILD *pc;
+ int status = 0;
+ pid_t pid;
+
+@@ -336,7 +336,7 @@
+ */
+ static void childscan()
+ {
+- register CHILD *pc, *nextpc;
++ CHILD *pc, *nextpc;
+
+ debugmsg(DM_CALL, "childscan() start");
+
+@@ -366,8 +366,8 @@
+ extern void waitup()
+ {
+ #if defined(HAVE_SELECT)
+- register int count;
+- register CHILD *pc;
++ int count;
++ CHILD *pc;
+ fd_set rchildfds;
+
+ debugmsg(DM_CALL, "waitup() start\n");
+--- rdist-6.1.5/src/docmd.c.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/src/docmd.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: docmd.c,v 6.87 1998/11/10 04:08:32 mcooper Exp $";
+
+@@ -99,10 +99,10 @@
+ */
+ static void notify(rhost, to, lmod)
+ char *rhost;
+- register struct namelist *to;
++ struct namelist *to;
+ time_t lmod;
+ {
+- register int fd, len;
++ int fd, len;
+ FILE *pf, *popen();
+ struct stat stb;
+ static char buf[BUFSIZ];
+@@ -221,7 +221,7 @@
+ struct cmd *cmd;
+ struct cmd *cmdlist;
+ {
+- register struct cmd *pcmd;
++ struct cmd *pcmd;
+
+ for (pcmd = cmdlist; pcmd; pcmd = pcmd->c_next) {
+ checkcmd(pcmd);
+@@ -238,7 +238,7 @@
+ struct cmd *cmd;
+ struct cmd *cmdlist;
+ {
+- register struct cmd *pc;
++ struct cmd *pc;
+
+ if (!cmd) {
+ debugmsg(DM_MISC, "markfailed() NULL cmd parameter");
+@@ -309,7 +309,7 @@
+ static int makeconn(rhost)
+ char *rhost;
+ {
+- register char *ruser, *cp;
++ char *ruser, *cp;
+ static char *cur_host = NULL;
+ extern char *locuser;
+ extern long min_freefiles, min_freespace;
+@@ -430,9 +430,9 @@
+ struct cmd *cmd;
+ char **filev;
+ {
+- register struct namelist *f;
+- register struct subcmd *sc;
+- register char **cpp;
++ struct namelist *f;
++ struct subcmd *sc;
++ char **cpp;
+ int n, ddir, destdir, opts = options;
+ struct namelist *files;
+ struct subcmd *sbcmds;
+@@ -567,7 +567,6 @@
+ }
+ }
+
+-done:
+ /*
+ * Run any commands for the entire cmd
+ */
+@@ -584,7 +583,7 @@
+ notify(rhost, sc->sc_args, (time_t) 0);
+
+ if (!nflag) {
+- register struct linkbuf *nextl, *l;
++ struct linkbuf *nextl, *l;
+
+ for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) {
+ nextl = l->nextp;
+@@ -601,11 +600,12 @@
+ setjmp_ok = FALSE;
+ }
+
++int
+ okname(name)
+- register char *name;
++ char *name;
+ {
+- register char *cp = name;
+- register int c, isbad;
++ char *cp = name;
++ int c, isbad;
+
+ for (isbad = FALSE; *cp && !isbad; ++cp) {
+ c = *cp;
+@@ -627,9 +627,9 @@
+ struct subcmd *sbcmds;
+ char **env;
+ {
+- register DIR *d;
+- register DIRENTRY *dp;
+- register char *cp;
++ DIR *d;
++ DIRENTRY *dp;
++ char *cp;
+ char *optarget;
+ int len;
+
+@@ -641,7 +641,7 @@
+ }
+ optarget = ptarget;
+ len = ptarget - target;
+- while (dp = readdir(d)) {
++ while ((dp = readdir(d))) {
+ if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))
+ continue;
+ if (len + 1 + (int)strlen(dp->d_name) >= BUFSIZ - 1) {
+@@ -651,7 +651,7 @@
+ ptarget = optarget;
+ *ptarget++ = '/';
+ cp = dp->d_name;
+- while (*ptarget++ = *cp++)
++ while ((*ptarget++ = *cp++))
+ ;
+ ptarget--;
+ cmptime(target, sbcmds, env);
+@@ -740,9 +740,9 @@
+ struct cmd *cmd;
+ char **filev;
+ {
+- register struct subcmd *sc;
+- register struct namelist *f;
+- register char *cp, **cpp;
++ struct subcmd *sc;
++ struct namelist *f;
++ char *cp, **cpp;
+ struct stat stb;
+ struct namelist *files = cmd->c_files;
+ struct subcmd *sbcmds = cmd->c_cmds;
+@@ -824,8 +824,8 @@
+ extern int except(file)
+ char *file;
+ {
+- register struct subcmd *sc;
+- register struct namelist *nl;
++ struct subcmd *sc;
++ struct namelist *nl;
+
+ debugmsg(DM_CALL, "except(%s)", file);
+
+@@ -918,8 +918,8 @@
+ int argc;
+ char **argv;
+ {
+- register struct namelist *f;
+- register int i;
++ struct namelist *f;
++ int i;
+
+ if (argc) {
+ for (i = 0; i < argc; i++) {
+@@ -962,9 +962,9 @@
+ int argc;
+ char **argv;
+ {
+- register struct cmd *c;
+- register char *cp;
+- register int i;
++ struct cmd *c;
++ char *cp;
++ int i;
+
+ (void) signal(SIGHUP, sighandler);
+ (void) signal(SIGINT, sighandler);
+@@ -1032,7 +1032,7 @@
+
+ if (hostlist) {
+ /* Do specific hosts as specified on command line */
+- register struct namelist *nlptr;
++ struct namelist *nlptr;
+
+ for (nlptr = hostlist; nlptr; nlptr = nlptr->n_next)
+ /*
+--- rdist-6.1.5/src/distopt.c.cleanup 1998-11-10 05:09:11.000000000 +0100
++++ rdist-6.1.5/src/distopt.c 2003-12-17 11:38:16.000000000 +0100
+@@ -6,7 +6,7 @@
+ * appropriately.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: distopt.c,v 6.12 1998/11/10 04:09:11 mcooper Exp $";
+
+@@ -55,7 +55,7 @@
+ extern DISTOPTINFO *getdistopt(name)
+ char *name;
+ {
+- register int i;
++ int i;
+
+ for (i = 0; distoptinfo[i].do_name; ++i)
+ if (strcasecmp(name, distoptinfo[i].do_name) == 0)
+@@ -74,7 +74,7 @@
+ opt_t *optptr;
+ int doerrs;
+ {
+- register char *string, *optstr;
++ char *string, *optstr;
+ DISTOPTINFO *distopt;
+ int negate;
+
+@@ -93,7 +93,7 @@
+ * and the option starts with "no", strip "no"
+ * from option and retry lookup.
+ */
+- if (distopt = getdistopt(optstr)) {
++ if ((distopt = getdistopt(optstr))) {
+ FLAG_ON(*optptr, distopt->do_value);
+ continue;
+ }
+@@ -116,7 +116,7 @@
+ */
+ extern char *getdistoptlist()
+ {
+- register int i;
++ int i;
+ static char buf[1024];
+
+ for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) {
+@@ -138,7 +138,7 @@
+ extern char *getondistoptlist(opts)
+ opt_t opts;
+ {
+- register int i;
++ int i;
+ static char buf[1024];
+
+ for (i = 0, buf[0] = CNULL; distoptinfo[i].do_name; ++i) {
+--- rdist-6.1.5/src/expand.c.cleanup 1998-11-10 05:09:31.000000000 +0100
++++ rdist-6.1.5/src/expand.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: expand.c,v 6.19 1998/11/10 04:09:31 mcooper Exp $";
+
+@@ -81,9 +81,9 @@
+ sizeof(*sortbase), argcmp), sortbase = &eargv[eargc]
+
+ static void Cat(s1, s2) /* quote in s1 and s2 */
+- register u_char *s1, *s2;
++ u_char *s1, *s2;
+ {
+- register char *cp;
++ char *cp;
+ int len = strlen((char *)s1) + strlen((char *)s2) + 2;
+
+ if ((eargc + 1) >= MAXEARGS) {
+@@ -97,12 +97,12 @@
+ do {
+ if (*s1 == QUOTECHAR)
+ s1++;
+- } while (*cp++ = *s1++);
++ } while ((*cp++ = *s1++));
+ cp--;
+ do {
+ if (*s2 == QUOTECHAR)
+ s2++;
+- } while (*cp++ = *s2++);
++ } while ((*cp++ = *s2++));
+ }
+
+ static void addpath(c)
+@@ -131,8 +131,8 @@
+ struct namelist *list;
+ int wh;
+ {
+- register struct namelist *nl, *prev;
+- register int n;
++ struct namelist *nl, *prev;
++ int n;
+ char pathbuf[BUFSIZ];
+
+ if (debug)
+@@ -182,7 +182,7 @@
+ u_char *str;
+ int ch;
+ {
+- register u_char *cp;
++ u_char *cp;
+
+ for (cp = str; cp && *cp != CNULL; ++cp)
+ if (ch == *cp)
+@@ -194,8 +194,8 @@
+ void expstr(s)
+ u_char *s;
+ {
+- register u_char *cp, *cp1;
+- register struct namelist *tp;
++ u_char *cp, *cp1;
++ struct namelist *tp;
+ u_char *tail;
+ u_char ebuf[BUFSIZ];
+ u_char varbuff[BUFSIZ];
+@@ -302,7 +302,7 @@
+ cp1 = (u_char *)pw->pw_dir;
+ s = cp;
+ }
+- for (cp = (u_char *)path; *cp++ = *cp1++; )
++ for (cp = (u_char *)path; (*cp++ = *cp1++); )
+ ;
+ tpathp = pathp = (char *)cp - 1;
+ } else {
+@@ -326,7 +326,7 @@
+ sort();
+ }
+
+-static
++static int
+ argcmp(a1, a2)
+ char **a1, **a2;
+ {
+@@ -341,8 +341,8 @@
+ void expsh(s) /* quote in s */
+ u_char *s;
+ {
+- register u_char *cp, *oldcp;
+- register char *spathp;
++ u_char *cp, *oldcp;
++ char *spathp;
+ struct stat stb;
+
+ spathp = pathp;
+@@ -380,7 +380,7 @@
+ char *pattern;
+ {
+ struct stat stb;
+- register DIRENTRY *dp;
++ DIRENTRY *dp;
+ DIR *dirp;
+
+ dirp = opendir(path);
+@@ -417,11 +417,12 @@
+ yyerror(path);
+ }
+
++int
+ execbrc(p, s) /* quote in p */
+ u_char *p, *s;
+ {
+ u_char restbuf[BUFSIZ + 2];
+- register u_char *pe, *pm, *pl;
++ u_char *pe, *pm, *pl;
+ int brclev = 0;
+ u_char *lm, savec;
+ char *spathp;
+@@ -507,11 +508,12 @@
+ return (0);
+ }
+
++int
+ match(s, p) /* quote in p */
+ char *s, *p;
+ {
+- register int c;
+- register char *sentp;
++ int c;
++ char *sentp;
+ char sexpany = expany;
+
+ if (*s == '.' && *p != '.')
+@@ -524,11 +526,12 @@
+ return (c);
+ }
+
++int
+ amatch(s, p) /* quote in p */
+- register char *s;
+- register u_char *p;
++ char *s;
++ u_char *p;
+ {
+- register int scc;
++ int scc;
+ int ok, lc;
+ char *spathp;
+ struct stat stb;
+@@ -545,7 +548,7 @@
+ case '[':
+ ok = 0;
+ lc = 077777;
+- while (cc = *p++) {
++ while ((cc = *p++)) {
+ if (cc == ']') {
+ if (ok)
+ break;
+@@ -599,7 +602,7 @@
+ while (*s)
+ addpath(*s++);
+ addpath('/');
+- if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode))
++ if (stat(path, &stb) == 0 && S_ISDIR(stb.st_mode)) {
+ if (*p == CNULL) {
+ if (which & E_TILDE)
+ Cat((u_char *)path,
+@@ -609,6 +612,7 @@
+ (u_char *)tpathp);
+ } else
+ expsh(p);
++ }
+ pathp = spathp;
+ *pathp = CNULL;
+ return (0);
+--- rdist-6.1.5/src/lookup.c.cleanup 1998-11-10 05:12:56.000000000 +0100
++++ rdist-6.1.5/src/lookup.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: lookup.c,v 6.9 1998/11/10 04:12:56 mcooper Exp $";
+
+@@ -68,11 +68,12 @@
+ /*
+ * Define a variable from a command line argument.
+ */
++void
+ define(name)
+ char *name;
+ {
+- register char *cp, *s;
+- register struct namelist *nl;
++ char *cp, *s;
++ struct namelist *nl;
+ struct namelist *value;
+
+ debugmsg(DM_CALL, "define(%s)", name);
+@@ -137,9 +138,9 @@
+ int action;
+ struct namelist *value;
+ {
+- register unsigned n;
+- register char *cp;
+- register struct syment *s;
++ unsigned n;
++ char *cp;
++ struct syment *s;
+ char ebuf[BUFSIZ];
+
+ debugmsg(DM_CALL, "lookup(%s, %d, %x)", name, action, value);
+--- rdist-6.1.5/src/isexec.c.cleanup 1998-11-10 05:11:42.000000000 +0100
++++ rdist-6.1.5/src/isexec.c 2003-12-17 11:38:16.000000000 +0100
+@@ -37,7 +37,7 @@
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: isexec.c,v 6.22 1998/11/10 04:11:42 mcooper Exp $";
+
+--- rdist-6.1.5/src/signal.c.cleanup 1998-11-10 05:16:13.000000000 +0100
++++ rdist-6.1.5/src/signal.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: signal.c,v 6.2 1998/11/10 04:16:13 mcooper Exp $";
+
+--- rdist-6.1.5/src/rshrcmd.c.cleanup 1998-11-10 05:15:07.000000000 +0100
++++ rdist-6.1.5/src/rshrcmd.c 2003-12-17 11:38:16.000000000 +0100
+@@ -10,7 +10,7 @@
+ * Chris Siebenmann <cks@utcc.utoronto.ca>.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: rshrcmd.c,v 1.9 1998/11/10 04:15:07 mcooper Exp $";
+
+@@ -34,6 +34,7 @@
+ * program in place of a direct rcmd() function call so as to
+ * avoid having to be root.
+ */
++int
+ rshrcmd(ahost, port, luser, ruser, cmd, fd2p)
+ char **ahost;
+ u_short port;
+@@ -108,6 +109,7 @@
+ (void) wait(0);
+ return sp[0];
+ }
++ return -1;
+ /*NOTREACHED*/
+ }
+
+--- rdist-6.1.5/src/common.c.cleanup 1998-11-10 05:09:01.000000000 +0100
++++ rdist-6.1.5/src/common.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: common.c,v 6.84 1998/11/10 04:09:01 mcooper Exp $";
+
+@@ -87,14 +87,14 @@
+ /*
+ * Front end to write() that handles partial write() requests.
+ */
+-extern WRITE_RETURN_T xwrite(fd, buf, len)
++WRITE_RETURN_T xwrite(fd, buf, len)
+ int fd;
+ void *buf;
+ WRITE_AMT_T len;
+ {
+ WRITE_AMT_T nleft = len;
+ WRITE_RETURN_T nwritten;
+- register char *ptr = buf;
++ char *ptr = buf;
+
+ while (nleft > 0) {
+ if ((nwritten = write(fd, ptr, nleft)) <= 0) {
+@@ -110,14 +110,14 @@
+ /*
+ * Set program name
+ */
+-extern void setprogname(argv)
++void setprogname(argv)
+ char **argv;
+ {
+- register char *cp;
++ char *cp;
+
+ if (!progname) {
+ progname = strdup(argv[0]);
+- if (cp = strrchr(progname, '/'))
++ if ((cp = strrchr(progname, '/')))
+ progname = cp + 1;
+ }
+ }
+@@ -125,14 +125,14 @@
+ /*
+ * Do run-time initialization
+ */
+-extern int init(argc, argv, envp)
++int init(argc, argv, envp)
+ /*ARGSUSED*/
+ int argc;
+ char **argv;
+ char **envp;
+ {
+- register int i;
+- register char *cp;
++ int i;
++ char *cp;
+
+ if (!isserver)
+ (void) signal(SIGSEGV, sighandler);
+@@ -182,7 +182,7 @@
+ /*
+ * Finish things up before ending.
+ */
+-extern void finish()
++void finish()
+ {
+ extern jmp_buf finish_jmpbuf;
+
+@@ -216,7 +216,7 @@
+ /*
+ * Handle lost connections
+ */
+-extern void lostconn()
++void lostconn()
+ {
+ /* Prevent looping */
+ (void) signal(SIGPIPE, SIG_IGN);
+@@ -232,7 +232,7 @@
+ /*
+ * Do a core dump
+ */
+-extern void coredump()
++void coredump()
+ {
+ error("Segmentation violation - dumping core [PID = %d, %s]",
+ getpid(),
+@@ -245,7 +245,7 @@
+ /*
+ * General signal handler
+ */
+-extern void sighandler(sig)
++void sighandler(sig)
+ int sig;
+ {
+ debugmsg(DM_CALL, "sighandler() received signal %d\n", sig);
+@@ -325,7 +325,7 @@
+ /*
+ * Stdarg frontend to sendcmdmsg()
+ */
+-extern int sendcmd(char cmd, char *fmt, ...)
++int sendcmd(char cmd, char *fmt, ...)
+ {
+ static char buf[BUFSIZ];
+ va_list args;
+@@ -345,7 +345,7 @@
+ /*
+ * Varargs frontend to sendcmdmsg()
+ */
+-extern int sendcmd(va_alist)
++int sendcmd(va_alist)
+ va_dcl
+ {
+ static char buf[BUFSIZ];
+@@ -372,7 +372,7 @@
+ * Stupid frontend to sendcmdmsg()
+ */
+ /*VARARGS2*/
+-extern int sendcmd(cmd, fmt, a1, a2, a3, a4, a5, a6, a7, a8)
++int sendcmd(cmd, fmt, a1, a2, a3, a4, a5, a6, a7, a8)
+ char cmd;
+ char *fmt;
+ {
+@@ -433,13 +433,13 @@
+ * errors, call cleanup() or lostconn(). In other words, unless
+ * the third argument is nonzero, this routine never returns failure.
+ */
+-extern int remline(buffer, space, doclean)
+- register u_char *buffer;
++int remline(buffer, space, doclean)
++ u_char *buffer;
+ int space;
+ int doclean;
+ {
+- register int c, left = space;
+- register u_char *p = buffer;
++ int c, left = space;
++ u_char *p = buffer;
+
+ if (rem_r < 0) {
+ error("Cannot read remote input: Remote descriptor not open.");
+@@ -494,9 +494,9 @@
+ /*
+ * Non-line-oriented remote read.
+ */
+-readrem(p, space)
++int readrem(p, space)
+ char *p;
+- register int space;
++ int space;
+ {
+ if (remleft <= 0) {
+ /*
+@@ -527,7 +527,7 @@
+ /*
+ * Get the user name for the uid.
+ */
+-extern char *getusername(uid, file, opts)
++char *getusername(uid, file, opts)
+ UID_T uid;
+ char *file;
+ opt_t opts;
+@@ -566,7 +566,7 @@
+ /*
+ * Get the group name for the gid.
+ */
+-extern char *getgroupname(gid, file, opts)
++char *getgroupname(gid, file, opts)
+ GID_T gid;
+ char *file;
+ opt_t opts;
+@@ -604,7 +604,7 @@
+ /*
+ * Read a response from the remote host.
+ */
+-extern int response()
++int response()
+ {
+ static u_char resp[BUFSIZ];
+ u_char *s;
+@@ -646,6 +646,7 @@
+ message(MT_FERROR, "%s", s);
+ finish();
+ }
++ return -1;
+ /*NOTREACHED*/
+ }
+
+@@ -657,11 +658,11 @@
+ * user's home directory path name. Return a pointer in buf to the
+ * part corresponding to `file'.
+ */
+-extern char *exptilde(ebuf, file)
++char *exptilde(ebuf, file)
+ char *ebuf;
+- register char *file;
++ char *file;
+ {
+- register char *s1, *s2, *s3;
++ char *s1, *s2, *s3;
+ extern char *homedir;
+
+ if (*file != '~') {
+@@ -694,12 +695,12 @@
+ *s3 = '/';
+ s2 = pw->pw_dir;
+ }
+- for (s1 = ebuf; *s1++ = *s2++; )
++ for (s1 = ebuf; (*s1++ = *s2++); )
+ ;
+ s2 = --s1;
+ if (s3 != NULL) {
+ s2++;
+- while (*s1++ = *s3++)
++ while ((*s1++ = *s3++))
+ ;
+ }
+ return(s2);
+@@ -710,7 +711,7 @@
+ * Set our effective user id to the user running us.
+ * This should be the uid we do most of our work as.
+ */
+-extern int becomeuser()
++int becomeuser()
+ {
+ int r = 0;
+
+@@ -732,7 +733,7 @@
+ /*
+ * Set our effective user id to "root" (uid = 0)
+ */
+-extern int becomeroot()
++int becomeroot()
+ {
+ int r = 0;
+
+@@ -753,7 +754,7 @@
+ /*
+ * Set access and modify times of a given file
+ */
+-extern int setfiletime(file, atime, mtime)
++int setfiletime(file, atime, mtime)
+ char *file;
+ time_t atime;
+ time_t mtime;
+@@ -790,7 +791,7 @@
+ /*
+ * Get version info
+ */
+-extern char *getversion()
++char *getversion()
+ {
+ static char buff[BUFSIZ];
+
+@@ -811,7 +812,7 @@
+ {
+ int fd[2], pid, i;
+ int status;
+- register char *cp, *s;
++ char *cp, *s;
+ char sbuf[BUFSIZ], buf[BUFSIZ];
+
+ if (pipe(fd) < 0) {
+@@ -933,12 +934,12 @@
+ /*
+ * Private version of basename()
+ */
+-extern char *xbasename(path)
++char *xbasename(path)
+ char *path;
+ {
+- register char *cp;
++ char *cp;
+
+- if (cp = strrchr(path, '/'))
++ if ((cp = strrchr(path, '/')))
+ return(cp+1);
+ else
+ return(path);
+@@ -949,11 +950,11 @@
+ * search until a component of that path is found and
+ * return the found file name.
+ */
+-extern char *searchpath(path)
++char *searchpath(path)
+ char *path;
+ {
+- register char *cp;
+- register char *file;
++ char *cp;
++ char *file;
+ struct stat statbuf;
+
+ for (; ;) {
+@@ -977,8 +978,7 @@
+ /*
+ * Set line buffering.
+ */
+-extern void
+-mysetlinebuf(fp)
++void mysetlinebuf(fp)
+ FILE *fp;
+ {
+ #if SETBUF_TYPE == SETBUF_SETLINEBUF
+@@ -995,8 +995,7 @@
+ /*
+ * Our interface to system call to get a socket pair.
+ */
+-int
+-getsocketpair(domain, type, protocol, sv)
++int getsocketpair(domain, type, protocol, sv)
+ int domain;
+ int type;
+ int protocol;
+--- rdist-6.1.5/src/message.c.cleanup 1998-11-10 05:13:30.000000000 +0100
++++ rdist-6.1.5/src/message.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: message.c,v 6.25 1998/11/10 04:13:30 mcooper Exp $";
+
+@@ -97,7 +97,7 @@
+ */
+ extern void msgprusage()
+ {
+- register int i, x;
++ int i, x;
+
+ (void) fprintf(stderr, "\nWhere <msgopt> is of form\n");
+ (void) fprintf(stderr,
+@@ -120,7 +120,7 @@
+ */
+ extern void msgprconfig()
+ {
+- register int i, x;
++ int i, x;
+ static char buf[MSGBUFSIZ];
+
+ debugmsg(DM_MISC, "Current message logging config:");
+@@ -145,7 +145,7 @@
+ static MSGFACILITY *getmsgfac(name)
+ char *name;
+ {
+- register int i;
++ int i;
+
+ for (i = 0; msgfacility[i].mf_name; ++i)
+ if (strcasecmp(name, msgfacility[i].mf_name) == 0)
+@@ -160,7 +160,7 @@
+ static MSGTYPE *getmsgtype(name)
+ char *name;
+ {
+- register int i;
++ int i;
+
+ for (i = 0; msgtypes[i].mt_name; ++i)
+ if (strcasecmp(name, msgtypes[i].mt_name) == 0)
+@@ -178,9 +178,9 @@
+ char *str;
+ {
+ static char ebuf[BUFSIZ];
+- register char *cp;
+- register char *strptr, *word;
+- register MSGTYPE *mtp;
++ char *cp;
++ char *strptr, *word;
++ MSGTYPE *mtp;
+
+ /*
+ * MF_SYSLOG is the only supported message facility for the server
+@@ -240,11 +240,11 @@
+ msgfac->mf_msgtypes = 0; /* Start from scratch */
+ while (strptr) {
+ word = strptr;
+- if (cp = strchr(strptr, ','))
++ if ((cp = strchr(strptr, ',')))
+ *cp++ = CNULL;
+ strptr = cp;
+
+- if (mtp = getmsgtype(word)) {
++ if ((mtp = getmsgtype(word))) {
+ msgfac->mf_msgtypes |= mtp->mt_type;
+ /*
+ * XXX This is really a kludge until we add real
+@@ -272,8 +272,8 @@
+ int doset;
+ {
+ static char ebuf[BUFSIZ], msgbuf[MSGBUFSIZ];
+- register char *cp, *optstr;
+- register char *word;
++ char *cp, *optstr;
++ char *word;
+ MSGFACILITY *msgfac;
+
+ if (msgstr == NULL)
+@@ -308,7 +308,7 @@
+ if (doset) {
+ char *mcp;
+
+- if (mcp = setmsgtypes(msgfac, cp))
++ if ((mcp = setmsgtypes(msgfac, cp)))
+ return(mcp);
+ }
+ }
+@@ -462,8 +462,9 @@
+ return;
+
+ if (!msgfac->mf_fptr) {
+- register char *cp;
++ char *cp;
+ char *getenv();
++ int fd;
+
+ /*
+ * Create and open a new temporary file
+@@ -475,7 +476,10 @@
+ (void) sprintf(tempfile, "%s/%s", cp, _RDIST_TMP);
+
+ msgfac->mf_filename = tempfile;
+- (void) mktemp(msgfac->mf_filename);
++ fd = mkstemp(msgfac->mf_filename);
++ if (fd < 0)
++ fatalerr("Cannot open notify file for writing: %s: %s.", msgfac->mf_filename, SYSERR);
++ close(fd);
+ if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL)
+ fatalerr("Cannot open notify file for writing: %s: %s.",
+ msgfac->mf_filename, SYSERR);
+@@ -515,15 +519,15 @@
+ int flags;
+ char *msgbuf;
+ {
+- register int i, x;
+- register char *cp;
++ int i, x;
++ char *cp;
+ static char mbuf[2048];
+
+ if (msgbuf && *msgbuf) {
+ /*
+ * Ensure no stray newlines are present
+ */
+- if (cp = strchr(msgbuf, '\n'))
++ if ((cp = strchr(msgbuf, '\n')))
+ *cp = CNULL;
+
+ checkhostname();
+@@ -863,7 +867,7 @@
+ */
+ extern char *getnotifyfile()
+ {
+- register int i;
++ int i;
+
+ for (i = 0; msgfacility[i].mf_name; i++)
+ if (msgfacility[i].mf_msgfac == MF_NOTIFY &&
+--- rdist-6.1.5/src/setargs.c.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/src/setargs.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: setargs.c,v 6.5 1998/11/10 04:15:56 mcooper Exp $";
+
+@@ -66,12 +66,12 @@
+ /*
+ * Settup things for using setproctitle()
+ */
+-setargs_settup(argc, argv, envp)
++void setargs_settup(argc, argv, envp)
+ int argc;
+ char **argv;
+ char **envp;
+ {
+- register int i;
++ int i;
+ extern char **environ;
+
+ /* Remember the User Environment */
+@@ -92,10 +92,10 @@
+ /*
+ * Set process title
+ */
+-extern void _setproctitle(msg)
++void _setproctitle(msg)
+ char *msg;
+ {
+- register int i;
++ int i;
+ char *p;
+
+ p = Argv[0];
+@@ -119,7 +119,7 @@
+ /*
+ * Varargs front-end to _setproctitle()
+ */
+-extern void setproctitle(va_alist)
++void setproctitle(va_alist)
+ va_dcl
+ {
+ static char buf[BUFSIZ];
+@@ -138,7 +138,7 @@
+ /*
+ * Stdarg front-end to _setproctitle()
+ */
+-extern void setproctitle(char *fmt, ...)
++void setproctitle(char *fmt, ...)
+ {
+ static char buf[BUFSIZ];
+ va_list args;
+@@ -155,7 +155,7 @@
+ * Non-Varargs front-end to _setproctitle()
+ */
+ /*VARARGS1*/
+-extern void setproctitle(fmt, a1, a2, a3, a4, a5, a6)
++void setproctitle(fmt, a1, a2, a3, a4, a5, a6)
+ char *fmt;
+ {
+ static char buf[BUFSIZ];
+--- rdist-6.1.5/src/rdistd.c.cleanup 1998-11-10 05:14:06.000000000 +0100
++++ rdist-6.1.5/src/rdistd.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: rdistd.c,v 6.23 1998/11/10 04:14:06 mcooper Exp $";
+
+@@ -53,21 +53,12 @@
+
+ #include "defs.h"
+
+-/*
+- * Print usage message
+- */
+-static void usage()
+-{
+- fprintf(stderr, "usage: %s -S [ -DV ]\n", progname);
+- exit(1);
+-}
+-
+ char localmsglist[] = "syslog=ferror";
+
+ /*
+ * The Beginning
+ */
+-main(argc, argv, envp)
++int main(argc, argv, envp)
+ int argc;
+ char **argv;
+ char **envp;
+@@ -95,7 +86,8 @@
+ case '?':
+ default:
+ error("Bad command line option.");
+- usage();
++ fprintf(stderr, "usage: %s -S [ -DV ]\n", progname);
++ exit(1);
+ }
+
+ if (!isserver) {
+@@ -108,7 +100,7 @@
+ rem_w = fileno(stdout);
+
+ /* Set logging */
+- if (cp = msgparseopts(localmsglist, TRUE))
++ if ((cp = msgparseopts(localmsglist, TRUE)))
+ fatalerr("Bad message logging option (%s): %s",
+ localmsglist, cp);
+
+--- rdist-6.1.5/src/server.c.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/src/server.c 2003-12-17 11:38:16.000000000 +0100
+@@ -37,7 +37,7 @@
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: server.c,v 6.86 1998/11/10 04:15:31 mcooper Exp $";
+
+@@ -197,7 +197,7 @@
+ static UID_T last_uid = (UID_T)-2;
+ static GID_T last_primegid;
+ extern char *locuser;
+- register int i;
++ int i;
+ UID_T uid;
+ GID_T gid;
+ GID_T primegid = (GID_T)-2;
+@@ -252,7 +252,7 @@
+ /*
+ * Invalid cached values so we need to do a new lookup.
+ */
+- if (gr = mygetgroup(group)) {
++ if ((gr = mygetgroup(group))) {
+ last_gid = gid = gr->gr_gid;
+ strcpy(last_group, gr->gr_name);
+ } else {
+@@ -325,7 +325,7 @@
+ {
+ DIR *d;
+ static DIRENTRY *dp;
+- register char *cp;
++ char *cp;
+ struct stat stb;
+ char *optarget;
+ int len, failures = 0;
+@@ -362,7 +362,7 @@
+
+ optarget = ptarget;
+ len = ptarget - target;
+- while (dp = readdir(d)) {
++ while ((dp = readdir(d))) {
+ if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') ||
+ (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' &&
+ dp->d_name[1] == '.'))
+@@ -376,7 +376,7 @@
+ ptarget = optarget;
+ *ptarget++ = '/';
+ cp = dp->d_name;;
+- while (*ptarget++ = *cp++)
++ while ((*ptarget++ = *cp++))
+ ;
+ ptarget--;
+ if (lstat(target, &stb) < 0) {
+@@ -414,10 +414,10 @@
+ * for extraneous files and remove them.
+ */
+ static void doclean(cp)
+- register char *cp;
++ char *cp;
+ {
+ DIR *d;
+- register DIRENTRY *dp;
++ DIRENTRY *dp;
+ struct stat stb;
+ char *optarget, *ep;
+ int len;
+@@ -436,7 +436,7 @@
+
+ optarget = ptarget;
+ len = ptarget - target;
+- while (dp = readdir(d)) {
++ while ((dp = readdir(d))) {
+ if ((D_NAMLEN(dp) == 1 && dp->d_name[0] == '.') ||
+ (D_NAMLEN(dp) == 2 && dp->d_name[0] == '.' &&
+ dp->d_name[1] == '.'))
+@@ -450,7 +450,7 @@
+ ptarget = optarget;
+ *ptarget++ = '/';
+ cp = dp->d_name;;
+- while (*ptarget++ = *cp++)
++ while ((*ptarget++ = *cp++))
+ ;
+ ptarget--;
+ if (lstat(target, &stb) < 0) {
+@@ -481,7 +481,7 @@
+ * Frontend to doclean().
+ */
+ static void clean(cp)
+- register char *cp;
++ char *cp;
+ {
+ doclean(cp);
+ (void) sendcmd(CC_END, NULL);
+@@ -509,7 +509,7 @@
+ */
+ static void docmdspecial()
+ {
+- register char *cp;
++ char *cp;
+ char *cmd, *env = NULL;
+ int n;
+ int len;
+@@ -667,7 +667,7 @@
+ char *name;
+ opt_t opts;
+ {
+- register char *cp;
++ char *cp;
+ struct stat stb;
+ int r = -1;
+
+@@ -760,7 +760,7 @@
+ {
+ int f, wrerr, olderrno, lastwashole = 0, wassparse = 0;
+ off_t i;
+- register char *cp;
++ char *cp;
+ char *savefile = NULL;
+ static struct stat statbuff;
+
+@@ -987,7 +987,7 @@
+ char *owner, *group;
+ {
+ static char lowner[100], lgroup[100];
+- register char *cp;
++ char *cp;
+ struct stat stb;
+ int s;
+
+@@ -1044,7 +1044,7 @@
+
+ o = (owner[0] == ':') ? opts & DO_NUMCHKOWNER :
+ opts;
+- if (cp = getusername(stb.st_uid, target, o))
++ if ((cp = getusername(stb.st_uid, target, o)))
+ if (strcmp(owner, cp))
+ (void) strcpy(lowner, cp);
+ }
+@@ -1053,7 +1053,7 @@
+
+ o = (group[0] == ':') ? opts & DO_NUMCHKGROUP :
+ opts;
+- if (cp = getgroupname(stb.st_gid, target, o))
++ if ((cp = getgroupname(stb.st_gid, target, o)))
+ if (strcmp(group, cp))
+ (void) strcpy(lgroup, cp);
+ }
+@@ -1107,8 +1107,8 @@
+ if (s < 0) {
+ if (errno == ENOENT) {
+ if (mkdir(target, mode) == 0 ||
+- chkparent(target, opts) == 0 &&
+- mkdir(target, mode) == 0) {
++ (chkparent(target, opts) == 0 &&
++ mkdir(target, mode) == 0)) {
+ message(MT_NOTICE, "%s: mkdir", target);
+ (void) fchog(-1, target, owner, group, mode);
+ ack();
+@@ -1304,7 +1304,7 @@
+ static void setconfig(cmd)
+ char *cmd;
+ {
+- register char *cp = cmd;
++ char *cp = cmd;
+ char *estr;
+
+ switch (*cp++) {
+@@ -1338,7 +1338,7 @@
+ break;
+
+ case SC_LOGGING: /* Logging options */
+- if (estr = msgparseopts(cp, TRUE)) {
++ if ((estr = msgparseopts(cp, TRUE))) {
+ fatalerr("Bad message option string (%s): %s",
+ cp, estr);
+ return;
+@@ -1455,7 +1455,7 @@
+ sptarget[catname] = ptarget;
+ if (catname++) {
+ *ptarget++ = '/';
+- while (*ptarget++ = *file++)
++ while ((*ptarget++ = *file++))
+ ;
+ ptarget--;
+ }
+@@ -1463,6 +1463,7 @@
+ /*
+ * Create name of temporary file
+ */
++ int fd;
+ if (catname && cattarget(file) < 0) {
+ error("Cannot set file name.");
+ return;
+@@ -1477,7 +1478,12 @@
+ (void) sprintf(new, "%s/%s", target, tempname);
+ *file = '/';
+ }
+- (void) mktemp(new);
++ fd = mkstemp(new);
++ if (fd < 0) {
++ error("Cannot set file name.");
++ return;
++ }
++ close(fd);
+ }
+
+ /*
+@@ -1581,8 +1587,8 @@
+ extern void server()
+ {
+ static char cmdbuf[BUFSIZ];
+- register char *cp;
+- register int n;
++ char *cp;
++ int n;
+ extern jmp_buf finish_jmpbuf;
+
+ if (setjmp(finish_jmpbuf)) {
+--- rdist-6.1.5/src/filesys.c.cleanup 1998-11-10 05:10:18.000000000 +0100
++++ rdist-6.1.5/src/filesys.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: filesys.c,v 6.25 1998/11/10 04:10:17 mcooper Exp $";
+
+@@ -72,7 +72,7 @@
+ static char last_pathname[MAXPATHLEN];
+ static char file[MAXPATHLEN + 3];
+ static struct stat filestat;
+- register char *p;
++ char *p;
+
+ /*
+ * Mark the statbuf as invalid to start with.
+@@ -125,7 +125,7 @@
+ * Normally we want to change /dir1/dir2/file
+ * into "/dir1/dir2/."
+ */
+- if (p = (char *) strrchr(file, '/')) {
++ if ((p = (char *) strrchr(file, '/'))) {
+ *++p = '.';
+ *++p = CNULL;
+ } else {
+@@ -183,7 +183,7 @@
+ struct stat *filest;
+ struct mntinfo *mntinfo;
+ {
+- register struct mntinfo *mi;
++ struct mntinfo *mi;
+
+ for (mi = mntinfo; mi; mi = mi->mi_nxt) {
+ if (mi->mi_mnt->me_flags & MEFLAG_IGNORE)
+@@ -202,7 +202,7 @@
+ mntent_t *mnt;
+ struct mntinfo *mntinfo;
+ {
+- register struct mntinfo *m;
++ struct mntinfo *m;
+
+ for (m = mntinfo; m; m = m->mi_nxt)
+ if (strcmp(m->mi_mnt->me_path, mnt->me_path) == 0)
+@@ -247,7 +247,7 @@
+ }
+
+ mntinfo = mi;
+- while (mnt = getmountent(mfp)) {
++ while ((mnt = getmountent(mfp))) {
+ debugmsg(DM_MISC, "mountent = '%s' (%s)",
+ mnt->me_path, mnt->me_type);
+
+@@ -308,7 +308,7 @@
+ static struct stat filestat;
+ struct stat *pstat;
+ struct mntinfo *tmpmi;
+- register mntent_t *mnt;
++ mntent_t *mnt;
+
+ /*
+ * Use the supplied stat buffer if not NULL or our own.
+@@ -330,16 +330,16 @@
+ /*
+ * Find the mnt that pathname is on.
+ */
+- if (mnt = findmnt(pstat, mntinfo))
++ if ((mnt = findmnt(pstat, mntinfo)))
+ return(mnt);
+
+ /*
+ * We failed to find correct mnt, so maybe it's a newly
+ * mounted filesystem. We rebuild mntinfo and try again.
+ */
+- if (tmpmi = makemntinfo(mntinfo)) {
++ if ((tmpmi = makemntinfo(mntinfo))) {
+ mntinfo = tmpmi;
+- if (mnt = findmnt(pstat, mntinfo))
++ if ((mnt = findmnt(pstat, mntinfo)))
+ return(mnt);
+ }
+
+--- rdist-6.1.5/src/filesys-os.c.cleanup 1998-11-10 05:09:59.000000000 +0100
++++ rdist-6.1.5/src/filesys-os.c 2003-12-17 11:38:16.000000000 +0100
+@@ -38,7 +38,7 @@
+ * SUCH DAMAGE.
+ */
+
+-#ifndef lint
++#if 0
+ static char RCSid[] =
+ "$Id: filesys-os.c,v 6.18 1998/11/10 04:09:58 mcooper Exp $";
+
+@@ -314,7 +314,7 @@
+
+ bzero((char *)&me, sizeof(mntent_t));
+
+- if (mntent = getmntent(fptr)) {
++ if ((mntent = getmntent(fptr))) {
+ me.me_path = mntent->mnt_dir;
+ me.me_type = mntent->mnt_type;
+ if (mntent->mnt_opts && hasmntopt(mntent, MNTOPT_RO))
+--- rdist-6.1.5/src/strcasecmp.c.cleanup 1998-11-10 05:16:52.000000000 +0100
++++ rdist-6.1.5/src/strcasecmp.c 2003-12-17 11:38:16.000000000 +0100
+@@ -51,9 +51,9 @@
+ };
+
+ strcasecmp(s1, s2)
+- register char *s1, *s2;
++ char *s1, *s2;
+ {
+- register char *cm = charmap;
++ char *cm = charmap;
+
+ while (cm[*s1] == cm[*s2++])
+ if (*s1++ == '\0')
+@@ -62,10 +62,10 @@
+ }
+
+ strncasecmp(s1, s2, n)
+- register char *s1, *s2;
+- register int n;
++ char *s1, *s2;
++ int n;
+ {
+- register char *cm = charmap;
++ char *cm = charmap;
+
+ while (--n >= 0 && cm[*s1] == cm[*s2++])
+ if (*s1++ == '\0')
+--- rdist-6.1.5/src/strtol.c.cleanup 1994-03-17 00:25:50.000000000 +0100
++++ rdist-6.1.5/src/strtol.c 2003-12-17 11:38:16.000000000 +0100
+@@ -54,13 +54,13 @@
+ strtol(nptr, endptr, base)
+ char *nptr;
+ char **endptr;
+- register int base;
++ int base;
+ {
+- register char *s = nptr;
+- register unsigned long acc;
+- register int c;
+- register unsigned long cutoff;
+- register int neg = 0, any, cutlim;
++ char *s = nptr;
++ unsigned long acc;
++ int c;
++ unsigned long cutoff;
++ int neg = 0, any, cutlim;
+
+ /*
+ * Skip white space and pick up leading +/- sign if any.
+--- rdist-6.1.5/src/regex.c.cleanup 1998-11-10 05:14:28.000000000 +0100
++++ rdist-6.1.5/src/regex.c 2003-12-17 11:39:14.000000000 +0100
+@@ -142,10 +142,8 @@
+ */
+ char *
+ re_comp(sp)
+- register char *sp;
+ {
+- register int c;
+- register char *ep = expbuf;
++ char *ep = expbuf;
+ int cclcnt, numbra = 0;
+ char *lastep = 0;
+ char bracket[NBRA];
+@@ -266,10 +264,10 @@
+ */
+ int
+ re_exec(p1)
+- register char *p1;
++ char *p1;
+ {
+- register char *p2 = expbuf;
+- register int c;
++ char *p2 = expbuf;
++ int c;
+ int rv;
+
+ for (c = 0; c < NBRA; c++) {
+@@ -306,9 +304,9 @@
+ */
+ static int
+ advance(lp, ep)
+- register char *lp, *ep;
++ char *lp, *ep;
+ {
+- register char *curlp;
++ char *curlp;
+ int ct, i;
+ int rv;
+
+@@ -413,10 +411,10 @@
+ }
+
+ backref(i, lp)
+- register int i;
+- register char *lp;
++ int i;
++ char *lp;
+ {
+- register char *bp;
++ char *bp;
+
+ bp = braslist[i];
+ while (*bp++ == *lp++)
+@@ -427,10 +425,10 @@
+
+ int
+ cclass(set, c, af)
+- register char *set, c;
++ char *set, c;
+ int af;
+ {
+- register int n;
++ int n;
+
+ if (c == 0)
+ return(0);
+--- rdist-6.1.5/include/defs.h.cleanup 2003-12-17 11:38:16.000000000 +0100
++++ rdist-6.1.5/include/defs.h 2003-12-17 11:38:16.000000000 +0100
+@@ -30,11 +30,13 @@
+ #include <grp.h>
+ #include <syslog.h>
+ #include <setjmp.h>
++#include <time.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/file.h>
+-#include <sys/time.h>
+ #include <sys/stat.h>
++#include <sys/wait.h>
++#include <sys/socket.h>
+
+ #include "version.h"
+ #include "config-def.h"
+@@ -48,6 +50,9 @@
+ #endif /* yacc */
+
+ #include <signal.h>
++#define _REGEX_RE_COMP
++#include <regex.h>
++
+
+ /*
+ * This belongs in os-svr4.h but many SVR4 OS's
+@@ -321,12 +326,11 @@
+ /*
+ * Our own declarations.
+ */
+-char *exptilde();
+ char *makestr();
+ char *xcalloc();
+ char *xmalloc();
+ char *xrealloc();
+-extern char *xbasename();
++extern char *exptilde();
+ extern char *getdistoptlist();
+ extern char *getgroupname();
+ extern char *getnlstr();
+@@ -336,44 +340,75 @@
+ extern char *getversion();
+ extern char *msgparseopts();
+ extern char *searchpath();
++extern char *xbasename();
++extern int amatch();
+ extern int any();
++extern int becomeroot();
++extern int becomeuser();
++extern int except();
++extern int execbrc();
++extern int getfilesysinfo();
++extern int getsocketpair();
+ extern int init();
+ extern int install();
+ extern int isexec();
++extern int is_nfs_mounted();
++extern int is_ro_mounted();
++extern int is_symlinked();
++extern int match();
++extern int okname();
+ extern int parsedistopts();
++extern int readrem();
+ extern int remline();
++extern int response();
++extern int rshrcmd();
+ extern int setfiletime();
++extern int setnonblocking();
+ extern int spawn();
++extern int yylex();
++extern int yyparse();
+ extern struct subcmd *makesubcmd();
++extern void append();
+ extern void checkhostname();
+ extern void cleanup();
+ extern void complain();
++extern void coredump();
++extern void define();
++extern void docmdargs();
+ extern void docmds();
+ extern void finish();
+-extern void log();
++extern void freelinkinfo();
++extern void insert();
+ extern void logmsg();
+ extern void lostconn();
+ extern void markassigned();
++extern void msgprconfig();
+ extern void msgprusage();
++extern void mysetlinebuf();
+ extern void note();
+ extern void runcmdspecial();
+ extern void runcommand();
+ extern void server();
++extern void setargs_settup();
+ extern void setprogname();
+ extern void sighandler();
++extern void usage();
+ extern void waitup();
++extern void yyerror();
++extern WRITE_RETURN_T xwrite();
+ struct namelist *expand();
+ struct namelist *lookup();
+ struct namelist *makenl();
+-extern WRITE_RETURN_T xwrite();
+
+ #if defined(ARG_TYPE) && ARG_TYPE == ARG_STDARG
++extern int sendcmd(char cmd, char *fmt, ...);
+ extern void debugmsg(int, char *, ...);
+ extern void error(char *, ...);
+ extern void fatalerr(char *, ...);
+ extern void message(int, char *, ...);
+ extern void setproctitle(char *fmt, ...);
+ #else
++extern int sendcmd(va_alist);
+ extern void debugmsg();
+ extern void error();
+ extern void fatalerr();
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch
new file mode 100644
index 000000000..d183d9183
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/message.c.thestokes 2006-04-19 17:30:39.000000000 -0400
++++ rdist-6.1.5/src/message.c 2006-04-19 17:36:37.000000000 -0400
+@@ -793,15 +793,20 @@
+ char *msg;
+ {
+ static char buf[MSGBUFSIZ];
+-
+- ++nerrs;
+-
+- if (isserver)
+- (void) sprintf(buf, "REMOTE ERROR: %s", msg);
+- else
+- (void) sprintf(buf, "LOCAL ERROR: %s", msg);
+-
+- _message(MT_FERROR, buf);
++ /* Don't reenter this function. There is a nasty infinite recursion
++ case that pops up when msgsndnotify tries to exit. */
++ static int inside=0;
++
++ if(inside==0){
++ ++nerrs;
++ inside=1;
++
++ if (isserver)
++ (void) sprintf(buf, "REMOTE ERROR: %s", msg);
++ else
++ (void) sprintf(buf, "LOCAL ERROR: %s", msg);
++ _message(MT_FERROR, buf);
++ }
+
+ exit(nerrs);
+ }
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch
new file mode 100644
index 000000000..baf8e3030
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/client.c.hardlink Thu Jun 3 13:56:31 1999
++++ rdist-6.1.5/src/client.c Thu Jun 3 14:00:06 1999
+@@ -348,7 +348,7 @@
+ lp->target = strdup(Tdest);
+ else
+ lp->target = NULL;
+- if (!lp->pathname || !lp->src || !(Tdest && lp->target))
++ if (!lp->pathname || !lp->src || (Tdest && !lp->target))
+ fatalerr("Cannot malloc memory in linkinfo.");
+
+ return((struct linkbuf *) NULL);
+@@ -370,7 +370,7 @@
+ "sendhardlink: rname='%s' pathname='%s' src='%s' target='%s'\n",
+ rname, lp->pathname, lp->src, lp->target);
+
+- if (*lp->target == CNULL)
++ if (lp->target == NULL || *lp->target == CNULL)
+ (void) sendcmd(C_RECVHARDLINK, "%o %s %s",
+ opts, lp->pathname, rname);
+ else {
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch
new file mode 100644
index 000000000..3fa8db8cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch
@@ -0,0 +1,142 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/client.c.lfs 2003-12-16 23:43:56.000000000 +0100
++++ rdist-6.1.5/src/client.c 2003-12-16 23:46:56.000000000 +0100
+@@ -414,9 +414,9 @@
+ /*
+ * Send file info
+ */
+- (void) sendcmd(C_RECVREG, "%o %04o %ld %ld %ld %s %s %s",
++ (void) sendcmd(C_RECVREG, "%o %04o %lld %ld %ld %s %s %s",
+ opts, stb->st_mode & 07777,
+- (long) stb->st_size,
++ (off_t) stb->st_size,
+ stb->st_mtime, stb->st_atime,
+ user, group, rname);
+ if (response() < 0) {
+@@ -424,8 +424,8 @@
+ return(-1);
+ }
+
+- debugmsg(DM_MISC, "Send file '%s' %d bytes\n",
+- rname, (long) stb->st_size);
++ debugmsg(DM_MISC, "Send file '%s' %lld bytes\n",
++ rname, (off_t) stb->st_size);
+
+ /*
+ * Set remote time out alarm handler.
+@@ -676,9 +676,9 @@
+ /*
+ * Gather and send basic link info
+ */
+- (void) sendcmd(C_RECVSYMLINK, "%o %04o %ld %ld %ld %s %s %s",
++ (void) sendcmd(C_RECVSYMLINK, "%o %04o %lld %ld %ld %s %s %s",
+ opts, stb->st_mode & 07777,
+- (long) stb->st_size,
++ (off_t) stb->st_size,
+ stb->st_mtime, stb->st_atime,
+ user, group, rname);
+ if (response() < 0)
+@@ -858,7 +858,7 @@
+ /*
+ * Parse size
+ */
+- size = strtol(cp, &cp, 10);
++ size = strtoll(cp, &cp, 10);
+ if (*cp++ != ' ') {
+ error("update: size not delimited");
+ return(US_NOTHING);
+@@ -910,8 +910,8 @@
+
+ debugmsg(DM_MISC, "update(%s,) local mode %04o remote mode %04o\n",
+ rname, lmode, rmode);
+- debugmsg(DM_MISC, "update(%s,) size %d mtime %d owner '%s' grp '%s'\n",
+- rname, (int) size, mtime, owner, group);
++ debugmsg(DM_MISC, "update(%s,) size %lld mtime %d owner '%s' grp '%s'\n",
++ rname, (off_t) size, mtime, owner, group);
+
+ if (statp->st_mtime != mtime) {
+ if (statp->st_mtime < mtime && IS_ON(opts, DO_YOUNGER)) {
+@@ -937,8 +937,8 @@
+ }
+
+ if (statp->st_size != size) {
+- debugmsg(DM_MISC, "size does not match (%d != %d).\n",
+- (int) statp->st_size, size);
++ debugmsg(DM_MISC, "size does not match (%lld != %lld).\n",
++ statp->st_size, size);
+ return(US_OUTDATE);
+ }
+
+--- rdist-6.1.5/src/server.c.lfs 1998-11-10 05:15:31.000000000 +0100
++++ rdist-6.1.5/src/server.c 2003-12-16 23:50:19.000000000 +0100
+@@ -645,8 +645,8 @@
+ case S_IFLNK:
+ case S_IFDIR:
+ case S_IFREG:
+- (void) sendcmd(QC_YES, "%ld %ld %o %s %s",
+- (long) stb.st_size,
++ (void) sendcmd(QC_YES, "%lld %ld %o %s %s",
++ (off_t) stb.st_size,
+ stb.st_mtime,
+ stb.st_mode & 07777,
+ getusername(stb.st_uid, target, options),
+@@ -1388,7 +1388,7 @@
+ /*
+ * Get file size
+ */
+- size = strtol(cp, &cp, 10);
++ size = strtoll(cp, &cp, 10);
+ if (*cp++ != ' ') {
+ error("recvit: size not delimited");
+ return;
+@@ -1441,7 +1441,7 @@
+ }
+
+ debugmsg(DM_MISC,
+- "recvit: opts = %04o mode = %04o size = %d mtime = %d",
++ "recvit: opts = %04o mode = %04o size = %lld mtime = %d",
+ opts, mode, size, mtime);
+ debugmsg(DM_MISC,
+ "recvit: owner = '%s' group = '%s' file = '%s' catname = %d isdir = %d",
+--- rdist-6.1.5/include/defs.h.lfs 2003-12-16 23:43:56.000000000 +0100
++++ rdist-6.1.5/include/defs.h 2003-12-16 23:43:56.000000000 +0100
+@@ -22,6 +22,8 @@
+ #include <stdlib.h>
+ #endif /* _POSIX_SOURCE */
+ #include <stdio.h>
++#include <string.h>
++#include <mntent.h>
+ #include <ctype.h>
+ #include <errno.h>
+ #include <pwd.h>
+@@ -317,15 +319,6 @@
+ #endif /* USE_STATDB */
+
+ /*
+- * System function declarations
+- */
+-char *hasmntopt();
+-char *strchr();
+-char *strdup();
+-char *strrchr();
+-char *strtok();
+-
+-/*
+ * Our own declarations.
+ */
+ char *exptilde();
+--- rdist-6.1.5/Makefile.local.lfs 1998-11-10 04:36:31.000000000 +0100
++++ rdist-6.1.5/Makefile.local 2003-12-16 23:43:56.000000000 +0100
+@@ -20,7 +20,7 @@
+ # Add any local definitions you want pass to the compiler to DEFS_LOCAL
+ # below. This includes those items found in "config/config.h".
+ #
+-#DEFS_LOCAL = -DDIRECT_RCMD
++DEFS_LOCAL = -O2 -g -pipe -Wall -D_POSIX_SOURCE -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+
+ #
+ # Add any local libraries that your system might need to LIBS_LOCAL below.
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch
new file mode 100644
index 000000000..e9994f2c9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch
@@ -0,0 +1,79 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/client.c.links Wed Feb 17 17:46:09 1999
++++ rdist-6.1.5/src/client.c Wed Feb 17 17:51:15 1999
+@@ -309,6 +309,18 @@
+ return(0);
+ }
+
++void freelinkinfo(lp)
++ struct linkbuf *lp;
++{
++ if (lp->pathname)
++ free(lp->pathname);
++ if (lp->src)
++ free(lp->src);
++ if (lp->target)
++ free(lp->target);
++ free(lp);
++}
++
+ /*
+ * Save and retrieve hard link info
+ */
+@@ -317,6 +329,7 @@
+ {
+ struct linkbuf *lp;
+
++ /* xxx: linear search doesn't scale with many links */
+ for (lp = ihead; lp != NULL; lp = lp->nextp)
+ if (lp->inum == statp->st_ino && lp->devnum == statp->st_dev) {
+ lp->count--;
+@@ -329,12 +342,14 @@
+ lp->inum = statp->st_ino;
+ lp->devnum = statp->st_dev;
+ lp->count = statp->st_nlink - 1;
+- (void) strcpy(lp->pathname, target);
+- (void) strcpy(lp->src, source);
++ lp->pathname = strdup(target);
++ lp->src = strdup(source);
+ if (Tdest)
+- (void) strcpy(lp->target, Tdest);
++ lp->target = strdup(Tdest);
+ else
+- *lp->target = CNULL;
++ lp->target = NULL;
++ if (!lp->pathname || !lp->src || !(Tdest && lp->target))
++ fatalerr("Cannot malloc memory in linkinfo.");
+
+ return((struct linkbuf *) NULL);
+ }
+--- rdist-6.1.5/src/docmd.c.links Wed Feb 17 17:51:23 1999
++++ rdist-6.1.5/src/docmd.c Wed Feb 17 17:52:44 1999
+@@ -586,7 +586,7 @@
+ if (!nflag) {
+ register struct linkbuf *nextl, *l;
+
+- for (l = ihead; l != NULL; free((char *)l), l = nextl) {
++ for (l = ihead; l != NULL; freelinkinfo(l), l = nextl) {
+ nextl = l->nextp;
+ if (contimedout || IS_ON(opts, DO_IGNLNKS) ||
+ l->count == 0)
+--- rdist-6.1.5/include/defs.h.links Wed Feb 17 17:52:58 1999
++++ rdist-6.1.5/include/defs.h Wed Feb 17 17:53:47 1999
+@@ -276,9 +276,9 @@
+ ino_t inum;
+ dev_t devnum;
+ int count;
+- char pathname[BUFSIZ];
+- char src[BUFSIZ];
+- char target[BUFSIZ];
++ char *pathname;
++ char *src;
++ char *target;
+ struct linkbuf *nextp;
+ };
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch
new file mode 100644
index 000000000..b56fd38b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+diff: rdist-6.1.5/config/mf: No such file or directory
+--- rdist-6.1.5/config/os-linux.h.linux Mon Nov 9 22:59:59 1998
++++ rdist-6.1.5/config/os-linux.h Thu Nov 12 14:50:35 1998
+@@ -58,7 +58,7 @@
+ /*
+ * Select the type of executable file format.
+ */
+-#define EXE_TYPE EXE_AOUT
++#define EXE_TYPE EXE_ELF
+
+ /*
+ * Select the type of statfs() system call (if any).
+--- rdist-6.1.5/mf/Makefile.var.linux Tue Nov 10 00:02:11 1998
++++ rdist-6.1.5/mf/Makefile.var Thu Nov 12 14:50:35 1998
+@@ -67,7 +67,7 @@
+ #
+ # Name of YACC.
+ #
+-#YACC = bison -y
++YACC = bison -y
+
+ OPT = -g
+ RM = rm
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch
new file mode 100644
index 000000000..cc82e16cc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch
@@ -0,0 +1,23 @@
+Add LDFLAGS variable to Makefile so that extra linker flags can be sent via this variable.
+
+Upstream-Status: Inappropriate [no upstream]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/src/Makefile.real b/src/Makefile.real
+index 02179e4..9070974 100644
+--- a/src/Makefile.real
++++ b/src/Makefile.real
+@@ -36,10 +36,10 @@ all: src
+ src: $(CLIENT_BIN) $(SERVER_BIN)
+
+ $(SERVER_BIN): $(SERVEROBJS) $(COMMONOBJS) $(MISSINGOBJS)
+- $(CC) -o $@ $(SERVEROBJS) $(COMMONOBJS) $(MISSINGOBJS) $(LIBS)
++ $(CC) -o $@ $(SERVEROBJS) $(COMMONOBJS) $(MISSINGOBJS) $(LIBS) $(LDFLAGS)
+
+ $(CLIENT_BIN): $(CLIENTOBJS) $(COMMONOBJS) $(MISSINGOBJS)
+- $(CC) -o $@ $(CLIENTOBJS) $(COMMONOBJS) $(MISSINGOBJS) $(LIBS)
++ $(CC) -o $@ $(CLIENTOBJS) $(COMMONOBJS) $(MISSINGOBJS) $(LIBS) $(LDFLAGS)
+
+ $(CLIENTOBJS) $(SERVEROBJS): $(HFILES) y.tab.h
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch
new file mode 100644
index 000000000..e81639446
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:rdist
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/setargs.c.maxargs 1998-11-10 05:15:56.000000000 +0100
++++ rdist-6.1.5/src/setargs.c 2003-09-04 14:39:03.000000000 +0200
+@@ -58,7 +58,7 @@
+ * Set process argument functions
+ */
+
+-#define MAXUSERENVIRON 40
++#define MAXUSERENVIRON 1024
+ char **Argv = NULL;
+ char *LastArgv = NULL;
+ char *UserEnviron[MAXUSERENVIRON+1];
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
new file mode 100644
index 000000000..e49e3e4d1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/server.c.mkstemp 2004-05-25 14:29:37.279312752 +0200
++++ rdist-6.1.5/src/server.c 2004-05-25 14:31:27.050744340 +0200
+@@ -1479,11 +1479,18 @@
+ *file = '/';
+ }
+ fd = mkstemp(new);
+- if (fd < 0) {
++ /*
++ * Don't consider it a fatal error if mkstemp() fails
++ * because parent directory didn't exist. (Missing
++ * parents are created later (in recvfile())
++ */
++ if ((fd < 0) && (errno != ENOENT)) {
+ error("Cannot set file name.");
+ return;
++ } else if (fd >= 0) {
++ close(fd);
++ unlink(new); /* Or symlink() will fail */
+ }
+- close(fd);
+ }
+
+ /*
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch
new file mode 100644
index 000000000..493b18397
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/config/config.h.oldpath Tue Nov 10 04:59:48 1998
++++ rdist-6.1.5/config/config.h Thu Jan 31 17:33:21 2002
+@@ -39,7 +39,7 @@
+ * don't have the old rdist, then uncomment the "#undef" line.
+ */
+ #ifndef _PATH_OLDRDIST
+-#define _PATH_OLDRDIST "/usr/ucb/oldrdist" /* Enable compat */
++#define _PATH_OLDRDIST "/usr/bin/oldrdist" /* Enable compat */
+ #endif
+ /*#undef _PATH_OLDRDIST*/ /* Disable compat */
+
+--- rdist-6.1.5/doc/rdist.man.oldpath Tue Nov 10 06:38:53 1998
++++ rdist-6.1.5/doc/rdist.man Thu Jan 31 17:36:57 2002
+@@ -170,10 +170,9 @@
+ This option will only work if
+ .I rdist
+ was compiled with the location of the old rdist
+-(usually either
+-.I /usr/ucb/oldrdist
+-or
+-.I /usr/old/rdist)
++(the path
++.I /usr/bin/oldrdist
++is used on Red Hat linux)
+ and that program is available at run time.
+ .PP
+ .I Rdist
+@@ -558,7 +557,7 @@
+ should be of form
+ .sp
+ .RS
+-\fIfacility\fB=\fItypes\fB:\fIfacility\fB=\fItypes...
++\fIfacility\fB=\fItypes\fB:\fIfacility\fB=\fItypes...\fR
+ .RE
+ .sp
+ The valid facility names are:
+--- rdist-6.1.5/README.oldpath Fri Jul 19 19:24:09 1996
++++ rdist-6.1.5/README Thu Jan 31 17:33:21 2002
+@@ -65,12 +65,12 @@
+
+ The way the old rdist started a server rdist is to run "rdist
+ -Server". If the new rdist is run with the "-Server" option, then it
+-will exec a copy of the old rdist (usually /usr/old/rdist or
+-/usr/ucb/oldrdist). In this way, you get compatibility with hosts
++will exec a copy of the old rdist (the path /usr/bin/oldrdist in Red
++Hat linux). In this way, you get compatibility with hosts
+ running the old rdist attempting to rdist to a machine running new
+ rdist. If your host running new rdist wants to rdist to a host
+ running the old rdist, then it must run the old rdist program
+-(/usr/old/rdist or /usr/ucb/oldrdist).
++(/usr/bin/oldrdist in Red Hat linux).
+
+ The definition _PATH_OLDRDIST in "config/config.h" controls the
+ location of the old rdist. If this is not defined, or the defined
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch
new file mode 100644
index 000000000..d3982cf41
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/rshrcmd.c.dist Tue Dec 12 08:20:56 1995
++++ rdist-6.1.5/src/rshrcmd.c Wed Dec 11 07:14:13 1996
+@@ -64,5 +64,5 @@
+ sp[0]. */
+ (void) close(sp[0]);
+- if (dup2(sp[1], 0) < 0 || dup2(0,1) < 0 || dup2(0, 2) < 0) {
++ if (dup2(sp[1], 0) < 0 || dup2(0,1) < 0) {
+ error("dup2 failed: %s.", SYSERR);
+ _exit(255);
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch
new file mode 100644
index 000000000..b20953ef3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch
@@ -0,0 +1,85 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/src/filesys.c.stat64 2005-05-04 14:11:03.000000000 +0200
++++ rdist-6.1.5/src/filesys.c 2005-05-04 14:11:10.000000000 +0200
+@@ -430,8 +430,8 @@
+ */
+ int getfilesysinfo(file, freespace, freefiles)
+ char *file;
+- long *freespace;
+- long *freefiles;
++ fsblkcnt_t *freespace;
++ fsfilcnt_t *freefiles;
+ {
+ #if defined(STATFS_TYPE)
+ static statfs_t statfsbuf;
+--- rdist-6.1.5/src/server.c.stat64 2005-05-04 14:11:23.000000000 +0200
++++ rdist-6.1.5/src/server.c 2005-05-04 14:20:34.000000000 +0200
+@@ -62,8 +62,8 @@
+ int catname = 0; /* cat name to target name */
+ char *sptarget[32]; /* stack of saved ptarget's for directories */
+ char *fromhost = NULL; /* Client hostname */
+-static long min_freespace = 0; /* Minimium free space on a filesystem */
+-static long min_freefiles = 0; /* Minimium free # files on a filesystem */
++static fsblkcnt_t min_freespace = 0; /* Minimium free space on a filesystem */
++static fsfilcnt_t min_freefiles = 0; /* Minimium free # files on a filesystem */
+ int oumask; /* Old umask */
+
+ /*
+@@ -1326,7 +1326,7 @@
+ fatalerr("Expected digit, got '%s'.", cp);
+ return;
+ }
+- min_freespace = (unsigned long) atoi(cp);
++ min_freespace = (fsblkcnt_t) atoll(cp);
+ break;
+
+ case SC_FREEFILES: /* Minimium free files */
+@@ -1334,7 +1334,7 @@
+ fatalerr("Expected digit, got '%s'.", cp);
+ return;
+ }
+- min_freefiles = (unsigned long) atoi(cp);
++ min_freefiles = (fsfilcnt_t) atoll(cp);
+ break;
+
+ case SC_LOGGING: /* Logging options */
+@@ -1364,7 +1364,8 @@
+ time_t mtime, atime;
+ char *owner, *group, *file;
+ char new[MAXPATHLEN];
+- long freespace = -1, freefiles = -1;
++ fsfilcnt_t freefiles = -1;
++ fsblkcnt_t freespace = -1;
+ char *cp = cmd;
+
+ /*
+@@ -1499,7 +1500,7 @@
+ */
+ if (min_freespace || min_freefiles) {
+ /* Convert file size to kilobytes */
+- long fsize = (long) (size / 1024);
++ fsblkcnt_t fsize = (fsblkcnt_t) (size / 1024);
+
+ if (getfilesysinfo(target, &freespace, &freefiles) != 0)
+ return;
+@@ -1511,14 +1512,14 @@
+ if (min_freespace && (freespace >= 0) &&
+ (freespace - fsize < min_freespace)) {
+ error(
+- "%s: Not enough free space on filesystem: min %d free %d",
++ "%s: Not enough free space on filesystem: min %lld free %lld",
+ target, min_freespace, freespace);
+ return;
+ }
+ if (min_freefiles && (freefiles >= 0) &&
+ (freefiles - 1 < min_freefiles)) {
+ error(
+- "%s: Not enough free files on filesystem: min %d free %d",
++ "%s: Not enough free files on filesystem: min %lld free %lld",
+ target, min_freefiles, freefiles);
+ return;
+ }
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch
new file mode 100644
index 000000000..bf73b71e1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/build/os-type.svr4 2003-12-17 12:44:18.000000000 +0100
++++ rdist-6.1.5/build/os-type 2003-12-17 12:44:29.000000000 +0100
+@@ -83,7 +83,6 @@
+ if [ -z "${OS}" -a ! -z "${uname}" ]; then
+ case "`$uname -a | tr '[A-Z]' '[a-z]'`" in
+ osf1*) OS=break;;
+- *"4.0"*) OS=svr4;; # There has to be a better way
+ *" dcosx "*) OS=dcosx;;
+ *"cx/ux"*) OS=cxux;;
+ *"hp-ux"*) # HP-UX 9.x
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch
new file mode 100644
index 000000000..e6edbc44d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Inappropriate [1]
+
+[1] Not the author, the patch is from:
+http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
+
+--- rdist-6.1.5/config/os-linux.h.varargs 2003-06-17 17:52:33.000000000 +0200
++++ rdist-6.1.5/config/os-linux.h 2003-06-17 17:53:07.000000000 +0200
+@@ -68,7 +68,7 @@
+ /*
+ * Type of arg functions we have.
+ */
+-#define ARG_TYPE ARG_VARARGS
++#define ARG_TYPE ARG_STDARG
+
+ /*
+ * Do we have select()?
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb
new file mode 100644
index 000000000..cea1f08f9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Remote file distribution client and server"
+DESCRIPTION = "\
+Rdist is a program to maintain identical copies of files over multiple \
+hosts. It preserves the owner, group, mode, and mtime of files if \
+possible and can update programs that are executing. \
+"
+SECTION = "console/network"
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHKSUM = "file://Copyright;md5=3f47ec9f64b11c8192ee05a66b5c2755"
+
+SRC_URI = "http://www.magnicomp.com/download/${BPN}/${BP}.tar.gz"
+SRC_URI[md5sum] = "546779700af70aa5f9103e08782cdcac"
+SRC_URI[sha256sum] = "2bb0d0f5904eadc9e7fe3d60c15389d6897fcf884211070e289a6c710ff37f96"
+
+SRC_URI += "file://rdist-6.1.5-linux.patch \
+ file://rdist-6.1.5-links.patch \
+ file://rdist-6.1.5-oldpath.patch \
+ file://rdist-6.1.5-hardlink.patch \
+ file://rdist-6.1.5-bison.patch \
+ file://rdist-6.1.5-varargs.patch \
+ file://rdist-6.1.5-maxargs.patch \
+ file://rdist-6.1.5-lfs.patch \
+ file://rdist-6.1.5-cleanup.patch \
+ file://rdist-6.1.5-svr4.patch \
+ file://rdist-6.1.5-ssh.patch \
+ file://rdist-6.1.5-mkstemp.patch \
+ file://rdist-6.1.5-stat64.patch \
+ file://rdist-6.1.5-fix-msgsndnotify-loop.patch \
+ file://rdist-6.1.5-bb-build.patch \
+ file://rdist-6.1.5-makefile-add-ldflags.patch \
+"
+
+DEPENDS = "bison-native"
+
+inherit autotools-brokensep
+
+EXTRA_OEMAKE = "BIN_GROUP=root MAN_GROUP=root RDIST_MODE=755 RDISTD_MODE=755 MAN_MODE=644"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch b/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch
new file mode 100644
index 000000000..eaaf30460
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch
@@ -0,0 +1,34 @@
+From 2fa326b26dc479942367dc4283e2f87372403988 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 09:32:04 -0700
+Subject: [PATCH] rtnl_flush: Error on failed write()
+
+Fixes
+route.c:45:2: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]
+| write(fd, "-1", 2);
+| ^~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ route.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/route.c b/route.c
+index c552d1f..fc5c31e 100644
+--- a/route.c
++++ b/route.c
+@@ -42,7 +42,8 @@ static void rtnl_flush(void)
+ if (fd < 0)
+ return;
+
+- write(fd, "-1", 2);
++ if (write(fd, "-1", 2) < 0 )
++ perror("write");
+ close(fd);
+ }
+
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb b/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
new file mode 100644
index 000000000..98dc41a09
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
@@ -0,0 +1,17 @@
+DESCRIPTION = "Layer 3 relay daemon"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://main.c;endline=17;md5=86aad799085683e0a2e1c2684a20bab2"
+
+DEPENDS = "libubox"
+
+SRC_URI = "git://git.openwrt.org/project/relayd.git \
+ file://0001-rtnl_flush-Error-on-failed-write.patch \
+"
+
+SRCREV = "ad0b25ad74345d367c62311e14b279f5ccb8ef13"
+PV = "0.0.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
new file mode 100644
index 000000000..0e89a9be0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Submitted [https://github.com/samba-team/samba/pull/70]
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+From 50eac4fd30944e5e1d83060757633fe0ed572723 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Wed, 30 Nov 2016 16:25:06 +0100
+Subject: [PATCH] packaging: Avoid timeout for nmbd if started offline with
+ systemd
+
+If no network connection appears within DefaultTimeoutStartSec
+(~ 90s) after startup, nmbd fails to notify systemd and will
+therefore get killed.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+---
+ packaging/systemd/nmb.service | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/packaging/systemd/nmb.service b/packaging/systemd/nmb.service
+index 71c93d6..f3d2fc2 100644
+--- a/packaging/systemd/nmb.service
++++ b/packaging/systemd/nmb.service
+@@ -10,6 +10,7 @@ EnvironmentFile=-/etc/sysconfig/samba
+ ExecStart=/usr/sbin/nmbd --foreground --no-process-group $NMBDOPTIONS
+ ExecReload=/usr/bin/kill -HUP $MAINPID
+ LimitCORE=infinity
++TimeoutStartSec=0
+
+ [Install]
+ WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch
new file mode 100644
index 000000000..cdf7a38c1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/0006-avoid-using-colon-in-the-checking-msg.patch
@@ -0,0 +1,32 @@
+From 5413f97290d3126262eb309ecbcf7769509f2a11 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 10 Nov 2015 00:48:35 -0500
+Subject: [PATCH 6/7] avoid using colon in the checking msg
+
+Upstream-Status: Pending
+
+colon is used as the separator when parse from
+a answers file, the colon here makes it never
+get the right answer.
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ wscript_configure_system_mitkrb5 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wscript_configure_system_mitkrb5 b/wscript_configure_system_mitkrb5
+index a62d00b..a2d89f0 100644
+--- a/wscript_configure_system_mitkrb5
++++ b/wscript_configure_system_mitkrb5
+@@ -240,7 +240,7 @@ conf.CHECK_CODE('''
+ ''',
+ 'HAVE_WRFILE_KEYTAB',
+ headers='krb5.h', lib='krb5', execute=True,
+- msg="Checking whether the WRFILE:-keytab is supported");
++ msg="Checking whether the WRFILE -keytab is supported");
+ # Check for KRB5_DEPRECATED handling
+ conf.CHECK_CODE('''#define KRB5_DEPRECATED 1
+ #include <krb5.h>''',
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
new file mode 100644
index 000000000..8ca7a52ed
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/16-do-not-check-xsltproc-manpages.patch
@@ -0,0 +1,57 @@
+From 2214c2d1e455a38c891d17e421b438e3f7c495d8 Mon Sep 17 00:00:00 2001
+From: Bian Naimeng <biannm@cn.fujitsu.com>
+Date: Mon, 18 Apr 2016 17:00:53 -0400
+Subject: [PATCH] Don't check xsltproc manpages
+
+Upstream-Status: Pending
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+---
+ lib/ldb/wscript | 2 +-
+ lib/talloc/wscript | 2 +-
+ lib/tdb/wscript | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/ldb/wscript b/lib/ldb/wscript
+index 5ea5231..d94086b 100644
+--- a/lib/ldb/wscript
++++ b/lib/ldb/wscript
+@@ -98,7 +98,7 @@ def configure(conf):
+ conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
+
+ if conf.env.standalone_ldb:
+- conf.CHECK_XSLTPROC_MANPAGES()
++ #conf.CHECK_XSLTPROC_MANPAGES()
+
+ # we need this for the ldap backend
+ if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+diff --git a/lib/talloc/wscript b/lib/talloc/wscript
+index df7e6be..b3305cf 100644
+--- a/lib/talloc/wscript
++++ b/lib/talloc/wscript
+@@ -49,7 +49,7 @@ def configure(conf):
+ conf.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+ conf.env.TALLOC_VERSION = VERSION
+
+- conf.CHECK_XSLTPROC_MANPAGES()
++ #conf.CHECK_XSLTPROC_MANPAGES()
+
+ conf.CHECK_HEADERS('sys/auxv.h')
+ conf.CHECK_FUNCS('getauxval')
+diff --git a/lib/tdb/wscript b/lib/tdb/wscript
+index 4782550..6bb3fa1 100644
+--- a/lib/tdb/wscript
++++ b/lib/tdb/wscript
+@@ -89,7 +89,7 @@ def configure(conf):
+ not conf.env.disable_tdb_mutex_locking):
+ conf.define('USE_TDB_MUTEX_LOCKING', 1)
+
+- conf.CHECK_XSLTPROC_MANPAGES()
++ #conf.CHECK_XSLTPROC_MANPAGES()
+
+ if not conf.env.disable_python:
+ # also disable if we don't have the python libs installed
+--
+2.14.3
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch
new file mode 100644
index 000000000..e112b3b40
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/20-do-not-import-target-module-while-cross-compile.patch
@@ -0,0 +1,58 @@
+Some modules such as dynamic library maybe cann't be imported while cross compile,
+we just check whether does the module exist.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+Index: samba-4.4.2/buildtools/wafsamba/samba_bundled.py
+===================================================================
+--- samba-4.4.2.orig/buildtools/wafsamba/samba_bundled.py
++++ samba-4.4.2/buildtools/wafsamba/samba_bundled.py
+@@ -2,6 +2,7 @@
+
+ import sys
+ import Build, Options, Logs
++import imp, os
+ from Configure import conf
+ from samba_utils import TO_LIST
+
+@@ -230,17 +231,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
+ # versions
+ minversion = minimum_library_version(conf, libname, minversion)
+
+- try:
+- m = __import__(modulename)
+- except ImportError:
+- found = False
+- else:
++ # Find module in PYTHONPATH
++ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
++ if stuff:
+ try:
+- version = m.__version__
+- except AttributeError:
++ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
++ except ImportError:
+ found = False
++
++ if conf.env.CROSS_COMPILE:
++ # Some modules such as dynamic library maybe cann't be imported
++ # while cross compile, we just check whether the module exist
++ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
++ found = True
+ else:
+- found = tuplize_version(version) >= tuplize_version(minversion)
++ try:
++ version = m.__version__
++ except AttributeError:
++ found = False
++ else:
++ found = tuplize_version(version) >= tuplize_version(minversion)
++ finally:
++ if stuff[0]:
++ stuff[0].close()
++ else:
++ found = False
++
+ if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
+ Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
+ sys.exit(1)
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
new file mode 100644
index 000000000..6a7f8facc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/21-add-config-option-without-valgrind.patch
@@ -0,0 +1,64 @@
+From 9a2d6315ff206b2a47100dfd85afe3af56576995 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Thu, 10 Dec 2015 04:20:51 -0500
+Subject: [PATCH] Add config option without-valgrind
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+---
+ lib/replace/wscript | 4 +++-
+ source3/wscript | 5 ++++-
+ wscript | 4 ++++
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index f0040b1..aca73af 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -101,7 +101,9 @@ def configure(conf):
+ conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
+ conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
+
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++ if not Options.options.disable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
+ conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+ conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+ conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+diff --git a/source3/wscript b/source3/wscript
+index bac3dd5..a5c51ea 100644
+--- a/source3/wscript
++++ b/source3/wscript
+@@ -1070,7 +1070,10 @@ syscall(SYS_setgroups32, 0, NULL);
+ Logs.warn("--with-dnsupdate=yes but gssapi support not sufficient")
+ else:
+ conf.DEFINE('WITH_DNS_UPDATES', 1)
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
++ if not Options.options.disable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
+ if Options.options.developer:
+ if conf.CONFIG_SET('HAVE_VALGRIND_H') or conf.CONFIG_SET('HAVE_VALGRIND_VALGRIND_H'):
+ conf.DEFINE('VALGRIND', '1')
+diff --git a/wscript b/wscript
+index 542a60c..22e6116 100644
+--- a/wscript
++++ b/wscript
+@@ -86,6 +86,10 @@ def set_options(opt):
+ help=("Disable RELRO builds"),
+ action="store_false", dest='enable_relro')
+
++ opt.add_option('--without-valgrind',
++ help=("Disable use of the valgrind headers"),
++ action="store_true", dest='disable_valgrind', default=False)
++
+ gr = opt.option_group('developer options')
+
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
new file mode 100644
index 000000000..0c7592f8e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/dnsserver-4.7.0.patch
@@ -0,0 +1,19 @@
+samba: build dnsserver_common code
+
+Just 'install' does not seem to do it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/source4/dns_server/wscript_build
++++ b/source4/dns_server/wscript_build
+@@ -4,7 +4,7 @@ bld.SAMBA_LIBRARY('dnsserver_common',
+ source='dnsserver_common.c',
+ deps='samba-util samba-errors ldbsamba clidns',
+ private_library=True,
+- install=bld.AD_DC_BUILD_IS_ENABLED()
++ enabled=bld.AD_DC_BUILD_IS_ENABLED()
+ )
+
+ bld.SAMBA_MODULE('service_dns',
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
new file mode 100644
index 000000000..894bc8bb2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/glibc_only.patch
@@ -0,0 +1,15 @@
+Index: samba-4.6.2/ctdb/tests/src/test_mutex_raw.c
+===================================================================
+--- samba-4.6.2.orig/ctdb/tests/src/test_mutex_raw.c
++++ samba-4.6.2/ctdb/tests/src/test_mutex_raw.c
+@@ -166,8 +166,10 @@ int main(int argc, const char **argv)
+ if (ret == 0) {
+ pthread_mutex_unlock(mutex);
+ }
++#ifdef __GLIBC__
+ } else if (ret == EBUSY) {
+ printf("pid=%u\n", mutex->__data.__owner);
++#endif
+ } else if (ret == 0) {
+ pthread_mutex_unlock(mutex);
+ }
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
new file mode 100644
index 000000000..5ae8c5978
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/iconv-4.7.0.patch
@@ -0,0 +1,25 @@
+samba: defeat iconv test
+
+A test was added when configuring samba which requires target code
+to be executed. In general, this will not work, so we eliminate it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/lib/util/charset/wscript_configure
++++ b/lib/util/charset/wscript_configure
+@@ -17,6 +17,8 @@ if (conf.CHECK_FUNCS_IN('iconv_open', 'i
+
+ conf.DEFINE('HAVE_NATIVE_ICONV', 1)
+
++"""
++[added for 4.7.0, but breaks cross-compilation]
+ conf.CHECK_CODE('''
+ uint8_t inbuf[2] = { 0x30, 0xdf };
+ uint8_t outbuf[4] = { 0 };
+@@ -36,3 +38,4 @@ conf.CHECK_CODE('''
+ msg='Checking errno of iconv for illegal multibyte sequence',
+ lib='iconv',
+ headers='errno.h iconv.h')
++"""
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch
new file mode 100644
index 000000000..eb06866f4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/netdb_defines.patch
@@ -0,0 +1,19 @@
+Index: samba-4.6.2/nsswitch/wins.c
+===================================================================
+--- samba-4.6.2.orig/nsswitch/wins.c
++++ samba-4.6.2/nsswitch/wins.c
+@@ -39,6 +39,14 @@ static pthread_mutex_t wins_nss_mutex =
+ #define INADDRSZ 4
+ #endif
+
++#ifndef NETDB_INTERNAL
++#define NETDB_INTERNAL (-1)
++#endif
++
++#ifndef NETDB_SUCCESS
++#define NETDB_SUCCESS 0
++#endif
++
+ NSS_STATUS _nss_wins_gethostbyname_r(const char *hostname,
+ struct hostent *he,
+ char *buffer,
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch
new file mode 100644
index 000000000..71db99c5d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-4.3.9-remove-getpwent_r.patch
@@ -0,0 +1,87 @@
+Musl does not have _r versions of getent() and getpwent() APIs
+
+Taken from gentoo
+http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.3.9-remove-getpwent_r.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: samba-4.4.5/source4/torture/local/nss_tests.c
+===================================================================
+--- samba-4.4.5.orig/source4/torture/local/nss_tests.c
++++ samba-4.4.5/source4/torture/local/nss_tests.c
+@@ -247,7 +247,6 @@ static bool test_getgrnam_r(struct tortu
+ return true;
+ }
+
+-
+ static bool test_getgrgid(struct torture_context *tctx,
+ gid_t gid,
+ struct group *grp_p)
+@@ -333,6 +332,7 @@ static bool test_enum_passwd(struct tort
+ return true;
+ }
+
++#if HAVE_GETPWENT_R
+ static bool test_enum_r_passwd(struct torture_context *tctx,
+ struct passwd **pwd_array_p,
+ size_t *num_pwd_p)
+@@ -381,6 +381,7 @@ static bool test_enum_r_passwd(struct to
+
+ return true;
+ }
++#endif
+
+ static bool torture_assert_passwd_equal(struct torture_context *tctx,
+ const struct passwd *p1,
+@@ -432,7 +433,7 @@ static bool test_passwd_r(struct torture
+ struct passwd *pwd, pwd1, pwd2;
+ size_t num_pwd;
+
+- torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
++ torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
+ "failed to enumerate passwd");
+
+ for (i=0; i < num_pwd; i++) {
+@@ -460,7 +461,7 @@ static bool test_passwd_r_cross(struct t
+ struct passwd *pwd, pwd1, pwd2, pwd3, pwd4;
+ size_t num_pwd;
+
+- torture_assert(tctx, test_enum_r_passwd(tctx, &pwd, &num_pwd),
++ torture_assert(tctx, test_enum_passwd(tctx, &pwd, &num_pwd),
+ "failed to enumerate passwd");
+
+ for (i=0; i < num_pwd; i++) {
+@@ -531,6 +532,7 @@ static bool test_enum_group(struct tortu
+ return true;
+ }
+
++#if HAVE_GETGRENT_R
+ static bool test_enum_r_group(struct torture_context *tctx,
+ struct group **grp_array_p,
+ size_t *num_grp_p)
+@@ -579,6 +581,7 @@ static bool test_enum_r_group(struct tor
+
+ return true;
+ }
++#endif
+
+ static bool torture_assert_group_equal(struct torture_context *tctx,
+ const struct group *g1,
+@@ -635,7 +638,7 @@ static bool test_group_r(struct torture_
+ struct group *grp, grp1, grp2;
+ size_t num_grp;
+
+- torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
++ torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
+ "failed to enumerate group");
+
+ for (i=0; i < num_grp; i++) {
+@@ -663,7 +666,7 @@ static bool test_group_r_cross(struct to
+ struct group *grp, grp1, grp2, grp3, grp4;
+ size_t num_grp;
+
+- torture_assert(tctx, test_enum_r_group(tctx, &grp, &num_grp),
++ torture_assert(tctx, test_enum_group(tctx, &grp, &num_grp),
+ "failed to enumerate group");
+
+ for (i=0; i < num_grp; i++) {
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch
new file mode 100644
index 000000000..0cbacb6c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/samba-pam.patch
@@ -0,0 +1,37 @@
+Lifted from gentoo and ported to 4.4.5
+
+http://data.gpo.zugaina.org/musl/net-fs/samba/files/samba-4.2.7-pam.patch
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: samba-4.7.0/source3/wscript
+===================================================================
+--- samba-4.7.0.orig/source3/wscript
++++ samba-4.7.0/source3/wscript
+@@ -875,7 +875,7 @@ msg.msg_accrightslen = sizeof(fd);
+ if conf.env.with_iconv:
+ conf.DEFINE('HAVE_ICONV', 1)
+
+- if Options.options.with_pam:
++ if Options.options.with_pam != False:
+ use_pam=True
+ conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+ if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+@@ -952,6 +952,17 @@ int i; i = PAM_RADIO_TYPE;
+ "or headers not found. Use --without-pam to disable "
+ "PAM support.");
+
++ else:
++ Logs.warn("PAM disabled")
++ use_pam=False
++ conf.undefine('WITH_PAM')
++ conf.undefine('WITH_PAM_MODULES')
++ conf.undefine('HAVE_SECURITY_PAM_APPL_H')
++ conf.undefine('PAM_RHOST')
++ conf.undefine('PAM_TTY')
++ conf.undefine('HAVE_PAM_PAM_APPL_H')
++
++
+ seteuid = False
+
+ #
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
new file mode 100644
index 000000000..77c8b3626
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/smb_conf-4.7.0.patch
@@ -0,0 +1,19 @@
+samba: correct log files location
+
+We use /var/log/samba.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/packaging/RHEL/setup/smb.conf
++++ b/packaging/RHEL/setup/smb.conf
+@@ -63,7 +63,7 @@
+
+ # this tells Samba to use a separate log file for each machine
+ # that connects
+- log file = /usr/local/samba/var/log.%m
++ log file = /var/log/samba/log.%m
+
+ # Put a capping on the size of the log files (in Kb).
+ max log size = 50
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba
new file mode 100644
index 000000000..4bdfa7d2c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/volatiles.03_samba
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d root root 0755 /var/log/samba none
+d root root 0755 /var/run/samba none
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb
new file mode 100644
index 000000000..a8517c541
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.7.6.bb
@@ -0,0 +1,318 @@
+HOMEPAGE = "https://www.samba.org/"
+SECTION = "console/network"
+
+LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
+ file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
+
+SAMBA_MIRROR = "http://samba.org/samba/ftp"
+MIRRORS += "\
+${SAMBA_MIRROR} http://mirror.internode.on.net/pub/samba \n \
+${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
+"
+
+SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
+ file://16-do-not-check-xsltproc-manpages.patch \
+ file://20-do-not-import-target-module-while-cross-compile.patch \
+ file://21-add-config-option-without-valgrind.patch \
+ file://0001-packaging-Avoid-timeout-for-nmbd-if-started-offline-.patch \
+ file://0006-avoid-using-colon-in-the-checking-msg.patch \
+ file://netdb_defines.patch \
+ file://glibc_only.patch \
+ file://iconv-4.7.0.patch \
+ file://dnsserver-4.7.0.patch \
+ file://smb_conf-4.7.0.patch \
+ file://volatiles.03_samba \
+ "
+SRC_URI_append_libc-musl = " \
+ file://samba-pam.patch \
+ file://samba-4.3.9-remove-getpwent_r.patch \
+ "
+
+SRC_URI[md5sum] = "0253021a45c479cec1e135b004a0177a"
+SRC_URI[sha256sum] = "1eede30fc8ef6504e24602fb72b00baa0a7b73b59f16d25cb0771dc8c7c57d6e"
+
+inherit systemd waf-samba cpan-base perlnative update-rc.d
+# remove default added RDEPENDS on perl
+RDEPENDS_${PN}_remove = "perl"
+
+DEPENDS += "readline virtual/libiconv zlib popt libtalloc libtdb libtevent libldb libbsd libaio libpam"
+
+inherit distro_features_check
+REQUIRED_DISTRO_FEATURES = "pam"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+LSB = ""
+LSB_linuxstdbase = "lsb"
+
+INITSCRIPT_NAME = "samba"
+INITSCRIPT_PARAMS = "start 20 3 5 . stop 20 0 1 6 ."
+
+SYSTEMD_PACKAGES = "${PN}-base ${PN}-ad-dc winbind"
+SYSTEMD_SERVICE_${PN}-base = "nmb.service smb.service"
+SYSTEMD_SERVICE_${PN}-ad-dc = "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'samba.service', '', d)}"
+SYSTEMD_SERVICE_winbind = "winbind.service"
+
+# There are prerequisite settings to enable ad-dc, so disable the service by default.
+# Reference:
+# https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
+SYSTEMD_AUTO_ENABLE_${PN}-ad-dc = "disable"
+
+# Use krb5. Build active domain controller.
+#
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd zeroconf', d)} \
+ acl ad-dc cups gnutls ldap mitkrb5 \
+"
+
+RDEPENDS_${PN}-base += "${LSB}"
+RDEPENDS_${PN}-ctdb-tests += "bash util-linux-getopt"
+
+PACKAGECONFIG[acl] = "--with-acl-support,--without-acl-support,acl"
+PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
+PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
+PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
+PACKAGECONFIG[sasl] = ",,cyrus-sasl"
+PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
+PACKAGECONFIG[dmapi] = "--with-dmapi,--without-dmapi,dmapi"
+PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[valgrind] = ",--without-valgrind,valgrind,"
+PACKAGECONFIG[lttng] = "--with-lttng, --without-lttng,lttng-ust"
+PACKAGECONFIG[archive] = "--with-libarchive, --without-libarchive, libarchive"
+
+# Building the AD (Active Directory) DC (Domain Controller) requires GnuTLS,
+# And ad-dc doesn't work with mitkrb5 for versions prior to 4.7.0 according to:
+# http://samba.2283325.n4.nabble.com/samba-4-6-6-Unknown-dependency-kdc-in-service-kdc-objlist-td4722096.html
+# So the working combination is:
+# 1) ad-dc: enable, gnutls: enable, mitkrb5: disable
+# 2) ad-dc: disable, gnutls: enable/disable, mitkrb5: enable
+#
+# We are now at 4.7.0, so take the above with a grain of salt. We do not need to know where
+# krb5kdc is unless ad-dc is enabled, but we tell configure anyhow.
+#
+PACKAGECONFIG[ad-dc] = ",--without-ad-dc,,"
+PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls,"
+PACKAGECONFIG[mitkrb5] = "--with-system-mitkrb5 --with-system-mitkdc=/usr/sbin/krb5kdc,,krb5,"
+
+SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
+SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
+SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
+SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
+
+# These libraries are supposed to replace others supplied by packages, but decorate the names of
+# .so files so there will not be a conflict. This is not done consistantly, so be very careful
+# when adding to this list.
+#
+SAMBA4_LIBS="heimdal,cmocka,NONE"
+
+EXTRA_OECONF += "--enable-fhs \
+ --with-piddir=/run \
+ --with-sockets-dir=/run/samba \
+ --with-modulesdir=${libdir}/samba \
+ --with-lockdir=${localstatedir}/lib/samba \
+ --with-cachedir=${localstatedir}/lib/samba \
+ --disable-rpath-install \
+ --with-shared-modules=${SAMBA4_MODULES} \
+ --bundled-libraries=${SAMBA4_LIBS} \
+ ${@oe.utils.conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
+ --with-cluster-support \
+ --with-profiling-data \
+ --with-libiconv=${STAGING_DIR_HOST}${prefix} \
+ --with-pam --with-pammodulesdir=${base_libdir}/security \
+ "
+
+LDFLAGS += "-Wl,-z,relro,-z,now ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', ' -fuse-ld=bfd ', '', d)}"
+
+do_install_append() {
+ for section in 1 5 7; do
+ install -d ${D}${mandir}/man$section
+ install -m 0644 ctdb/doc/*.$section ${D}${mandir}/man$section
+ done
+ for section in 1 5 7 8; do
+ install -d ${D}${mandir}/man$section
+ install -m 0644 docs/manpages/*.$section ${D}${mandir}/man$section
+ done
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 packaging/systemd/*.service ${D}${systemd_system_unitdir}
+ sed -e 's,\(ExecReload=\).*\(/kill\),\1${base_bindir}\2,' \
+ -e 's,/etc/sysconfig/samba,${sysconfdir}/default/samba,' \
+ -i ${D}${systemd_system_unitdir}/*.service
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'ad-dc', 'yes', 'no', d)}" = "no" ]; then
+ rm -f ${D}${systemd_system_unitdir}/samba.service
+ fi
+
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m644 packaging/systemd/samba.conf.tmp ${D}${sysconfdir}/tmpfiles.d/samba.conf
+ echo "d ${localstatedir}/log/samba 0755 root root -" \
+ >> ${D}${sysconfdir}/tmpfiles.d/samba.conf
+ if [ "${LSB}" = "lsb" ]; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 packaging/LSB/samba.sh ${D}${sysconfdir}/init.d/samba
+ else
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba
+ sed -e 's,/opt/samba/bin,${sbindir},g' \
+ -e 's,/opt/samba/smb.conf,${sysconfdir}/samba/smb.conf,g' \
+ -e 's,/opt/samba/log,${localstatedir}/log/samba,g' \
+ -e 's,/etc/init.d/samba.server,${sysconfdir}/init.d/samba,g' \
+ -e 's,/usr/bin,${base_bindir},g' \
+ -i ${D}${sysconfdir}/init.d/samba
+ fi
+
+ install -d ${D}${sysconfdir}/samba
+ echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
+ install -m644 packaging/RHEL/setup/smb.conf ${D}${sysconfdir}/samba/smb.conf
+ install -D -m 644 ${WORKDIR}/volatiles.03_samba ${D}${sysconfdir}/default/volatiles/03_samba
+
+ install -d ${D}${sysconfdir}/default
+ install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/default/samba
+
+ # install ctdb config file and test cases
+ install -D -m 0644 ${S}/ctdb/tests/onnode/nodes ${D}${sysconfdir}/ctdb/nodes
+ # the items are from ctdb/tests/run_tests.sh
+ for d in onnode takeover tool eventscripts cunit simple complex; do
+ testdir=${D}${datadir}/ctdb-tests/$d
+ install -d $testdir
+ cp ${S}/ctdb/tests/$d/*.sh $testdir
+ cp -r ${S}/ctdb/tests/$d/scripts ${S}/ctdb/tests/$d/stubs $testdir || true
+ done
+
+ # fix file-rdeps qa warning
+ if [ -f ${D}${bindir}/onnode ]; then
+ sed -i 's:\(#!/bin/\)bash:\1sh:' ${D}${bindir}/onnode
+ fi
+
+ chmod 0750 ${D}${sysconfdir}/sudoers.d
+ rm -rf ${D}/run ${D}${localstatedir}/run ${D}${localstatedir}/log
+}
+
+PACKAGES =+ "${PN}-python ${PN}-pidl \
+ ${PN}-dsdb-modules ${PN}-testsuite registry-tools \
+ winbind \
+ ${PN}-common ${PN}-base ${PN}-ad-dc ${PN}-ctdb-tests \
+ smbclient ${PN}-client ${PN}-server ${PN}-test"
+
+python samba_populate_packages() {
+ def module_hook(file, pkg, pattern, format, basename):
+ pn = d.getVar('PN', True)
+ d.appendVar('RRECOMMENDS_%s-base' % pn, ' %s' % pkg)
+
+ mlprefix = d.getVar('MLPREFIX', True) or ''
+ pam_libdir = d.expand('${base_libdir}/security')
+ pam_pkgname = mlprefix + 'pam-plugin%s'
+ do_split_packages(d, pam_libdir, '^pam_(.*)\.so$', pam_pkgname, 'PAM plugin for %s', extra_depends='', prepend=True)
+
+ libdir = d.getVar('libdir', True)
+ do_split_packages(d, libdir, '^lib(.*)\.so\..*$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True, allow_links=True)
+ pkglibdir = '%s/samba' % libdir
+ do_split_packages(d, pkglibdir, '^lib(.*)\.so$', 'lib%s', 'Samba %s library', extra_depends='${PN}-common', prepend=True)
+ moduledir = '%s/samba/auth' % libdir
+ do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-auth-%s', 'Samba %s authentication backend', hook=module_hook, extra_depends='', prepend=True)
+ moduledir = '%s/samba/pdb' % libdir
+ do_split_packages(d, moduledir, '^(.*)\.so$', 'samba-pdb-%s', 'Samba %s password backend', hook=module_hook, extra_depends='', prepend=True)
+}
+
+PACKAGESPLITFUNCS_prepend = "samba_populate_packages "
+
+RDEPENDS_${PN} += "${PN}-base ${PN}-python ${PN}-dsdb-modules"
+RDEPENDS_${PN}-python += "pytalloc python-tdb"
+
+FILES_${PN}-base = "${sbindir}/nmbd \
+ ${sbindir}/smbd \
+ ${sysconfdir}/init.d \
+ ${localstatedir}/lib/samba \
+ ${localstatedir}/nmbd \
+ ${localstatedir}/spool/samba \
+ ${systemd_system_unitdir}/nmb.service \
+ ${systemd_system_unitdir}/smb.service"
+
+FILES_${PN}-ad-dc = "${sbindir}/samba \
+ ${systemd_system_unitdir}/samba.service \
+ ${libdir}/krb5/plugins/kdb/samba.so \
+ "
+RDEPENDS_${PN}-ad-dc = "krb5-kdc"
+
+FILES_${PN}-ctdb-tests = "${bindir}/ctdb_run_tests \
+ ${bindir}/ctdb_run_cluster_tests \
+ ${sysconfdir}/ctdb/nodes \
+ ${datadir}/ctdb-tests \
+ ${datadir}/ctdb/tests \
+ "
+
+FILES_${BPN}-common = "${sysconfdir}/default \
+ ${sysconfdir}/samba \
+ ${sysconfdir}/tmpfiles.d \
+"
+
+FILES_${PN} += "${libdir}/vfs/*.so \
+ ${libdir}/charset/*.so \
+ ${libdir}/*.dat \
+ ${libdir}/auth/*.so \
+"
+
+FILES_${PN}-dsdb-modules = "${libdir}/samba/ldb"
+
+FILES_${PN}-testsuite = "${bindir}/gentest \
+ ${bindir}/locktest \
+ ${bindir}/masktest \
+ ${bindir}/ndrdump \
+ ${bindir}/smbtorture"
+
+FILES_registry-tools = "${bindir}/regdiff \
+ ${bindir}/regpatch \
+ ${bindir}/regshell \
+ ${bindir}/regtree"
+
+FILES_winbind = "${sbindir}/winbindd \
+ ${bindir}/wbinfo \
+ ${bindir}/ntlm_auth \
+ ${libdir}/samba/idmap \
+ ${libdir}/samba/nss_info \
+ ${libdir}/winbind_krb5_locator.so \
+ ${sysconfdir}/init.d/winbind \
+ ${systemd_system_unitdir}/winbind.service"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+FILES_smbclient = "${bindir}/cifsdd \
+ ${bindir}/rpcclient \
+ ${bindir}/smbcacls \
+ ${bindir}/smbclient \
+ ${bindir}/smbcquotas \
+ ${bindir}/smbget \
+ ${bindir}/smbspool \
+ ${bindir}/smbtar \
+ ${bindir}/smbtree \
+ ${libdir}/samba/smbspool_krb5_wrapper"
+
+RDEPENDS_${PN}-pidl_append = " perl"
+FILES_${PN}-pidl = "${bindir}/pidl ${datadir}/perl5/Parse"
+
+RDEPENDS_${PN}-client = "\
+ smbclient \
+ winbind \
+ registry-tools \
+ ${PN}-pidl \
+ "
+
+ALLOW_EMPTY_${PN}-client = "1"
+
+RDEPENDS_${PN}-server = "\
+ ${PN} \
+ winbind \
+ registry-tools \
+ "
+
+ALLOW_EMPTY_${PN}-server = "1"
+
+RDEPENDS_${PN}-test = "\
+ ${PN}-ctdb-tests \
+ ${PN}-testsuite \
+ "
+
+ALLOW_EMPTY_${PN}-test = "1"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch b/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch
new file mode 100644
index 000000000..f25a02cd8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/files/sethdlc-fix-host-contamination.patch
@@ -0,0 +1,42 @@
+From 9a9137c3df5309ac359737d6ebd67fb4ff5f3cf2 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 24 Nov 2014 22:05:18 -0500
+Subject: [PATCH] sethdlc: fix host contamination
+
+Clean INCLUDES to fix the host contamination errors:
+
+ In file included from /usr/src/linux/include/linux/posix_types.h:47:0,
+ from /usr/src/linux/include/linux/types.h:17,
+ from /usr/src/linux/include/linux/if.h:22,
+ from sethdlc.c:23:
+ /usr/src/linux/include/asm-generic/posix_types.h:91:3: \
+ error: conflicting types for '__kernel_fsid_t'
+ } __kernel_fsid_t;
+ ^
+ .../tmp/sysroots/qemumips/usr/include/asm/posix_types.h:26:3: \
+ note: previous declaration of '__kernel_fsid_t' was here
+ } __kernel_fsid_t;
+ ^
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0492f2b..97dec22 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,6 +1,6 @@
+ CC = gcc
+ CFLAGS = -O2 -Wall -W -Wno-long-long -pipe
+-INCLUDES = -I/usr/src/linux/include -I/usr/src/linux-2.6/include
++INCLUDES =
+
+ all: sethdlc
+
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb b/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb
new file mode 100644
index 000000000..fc304fae7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb
@@ -0,0 +1,33 @@
+DESCRIPTION = "set Linux HDLC packet radio modem driver port information"
+HOMEPAGE = "https://www.kernel.org/pub/linux/utils/net/hdlc"
+SECTION = "comm"
+LICENSE = "GPLv2 & GPLv2+ "
+LIC_FILES_CHKSUM = "file://sethdlc.c;endline=10;md5=90f936879e9f8b755a138aeb348782eb"
+
+
+SRC_URI = "https://www.kernel.org/pub/linux/utils/net/hdlc/${BPN}-1.18.tar.gz \
+ file://sethdlc-fix-host-contamination.patch \
+"
+SRC_URI[md5sum] = "9016878156a5eadb06c0bae71cc5c9ab"
+SRC_URI[sha256sum] = "21b1e2e1cb0e288b0ec8fcfd9fed449914e0f8e6fc273706bd5b3d4f6ab6b04e"
+
+
+S = "${WORKDIR}/${BPN}-1.18"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+DEPENDS = "virtual/kernel"
+
+EXTRA_OEMAKE="CROSS_COMPILE=${TARGET_PREFIX} CC='${CC} ${LDFLAGS}' \
+ KERNEL_DIR=${STAGING_KERNEL_DIR} "
+
+do_compile_prepend () {
+ oe_runmake clean
+}
+
+
+do_install() {
+ install -d ${D}/${bindir}
+ install sethdlc ${D}/${bindir}/
+}
+
+FILES_${PN} += "${bindir}/sethdlc"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-fix-do_package-failed-since-snort-2.9.7.0.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-fix-do_package-failed-since-snort-2.9.7.0.patch
new file mode 100644
index 000000000..047caec32
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-fix-do_package-failed-since-snort-2.9.7.0.patch
@@ -0,0 +1,33 @@
+From 4335c4c61877c0b65ff4ec767e8ad3ad8c73c32d Mon Sep 17 00:00:00 2001
+From: Zhiquan Li <zhiquan.li@windriver.com>
+Date: Fri, 13 Nov 2015 17:40:24 +0800
+Subject: [PATCH] fix do_package failed since snort 2.9.7.0
+
+Remove redundant '/' as a workround for below error:
+/lib/rpm/bin/debugedit: canonicalization unexpectedly shrank by one character
+
+It's a rpm debugedit bug:
+* http://sourceforge.net/p/snort/mailman/message/34130268/
+* https://bugzilla.redhat.com/show_bug.cgi?id=304121
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Zhiquan Li <zhiquan.li@windriver.com>
+
+---
+ src/snort.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/snort.h b/src/snort.h
+index 8308e57..499d157 100644
+--- a/src/snort.h
++++ b/src/snort.h
+@@ -39,7 +39,7 @@
+ #include "sfdaq.h"
+ #include "sf_types.h"
+ #include "sfutil/sflsq.h"
+-#include "sfutil//sfActionQueue.h"
++#include "sfutil/sfActionQueue.h"
+ #include "profiler.h"
+ #include "rules.h"
+ #include "treenodes.h"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch
new file mode 100644
index 000000000..2e28cd048
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/0001-libpcap-search-sysroot-for-headers.patch
@@ -0,0 +1,29 @@
+From 5875dea90f71350b7205788fbc67e3759077cefe Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe@deserted.net>
+Date: Wed, 20 Nov 2013 16:06:07 -0500
+Subject: [PATCH] libpcap: search sysroot for headers
+
+Configure hard-coded host header paths when building with libpcap. Point
+the search path at the sysroot instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe MacDonald <joe@deserted.net>
+
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 62573a8..fded45b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -69,7 +69,7 @@ case "$host" in
+ linux="yes"
+ AC_DEFINE([LINUX],[1],[Define if Linux])
+ AC_SUBST(extra_incl)
+- extra_incl="-I/usr/include/pcap"
++ extra_incl="-I=/usr/include/pcap"
+ ;;
+ *-hpux10*|*-hpux11*)
+ AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11])
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch
new file mode 100644
index 000000000..6aa0b736f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-dap-address-space-id.patch
@@ -0,0 +1,62 @@
+From 5a53260a819e2873f58165e96852529719101c53 Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <B40290@freescale.com>
+Date: Mon, 4 Nov 2013 10:39:56 +0800
+Subject: [PATCH] snort: add recipe
+
+Upstream-Status:Inappropriate [embedded specific]
+
+fix the below error:
+checking for dap address space id... configure:
+configure: error: cannot run test program while cross compiling
+
+Signed-off-by: Chunrong Guo <B40290@freescale.com>
+
+---
+ configure.in | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 6fe5d68..e7636ce 100644
+--- a/configure.in
++++ b/configure.in
+@@ -698,23 +698,23 @@ if test "x$ac_cv_func_daq_dp_add_dc" = "xyes"; then
+
+ fi
+
+-AC_MSG_CHECKING([for daq address space ID])
+-AC_RUN_IFELSE(
+-[AC_LANG_PROGRAM(
+-[[
+-#include <daq.h>
+-]],
+-[[
+- DAQ_PktHdr_t hdr;
+- hdr.address_space_id = 0;
+-]])],
+-[have_daq_address_space_id="yes"],
+-[have_daq_address_space_id="no"])
+-AC_MSG_RESULT($have_daq_address_space_id)
+-if test "x$have_daq_address_space_id" = "xyes"; then
+- AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1],
+- [DAQ version supports address space ID in header.])
+-fi
++#AC_MSG_CHECKING([for daq address space ID])
++#AC_RUN_IFELSE(
++#[AC_LANG_PROGRAM(
++#[[
++##include <daq.h>
++#]],
++#[[
++# DAQ_PktHdr_t hdr;
++# hdr.address_space_id = 0;
++#]])],
++have_daq_address_space_id="yes"
++#[have_daq_address_space_id="no"])
++#AC_MSG_RESULT($have_daq_address_space_id)
++#if test "x$have_daq_address_space_id" = "xyes"; then
++# AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1],
++# [DAQ version supports address space ID in header.])
++#fi
+
+ AC_MSG_CHECKING([for daq flow ID])
+ AC_RUN_IFELSE(
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-flow-id.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-flow-id.patch
new file mode 100644
index 000000000..04df37c94
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-flow-id.patch
@@ -0,0 +1,60 @@
+From 5aa42a3137c657b5eddd4608343aa1854bd7cd27 Mon Sep 17 00:00:00 2001
+From: Zhiquan Li <zhiquan.li@windriver.com>
+Date: Mon, 16 Nov 2015 10:23:00 +0800
+Subject: [PATCH] snort: 2.9.6.0 -> 2.9.7.5
+
+Upstream-Status:Inappropriate [embedded specific]
+
+fix the below error:
+checking for daq flow ID... configure:
+configure: error: cannot run test program while cross compiling
+
+---
+ configure.in | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index e7636ce..2fbd298 100644
+--- a/configure.in
++++ b/configure.in
+@@ -716,23 +716,23 @@ have_daq_address_space_id="yes"
+ # [DAQ version supports address space ID in header.])
+ #fi
+
+-AC_MSG_CHECKING([for daq flow ID])
+-AC_RUN_IFELSE(
+-[AC_LANG_PROGRAM(
+-[[
+-#include <daq.h>
+-]],
+-[[
+- DAQ_PktHdr_t hdr;
+- hdr.flow_id = 0;
+-]])],
+-[have_daq_flow_id="yes"],
+-[have_daq_flow_id="no"])
+-AC_MSG_RESULT($have_daq_flow_id)
+-if test "x$have_daq_flow_id" = "xyes"; then
+- AC_DEFINE([HAVE_DAQ_FLOW_ID],[1],
+- [DAQ version supports flow ID in header.])
+-fi
++#AC_MSG_CHECKING([for daq flow ID])
++#AC_RUN_IFELSE(
++#[AC_LANG_PROGRAM(
++#[[
++##include <daq.h>
++#]],
++#[[
++# DAQ_PktHdr_t hdr;
++# hdr.flow_id = 0;
++#]])],
++have_daq_flow_id="yes"
++#[have_daq_flow_id="no"])
++#AC_MSG_RESULT($have_daq_flow_id)
++#if test "x$have_daq_flow_id" = "xyes"; then
++# AC_DEFINE([HAVE_DAQ_FLOW_ID],[1],
++# [DAQ version supports flow ID in header.])
++#fi
+
+ AC_MSG_CHECKING([for DAQ_VERDICT_RETRY])
+ AC_RUN_IFELSE(
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-verdict-retry.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-verdict-retry.patch
new file mode 100644
index 000000000..15958a72d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-daq-verdict-retry.patch
@@ -0,0 +1,60 @@
+From b916443d43f2e1eeacfbed0033274a0270ef634d Mon Sep 17 00:00:00 2001
+From: Zhiquan Li <zhiquan.li@windriver.com>
+Date: Mon, 16 Nov 2015 10:23:00 +0800
+Subject: [PATCH] snort: 2.9.6.0 -> 2.9.7.5
+
+Upstream-Status:Inappropriate [embedded specific]
+
+fix the below error:
+checking for DAQ_VERDICT_RETRY... configure:
+configure: error: cannot run test program while cross compiling
+
+---
+ configure.in | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 2fbd298..62573a8 100644
+--- a/configure.in
++++ b/configure.in
+@@ -734,23 +734,23 @@ have_daq_flow_id="yes"
+ # [DAQ version supports flow ID in header.])
+ #fi
+
+-AC_MSG_CHECKING([for DAQ_VERDICT_RETRY])
+-AC_RUN_IFELSE(
+-[AC_LANG_PROGRAM(
+-[[
+-#include <daq.h>
+-]],
+-[[
+- DAQ_Verdict verdict;
+- verdict = DAQ_VERDICT_RETRY;
+-]])],
+-[have_daq_verdict_retry="yes"],
+-[have_daq_verdict_retry="no"])
+-AC_MSG_RESULT($have_daq_verdict_retry)
+-if test "x$have_daq_verdict_retry" = "xyes"; then
+- AC_DEFINE([HAVE_DAQ_VERDICT_RETRY],[1],
+- [DAQ version supports DAQ_VERDICT_RETRY in DAQ_Verdict.])
+-fi
++#AC_MSG_CHECKING([for DAQ_VERDICT_RETRY])
++#AC_RUN_IFELSE(
++#[AC_LANG_PROGRAM(
++#[[
++##include <daq.h>
++#]],
++#[[
++# DAQ_Verdict verdict;
++# verdict = DAQ_VERDICT_RETRY;
++#]])],
++have_daq_verdict_retry="yes"
++#[have_daq_verdict_retry="no"])
++#AC_MSG_RESULT($have_daq_verdict_retry)
++#if test "x$have_daq_verdict_retry" = "xyes"; then
++# AC_DEFINE([HAVE_DAQ_VERDICT_RETRY],[1],
++# [DAQ version supports DAQ_VERDICT_RETRY in DAQ_Verdict.])
++#fi
+
+ # any sparc platform has to have this one defined.
+ AC_MSG_CHECKING(for sparc)
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch
new file mode 100644
index 000000000..79e9f076b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/disable-inaddr-none.patch
@@ -0,0 +1,85 @@
+From a1fdbced4166cb0f35d23b63a59312d86860485a Mon Sep 17 00:00:00 2001
+From: Chunrong Guo <B40290@freescale.com>
+Date: Mon, 4 Nov 2013 10:39:56 +0800
+Subject: [PATCH] snort: add recipe
+
+Upstream-Status: Inappropriate [embedded specific]
+
+fix the below error:
+checking for INADDR_NONE... configure:
+configure: error: cannot run test program while cross compiling
+
+Signed-off-by: Chunrong Guo <B40290@freescale.com>
+
+---
+ configure.in | 50 ++++++++++++++++----------------------------------
+ 1 file changed, 16 insertions(+), 34 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 20d15eb..6fe5d68 100644
+--- a/configure.in
++++ b/configure.in
+@@ -274,25 +274,7 @@ AC_CHECK_TYPES([int8_t,int16_t,int32_t,int64_t])
+ AC_CHECK_TYPES([boolean])
+
+ # In case INADDR_NONE is not defined (like on Solaris)
+-have_inaddr_none="no"
+-AC_MSG_CHECKING([for INADDR_NONE])
+-AC_RUN_IFELSE(
+-[AC_LANG_PROGRAM(
+-[[
+-#include <sys/types.h>
+-#include <netinet/in.h>
+-#include <arpa/inet.h>
+-]],
+-[[
+- if (inet_addr("10,5,2") == INADDR_NONE);
+- return 0;
+-]])],
+-[have_inaddr_none="yes"],
+-[have_inaddr_none="no"])
+-AC_MSG_RESULT($have_inaddr_none)
+-if test "x$have_inaddr_none" = "xno"; then
+- AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition])
+-fi
++have_inaddr_none="yes"
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdio.h>
+@@ -421,21 +403,21 @@ if test "x$LPCAP" = "xno"; then
+ fi
+ fi
+
+-AC_MSG_CHECKING([for pcap_lex_destroy])
+-AC_RUN_IFELSE(
+-[AC_LANG_PROGRAM(
+-[[
+-#include <pcap.h>
+-]],
+-[[
+- pcap_lex_destroy();
+-]])],
+-[have_pcap_lex_destroy="yes"],
+-[have_pcap_lex_destroy="no"])
+-AC_MSG_RESULT($have_pcap_lex_destroy)
+-if test "x$have_pcap_lex_destroy" = "xyes"; then
+- AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter])
+-fi
++#AC_MSG_CHECKING([for pcap_lex_destroy])
++#AC_RUN_IFELSE(
++#[AC_LANG_PROGRAM(
++#[[
++##include <pcap.h>
++#]],
++#[[
++# pcap_lex_destroy();
++#]])],
++have_pcap_lex_destroy="yes"
++#[have_pcap_lex_destroy="no"])
++#AC_MSG_RESULT($have_pcap_lex_destroy)
++#if test "x$have_pcap_lex_destroy" = "xyes"; then
++# AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter])
++#fi
+
+ AC_MSG_CHECKING([for pcap_lib_version])
+ AC_LINK_IFELSE(
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch
new file mode 100644
index 000000000..0404ea0fa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch
@@ -0,0 +1,30 @@
+From f46d096015d7402a37a59eb66b8f6b7fbf0cdff0 Mon Sep 17 00:00:00 2001
+From: Kai Kang <kai.kang@windriver.com>
+Date: Wed, 24 May 2017 17:38:53 +0800
+Subject: [PATCH] snort: enable static daq
+
+Upstream-Status: Inappropriate [embedded specific]
+
+When enable static daq for snort, it calls to daq-modules-config to get link
+library and library path. Library path is useless for oe and cause host
+contamination issue. So filter it.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index fded45b..a247bb9 100644
+--- a/configure.in
++++ b/configure.in
+@@ -658,7 +658,7 @@ fi
+
+ if test "x$enable_static_daq" = "xyes"; then
+ LDAQ=""
+- LIBS="${LIBS} `daq-modules-config --static --libs`"
++ LIBS="${LIBS} `daq-modules-config --static --libs | sed 's#-L[^ ]*##g'`"
+ AC_CHECK_LIB([daq_static], [daq_load_modules],
+ [LIBS="-ldaq_static ${LIBS}"], [LDAQ="no"], [ ])
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init
new file mode 100644
index 000000000..d8a00c43f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/snort.init
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# Snort Startup Script modified for OpenEmbedded
+#
+
+# Script variables
+
+LAN_INTERFACE="$2"
+RETURN_VAL=0
+BINARY=/usr/bin/snort
+PATH=/bin:/usr/bin
+PID=/var/run/snort_${LAN_INTERFACE}_ids.pid
+DEL_PID=$PID
+LOGDIR="/var/log/snort"
+DATE=`/bin/date +%Y%m%d`
+CONFIG_FILE=/etc/snort/snort.conf
+PROG=snort
+USER=root
+GROUP=root
+
+if [ ! -x "$BINARY" ]; then
+ echo "ERROR: $BINARY not found."
+ exit 1
+fi
+
+if [ ! -r "$CONFIG_FILE" ]; then
+ echo "ERROR: $CONFIG_FILE not found."
+ exit 1
+fi
+
+start()
+{
+
+ [ -n "$LAN_INTERFACE" ] || return 0
+ # Check if log diratory is present. Otherwise, create it.
+ if [ ! -d $LOGDIR/$DATE ]; then
+ mkdir -d $LOGDIR/$DATE
+ /bin/chown -R $USER:$USER $LOGDIR/$DATE
+ /bin/chmod -R 700 $LOGDIR/$DATE
+ fi
+
+ /bin/echo "Starting $PROG: "
+ # Snort parameters
+ # -D Run Snort in background (daemon) mode
+ # -i <if> Listen on interface <if>
+ # -u <uname> Run snort uid as <uname> user (or uid)
+ # -g <gname> Run snort uid as <gname> group (or gid)
+ # -c Load configuration file
+ # -N Turn off logging (alerts still work) (removed to enable logging) :)
+ # -l Log to directory
+ # -t Chroots process to directory after initialization
+ # -R <id> Include 'id' in snort_intf<id>.pid file name
+
+ $BINARY -D -i $LAN_INTERFACE -u $USER -g $GROUP -c $CONFIG_FILE -l $LOGDIR/$DATE -t $LOGDIR/$DATE -R _ids
+ /bin/echo "$PROG startup complete."
+ return $RETURN_VAL
+}
+
+stop()
+{
+ if [ -s $PID ]; then
+ /bin/echo "Stopping $PROG with PID `cat $PID`: "
+ kill -TERM `cat $PID` 2>/dev/null
+ RETURN_VAL=$?
+ /bin/echo "$PROG shutdown complete."
+ [ -e $DEL_PID ] && rm -f $DEL_PID
+ [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck
+ else
+ /bin/echo "ERROR: PID in $PID file not found."
+ RETURN_VAL=1
+ fi
+ return $RETURN_VAL
+}
+
+status() {
+ if [ -s $PID ]; then
+ echo "$PROG is running as pid `cat $PID`:"
+ else
+ echo "$PROG is not running."
+ fi
+}
+
+restart()
+{
+ stop
+ start
+ RETURN_VAL=$?
+ return $RETURN_VAL
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ status)
+ status
+ ;;
+ restart|reload)
+ restart
+ ;;
+ *)
+ /bin/echo "Usage: $0 {start|stop|status|restart|reload}"
+ RETURN_VAL=1
+esac
+
+exit $RETURN_VAL
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
new file mode 100644
index 000000000..2034b85fb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
@@ -0,0 +1,105 @@
+DESCRIPTION = "snort - a free lightweight network intrusion detection system for UNIX and Windows."
+HOMEPAGE = "http://www.snort.org/"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"
+
+DEPENDS = "xz libpcap libpcre daq libdnet util-linux daq-native"
+DEPENDS_append_libc-musl = " libtirpc"
+
+SRC_URI = " ${GENTOO_MIRROR}/${BP}.tar.gz;name=tarball \
+ file://snort.init \
+ file://disable-inaddr-none.patch \
+ file://disable-dap-address-space-id.patch \
+ file://disable-daq-flow-id.patch \
+ file://disable-daq-verdict-retry.patch \
+ file://0001-libpcap-search-sysroot-for-headers.patch \
+ file://0001-fix-do_package-failed-since-snort-2.9.7.0.patch \
+ file://fix-host-contamination-when-enable-static-daq.patch \
+"
+
+SRC_URI[tarball.md5sum] = "fd271788c0f8876be87a858a9142f202"
+SRC_URI[tarball.sha256sum] = "ad03f11b5301b16642199a86aa90388eaa53f5003f83b0c5595745a490047be1"
+
+inherit autotools gettext update-rc.d pkgconfig
+
+INITSCRIPT_NAME = "snort"
+INITSCRIPT_PARAMS = "defaults"
+
+EXTRA_OECONF = " \
+ --enable-gre \
+ --enable-linux-smp-stats \
+ --enable-reload \
+ --enable-reload-error-restart \
+ --enable-targetbased \
+ --enable-static-daq \
+ --with-dnet-includes=${STAGING_INCDIR} \
+ --with-dnet-libraries=${STAGING_LIBDIR} \
+ --with-libpcre-includes=${STAGING_INCDIR} \
+ --with-libpcre-libraries=${STAGING_LIBDIR} \
+ --with-daq-includes=${STAGING_INCDIR} \
+ --with-daq-libraries=${STAGING_LIBDIR} \
+"
+
+# if you want to disable it, you need to patch configure.in first
+# AC_CHECK_HEADERS([openssl/sha.h],, SHA_H="no")
+# is called even with --without-openssl-includes
+PACKAGECONFIG ?= "openssl lzma"
+PACKAGECONFIG[openssl] = "--with-openssl-includes=${STAGING_INCDIR} --with-openssl-libraries=${STAGING_LIBDIR}, --without-openssl-includes --without-openssl-libraries, openssl,"
+PACKAGECONFIG[lzma] = "--with-lzma-includes=${STAGING_INCDIR} --with-lzma-libraries=${STAGING_LIBDIR}, --without-lzma-includes --without-lzma-libraries, xz,"
+
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/snort/rules
+ install -d ${D}${sysconfdir}/snort/preproc_rules
+ install -d ${D}${sysconfdir}/init.d
+ for i in map config conf dtd; do
+ cp ${S}/etc/*.$i ${D}${sysconfdir}/snort/
+ done
+
+ # fix the hardcoded path and lib name
+ # comment out the rules that are not provided
+ sed -i -e 's#/usr/local/lib#${libdir}#' \
+ -e 's#\.\./\(.*rules\)#${sysconfdir}/snort/\1#' \
+ -e 's#\(libsf_engine.so\)#\1.0#' \
+ -e 's/^\(include $RULE_PATH\)/#\1/' \
+ -e 's/^\(dynamicdetection\)/#\1/' \
+ -e '/preprocessor reputation/,/blacklist/ s/^/#/' \
+ ${D}${sysconfdir}/snort/snort.conf
+
+ cp ${S}/preproc_rules/*.rules ${D}${sysconfdir}/snort/preproc_rules/
+ install -m 755 ${WORKDIR}/snort.init ${D}${sysconfdir}/init.d/snort
+ mkdir -p ${D}${localstatedir}/log/snort
+ install -d ${D}/var/log/snort
+
+ sed -i 's/-fdebug-prefix-map[^ ]*//g; s#${STAGING_DIR_TARGET}##g' ${D}${libdir}/pkgconfig/*.pc
+}
+
+FILES_${PN} += " \
+ ${libdir}/snort_dynamicengine/*.so.* \
+ ${libdir}/snort_dynamicpreprocessor/*.so.* \
+ ${libdir}/snort_dynamicrules/*.so.* \
+"
+FILES_${PN}-dbg += " \
+ ${libdir}/snort_dynamicengine/.debug \
+ ${libdir}/snort_dynamicpreprocessor/.debug \
+ ${libdir}/snort_dynamicrules/.debug \
+"
+FILES_${PN}-staticdev += " \
+ ${libdir}/snort_dynamicengine/*.a \
+ ${libdir}/snort_dynamicpreprocessor/*.a \
+ ${libdir}/snort_dynamicrules/*.a \
+ ${libdir}/snort/dynamic_preproc/*.a \
+ ${libdir}/snort/dynamic_output/*.a \
+"
+FILES_${PN}-dev += " \
+ ${libdir}/snort_dynamicengine/*.la \
+ ${libdir}/snort_dynamicpreprocessor/*.la \
+ ${libdir}/snort_dynamicrules/*.la \
+ ${libdir}/snort_dynamicengine/*.so \
+ ${libdir}/snort_dynamicpreprocessor/*.so \
+ ${libdir}/snort_dynamicrules/*.so \
+ ${prefix}/src/snort_dynamicsrc \
+"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0001-optimize-boot.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0001-optimize-boot.patch
new file mode 100644
index 000000000..a1e56b7ca
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0001-optimize-boot.patch
@@ -0,0 +1,25 @@
+Author: Jamie Strandboge <jamie@canonical.com>
+Description: to improve boot speed when disabled, don't source all of
+ ufw-init-functions (which also sources in other files).
+
+Upstream-Status: Inappropriate [ not author ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+Index: ufw-0.31/src/ufw-init
+===================================================================
+--- ufw-0.31.orig/src/ufw-init 2012-03-09 17:07:11.000000000 -0600
++++ ufw-0.31/src/ufw-init 2012-03-17 09:37:51.000000000 -0500
+@@ -18,6 +18,12 @@
+ #
+ set -e
+
++# Debian/Ubuntu: small boot speed improvement
++. "#CONFIG_PREFIX#/ufw/ufw.conf"
++if [ "$1" = "start" ] && [ "$2" = "quiet" ] && [ "$ENABLED" = "no" ]; then
++ exit 0
++fi
++
+ if [ -s "#STATE_PREFIX#/ufw-init-functions" ]; then
+ . "#STATE_PREFIX#/ufw-init-functions"
+ else
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0002-lp1044361.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0002-lp1044361.patch
new file mode 100644
index 000000000..804c18bc9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0002-lp1044361.patch
@@ -0,0 +1,118 @@
+Origin: r795, r796
+Description: move netfilter capabilities checking into initcaps(), and call
+ initcaps() only when we need it.
+Bug-Ubuntu: https://launchpad.net/bugs/1044361
+
+Upstream-Status: Inappropriate [ not author ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+Index: ufw-0.33/src/backend_iptables.py
+===================================================================
+--- ufw-0.33.orig/src/backend_iptables.py 2012-09-23 09:58:34.000000000 -0500
++++ ufw-0.33/src/backend_iptables.py 2012-09-23 09:58:36.000000000 -0500
+@@ -160,6 +160,9 @@
+ out += "> " + _("Checking raw ip6tables\n")
+ return out
+
++ # Initialize the capabilities database
++ self.initcaps()
++
+ args = ['-n', '-v', '-x', '-L']
+ items = []
+ items6 = []
+@@ -470,6 +473,9 @@
+ if self.dryrun:
+ return False
+
++ # Initialize the capabilities database
++ self.initcaps()
++
+ prefix = "ufw"
+ exe = self.iptables
+ if v6:
+@@ -684,6 +690,9 @@
+ except Exception:
+ raise
+
++ # Initialize the capabilities database
++ self.initcaps()
++
+ chain_prefix = "ufw"
+ rules = self.rules
+ if v6:
+@@ -830,6 +839,10 @@
+ * updating user rules file
+ * reloading the user rules file if rule is modified
+ '''
++
++ # Initialize the capabilities database
++ self.initcaps()
++
+ rstr = ""
+
+ if rule.v6:
+@@ -1073,6 +1086,9 @@
+ if self.dryrun:
+ return
+
++ # Initialize the capabilities database
++ self.initcaps()
++
+ rules_t = []
+ try:
+ rules_t = self._get_logging_rules(level)
+Index: ufw-0.33/src/backend.py
+===================================================================
+--- ufw-0.33.orig/src/backend.py 2012-09-23 09:58:34.000000000 -0500
++++ ufw-0.33/src/backend.py 2012-09-23 09:59:03.000000000 -0500
+@@ -21,7 +21,7 @@
+ import stat
+ import sys
+ import ufw.util
+-from ufw.util import warn, debug
++from ufw.util import error, warn, debug
+ from ufw.common import UFWError, config_dir, iptables_dir, UFWRule
+ import ufw.applications
+
+@@ -68,6 +68,17 @@
+ err_msg = _("Couldn't determine iptables version")
+ raise UFWError(err_msg)
+
++ # Initialize via initcaps only when we need it (LP: #1044361)
++ self.caps = None
++
++ def initcaps(self):
++ '''Initialize the capabilities database. This needs to be called
++ before accessing the database.'''
++
++ # Only initialize if not initialized already
++ if self.caps != None:
++ return
++
+ self.caps = {}
+ self.caps['limit'] = {}
+
+@@ -78,14 +89,20 @@
+ # Try to get capabilities from the running system if root
+ if self.do_checks and os.getuid() == 0 and not self.dryrun:
+ # v4
+- nf_caps = ufw.util.get_netfilter_capabilities(self.iptables)
++ try:
++ nf_caps = ufw.util.get_netfilter_capabilities(self.iptables)
++ except OSError as e:
++ error("initcaps\n%s" % e)
+ if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
+ self.caps['limit']['4'] = True
+ else:
+ self.caps['limit']['4'] = False
+
+ # v6
+- nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
++ try:
++ nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
++ except OSError as e:
++ error("initcaps\n%s" % e)
+ if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
+ self.caps['limit']['6'] = True
+ else:
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0003-fix-typeerror-on-error.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0003-fix-typeerror-on-error.patch
new file mode 100644
index 000000000..b259fdf78
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0003-fix-typeerror-on-error.patch
@@ -0,0 +1,20 @@
+Origin: r797
+Description: src/backend_iptables.py: fix misplaced parenthesis
+
+Upstream-Status: Inappropriate [ not author ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+Index: ufw-0.33/src/backend_iptables.py
+===================================================================
+--- ufw-0.33.orig/src/backend_iptables.py 2012-09-24 08:51:13.000000000 -0500
++++ ufw-0.33/src/backend_iptables.py 2012-09-24 08:52:00.000000000 -0500
+@@ -1075,7 +1075,7 @@
+ exe = self.ip6tables
+ (rc, out) = cmd([exe] + args)
+ if rc != 0:
+- err_msg = _("Could not perform '%s'") % (args)
++ err_msg = _("Could not perform '%s'" % (args))
+ if fail_ok:
+ debug("FAILOK: " + err_msg)
+ else:
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch
new file mode 100644
index 000000000..695b26567
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0004-lp1039729.patch
@@ -0,0 +1,40 @@
+Origin: r803, r804
+Description: Don't call get_netfilter_capabilities() with ipv6 if ipv6 is
+ disabled.
+Bug-Ubuntu: https://launchpad.net/ufw/bugs/1039729
+
+Upstream-Status: Inappropriate [ not author ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+Index: ufw-0.33/src/backend.py
+===================================================================
+--- ufw-0.33.orig/src/backend.py 2012-12-04 09:21:57.000000000 -0600
++++ ufw-0.33/src/backend.py 2012-12-04 09:22:40.000000000 -0600
+@@ -98,15 +98,17 @@
+ else:
+ self.caps['limit']['4'] = False
+
+- # v6
+- try:
+- nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
+- except OSError as e:
+- error("initcaps\n%s" % e)
+- if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
+- self.caps['limit']['6'] = True
+- else:
+- self.caps['limit']['6'] = False
++ # v6 (skip capabilities check for ipv6 if ipv6 is disabled in ufw
++ # because the system may not have ipv6 support (LP: #1039729)
++ if self.use_ipv6():
++ try:
++ nf_caps = ufw.util.get_netfilter_capabilities(self.ip6tables)
++ except OSError as e:
++ error("initcaps\n%s" % e)
++ if 'recent-set' in nf_caps and 'recent-update' in nf_caps:
++ self.caps['limit']['6'] = True
++ else:
++ self.caps['limit']['6'] = False
+
+ def is_enabled(self):
+ '''Is firewall configured as enabled'''
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0005-lp1191197.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0005-lp1191197.patch
new file mode 100644
index 000000000..b760d3fd3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/0005-lp1191197.patch
@@ -0,0 +1,32 @@
+Origin: r816
+Description: add check for -m rt --rt-type 0
+Bug-Ubuntu: https://launchpad.net/bugs/1191197
+Forwarded: yes
+
+Upstream-Status: Inappropriate [ not author ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+
+Index: ufw-0.33/tests/check-requirements
+===================================================================
+--- ufw-0.33.orig/tests/check-requirements 2012-08-17 16:12:49.000000000 -0500
++++ ufw-0.33/tests/check-requirements 2013-06-15 07:47:00.000000000 -0500
+@@ -3,7 +3,7 @@
+ # check-requirements: verify all the required iptables functionality is
+ # available
+ #
+-# Copyright 2008-2012 Canonical Ltd.
++# Copyright 2008-2013 Canonical Ltd.
+ #
+ # This program is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License version 3,
+@@ -218,6 +218,9 @@
+ echo -n "icmpv6 with hl ($j): "
+ runcmd $exe -A $c -p icmpv6 --icmpv6-type $j -m hl --hl-eq 255 -j ACCEPT
+ done
++
++ echo -n "ipv6 rt: "
++ runcmd $exe -A $c -m rt --rt-type 0 -j ACCEPT
+ fi
+
+ echo ""
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-add-an-option-to-specify-iptables-location.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-add-an-option-to-specify-iptables-location.patch
new file mode 100644
index 000000000..511742338
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-add-an-option-to-specify-iptables-location.patch
@@ -0,0 +1,107 @@
+From c54d36d0582a60fd281cd9287077cea205fd849d Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Thu, 27 Nov 2014 15:20:34 -0500
+Subject: [PATCH] setup: add an option to specify iptables location
+
+When cross-compiling it isn't certain that the location of iptables on the
+target will be the same as on the host. It also doesn't make sense the
+test the version of the host during setup. We provide an option to
+specify an alternate iptables directory. This is assumed to be a
+cross-compile environment and therefore no attempt is made to verify the
+version of iptables to be used.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ setup.py | 69 ++++++++++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 39 insertions(+), 30 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 6fb3751..b13d11c 100644
+--- a/setup.py
++++ b/setup.py
+@@ -225,41 +225,50 @@ shutil.copytree('src', 'staging')
+ os.unlink(os.path.join('staging', 'ufw-init'))
+ os.unlink(os.path.join('staging', 'ufw-init-functions'))
+
++iptables_set = 0
+ iptables_exe = ''
+ iptables_dir = ''
+
+-for e in ['iptables']:
+- for dir in ['/sbin', '/bin', '/usr/sbin', '/usr/bin', '/usr/local/sbin', \
+- '/usr/local/bin']:
+- if e == "iptables":
+- if os.path.exists(os.path.join(dir, e)):
+- iptables_dir = dir
+- iptables_exe = os.path.join(iptables_dir, "iptables")
+- print("Found '%s'" % iptables_exe)
+- else:
+- continue
+-
+- if iptables_exe != "":
+- break
+-
+-
+-if iptables_exe == '':
+- print("ERROR: could not find required binary 'iptables'", file=sys.stderr)
+- sys.exit(1)
+-
+-for e in ['ip6tables', 'iptables-restore', 'ip6tables-restore']:
+- if not os.path.exists(os.path.join(iptables_dir, e)):
+- print("ERROR: could not find required binary '%s'" % (e), file=sys.stderr)
++if "--iptables-dir" in sys.argv:
++ iptables_dir = sys.argv[sys.argv.index("--iptables-dir") + 1]
++ iptables_exe = os.path.join(iptables_dir, "iptables")
++ iptables_set = 1
++ print("INFO: iptables manually set: '%s'" % (iptables_exe))
++ sys.argv.remove(iptables_dir)
++ sys.argv.remove("--iptables-dir")
++
++if not iptables_set:
++ for e in ['iptables']:
++ for dir in ['/sbin', '/bin', '/usr/sbin', '/usr/bin', '/usr/local/sbin', \
++ '/usr/local/bin']:
++ if e == "iptables":
++ if os.path.exists(os.path.join(dir, e)):
++ iptables_dir = dir
++ iptables_exe = os.path.join(iptables_dir, "iptables")
++ print("Found '%s'" % iptables_exe)
++ else:
++ continue
++
++ if iptables_exe != "":
++ break
++
++ if iptables_exe == '':
++ print("ERROR: could not find required binary 'iptables'", file=sys.stderr)
+ sys.exit(1)
+
+-(rc, out) = cmd([iptables_exe, '-V'])
+-if rc != 0:
+- raise OSError(errno.ENOENT, "Could not find version for '%s'" % \
+- (iptables_exe))
+-version = re.sub('^v', '', re.split('\s', str(out))[1])
+-print("Found '%s' version '%s'" % (iptables_exe, version))
+-if version < "1.4":
+- print("WARN: version '%s' has limited IPv6 support. See README for details." % (version), file=sys.stderr)
++ for e in ['ip6tables', 'iptables-restore', 'ip6tables-restore']:
++ if not os.path.exists(os.path.join(iptables_dir, e)):
++ print("ERROR: could not find required binary '%s'" % (e), file=sys.stderr)
++ sys.exit(1)
++
++ (rc, out) = cmd([iptables_exe, '-V'])
++ if rc != 0:
++ raise OSError(errno.ENOENT, "Could not find version for '%s'" % \
++ (iptables_exe))
++ version = re.sub('^v', '', re.split('\s', str(out))[1])
++ print("Found '%s' version '%s'" % (iptables_exe, version))
++ if version < "1.4":
++ print("WARN: version '%s' has limited IPv6 support. See README for details." % (version), file=sys.stderr)
+
+ setup (name='ufw',
+ version=ufw_version,
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch
new file mode 100644
index 000000000..ff704b5a4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw/setup-only-make-one-reference-to-env.patch
@@ -0,0 +1,77 @@
+From be53eea06a5655fdc98f47a73be8277b65bb42ed Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 11 Nov 2014 21:41:14 -0500
+Subject: [PATCH] setup: only make one reference to env
+
+If sys.executable happens to be '/usr/bin/env python' or something
+similar, the setup script will result in 'ufw' getting /usr/bin/env
+repeated on the top line. This causes an error at runtime. Perform a
+quick sanity check on sys.executable before doing the substitution.
+
+While we're at it, change the default value of 'exe' to the one we either
+detected or specified on the build line.
+
+Upstream-Status: Inappropriate [ embedded specific ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ setup.py | 34 ++++++++++++++++++++++++++++------
+ 1 file changed, 28 insertions(+), 6 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index b13d11c..73acdef 100644
+--- a/setup.py
++++ b/setup.py
+@@ -64,7 +64,7 @@ class Install(_install, object):
+ real_sharedir = os.path.join(real_prefix, 'share', 'ufw')
+
+ # Update the modules' paths
+- for file in [ 'common.py' ]:
++ for file in [ 'common.py', 'util.py' ]:
+ print("Updating " + file)
+ subprocess.call(["sed",
+ "-i",
+@@ -91,6 +91,11 @@ class Install(_install, object):
+ "s%#SHARE_DIR#%" + real_sharedir + "%g",
+ os.path.join('staging', file)])
+
++ subprocess.call(["sed",
++ "-i.jjm",
++ "s%/sbin/iptables%" + iptables_exe + "%g",
++ os.path.join('staging', file)])
++
+ # Now byte-compile everything
+ super(Install, self).run()
+
+@@ -107,12 +112,23 @@ class Install(_install, object):
+ for f in [ script, manpage, manpage_f ]:
+ self.mkpath(os.path.dirname(f))
+
++ # if sys.executable == /usr/bin/env python* the result will be the top
++ # of ufw getting:
++ #
++ # #! /usr/bin/env /usr/bin/env python
++ #
++ # which is not ideal
++ #
+ # update the interpreter to that of the one the user specified for setup
+- print("Updating staging/ufw to use %s" % (sys.executable))
+- subprocess.call(["sed",
+- "-i",
+- "1s%^#.*python.*%#! /usr/bin/env " + sys.executable + "%g",
+- 'staging/ufw'])
++ print("Updating staging/ufw to use (%s)" % (sys.executable))
++
++ if re.search("(/usr/bin/env)", sys.executable):
++ print("found 'env' in sys.executable (%s)" % (sys.executable))
++ subprocess.call(["sed",
++ "-i.jjm",
++ "1s%^#.*python.*%#! " + sys.executable + "%g",
++ 'staging/ufw'])
++
+ self.copy_file('staging/ufw', script)
+ self.copy_file('doc/ufw.8', manpage)
+ self.copy_file('doc/ufw-framework.8', manpage_f)
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw_0.33.bb b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw_0.33.bb
new file mode 100644
index 000000000..19cfe46b7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/ufw/ufw_0.33.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Uncomplicated Firewall"
+DESCRIPTION = "UFW stands for Uncomplicated Firewall, and is program for \
+managing a netfilter firewall. It provides a command line interface and aims \
+to be uncomplicated and easy to use."
+HOMEPAGE = "https://launchpad.net/ufw"
+SECTION = "net"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+SRC_URI = " \
+ https://launchpad.net/ufw/0.33/0.33/+download/ufw-0.33.tar.gz \
+ file://setup-add-an-option-to-specify-iptables-location.patch \
+ file://setup-only-make-one-reference-to-env.patch \
+ file://0001-optimize-boot.patch \
+ file://0002-lp1044361.patch \
+ file://0003-fix-typeerror-on-error.patch \
+ file://0004-lp1039729.patch \
+ file://0005-lp1191197.patch \
+"
+SRC_URI[md5sum] = "3747b453d76709e5a99da209fc0bb5f5"
+SRC_URI[sha256sum] = "5f85a8084ad3539b547bec097286948233188c971f498890316dec170bdd1da8"
+
+inherit setuptools distro_features_check
+
+RDEPENDS_${PN} = " \
+ iptables \
+ python \
+ python-modules \
+ "
+
+RRECOMMENDS_${PN} = " \
+ kernel-module-ipv6 \
+ kernel-module-nf-conntrack-ipv6 \
+ kernel-module-nf-log-common \
+ kernel-module-nf-log-ipv4 \
+ kernel-module-nf-log-ipv6 \
+ kernel-module-nf-addrtype \
+ kernel-module-nf-limit \
+ kernel-module-nf-log \
+ kernel-module-nf-recent \
+"
+
+# Certain items are explicitly put under /lib, not base_libdir when installed.
+#
+FILES_${PN} += " \
+ ${sbindir}/* \
+ ${datadir}/ufw/* \
+ /lib/ufw/* \
+ ${sysconfdir}/ufw/* \
+ ${sysconfdir}/default/ufw \
+"
+
+REQUIRED_DISTRO_FEATURES = "ipv6"
+
+DISTUTILS_BUILD_ARGS_append = " --iptables-dir /usr/sbin"
+DISTUTILS_INSTALL_ARGS_append = " --iptables-dir /usr/sbin"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch
new file mode 100644
index 000000000..ebcfc7c2f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/0001-Add-printf-format-and-silence-format-security-warnin.patch
@@ -0,0 +1,34 @@
+From 400b8f235377f677a7a760f1e3a1cd26d95140bc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 16 Jun 2017 22:58:18 -0700
+Subject: [PATCH] Add printf format and silence format-security warnings
+
+Fix
+
+vconfig.c:66:4: error: format not a string literal and no format arguments [-Werror=format-security]
+ fprintf(stdout,usage);
+ ^~~~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ vconfig.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vconfig.c b/vconfig.c
+index 5057cfd..83137ba 100644
+--- a/vconfig.c
++++ b/vconfig.c
+@@ -63,7 +63,7 @@ static char* usage =
+ " is OFF.\n";
+
+ void show_usage() {
+- fprintf(stdout,usage);
++ fprintf(stdout, "%s", usage);
+ }
+
+ int hex_to_bytes(char* bytes, int bytes_length, char* hex_str) {
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/no-HOME-includes.patch b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/no-HOME-includes.patch
new file mode 100644
index 000000000..b7ab7d97c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan-1.9/no-HOME-includes.patch
@@ -0,0 +1,22 @@
+From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
+Subject: vlan: do not include ${HOME}/linux/include dir
+
+~/linux/include dir may exist and so will be added to include path
+in front of sanitized kernel headers in OE chroot. Drop this include
+option.
+
+Upstream-Status: not-applicable
+
+Index: vlan/MakeInclude
+===================================================================
+--- vlan.orig/MakeInclude
++++ vlan/MakeInclude
+@@ -16,7 +16,7 @@ ifeq "${PLATFORM}" ""
+ endif
+
+ ## You may need to change this linux/include part.
+-CCFLAGS = -g -D_GNU_SOURCE -Wall -I${HOME}/linux/include
++CCFLAGS = -g -D_GNU_SOURCE -Wall
+ LDLIBS = # -lm #-lnsl # -lsocket
+
+ ARM_TC_BIN = ${HOME}/Intrinsyc/bin
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
new file mode 100644
index 000000000..7eea5d135
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
@@ -0,0 +1,38 @@
+SUMMARY = "VLAN provides vconfig utility"
+HOMEPAGE = "http://www.candelatech.com/~greear/vlan.html"
+SECTION = "misc"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://vconfig.c;beginline=1;endline=19;md5=094ca47de36c20c598b15b32c270ce0a"
+
+SRC_URI = "http://${BPN}.sourcearchive.com/downloads/${PV}-3ubuntu9/${BPN}_${PV}.orig.tar.gz \
+ file://no-HOME-includes.patch \
+ file://0001-Add-printf-format-and-silence-format-security-warnin.patch \
+"
+
+SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394"
+SRC_URI[sha256sum] = "3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit update-alternatives
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+# comment out MakeInclude in Makefile which sets build environment
+do_configure_append () {
+ sed -i 's/^ include/#^include/' ${S}/Makefile
+}
+
+# ignore strip to avoid yocto errors in stripping
+do_compile () {
+ oe_runmake PLATFORM=ARM 'STRIP=echo' all
+}
+
+do_install () {
+ install -d ${D}/${base_sbindir}
+ install -m 0755 ${S}/vconfig ${D}/${base_sbindir}/
+}
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "vconfig"
+ALTERNATIVE_LINK_NAME[vconfig] = "${base_sbindir}/vconfig"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch
new file mode 100644
index 000000000..184c7943b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0001-search-for-log-help-in-build-dir.patch
@@ -0,0 +1,26 @@
+From 48e16e9ae7d8e4c42282bd82cbbd9a6d346a5c00 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 2 Dec 2012 02:16:54 +0100
+Subject: [PATCH 1/8] search for log-help in build dir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ makeman.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/makeman.pl b/makeman.pl
+index cf241a1..2d73432 100755
+--- a/makeman.pl
++++ b/makeman.pl
+@@ -30,7 +30,7 @@ my $vpnc = './vpnc';
+ # indenting lists (those originally starting with an asterisk). I hope
+ # this pays off when converting the manpage to HTML or such.
+
+-open my $LONGHELP, '-|', "$vpnc --long-help";
++open my $LONGHELP, '-|', "cat ./long-help";
+ my $vpnc_options = '';
+ my $relative_indent = 0;
+ my $indent_needed = 0;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch
new file mode 100644
index 000000000..6f00d3b89
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0002-Fix-vpnc-install-for-cross-compile.patch
@@ -0,0 +1,49 @@
+From d565b4a5e0045f1e40e0e462920ed5b8faca9eec Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 2 Dec 2012 02:16:54 +0100
+Subject: [PATCH 2/8] Fix vpnc install for cross compile
+
+---
+ Makefile | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 69f5aca..a15782e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -133,21 +133,21 @@ install-common: all
+ else \
+ install vpnc-script $(DESTDIR)$(ETCDIR); \
+ fi
+- install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
+- install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
+- install -m755 pcf2vpnc $(DESTDIR)$(BINDIR)
+- install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
+- install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
+- install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
+- install -m644 COPYING $(DESTDIR)$(DOCDIR)
++ install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf
++ install -m 755 vpnc-disconnect $(DESTDIR)$(SBINDIR)
++ install -m 755 pcf2vpnc $(DESTDIR)$(BINDIR)
++ install -m 644 vpnc.8 $(DESTDIR)$(MANDIR)/man8
++ install -m 644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1
++ install -m 644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1
++ install -m 644 COPYING $(DESTDIR)$(DOCDIR)
+
+ install : install-common
+- install -m755 vpnc $(DESTDIR)$(SBINDIR)
+- install -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
++ install -m 755 vpnc $(DESTDIR)$(SBINDIR)
++ install -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
+
+ install-strip : install-common
+- install -s -m755 vpnc $(DESTDIR)$(SBINDIR)
+- install -s -m755 cisco-decrypt $(DESTDIR)$(BINDIR)
++ install -s -m 755 vpnc $(DESTDIR)$(SBINDIR)
++ install -s -m 755 cisco-decrypt $(DESTDIR)$(BINDIR)
+
+ uninstall :
+ rm -f $(DESTDIR)$(SBINDIR)/vpnc \
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch
new file mode 100644
index 000000000..bb7730647
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0003-error.h-is-specific-to-glibc-on-linux.patch
@@ -0,0 +1,30 @@
+From 6b49020893f999df56392b49b1a289cb96a113a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 22:08:17 -0700
+Subject: [PATCH 3/8] error.h is specific to glibc on linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index 137bf6d..6a323f0 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -37,9 +37,10 @@ int tun_read(int fd, unsigned char *buf, int len);
+ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+
+ /***************************************************************************/
+-#if defined(__linux__) || defined(__GLIBC__)
++#if defined(__linux__)
++#if defined(__GLIBC__)
+ #include <error.h>
+-
++#endif
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF 1
+ #define HAVE_ERROR 1
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch
new file mode 100644
index 000000000..f70a13898
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0004-Use-pkgconfig-instead-of-libgcrypt-config.patch
@@ -0,0 +1,30 @@
+From 4d1dd61c04f52a7c796debbdea5fc9139ffa271d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 22:45:05 -0700
+Subject: [PATCH 4/8] Use pkgconfig instead of libgcrypt-config
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a15782e..b537046 100644
+--- a/Makefile
++++ b/Makefile
+@@ -63,10 +63,10 @@ RELEASE_VERSION := $(shell cat VERSION)
+ CC ?= gcc
+ CFLAGS ?= -O3 -g
+ CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
+-CFLAGS += $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
++CFLAGS += $(shell pkg-config libgcrypt --cflags) $(CRYPTO_CFLAGS)
+ CPPFLAGS += -DVERSION=\"$(VERSION)\"
+ LDFLAGS ?= -g
+-LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
++LIBS += $(shell pkg-config libgcrypt --libs) $(CRYPTO_LDADD)
+
+ ifeq ($(shell uname -s), SunOS)
+ LIBS += -lnsl -lresolv -lsocket
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch
new file mode 100644
index 000000000..01783f45b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0005-include-sys-ttydefaults.h-for-CEOT-definition.patch
@@ -0,0 +1,30 @@
+From 1947ea776dc38c3377702dd89bd229670f4d948d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:06:52 -0700
+Subject: [PATCH 5/8] include sys/ttydefaults.h for CEOT definition
+
+Fixes
+
+config.c:146:25: error: use of undeclared identifier 'CEOT'
+ if (llen == 0 && c == CEOT)
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/config.c b/config.c
+index 804faa7..1883d12 100644
+--- a/config.c
++++ b/config.c
+@@ -31,6 +31,7 @@
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+ #include <sys/wait.h>
++#include <sys/ttydefaults.h>
+
+ #include <gcrypt.h>
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch
new file mode 100644
index 000000000..fa89df279
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch
@@ -0,0 +1,40 @@
+From 56768fc0c2cbd6abcf28c9805ab516db8a0548d4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:09:47 -0700
+Subject: [PATCH 6/8] sysdep: Add header include sequence to adjust for musl
+
+---
+ sysdep.h | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/sysdep.h b/sysdep.h
+index 6a323f0..0122b95 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -17,16 +17,20 @@
+ * __SKYOS__
+ *
+ */
++/* hack to make sure kernel headers understand that libc (musl)
++ * does define IFF_LOWER_UP et al.
++ */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#include <netinet/in.h>
+
+ #if !defined(__CYGWIN__)
+-#include <net/if.h>
+-#include <net/if_arp.h>
++//#include <linux/if.h>
++//#include <net/if_arp.h>
+ #include <netinet/if_ether.h>
+ #endif
++#include <netinet/in.h>
+
+ #include "config.h"
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch
new file mode 100644
index 000000000..de67b47a4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0007-add-error-API-when-error.h-is-not-on-platform.patch
@@ -0,0 +1,66 @@
+From b6a027fe4da6f66552b533f1314e5005b16c5455 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:52:36 -0700
+Subject: [PATCH 7/8] add error() API when error.h is not on platform
+
+sign-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.c | 24 ++++++++++++++++++++++++
+ sysdep.h | 2 ++
+ 2 files changed, 26 insertions(+)
+
+diff --git a/sysdep.c b/sysdep.c
+index d8f181d..2518ec1 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -17,6 +17,7 @@
+ GNU General Public License for more details.
+ */
+
++#define _GNU_SOURCE
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+@@ -794,3 +795,26 @@ int setenv(const char *name, const char *value, int overwrite)
+ return ret;
+ }
+ #endif
++
++#ifndef _ERROR_H_
++#define _ERROR_H_
++#include <stdarg.h>
++#include <stdio.h>
++#include <errno.h>
++
++void error(int status, int errnum, const char* format, ...)
++{
++ va_list ap;
++
++ fflush(stdout);
++ fprintf(stderr, "%s: ", program_invocation_name);
++ va_start(ap, format);
++ vfprintf(stderr, format, ap);
++ va_end(ap);
++ if (errnum)
++ fprintf(stderr, ":%d", errnum);
++ if (status)
++ exit(status);
++}
++#endif /* _ERROR_H_ */
++
+diff --git a/sysdep.h b/sysdep.h
+index 0122b95..4e60064 100644
+--- a/sysdep.h
++++ b/sysdep.h
+@@ -44,6 +44,8 @@ int tun_get_hwaddr(int fd, char *dev, uint8_t *hwaddr);
+ #if defined(__linux__)
+ #if defined(__GLIBC__)
+ #include <error.h>
++#else
++void error(int status, int errnum, const char* format, ...);
+ #endif
+ #define HAVE_VASPRINTF 1
+ #define HAVE_ASPRINTF 1
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch
new file mode 100644
index 000000000..62ffdb7c9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0008-include-sysdep.h-before-net-if_tun.h.patch
@@ -0,0 +1,36 @@
+From 7f01847d14a1a3af50f49499743b0551ddef1311 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 29 Mar 2017 23:54:01 -0700
+Subject: [PATCH 8/8] include sysdep.h before net/if_tun.h
+
+Fixes duplicate defines in header errors
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdep.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/sysdep.c b/sysdep.c
+index 2518ec1..5624ef1 100644
+--- a/sysdep.c
++++ b/sysdep.c
+@@ -57,6 +57,8 @@
+ #include <sys/cygwin.h>
+ #endif
+
++#include "sysdep.h"
++
+ #if defined(__DragonFly__)
+ #include <net/tun/if_tun.h>
+ #elif defined(__linux__)
+@@ -69,7 +71,6 @@
+ #include <net/if_tun.h>
+ #endif
+
+-#include "sysdep.h"
+
+ #if !defined(HAVE_VASPRINTF) || !defined(HAVE_ASPRINTF) || !defined(HAVE_ERROR)
+ #include <stdarg.h>
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch
new file mode 100644
index 000000000..2bed55041
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch
@@ -0,0 +1,42 @@
+From 39925f090c21ab571ebc6ec250696f7f7093a2a6 Mon Sep 17 00:00:00 2001
+From: Will Page <Will.Page@ni.com>
+Date: Wed, 30 Aug 2017 18:14:00 -0700
+Subject: [PATCH 1/1] Reduce lifetime value to widely-compatible value
+
+Current proposed lifetime value (2147483 seconds, which equates to
+MAXINT ms, or ~25 days) is rejected by Fortigate vpn devices because
+"peer SA proposal does not match local policy". It seems default
+policy for these devices constrains lifetime where similar VPN devices
+don't.
+
+Reducing the lifetime from its current value to 28800 (exactly 8 hours)
+causes it to start working with fortigate devices.
+---
+ vpnc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/vpnc.c b/vpnc.c
+index 36dd0f3..3e0fcba 100644
+--- a/vpnc.c
++++ b/vpnc.c
+@@ -1135,7 +1135,7 @@ static struct isakmp_attribute *make_transform_ike(int dh_group, int crypt, int
+ a->af = isakmp_attr_lots;
+ a->u.lots.length = 4;
+ a->u.lots.data = xallocc(a->u.lots.length);
+- *((uint32_t *) a->u.lots.data) = htonl(2147483);
++ *((uint32_t *) a->u.lots.data) = htonl(28800);
+ a = new_isakmp_attribute_16(IKE_ATTRIB_LIFE_TYPE, IKE_LIFE_TYPE_SECONDS, a);
+ a = new_isakmp_attribute_16(IKE_ATTRIB_AUTH_METHOD, auth, a);
+ a = new_isakmp_attribute_16(IKE_ATTRIB_GROUP_DESC, dh_group, a);
+@@ -2561,7 +2561,7 @@ static struct isakmp_attribute *make_transform_ipsec(struct sa_block *s, int dh_
+ a->af = isakmp_attr_lots;
+ a->u.lots.length = 4;
+ a->u.lots.data = xallocc(a->u.lots.length);
+- *((uint32_t *) a->u.lots.data) = htonl(2147483);
++ *((uint32_t *) a->u.lots.data) = htonl(28800);
+ a = new_isakmp_attribute_16(ISAKMP_IPSEC_ATTRIB_SA_LIFE_TYPE, IPSEC_LIFE_SECONDS, a);
+
+ if (dh_group)
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf
new file mode 100644
index 000000000..48b15eca6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf
@@ -0,0 +1,19 @@
+# Comment out the options you need.
+# Verify your config with "vpnc --print-config".
+# You might also try "vpnc --long-help" or look into the documentation.
+
+# Needed (you will be prompted if this is missing):
+#IPSec gateway 10.1.2.3
+#IPSec ID YOURPEERSID
+#IPSec secret YOURPEERSSECRET
+#Xauth username YOURUSERNAME
+#Xauth password YOURPASSWORD
+
+# Optional:
+#UDP Encapsulate
+#UDP Encapsulation Port 10000
+#Noninteractive
+#No Detach
+#Debug 99
+#Interface name tun0
+#Script /etc/vpnc/vpnc-script
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/long-help b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/long-help
new file mode 100644
index 000000000..fbec25414
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/long-help
@@ -0,0 +1,168 @@
+Usage: vpnc [--version] [--print-config] [--help] [--long-help] [options] [config files]
+
+Options:
+ --gateway <ip/hostname>
+ IP/name of your IPSec gateway
+ conf-variable: IPSec gateway <ip/hostname>
+
+ --id <ASCII string>
+ your group name
+ conf-variable: IPSec ID <ASCII string>
+
+ (configfile only option)
+ your group password (cleartext)
+ conf-variable: IPSec secret <ASCII string>
+
+ (configfile only option)
+ your group password (obfuscated)
+ conf-variable: IPSec obfuscated secret <hex string>
+
+ --username <ASCII string>
+ your username
+ conf-variable: Xauth username <ASCII string>
+
+ (configfile only option)
+ your password (cleartext)
+ conf-variable: Xauth password <ASCII string>
+
+ (configfile only option)
+ your password (obfuscated)
+ conf-variable: Xauth obfuscated password <hex string>
+
+ --domain <ASCII string>
+ (NT-) Domain name for authentication
+ conf-variable: Domain <ASCII string>
+
+ --xauth-inter
+ enable interactive extended authentication (for challenge response auth)
+ conf-variable: Xauth interactive
+
+ --vendor <cisco/netscreen>
+ vendor of your IPSec gateway
+ Default: cisco
+ conf-variable: Vendor <cisco/netscreen>
+
+ --natt-mode <natt/none/force-natt/cisco-udp>
+ Which NAT-Traversal Method to use:
+ * natt -- NAT-T as defined in RFC3947
+ * none -- disable use of any NAT-T method
+ * force-natt -- always use NAT-T encapsulation even
+ without presence of a NAT device
+ (useful if the OS captures all ESP traffic)
+ * cisco-udp -- Cisco proprietary UDP encapsulation, commonly over Port 10000
+ Note: cisco-tcp encapsulation is not yet supported
+ Default: natt
+ conf-variable: NAT Traversal Mode <natt/none/force-natt/cisco-udp>
+
+ --script <command>
+ command is executed using system() to configure the interface,
+ routing and so on. Device name, IP, etc. are passed using enviroment
+ variables, see README. This script is executed right after ISAKMP is
+ done, but before tunneling is enabled. It is called when vpnc
+ terminates, too
+ Default: /etc/vpnc/vpnc-script
+ conf-variable: Script <command>
+
+ --dh <dh1/dh2/dh5>
+ name of the IKE DH Group
+ Default: dh2
+ conf-variable: IKE DH Group <dh1/dh2/dh5>
+
+ --pfs <nopfs/dh1/dh2/dh5/server>
+ Diffie-Hellman group to use for PFS
+ Default: server
+ conf-variable: Perfect Forward Secrecy <nopfs/dh1/dh2/dh5/server>
+
+ --enable-1des
+ enables weak single DES encryption
+ conf-variable: Enable Single DES
+
+ --enable-no-encryption
+ enables using no encryption for data traffic (key exchanged must be encrypted)
+ conf-variable: Enable no encryption
+
+ --application-version <ASCII string>
+ Application Version to report. Note: Default string is generated at runtime.
+ Default: Cisco Systems VPN Client 0.5.3-394:Linux
+ conf-variable: Application version <ASCII string>
+
+ --ifname <ASCII string>
+ visible name of the TUN/TAP interface
+ conf-variable: Interface name <ASCII string>
+
+ --ifmode <tun/tap>
+ mode of TUN/TAP interface:
+ * tun: virtual point to point interface (default)
+ * tap: virtual ethernet interface
+ Default: tun
+ conf-variable: Interface mode <tun/tap>
+
+ --debug <0/1/2/3/99>
+ Show verbose debug messages
+ * 0: Do not print debug information.
+ * 1: Print minimal debug information.
+ * 2: Show statemachine and packet/payload type information.
+ * 3: Dump everything exluding authentication data.
+ * 99: Dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS).
+ conf-variable: Debug <0/1/2/3/99>
+
+ --no-detach
+ Don't detach from the console after login
+ conf-variable: No Detach
+
+ --pid-file <filename>
+ store the pid of background process in <filename>
+ Default: /var/run/vpnc/pid
+ conf-variable: Pidfile <filename>
+
+ --local-addr <ip/hostname>
+ local IP to use for ISAKMP / ESP / ... (0.0.0.0 == automatically assign)
+ Default: 0.0.0.0
+ conf-variable: Local Addr <ip/hostname>
+
+ --local-port <0-65535>
+ local ISAKMP port number to use (0 == use random port)
+ Default: 500
+ conf-variable: Local Port <0-65535>
+
+ --udp-port <0-65535>
+ Local UDP port number to use (0 == use random port).
+ This is only relevant if cisco-udp nat-traversal is used.
+ This is the _local_ port, the remote udp port is discovered automatically.
+ It is especially not the cisco-tcp port.
+ Default: 10000
+ conf-variable: Cisco UDP Encapsulation Port <0-65535>
+
+ --dpd-idle <0,10-86400>
+ Send DPD packet after not receiving anything for <idle> seconds.
+ Use 0 to disable DPD completely (both ways).
+ Default: 300
+ conf-variable: DPD idle timeout (our side) <0,10-86400>
+
+ --non-inter
+ Don't ask anything, exit on missing options
+ conf-variable: Noninteractive
+
+ --auth-mode <psk/cert/hybrid>
+ Authentication mode:
+ * psk: pre-shared key (default)
+ * cert: server + client certificate (not implemented yet)
+ * hybrid: server certificate + xauth (if built with openssl support)
+ Default: psk
+ conf-variable: IKE Authmode <psk/cert/hybrid>
+
+ --ca-file <filename>
+ filename and path to the CA-PEM-File
+ conf-variable: CA-File <filename>
+
+ --ca-dir <directory>
+ path of the trusted CA-Directory
+ Default: /etc/ssl/certs
+ conf-variable: CA-Dir <directory>
+
+ --target-network <target network/netmask>
+ Target network in dotted decimal or CIDR notation
+ Default: 0.0.0.0/0.0.0.0
+ conf-variable: IPSEC target network <target network/netmask>
+
+Report bugs to vpnc@unix-ag.uni-kl.de
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
new file mode 100644
index 000000000..ea2179985
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
@@ -0,0 +1,59 @@
+SUMMARY = "A client for the Cisco3000 VPN Concentrator"
+HOMEPAGE = "http://www.unix-ag.uni-kl.de/~massar/vpnc/"
+AUTHOR = "Maurice Massar vpnc@unix-ag.uni-kl.de"
+SECTION = "net"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=173b74cb8ac640a9992c03f3bce22a33"
+
+DEPENDS += "libgcrypt"
+
+PV .= "r550-2jnpr1"
+SRCREV = "b1243d29e0c00312ead038b04a2cf5e2fa31d740"
+SRC_URI = "git://github.com/ndpgroup/vpnc \
+ file://long-help \
+ file://default.conf \
+ file://0001-search-for-log-help-in-build-dir.patch \
+ file://0002-Fix-vpnc-install-for-cross-compile.patch \
+ file://0003-error.h-is-specific-to-glibc-on-linux.patch \
+ file://0004-Use-pkgconfig-instead-of-libgcrypt-config.patch \
+ file://0005-include-sys-ttydefaults.h-for-CEOT-definition.patch \
+ file://0006-sysdep-Add-header-include-sequence-to-adjust-for-mus.patch \
+ file://0007-add-error-API-when-error.h-is-not-on-platform.patch \
+ file://0008-include-sysdep.h-before-net-if_tun.h.patch \
+ file://0009-reduce-lifetime-value.patch \
+ "
+
+PACKAGECONFIG ?= "gnutls"
+
+PACKAGECONFIG[gnutls] = ",,gnutls"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+S = "${WORKDIR}/git"
+
+inherit perlnative pkgconfig
+
+#EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_configure_append () {
+ # Make sure we use our nativeperl wrapper
+ sed -i "1s:#!.*:#!/usr/bin/env nativeperl:" ${S}/*.pl
+ cp ${WORKDIR}/long-help ${S}
+}
+
+do_install () {
+ sed -i s:m600:m\ 600:g Makefile
+ oe_runmake 'DESTDIR=${D}' 'PREFIX=/usr' install
+ rm -f ${D}${sysconfdir}/vpnc/vpnc.conf #This file is useless
+ install ${WORKDIR}/default.conf ${D}${sysconfdir}/vpnc/default.conf
+}
+
+SYSROOT_PREPROCESS_FUNCS += "vpnc_sysroot_preprocess"
+
+vpnc_sysroot_preprocess () {
+ install -d ${SYSROOT_DESTDIR}${sysconfdir}/vpnc
+ install -m 755 ${D}${sysconfdir}/vpnc/vpnc-script ${SYSROOT_DESTDIR}${sysconfdir}/vpnc
+}
+
+CONFFILES_${PN} = "${sysconfdir}/vpnc/default.conf"
+RDEPENDS_${PN} = "perl-module-io-file"
+RRECOMMENDS_${PN} = "kernel-module-tun"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb b/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb
new file mode 100644
index 000000000..64e9401e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/wireless-regdb/wireless-regdb_2016.06.10.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Wireless Central Regulatory Domain Database"
+HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA"
+SECTION = "net"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c"
+
+SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "d282cce92b6e692e8673e2bd97adf33b"
+SRC_URI[sha256sum] = "cfedf1c3521b3c8f32602f25ed796e96e687c3441a00e7c050fedf7fd4f1b8b7"
+
+inherit bin_package
+
+do_install() {
+ install -d -m0755 ${D}${libdir}/crda
+ install -d -m0755 ${D}${sysconfdir}/wireless-regdb/pubkeys
+ install -m 0644 regulatory.bin ${D}${libdir}/crda/regulatory.bin
+ install -m 0644 sforshee.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/sforshee.key.pub.pem
+}
+
+RSUGGESTS_${PN} = "crda"
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch b/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch
new file mode 100644
index 000000000..f304d933d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch
@@ -0,0 +1,27 @@
+From fb490136cf8f2456cfe13b0b4f796e6c155e75dc Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Wed, 30 Aug 2017 03:02:32 -0400
+Subject: [PATCH] fix no rule to make cyassl/options.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index 395d75d..d4a3880 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3684,6 +3684,7 @@ AC_CONFIG_FILES([wolfssl/options.h])
+ #fi
+ AC_CONFIG_FILES([support/wolfssl.pc])
+ AC_CONFIG_FILES([rpm/spec])
++AC_CONFIG_FILES([cyassl/options.h])
+
+ AX_CREATE_GENERIC_CONFIG
+ AX_AM_JOBSERVER([yes])
+--
+2.8.1
+
diff --git a/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb b/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb
new file mode 100644
index 000000000..9290651d0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "wolfSSL Lightweight, Embedded SSL Library"
+DESCRIPTION = "wolfSSL, formerly CyaSSL, is a lightweight SSL library written in C and \
+ optimized for embedded and RTOS environments. It can be \
+ Up to 20 times smaller than OpenSSL while still supporting \
+ a full TLS 1.2 client and server."
+HOMEPAGE = "http://www.wolfssl.com/yaSSL/Products-wolfssl.html"
+BUGTRACKER = "http://github.com/wolfssl/wolfssl/issues"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+PROVIDES += "cyassl"
+RPROVIDES_${PN} = "cyassl"
+
+S = "${WORKDIR}/git"
+SRCREV = "d195009dcb62d8712195661bd1d50f8dd6831044"
+SRC_URI = "git://github.com/wolfSSL/wolfssl.git;protocol=https; \
+ file://0001-fix-no-rule-to-make-cyassl-options.h.patch \
+ "
+
+inherit autotools
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch
new file mode 100644
index 000000000..cfa8a7325
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0001-argz.h-fix-musl-compile-add-missing-defines.patch
@@ -0,0 +1,45 @@
+From 543e67919f5cacf309ac88ab091331e41af4224b Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Thu, 16 Apr 2015 22:41:57 +0200
+Subject: [PATCH] argz.h: fix musl compile (add missing defines)
+
+Upstream-Status: Pending
+
+Add __THROW, __BEGIN_DECLS, __END_DECLS and __attribute_pure__ defines.
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ argz.h | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/argz.h b/argz.h
+index 582be55..bdf9f62 100644
+--- a/argz.h
++++ b/argz.h
+@@ -48,6 +48,22 @@
+ # define __const const
+ #endif
+
++#ifndef __THROW
++# define __THROW
++#endif
++
++#ifndef __BEGIN_DECLS
++# define __BEGIN_DECLS
++#endif
++
++#ifndef __END_DECLS
++# define __END_DECLS
++#endif
++
++#ifndef __attribute_pure__
++# define __attribute_pure__
++#endif
++
+ #ifndef __error_t_defined
+ typedef int error_t;
+ #endif
+--
+2.1.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch
new file mode 100644
index 000000000..093054ce8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch
@@ -0,0 +1,43 @@
+From 77e399899d9d7297d23c321811b628febdf0fd92 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Thu, 16 Apr 2015 22:43:49 +0200
+Subject: [PATCH] tftp.h/tftpd.h: fix musl compile (missing include)
+
+Upstream-Status: Pending
+
+Add sys/types.h include for u_char typedef.
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+Signed-off-by: Ming Liu <peter.x.liu@external.atlascopco.com>
+---
+ tftp.h | 1 +
+ tftpd.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/tftp.h b/tftp.h
+index 12bd6aa..32a3f63 100644
+--- a/tftp.h
++++ b/tftp.h
+@@ -19,6 +19,7 @@
+
+ #include <sys/time.h>
+ #include <sys/times.h>
++#include <sys/types.h>
+ #include "tftp_def.h"
+ #include "config.h"
+
+diff --git a/tftpd.h b/tftpd.h
+index 945065e..60d3a49 100644
+--- a/tftpd.h
++++ b/tftpd.h
+@@ -20,6 +20,7 @@
+ #include <pthread.h>
+ #include <arpa/tftp.h>
+ #include <arpa/inet.h>
++#include <sys/types.h>
+ #include "tftp_io.h"
+
+ /*
+--
+2.1.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service
new file mode 100644
index 000000000..480bc702e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp/atftpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Advanced TFTP Server
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/atftpd --daemon --port 69
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb
new file mode 100644
index 000000000..a9949d59a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/atftp_git.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Advanced TFTP server and client"
+SECTION = "net"
+HOMEPAGE = "http://packages.debian.org/atftp"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f"
+PV = "0.7.1+git${SRCPV}"
+PR = "r3"
+
+SRCREV = "be3291a18c069ae23a124ffdc56d64a5ff0bbec7"
+
+SRC_URI = "git://git.code.sf.net/p/atftp/code \
+ file://atftpd-0.7_circumvent_tftp_size_restrictions.patch \
+ file://atftpd-0.7_unprotected_assignments_crash.patch \
+ file://atftpd.init \
+ file://atftpd.service \
+ file://atftp-0.7-sorcerers_apprentice.patch \
+"
+SRC_URI_append_libc-musl = " file://0001-argz.h-fix-musl-compile-add-missing-defines.patch \
+ file://0002-tftp.h-tftpd.h-fix-musl-compile-missing-include.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools update-rc.d systemd
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline"
+
+INITSCRIPT_PACKAGES = "${PN}d"
+INITSCRIPT_NAME_${PN}d = "atftpd"
+INITSCRIPT_PARAMS_${PN}d = "defaults 80"
+
+
+EXTRA_OEMAKE = "CFLAGS='${CFLAGS} -std=gnu89'"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd
+
+ install -d ${D}/srv/tftp
+
+ rm ${D}${sbindir}/in.tftpd
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system
+}
+
+PACKAGES =+ "${PN}d"
+
+FILES_${PN} = "${bindir}/*"
+
+FILES_${PN}d = "${sbindir}/* \
+ ${sysconfdir} \
+ /srv/tftp \
+ ${systemd_unitdir}/system/atftpd.service \
+"
+
+SYSTEMD_PACKAGES = "${PN}d"
+SYSTEMD_SERVICE_${PN}d = "atftpd.service"
+RPROVIDES_${PN}d += "${PN}d-systemd"
+RREPLACES_${PN}d += "${PN}d-systemd"
+RCONFLICTS_${PN}d += "${PN}d-systemd"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch
new file mode 100644
index 000000000..fc64291cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch
@@ -0,0 +1,94 @@
+atftp exhibits the well known "Sorcerer's Apprentice Syndrome"(SAS) problem.
+According to RFC 1350, the fix to SAS is quite simple: further copies of the
+acknowledgment for a particular data block would be ignored.
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/view_file?file=atftp-0.7-sorcerers_apprentice.patch&package=atftp.539&project=openSUSE%3A12.1%3AUpdate&rev=84569792975e00573d7df597d2a6e895
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Index: atftp-0.7/tftp_file.c
+===================================================================
+--- atftp-0.7.orig/tftp_file.c 2011-11-22 15:12:53.792744083 +0100
++++ atftp-0.7/tftp_file.c 2011-11-22 15:13:51.706421893 +0100
+@@ -605,6 +605,7 @@
+ int timeout_state = state; /* what state should we go on when timeout */
+ int result;
+ long block_number = 0;
++ long last_requested_block = -1;
+ long last_block = -1;
+ int data_size; /* size of data received */
+ int sockfd = data->sockfd; /* just to simplify calls */
+@@ -765,6 +766,17 @@
+ connected = 1;
+ }
+ block_number = ntohs(tftphdr->th_block);
++
++ if (last_requested_block >= block_number)
++ {
++ if (data->trace)
++ fprintf(stderr, "received duplicated ACK <block: %ld >= %ld>\n",
++ last_requested_block, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++
+ if (data->trace)
+ fprintf(stderr, "received ACK <block: %ld>\n",
+ block_number);
+Index: atftp-0.7/tftpd_file.c
+===================================================================
+--- atftp-0.7.orig/tftpd_file.c 2011-11-22 15:12:53.793744112 +0100
++++ atftp-0.7/tftpd_file.c 2011-11-22 15:15:04.617534260 +0100
+@@ -403,6 +403,7 @@
+ int timeout_state = state;
+ int result;
+ long block_number = 0;
++ long last_requested_block = -1;
+ long last_block = -1;
+ int block_loops = 0;
+ int data_size;
+@@ -859,6 +860,32 @@
+ {
+ logger(LOG_DEBUG, "received ACK <block: %d>", block_number);
+ }
++
++ /* check whether the block request isn't already fulfilled */
++
++ /* multicast, block numbers could contain gaps */
++ if (multicast) {
++ if (last_requested_block >= block_number)
++ {
++ if (data->trace)
++ logger(LOG_DEBUG, "received duplicated ACK <block: %d >= %d>", last_requested_block, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++ /* unicast, blocks should be requested one after another */
++ } else {
++ if (last_requested_block + 1 != block_number && last_requested_block != -1)
++ {
++ if (data->trace)
++ logger(LOG_DEBUG, "received out of order ACK <block: %d != %d>", last_requested_block + 1, block_number);
++ break;
++ }
++ else
++ last_requested_block = block_number;
++ }
++
++
+ if (ntohs(tftphdr->th_block) == 65535)
+ {
+ block_loops++;
+@@ -958,6 +985,8 @@
+ /* nedd to send an oack to that client */
+ state = S_SEND_OACK;
+ fseek(fp, 0, SEEK_SET);
++ /* reset the last block received counter */
++ last_requested_block = -1;
+ }
+ else
+ {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch
@@ -0,0 +1,163 @@
+Fate #303031: Circumvent TFTP size restrictions in atftpd
+The size of a single image file that can be transferred with TFTP is limited to
+2^(2*8) *BLOCKSIZE (as per RFC 1350 there are only two bytes for the block
+counter). This is problematic for one of our customers who needs to transfer
+100+ MB Windows images using a TFTP client (NT bootloader) which has a
+hardwared BLOCKSIZE setting of 1432).
+
+block rollover
+http://www.compuphase.com/tftp.htm
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2
+
+Upstream-Status: Pending
+
+Index: git/tftp_def.h
+===================================================================
+--- git.orig/tftp_def.h 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_def.h 2012-11-20 17:40:54.391206979 -0800
+@@ -32,6 +32,7 @@
+ #define TIMEOUT 5 /* Client timeout */
+ #define S_TIMEOUT 5 /* Server timout. */
+ #define NB_OF_RETRY 5
++#define MAXBLOCKS 1000000 /* maximum number of blocks in a download */
+
+ /* definition to use tftp_options structure */
+ #define OPT_FILENAME 0
+Index: git/tftp_file.c
+===================================================================
+--- git.orig/tftp_file.c 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_file.c 2012-11-19 16:28:51.201027167 -0800
+@@ -622,8 +622,8 @@
+ int state = S_SEND_REQ; /* current state in the state machine */
+ int timeout_state = state; /* what state should we go on when timeout */
+ int result;
+- int block_number = 0;
+- int last_block = -1;
++ long block_number = 0;
++ long last_block = -1;
+ int data_size; /* size of data received */
+ int sockfd = data->sockfd; /* just to simplify calls */
+ struct sockaddr_storage sa; /* a copy of data.sa_peer */
+@@ -637,8 +637,8 @@
+ int convert = 0; /* if true, do netascii convertion */
+ char string[MAXLEN];
+
+- int prev_block_number = 0; /* needed to support netascii convertion */
+- int prev_file_pos = 0;
++ long prev_block_number = 0; /* needed to support netascii convertion */
++ long prev_file_pos = 0;
+ int temp = 0;
+
+ data->file_size = 0;
+@@ -745,7 +745,7 @@
+ data_size, data->data_buffer);
+ data->file_size += data_size;
+ if (data->trace)
+- fprintf(stderr, "sent DATA <block: %d, size: %d>\n",
++ fprintf(stderr, "sent DATA <block: %ld, size: %d>\n",
+ block_number + 1, data_size - 4);
+ state = S_WAIT_PACKET;
+ break;
+@@ -785,7 +785,7 @@
+ }
+ block_number = ntohs(tftphdr->th_block);
+ if (data->trace)
+- fprintf(stderr, "received ACK <block: %d>\n",
++ fprintf(stderr, "received ACK <block: %ld>\n",
+ block_number);
+ if ((last_block != -1) && (block_number > last_block))
+ {
+Index: git/tftp_io.c
+===================================================================
+--- git.orig/tftp_io.c 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_io.c 2012-11-19 16:28:51.201027167 -0800
+@@ -350,8 +350,8 @@
+ /*
+ * Read from file and do netascii conversion if needed
+ */
+-int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, int block_number,
+- int convert, int *prev_block_number, int *prev_file_pos, int *temp)
++int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, long block_number,
++ int convert, long *prev_block_number, long *prev_file_pos, int *temp)
+ {
+ int i;
+ int c;
+Index: git/tftp_io.h
+===================================================================
+--- git.orig/tftp_io.h 2012-11-19 16:28:50.221027144 -0800
++++ git/tftp_io.h 2012-11-19 16:28:51.201027167 -0800
+@@ -52,8 +52,8 @@
+ int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa,
+ struct sockaddr_storage *from, struct sockaddr_storage *to,
+ int timeout, int *size, char *data);
+-int tftp_file_read(FILE *fp, char *buffer, int buffer_size, int block_number, int convert,
+- int *prev_block_number, int *prev_file_pos, int *temp);
++int tftp_file_read(FILE *fp, char *buffer, int buffer_size, long block_number, int convert,
++ long *prev_block_number, long *prev_file_pos, int *temp);
+ int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, int block_number,
+ int data_size, int convert, int *prev_block_number, int *temp);
+ #endif
+Index: git/tftpd_file.c
+===================================================================
+--- git.orig/tftpd_file.c 2012-11-19 16:28:50.225027144 -0800
++++ git/tftpd_file.c 2012-11-19 16:28:51.201027167 -0800
+@@ -407,8 +407,9 @@
+ int state = S_BEGIN;
+ int timeout_state = state;
+ int result;
+- int block_number = 0;
+- int last_block = -1;
++ long block_number = 0;
++ long last_block = -1;
++ int block_loops = 0;
+ int data_size;
+ struct sockaddr_storage *sa = &data->client_info->client;
+ struct sockaddr_storage from;
+@@ -431,8 +432,8 @@
+ struct client_info *client_old = NULL;
+ struct tftp_opt options[OPT_NUMBER];
+
+- int prev_block_number = 0; /* needed to support netascii convertion */
+- int prev_file_pos = 0;
++ long prev_block_number = 0; /* needed to support netascii convertion */
++ long prev_file_pos = 0;
+ int temp = 0;
+
+ /* look for mode option */
+@@ -565,11 +566,12 @@
+ logger(LOG_INFO, "blksize option -> %d", result);
+ }
+
+- /* Verify that the file can be sent in 2^16 block of BLKSIZE octets */
+- if ((file_stat.st_size / (data->data_buffer_size - 4)) > 65535)
++ /* Verify that the file can be sent in MAXBLOCKS blocks of BLKSIZE octets */
++ if ((file_stat.st_size / (data->data_buffer_size - 4)) > MAXBLOCKS)
+ {
+ tftp_send_error(sockfd, sa, EUNDEF, data->data_buffer, data->data_buffer_size);
+- logger(LOG_NOTICE, "Requested file to big, increase BLKSIZE");
++ logger(LOG_NOTICE, "Requested file too big, increase BLKSIZE");
++ logger(LOG_NOTICE, "Only %d blocks of %d bytes can be served.", MAXBLOCKS, data->data_buffer_size);
+ if (data->trace)
+ logger(LOG_DEBUG, "sent ERROR <code: %d, msg: %s>", EUNDEF,
+ tftp_errmsg[EUNDEF]);
+@@ -880,10 +882,15 @@
+ }
+ /* The ACK is from the current client */
+ number_of_timeout = 0;
+- block_number = ntohs(tftphdr->th_block);
++ block_number = (block_loops * 65536) + ntohs(tftphdr->th_block);
+ if (data->trace)
+- logger(LOG_DEBUG, "received ACK <block: %d>",
+- block_number);
++ {
++ logger(LOG_DEBUG, "received ACK <block: %d>", block_number);
++ }
++ if (ntohs(tftphdr->th_block) == 65535)
++ {
++ block_loops++;
++ };
+ if ((last_block != -1) && (block_number > last_block))
+ {
+ state = S_END;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch
new file mode 100644
index 000000000..28fba6cf5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch
@@ -0,0 +1,152 @@
+Avoid assigning thread data outside of mutex lock
+
+Patch originally from OpenSUSE:
+https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2
+
+Upstream-Status: Pending
+
+Index: git/tftpd_list.c
+===================================================================
+--- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700
++++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700
+@@ -49,11 +49,11 @@
+ */
+ int tftpd_list_add(struct thread_data *new)
+ {
+- struct thread_data *current = thread_data;
++ struct thread_data *current;
+ int ret;
+
+ pthread_mutex_lock(&thread_list_mutex);
+-
++ current = thread_data;
+ number_of_thread++;
+
+ ret = number_of_thread;
+@@ -81,11 +81,13 @@
+ */
+ int tftpd_list_remove(struct thread_data *old)
+ {
+- struct thread_data *current = thread_data;
++ struct thread_data *current;
+ int ret;
+
+ pthread_mutex_lock(&thread_list_mutex);
+
++ current = thread_data;
++
+ number_of_thread--;
+ ret = number_of_thread;
+
+@@ -137,23 +139,26 @@
+ struct thread_data *data,
+ struct client_info *client)
+ {
+- struct thread_data *current = thread_data; /* head of the list */
+- struct tftp_opt *tftp_options = data->tftp_options;
++ struct thread_data *current; /* head of the list */
++ struct tftp_opt *tftp_options;
+ struct client_info *tmp;
+ char options[MAXLEN];
+ char string[MAXLEN];
+ char *index;
+ int len;
+
++ /* lock the whole list before walking it */
++ pthread_mutex_lock(&thread_list_mutex);
++
+ *thread = NULL;
+
++ current = thread_data;
++ tftp_options = data->tftp_options;
++
+ opt_request_to_string(tftp_options, options, MAXLEN);
+ index = strstr(options, "multicast");
+ len = (int)index - (int)options;
+
+- /* lock the whole list before walking it */
+- pthread_mutex_lock(&thread_list_mutex);
+-
+ while (current)
+ {
+ if (current != data)
+@@ -214,9 +219,10 @@
+ void tftpd_clientlist_remove(struct thread_data *thread,
+ struct client_info *client)
+ {
+- struct client_info *tmp = thread->client_info;
++ struct client_info *tmp;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ tmp = thread->client_info;
+ while ((tmp->next != client) && (tmp->next != NULL))
+ tmp = tmp->next;
+ if (tmp->next == NULL)
+@@ -231,9 +237,11 @@
+ void tftpd_clientlist_free(struct thread_data *thread)
+ {
+ struct client_info *tmp;
+- struct client_info *head = thread->client_info;
++ struct client_info *head;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ head = thread->client_info;
++
+ while (head)
+ {
+ tmp = head;
+@@ -250,9 +258,10 @@
+ struct client_info *client,
+ struct sockaddr_storage *sock)
+ {
+- struct client_info *head = thread->client_info;
++ struct client_info *head;
+
+ pthread_mutex_lock(&thread->client_mutex);
++ head = thread->client_info;
+
+ if (client)
+ {
+@@ -334,10 +343,10 @@
+
+ void tftpd_list_kill_threads(void)
+ {
+- struct thread_data *current = thread_data; /* head of list */
++ struct thread_data *current; /* head of list */
+
+ pthread_mutex_lock(&thread_list_mutex);
+-
++ current = thread_data;
+
+ while (current != NULL)
+ {
+Index: git/tftpd_mcast.c
+===================================================================
+--- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700
++++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700
+@@ -51,9 +51,11 @@
+ */
+ int tftpd_mcast_get_tid(char **addr, short *port)
+ {
+- struct tid *current = tid_list;
++ struct tid *current;
+
+ pthread_mutex_lock(&mcast_tid_list);
++ current = tid_list;
++
+ /* walk the list for a free tid */
+ while (current != NULL)
+ {
+@@ -74,9 +76,11 @@
+
+ int tftpd_mcast_free_tid(char *addr, short port)
+ {
+- struct tid *current = tid_list;
++ struct tid *current;
+
+ pthread_mutex_lock(&mcast_tid_list);
++ current = tid_list;
++
+ while (current != NULL)
+ {
+ if ((current->used == 1) && (current->port == port) &&
diff --git a/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init
new file mode 100644
index 000000000..161d97aca
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/atftp/files/atftpd.init
@@ -0,0 +1,37 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/atftpd and type
+# > update-rc.d atftpd defaults 60
+#
+
+
+test -f /usr/sbin/atftpd || exit 0
+
+test -d /srv/tftp || mkdir -p /srv/tftp
+
+case "$1" in
+ start)
+ echo -n "Starting tftp daemon: atftpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping tftp daemon: atftpd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd
+ echo "."
+ ;;
+ reload|force-reload)
+ start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
new file mode 100644
index 000000000..87159718b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch
@@ -0,0 +1,48 @@
+From 987c8f4a718cdd6b764592ba7510090a59623959 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:10:57 -0700
+Subject: [PATCH] Define __SWORD_TYPE and _PATH_NSSWITCH_CONF
+
+if they are not defined as is in musl then define
+them here
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ include/automount.h | 8 ++++++++
+ include/nsswitch.h | 3 +++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/include/automount.h b/include/automount.h
+index cc336ad..8bdcf12 100644
+--- a/include/automount.h
++++ b/include/automount.h
+@@ -42,6 +42,14 @@
+
+ #define ENABLE_CORES 1
+
++#ifndef __SWORD_TYPE
++# if __WORDSIZE == 32 /* System word size */
++# define __SWORD_TYPE int
++# else /* __WORDSIZE == 64 */
++# define __SWORD_TYPE long int
++# endif
++#endif
++
+ /* We MUST have the paths to mount(8) and umount(8) */
+ #ifndef HAVE_MOUNT
+ #error Failed to locate mount(8)!
+diff --git a/include/nsswitch.h b/include/nsswitch.h
+index d3e4027..7a0c38f 100644
+--- a/include/nsswitch.h
++++ b/include/nsswitch.h
+@@ -24,6 +24,9 @@
+ #include <netdb.h>
+ #include "list.h"
+
++#ifndef _PATH_NSSWITCH_CONF
++#define _PATH_NSSWITCH_CONF "/etc/nsswitch.conf"
++#endif
+ #define NSSWITCH_FILE _PATH_NSSWITCH_CONF
+
+ enum nsswitch_status {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch
new file mode 100644
index 000000000..32293dd09
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch
@@ -0,0 +1,27 @@
+From 745e355ac8b595a27e1fcca75bf01d3e244f4a5f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 7 Sep 2017 22:22:31 -0700
+Subject: [PATCH] modules/lookup_multi.c: Replace __S_IEXEC with S_IEXEC
+
+__S_IEXEC is internal to libc and may not be available on
+all libc e.g. musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ modules/lookup_multi.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
+index 3ecda6d..cf109de 100644
+--- a/modules/lookup_multi.c
++++ b/modules/lookup_multi.c
+@@ -452,7 +452,7 @@ int lookup_reinit(const char *my_mapfmt,
+ continue;
+ }
+
+- if (st.st_mode & __S_IEXEC)
++ if (st.st_mode & S_IEXEC)
+ type = src_prog;
+ else
+ type = src_file;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
new file mode 100644
index 000000000..469027aac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/0002-Replace-__S_IEXEC-with-S_IEXEC.patch
@@ -0,0 +1,49 @@
+From 557ca399f4b3a397f20bb147ec6dc4ab9732dd1e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 19:12:10 -0700
+Subject: [PATCH] Replace __S_IEXEC with S_IEXEC
+
+S_IEXEC is portable
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ daemon/lookup.c | 4 ++--
+ modules/lookup_multi.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/daemon/lookup.c b/daemon/lookup.c
+index 201ccbb..d821db8 100644
+--- a/daemon/lookup.c
++++ b/daemon/lookup.c
+@@ -366,7 +366,7 @@ static int read_file_source_instance(struct autofs_point *ap, struct map_source
+ if (!S_ISREG(st.st_mode))
+ return NSS_STATUS_NOTFOUND;
+
+- if (st.st_mode & __S_IEXEC)
++ if (st.st_mode & S_IEXEC)
+ type = src_prog;
+ else
+ type = src_file;
+@@ -856,7 +856,7 @@ static int lookup_name_file_source_instance(struct autofs_point *ap, struct map_
+ if (!S_ISREG(st.st_mode))
+ return NSS_STATUS_NOTFOUND;
+
+- if (st.st_mode & __S_IEXEC)
++ if (st.st_mode & S_IEXEC)
+ type = src_prog;
+ else
+ type = src_file;
+diff --git a/modules/lookup_multi.c b/modules/lookup_multi.c
+index fadd2ea..3ecda6d 100644
+--- a/modules/lookup_multi.c
++++ b/modules/lookup_multi.c
+@@ -247,7 +247,7 @@ static struct lookup_mod *nss_open_lookup(const char *format, int argc, const ch
+ continue;
+ }
+
+- if (st.st_mode & __S_IEXEC)
++ if (st.st_mode & S_IEXEC)
+ type = src_prog;
+ else
+ type = src_file;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch
new file mode 100644
index 000000000..816a409cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/add-the-needed-stdarg.h.patch
@@ -0,0 +1,25 @@
+From df5d45b2d7ad7e7b5f0542a816d08b0409a529a1 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] [PATCH] add the needed stdarg.h
+
+Upstream-status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ lib/defaults.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/defaults.c b/lib/defaults.c
+index 0e48a78..667f35d 100644
+--- a/lib/defaults.c
++++ b/lib/defaults.c
+@@ -16,6 +16,7 @@
+
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <stdarg.h>
+ #include <ctype.h>
+ #include <string.h>
+ #include <sys/utsname.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch
new file mode 100644
index 000000000..1d5c3e1ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-do-not-check-for-modprobe.patch
@@ -0,0 +1,89 @@
+From 2cbc576ea1fbd1cbf4579d64b30e41d762084e7f Mon Sep 17 00:00:00 2001
+From: "yanjun.zhu" <yanjun.zhu@windriver.com>
+Date: Tue, 15 Jan 2013 12:45:44 +0800
+Subject: [PATCH] autofs: do not check for modprobe
+
+Description: Loading autofs module is #ifdef'ed in the source, so
+ there is no need to check for /proc (which is only used
+ to load module) or modprobe. Both modprobe and /proc
+ are always in the fixed location so there's no need to
+ check for these to start with.
+
+Upstream-Status: Backport [1]
+[1] http://www.spinics.net/lists/autofs/msg00139.html
+
+---
+ configure.in | 6 ------
+ daemon/module.c | 3 +++
+ include/automount.h | 11 +++--------
+ 3 files changed, 6 insertions(+), 14 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 44a1c8b..b226236 100644
+--- a/configure.in
++++ b/configure.in
+@@ -34,11 +34,6 @@ AC_MSG_CHECKING([for binaries in])
+ AC_MSG_RESULT([$searchpath])
+
+ #
+-# Make sure we have "/proc"
+-#
+-AF_LINUX_PROCFS()
+-
+-#
+ # Location of init.d directory?
+ #
+ AF_INIT_D()
+@@ -142,7 +137,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umount, $searchpath)
+ AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath)
+ AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath)
+ AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath)
+-AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath)
+
+ AF_CHECK_PROG(LEX, flex lex, , $searchpath)
+ AF_CHECK_PROG(YACC, bison, , $searchpath)
+diff --git a/daemon/module.c b/daemon/module.c
+index bed8f7a..e41a98e 100644
+--- a/daemon/module.c
++++ b/daemon/module.c
+@@ -19,6 +19,8 @@
+ #include "automount.h"
+ #include "nsswitch.h"
+
++#if 0
++/* see comment in daemon/automount.c around load_autofs4_module() call */
+ int load_autofs4_module(void)
+ {
+ FILE *fp;
+@@ -53,6 +55,7 @@ int load_autofs4_module(void)
+
+ return 1;
+ }
++#endif
+
+ int open_lookup(const char *name, const char *err_prefix, const char *mapfmt,
+ int argc, const char *const *argv, struct lookup_mod **lookup)
+diff --git a/include/automount.h b/include/automount.h
+index c0f5fbf..cc336ad 100644
+--- a/include/automount.h
++++ b/include/automount.h
+@@ -51,16 +51,11 @@
+ #error Failed to locate umount(8)!
+ #endif
+
+-#ifndef HAVE_MODPROBE
+-#error Failed to locate modprobe(8)!
+-#endif
+-
+-#ifndef HAVE_LINUX_PROCFS
+-#error Failed to verify existence of procfs filesystem!
+-#endif
+-
++#if 0
++/* see comment in daemon/automount.c around load_autofs4_module() call */
+ #define FS_MODULE_NAME "autofs4"
+ int load_autofs4_module(void);
++#endif
+
+ /* The -s (sloppy) option to mount is good, if we have it... */
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch
new file mode 100644
index 000000000..8e06db6e4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-fix-lib-deps.patch
@@ -0,0 +1,26 @@
+From 080626108c9ab70e2489752ef2a14006d0564b0c Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe.macdonald@windriver.com>
+Date: Tue, 18 Jun 2013 10:05:21 -0400
+Subject: [PATCH] Fix the dependency issue
+
+Upstream-Status: Pending
+
+autofs's lib sources have a dependency on a number of files that are
+generated by rpcgen during buildtime
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
+
+---
+ lib/Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 518b483..4798a4b 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -81,3 +81,4 @@ install: all
+ clean:
+ rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~
+
++$(OBJS): $(RPCS)
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch
new file mode 100644
index 000000000..9b0942ebf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch
@@ -0,0 +1,30 @@
+From 2256b8aa98cff15ddf2a8d36496e6c9125927901 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Wed, 13 Mar 2013 16:17:08 +0100
+Subject: [PATCH] autofs-5.0.7: include linux/nfs.h directly in rpc_subs.h
+
+Upstream-Status: Pending
+
+Fixes compile error with uclibc. Glibc's nfs/nfs.h contains
+nothing but "#include linux/nfs.h". rpc_subs.h already includes
+other linux/nfs*.h files directly.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+---
+ include/rpc_subs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/rpc_subs.h b/include/rpc_subs.h
+index e744e89..83db47e 100644
+--- a/include/rpc_subs.h
++++ b/include/rpc_subs.h
+@@ -18,7 +18,7 @@
+
+ #include <rpc/rpc.h>
+ #include <rpc/pmap_prot.h>
+-#include <nfs/nfs.h>
++#include <linux/nfs.h>
+ #include <linux/nfs2.h>
+ #include <linux/nfs3.h>
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
new file mode 100644
index 000000000..18ce19385
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/autofs-5.1.2-libtirpc-as-need.patch
@@ -0,0 +1,39 @@
+From b31decac4acb194b020c621d2d11019f636a45e0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 20:41:25 -0700
+Subject: [PATCH] autofs: Upgrade to 5.1.2 release
+
+Make configure compatible with -Wl,--as-needed following
+https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Failure_in_..2Fconfigure
+
+2016-07-05 Martin von Gagern
+
+---
+ aclocal.m4 | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 0e4a624..2e620cd 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -415,9 +415,9 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
+ [
+ # save current flags
+ af_check_libtirpc_save_cflags="$CFLAGS"
+-af_check_libtirpc_save_ldflags="$LDFLAGS"
++af_check_libtirpc_save_libs="$LIBS"
+ CFLAGS="$CFLAGS -I=/usr/include/tirpc"
+-LDFLAGS="$LDFLAGS -ltirpc"
++LIBS="$LIBS -ltirpc"
+
+ AC_TRY_LINK(
+ [ #include <rpc/rpc.h> ],
+@@ -440,7 +440,7 @@ AC_CHECK_FUNCS([getrpcbyname getservbyname])
+
+ # restore flags
+ CFLAGS="$af_check_libtirpc_save_cflags"
+-LDFLAGS="$af_check_libtirpc_save_ldflags"
++LIBS="$af_check_libtirpc_save_libs"
+ ])
+
+ AC_DEFUN([AF_WITH_LIBTIRPC],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch
new file mode 100644
index 000000000..b25c43f74
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/cross.patch
@@ -0,0 +1,53 @@
+From b9b44cd82caceeb638cc6a862b5bb90b93ad6c6a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ aclocal.m4 | 2 ++
+ configure.in | 8 ++++++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 2115204..2a9a802 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -7,6 +7,8 @@ dnl --------------------------------------------------------------------------
+ AC_DEFUN(AF_PATH_INCLUDE,
+ [AC_PATH_PROGS($1,$2,$3,$4)
+ if test -n "$$1"; then
++ AH_TEMPLATE([HAVE_$1], [Have $2])
++ AH_TEMPLATE([PATH_$1], [Have $2])
+ AC_DEFINE(HAVE_$1,1,[define if you have $1])
+ AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1])
+ HAVE_$1=1
+diff --git a/configure.in b/configure.in
+index 25d7c4e..44a1c8b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -324,13 +324,15 @@ AC_PROG_CC
+ cat > pietest.c <<EOF
+ int main(void) { return 0; }
+ EOF
++AF_tmp_ldflags="$LDFLAGS"
++AF_tmp_cflags="$CFLAGS"
+ CFLAGS=-fPIE
+ LDFLAGS=-pie
+ DAEMON_CFLAGS=
+ DAEMON_LDFLAGS=
+ AC_MSG_CHECKING([whether gcc -fPIE works])
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
+- [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])],
++ [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no])
+ AC_MSG_RESULT([$gcc_supports_pie])
+ if test $gcc_supports_pie = yes ; then
+ DAEMON_CFLAGS="-fPIE"
+@@ -339,6 +341,8 @@ fi
+ rm -f pietest.c
+ AC_SUBST(DAEMON_CFLAGS)
+ AC_SUBST(DAEMON_LDFLAGS)
++CFLAGS="${AF_tmp_cflags}"
++LDFLAGS="${AF_tmp_ldflags}"
+
+ #
+ # Enable ability to access value in external env variable
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch
new file mode 100644
index 000000000..21a97c8f5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix-the-YACC-rule-to-fix-a-building-failure.patch
@@ -0,0 +1,63 @@
+From 971d48a00ef82880c34e89778bf430a01360ebd5 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Mon, 18 May 2015 16:28:36 +0800
+Subject: [PATCH] [PATCH] fix the YACC rule to fix a building failure
+
+Upstream-Statu: Pending
+
+The original rule will create the header file twice, one is that the header
+file as the object file is created, other time is when create the C source file.
+since YACC always has "-d" parameter.
+
+This lead to a race when compile amd_tok.o, the header file maybe rewritten.
+ |----------------------
+ |amd_tok.l:359:10: error: 'RBRACKET' undeclared (first use in this function)
+ | ")" { return RBRACKET; }
+ | ^
+ |../Makefile.rules:64: recipe for target 'amd_tok.o' failed
+ |----------------------
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ lib/Makefile | 6 ++++--
+ modules/Makefile | 3 ++-
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 4798a4b..c40cf86 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -57,7 +57,8 @@ mount_xdr.o: mount_xdr.c
+ master_tok.c: master_tok.l
+ $(LEX) -o$@ -Pmaster_ $?
+
+-master_parse.tab.c master_parse.tab.h: master_parse.y
++master_parse.tab.h: master_parse.tab.c
++master_parse.tab.c: master_parse.y
+ $(YACC) -v -d -p master_ -b master_parse $?
+
+ master_tok.o: master_tok.c master_parse.tab.h
+@@ -67,7 +68,8 @@ master_parse.tab.o: master_parse.tab.c master_parse.tab.h
+ nss_tok.c: nss_tok.l
+ $(LEX) -o$@ -Pnss_ $?
+
+-nss_parse.tab.c nss_parse.tab.h: nss_parse.y
++nss_parse.tab.h: nss_parse.tab.c
++nss_parse.tab.c: nss_parse.y
+ $(YACC) -v -d -p nss_ -b nss_parse $?
+
+ nss_tok.o: nss_tok.c nss_parse.tab.h
+diff --git a/modules/Makefile b/modules/Makefile
+index d9ab06c..abc7698 100644
+--- a/modules/Makefile
++++ b/modules/Makefile
+@@ -103,7 +103,8 @@ amd_tok.c: amd_tok.l
+
+ amd_tok.o: amd_tok.c amd_parse.tab.h
+
+-amd_parse.tab.c amd_parse.tab.h: amd_parse.y
++amd_parse.tab.h: amd_parse.tab.c
++amd_parse.tab.c: amd_parse.y
+ $(YACC) -v -d -p amd_ -b amd_parse $?
+
+ amd_parse.tab.o: amd_parse.tab.c amd_parse.tab.h
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
new file mode 100644
index 000000000..414325974
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/fix_disable_ldap.patch
@@ -0,0 +1,47 @@
+From c500d9906f163bf716c872d37403b9de02ef0a86 Mon Sep 17 00:00:00 2001
+From: Amy Fong <amy.fong@windriver.com>
+Date: Fri, 18 Jan 2013 12:13:32 -0500
+Subject: [PATCH] autofs: fails to compile with openldap disabled
+
+As of 5.0.6, it appears that changes were introduced so that
+if you compile with openldap disabled and openldap headers are not
+available, then autofs fails to build.
+
+Upstream-Status: Pending
+
+Signed-off-by: Amy Fong <amy.fong@windriver.com>
+--
+ lookup_ldap.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+---
+ include/lookup_ldap.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h
+index 3a7aba7..bfdb0b3 100644
+--- a/include/lookup_ldap.h
++++ b/include/lookup_ldap.h
+@@ -1,7 +1,9 @@
+ #ifndef LOOKUP_LDAP_H
+ #define LOOKUP_LDAP_H
+
++#ifdef WITH_LDAP
+ #include <ldap.h>
++#endif
+
+ #ifdef WITH_SASL
+ #include <openssl/ssl.h>
+@@ -117,10 +119,12 @@ struct lookup_context {
+
+ #define LDAP_AUTH_USESIMPLE 0x0008
+
++#ifdef WITH_LDAP
+ /* lookup_ldap.c */
+ LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt);
+ int unbind_ldap_connection(unsigned logopt, struct ldap_conn *conn, struct lookup_context *ctxt);
+ int authtype_requires_creds(const char *authtype);
++#endif
+
+ #ifdef WITH_SASL
+ /* cyrus-sasl.c */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch
new file mode 100644
index 000000000..21396dd6f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/force-STRIP-to-emtpy.patch
@@ -0,0 +1,26 @@
+From 3cbee00fe5725b87abdae80cfa2ee735e4513ca6 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] [PATCH] force STRIP to emtpy
+
+otherwise the generate file will be stripped
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ Makefile.rules | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.rules b/Makefile.rules
+index 709dd04..b1f7e50 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -31,7 +31,7 @@ LDFLAGS ?= -s
+ endif
+
+ ifdef DONTSTRIP
+-STRIP ?= :
++STRIP = :
+ else
+ STRIP ?= strip --strip-debug
+ endif
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch
new file mode 100644
index 000000000..0a2d502b8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/libtirpc.patch
@@ -0,0 +1,35 @@
+From cb6a4f61adb027f2366318f2c08c8264ebf39218 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ Makefile.rules | 2 +-
+ aclocal.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.rules b/Makefile.rules
+index 6fa3e02..709dd04 100644
+--- a/Makefile.rules
++++ b/Makefile.rules
+@@ -46,7 +46,7 @@ CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64
+ LIBS += -lpthread
+
+ ifdef TIRPCLIB
+-CFLAGS += -I/usr/include/tirpc
++CFLAGS += -I=/usr/include/tirpc
+ LIBS += $(TIRPCLIB)
+ endif
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 2a9a802..0e4a624 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -416,7 +416,7 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
+ # save current flags
+ af_check_libtirpc_save_cflags="$CFLAGS"
+ af_check_libtirpc_save_ldflags="$LDFLAGS"
+-CFLAGS="$CFLAGS -I/usr/include/tirpc"
++CFLAGS="$CFLAGS -I=/usr/include/tirpc"
+ LDFLAGS="$LDFLAGS -ltirpc"
+
+ AC_TRY_LINK(
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch
new file mode 100644
index 000000000..c46c0e5ad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/no-bash.patch
@@ -0,0 +1,29 @@
+From a3007d7ea930823926611081bb873ddd771325cb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Jan 2013 19:53:10 -0800
+
+---
+ samples/auto.net | 2 +-
+ samples/auto.smb | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/samples/auto.net b/samples/auto.net
+index 0384f61..61215f6 100755
+--- a/samples/auto.net
++++ b/samples/auto.net
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # This file must be executable to work! chmod 755!
+
+diff --git a/samples/auto.smb b/samples/auto.smb
+index 6af5d85..d296b81 100755
+--- a/samples/auto.smb
++++ b/samples/auto.smb
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+
+ # This file must be executable to work! chmod 755!
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
new file mode 100644
index 000000000..1c7b11997
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/pkgconfig-libnsl.patch
@@ -0,0 +1,28 @@
+From e3ae56cf0bb4063c31295f45d04e3c504f4b6cc7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 24 Apr 2017 20:41:25 -0700
+Subject: [PATCH] autofs: Upgrade to 5.1.2 release
+
+Use pkg-config first to look for external libnsl which is now
+split out from glibc, if it does not exist then see if its provided
+by glibc itself.
+
+-Khem
+
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 9cf73b8..1016c71 100644
+--- a/configure.in
++++ b/configure.in
+@@ -186,7 +186,7 @@ fi
+ #
+ # glibc/libc 6 new libraries
+ #
+-AC_CHECK_LIB(nsl, yp_match, LIBNSL="-lnsl")
++PKG_CHECK_MODULES([NSL], [libnsl], [], [AC_CHECK_LIB([nsl],[yp_match],[LIBNSL="-lnsl"],[LIBNSL=""])])
+ AC_SUBST(LIBNSL)
+
+ AC_CHECK_LIB(resolv, res_query, LIBRESOLV="-lresolv")
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch
new file mode 100644
index 000000000..4183069bb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/remove-bashism.patch
@@ -0,0 +1,118 @@
+From cfacbb917f87b903b50132a5025f86b0cc522e9c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 13 Sep 2014 20:19:28 -0700
+Subject: [PATCH] autofs.init.in: remove bashism
+
+It can work without the bashism.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ redhat/autofs.init.in | 12 ++++++------
+ samples/rc.autofs.in | 10 +++++-----
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
+index 9d008ff..4f1c0d8 100644
+--- a/redhat/autofs.init.in
++++ b/redhat/autofs.init.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # rc file for automount using a Sun-style "master map".
+ #
+@@ -42,7 +42,7 @@ if [ -r $confdir/autofs ]; then
+ . $confdir/autofs
+ fi
+
+-function start() {
++start() {
+ # Make sure autofs4 module is loaded
+ if ! grep -q autofs /proc/filesystems
+ then
+@@ -102,7 +102,7 @@ function start() {
+ return $RETVAL
+ }
+
+-function stop() {
++stop() {
+ echo -n $"Stopping $prog: "
+ count=0
+ while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
+@@ -125,7 +125,7 @@ function stop() {
+ return $RETVAL
+ }
+
+-function restart() {
++restart() {
+ status autofs > /dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ stop
+@@ -143,7 +143,7 @@ function restart() {
+ start
+ }
+
+-function reload() {
++reload() {
+ if [ ! -f /var/lock/subsys/autofs ]; then
+ echo $"$prog not running"
+ RETVAL=1
+@@ -161,7 +161,7 @@ function reload() {
+ return $RETVAL
+ }
+
+-function usage_message() {
++usage_message() {
+ echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}"
+ }
+
+diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
+index 487669f..e96cde1 100644
+--- a/samples/rc.autofs.in
++++ b/samples/rc.autofs.in
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # rc file for automount using a Sun-style "master map".
+ #
+@@ -36,7 +36,7 @@ if [ -r $confdir/autofs ]; then
+ . $confdir/autofs
+ fi
+
+-function start() {
++start() {
+ echo -n "Starting $prog: "
+
+ # Make sure autofs4 module is loaded
+@@ -85,7 +85,7 @@ function start() {
+ return $RETVAL
+ }
+
+-function stop() {
++stop() {
+ echo -n $"Stopping $prog: "
+ count=0
+ while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
+@@ -102,7 +102,7 @@ function stop() {
+ return $RETVAL
+ }
+
+-function restart() {
++restart() {
+ stop
+ while [ -n "`pidof $prog`" ] ; do
+ sleep 5
+@@ -110,7 +110,7 @@ function restart() {
+ start
+ }
+
+-function reload() {
++reload() {
+ pid=`pidof $prog`
+ if [ -z $pid ]; then
+ echo $"$prog not running"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch
new file mode 100644
index 000000000..3d0c6bd71
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs/using-pkg-config-to-detect-libxml-2.0-and-krb5.patch
@@ -0,0 +1,40 @@
+From dabcbdae38038a8e4ad2c4286112381c407c5ce7 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 Aug 2014 11:31:35 +0800
+Subject: [PATCH] using pkg-config to detect libxml-2.0 and krb5
+
+Upstream-status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ configure.in | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index b226236..9cf73b8 100644
+--- a/configure.in
++++ b/configure.in
+@@ -162,8 +162,20 @@ if test x$enable_sloppy_mount = xyes; then
+ fi
+
+ # LDAP SASL auth needs libxml and Kerberos
+-AF_CHECK_LIBXML()
+-AF_CHECK_KRB5()
++PKG_CHECK_MODULES(XML, [libxml-2.0],HAVE_LIBXML=1,HAVE_LIBXML=0)
++AC_SUBST([HAVE_LIBXML])
++XML_FLAGS=$XML_CFLAGS
++
++PKG_CHECK_MODULES(KRB5, [krb5],HAVE_KRB5=1,HAVE_KRB5=0)
++AC_SUBST([HAVE_KRB5])
++if test "x$HAVE_KRB5" = "x1"; then
++ SAVE_CFLAGS=$CFLAGS
++ SAVE_LIBS=$LIBS
++ CFLAGS="$CFLAGS $KRB5_FLAGS"
++ LIBS="$LIBS $KRB5_LIBS"
++
++ AC_CHECK_FUNCS([krb5_principal_get_realm])
++fi
+
+ AC_SEARCH_LIBS([versionsort],[])
+ if test "$ac_cv_search_versionsort" = "no"; then
diff --git a/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
new file mode 100644
index 000000000..68c64fdb0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/autofs/autofs_5.1.2.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Kernel based automounter for linux"
+SECTION = "utils"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+DEPENDS += "libtirpc flex-native bison-native e2fsprogs openssl libxml2 util-linux cyrus-sasl libnsl2"
+
+CFLAGS += "-I${STAGING_INCDIR}/tirpc"
+
+inherit autotools-brokensep systemd update-rc.d pkgconfig
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.gz \
+ file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \
+ file://no-bash.patch \
+ file://cross.patch \
+ file://libtirpc.patch \
+ file://autofs-5.0.7-do-not-check-for-modprobe.patch \
+ file://fix_disable_ldap.patch \
+ file://autofs-5.0.7-fix-lib-deps.patch \
+ file://add-the-needed-stdarg.h.patch \
+ file://using-pkg-config-to-detect-libxml-2.0-and-krb5.patch \
+ file://force-STRIP-to-emtpy.patch \
+ file://remove-bashism.patch \
+ file://fix-the-YACC-rule-to-fix-a-building-failure.patch \
+ file://0001-Define-__SWORD_TYPE-and-_PATH_NSSWITCH_CONF.patch \
+ file://0002-Replace-__S_IEXEC-with-S_IEXEC.patch \
+ file://autofs-5.1.2-libtirpc-as-need.patch \
+ file://pkgconfig-libnsl.patch \
+ file://0001-modules-lookup_multi.c-Replace-__S_IEXEC-with-S_IEXE.patch \
+ "
+SRC_URI[md5sum] = "28cf88f99eff553a8500659ba5d45a76"
+SRC_URI[sha256sum] = "0d57e4138c2ec8058ca92164d035546f68ce4af93acb893369993d67c7056a10"
+
+INITSCRIPT_NAME = "autofs"
+INITSCRIPT_PARAMS = "defaults"
+
+# FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS
+#CFLAGS += "${LDFLAGS}"
+
+PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+
+EXTRA_OEMAKE = "DONTSTRIP=1"
+EXTRA_OECONF += "--disable-mount-locking \
+ --enable-ignore-busy --with-openldap=no \
+ --with-sasl=no --with-libtirpc \
+ --with-path=${STAGING_BINDIR_NATIVE} \
+"
+CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \
+ ac_cv_path_RPCGEN=rpcgen \
+"
+
+do_configure_prepend () {
+ sed -e "s:filagdir:flagdir:" -i ${S}/configure.in
+ if [ ! -e ${S}/acinclude.m4 ]; then
+ cp ${S}/aclocal.m4 ${S}/acinclude.m4
+ fi
+}
+
+do_install_append () {
+ if [ -d ${D}/run ]; then
+ rmdir ${D}/run
+ fi
+ if [ -d ${D}${localstatedir}/run ]; then
+ rmdir ${D}${localstatedir}/run
+ fi
+}
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "autofs.service"
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
new file mode 100644
index 000000000..3fa8431c3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch
@@ -0,0 +1,25 @@
+Fix hardcoded libdir.
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ plugins/Makefile.am | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/Makefile.am b/plugins/Makefile.am
+index b00915f..25262a1 100644
+--- a/plugins/Makefile.am
++++ b/plugins/Makefile.am
+@@ -62,7 +62,7 @@ plugindir = @plugindir@
+
+ common_sources = plugin_common.c plugin_common.h
+
+-sasldir = $(prefix)/lib/sasl2
++sasldir = $(libdir)/sasl2
+ sasl_LTLIBRARIES = @SASL_MECHS@
+ EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \
+ libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \
+--
+1.7.4.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch
@@ -0,0 +1,46 @@
+Avoid to call AC_TRY_RUN
+
+Upstream-Status: Inappropriate [configuration]
+
+Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO
+on cross-compile environment by definition AC_ARG_ENABLE enable-spnego
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ cmulocal/sasl2.m4 | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/cmulocal/sasl2.m4 b/cmulocal/sasl2.m4
+index 3c2841a..a5ecf81 100644
+--- a/cmulocal/sasl2.m4
++++ b/cmulocal/sasl2.m4
+@@ -281,6 +281,17 @@ if test "$gssapi" != no; then
+
+ cmu_save_LIBS="$LIBS"
+ LIBS="$LIBS $GSSAPIBASE_LIBS"
++ AC_ARG_ENABLE([spnego],
++ [AC_HELP_STRING([--enable-spnego=<DIR>],
++ [enable SPNEGO support in GSSAPI libraries [no]])],
++ [spnego=$enableval],
++ [spnego=no])
++
++ if test "$spnego" = no; then
++ echo "no"
++ elif test "$spnego" = yes; then
++ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
++ else
+ AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries])
+ AC_TRY_RUN([
+ #ifdef HAVE_GSSAPI_H
+@@ -308,7 +319,7 @@ int main(void)
+ AC_MSG_RESULT(yes) ],
+ AC_MSG_RESULT(no))
+ LIBS="$cmu_save_LIBS"
+-
++ fi
+ else
+ AC_MSG_RESULT([disabled])
+ fi
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff
@@ -0,0 +1,14 @@
+Author: Fabian Fagerholm <fabbe@debian.org>
+Description: Fix linking with libsasldb.a when saslauthd is built with sasldb
+support.
+--- a/saslauthd/configure.in
++++ b/saslauthd/configure.in
+@@ -77,7 +77,7 @@ if test "$authsasldb" != no; then
+ AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support])
+ SASL_DB_PATH_CHECK()
+ SASL_DB_CHECK()
+- SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al"
++ SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a"
+ fi
+
+ AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff
@@ -0,0 +1,27 @@
+Author: Fabian Fagerholm <fabbe@debian.org>
+Description: This patch makes sure the non-PIC version of libsasldb.a, which
+is created out of non-PIC objects, is not going to overwrite the PIC version,
+which is created out of PIC objects. The PIC version is placed in .libs, and
+the non-PIC version in the current directory. This ensures that both non-PIC
+and PIC versions are available in the correct locations.
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -78,7 +78,7 @@ endif
+
+ libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS)
+ @echo adding static plugins and dependencies
+- $(AR) cru .libs/$@ $(SASL_STATIC_OBJS)
++ $(AR) cru $@ $(SASL_STATIC_OBJS)
+ @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \
+ if test ! -f $$i; then continue; fi; . $$i; \
+ for j in $$dependency_libs foo; do \
+--- a/sasldb/Makefile.am
++++ b/sasldb/Makefile.am
+@@ -63,6 +63,6 @@ libsasldb_a_SOURCES =
+ EXTRA_libsasldb_a_SOURCES =
+
+ libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC)
+- $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC)
++ $(AR) cru $@ $(SASL_DB_BACKEND_STATIC)
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch
@@ -0,0 +1,31 @@
+From 92d72789c811b0d55f624a8bac5ccc4412f5996e Mon Sep 17 00:00:00 2001
+From: Ken Murchison <murch@andrew.cmu.edu>
+Date: Thu, 20 Dec 2012 18:14:50 -0500
+Subject: [PATCH] sasl.h: #include <stddef.h> for size_t on NetBSD
+
+This patch was imported from git://git.cyrusimap.org/cyrus-sasl
+commit 67a188693796a14e3a76ac603104807fbbfddfc4
+
+Upstream-Status: Backport
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ include/sasl.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/sasl.h b/include/sasl.h
+index fef4d51..8b8a63f 100755
+--- a/include/sasl.h
++++ b/include/sasl.h
+@@ -121,6 +121,8 @@
+ #ifndef SASL_H
+ #define SASL_H 1
+
++#include <stddef.h> /* For size_t */
++
+ /* Keep in sync with win32/common.mak */
+ #define SASL_VERSION_MAJOR 2
+ #define SASL_VERSION_MINOR 1
+--
+1.8.3.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf
new file mode 100644
index 000000000..a91a9d334
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf
@@ -0,0 +1,11 @@
+# Directory in which to place saslauthd's listening socket, pid file, and so
+# on. This directory must already exist.
+SOCKETDIR=@LOCALSTATEDIR@/run/saslauthd
+
+# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
+# of which mechanism your installation was compiled with the ablity to use.
+MECH=pam
+
+# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
+# for the list of accepted flags.
+FLAGS=
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service
new file mode 100644
index 000000000..96dbae378
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=SASL authentication daemon.
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=@LOCALSTATEDIR@/run/saslauthd/saslauthd.pid
+EnvironmentFile=@SYSCONFDIR@/default/saslauthd
+ExecStart=@SBINDIR@/saslauthd -m $SOCKETDIR -a $MECH $FLAGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
new file mode 100644
index 000000000..6dbff87dd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb
@@ -0,0 +1,96 @@
+SUMMARY = "Generic client/server library for SASL authentication"
+SECTION = "libs"
+HOMEPAGE = "http://asg.web.cmu.edu/sasl/"
+DEPENDS = "openssl db"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396"
+
+SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \
+ file://avoid-to-call-AC_TRY_RUN.patch \
+ file://Fix-hardcoded-libdir.patch \
+ file://debian_patches_0009_sasldb_al.diff \
+ file://debian_patches_0014_avoid_pic_overwrite.diff \
+ file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \
+ file://saslauthd.service \
+ file://saslauthd.conf \
+"
+
+inherit autotools-brokensep pkgconfig useradd systemd
+
+EXTRA_OECONF += "--with-dblib=berkeley \
+ --with-bdb-libdir=${STAGING_LIBDIR} \
+ --with-bdb-incdir=${STAGING_INCDIR} \
+ --with-bdb=db-5.3 \
+ --with-plugindir="${libdir}/sasl2" \
+ andrew_cv_runpath_switch=none"
+
+PACKAGECONFIG ??= "ntlm \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 ldap pam', d)} \
+"
+PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5,"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
+PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie,"
+PACKAGECONFIG[des] = "--with-des,--without-des,,"
+PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap,"
+PACKAGECONFIG[ntlm] = "--with-ntlm,--without-ntlm,,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+CFLAGS += "-fPIC"
+
+do_configure_prepend () {
+ rm -f acinclude.m4 config/libtool.m4
+
+ # make it be able to work with db 5.0 version
+ local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c"
+ for sed_file in $sed_files; do
+ sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' $sed_file
+ done
+}
+
+do_compile_prepend () {
+ cd include
+ ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} makemd5.c -o makemd5
+ touch makemd5.o makemd5.lo makemd5
+ cd ..
+}
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service
+
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf
+
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd
+ fi
+}
+
+USERADD_PACKAGES = "${PN}-bin"
+USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus"
+
+SYSTEMD_PACKAGES = "${PN}-bin"
+SYSTEMD_SERVICE_${PN}-bin = "saslauthd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425"
+SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3"
+
+PACKAGES =+ "${PN}-bin"
+
+FILES_${PN} += "${libdir}/sasl2/*.so*"
+FILES_${PN}-bin += "${bindir} \
+ ${sysconfdir}/default/saslauthd \
+ ${systemd_unitdir}/system/saslauthd.service \
+ ${sysconfdir}/tmpfiles.d/saslauthd.conf"
+FILES_${PN}-dev += "${libdir}/sasl2/*.la"
+FILES_${PN}-dbg += "${libdir}/sasl2/.debug"
+FILES_${PN}-staticdev += "${libdir}/sasl2/*.a"
+
+INSANE_SKIP_${PN} += "dev-so"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample
new file mode 100644
index 000000000..ec0584193
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.conf.sample
@@ -0,0 +1,21 @@
+# options to dnrd
+
+# example: two default dns servers and dns servers for exampledomain.com. The
+# latter are load balanced (-b)
+#
+#
+
+# DNRD_OPTS="
+# -s XXX.XXX.XX.XXX
+# -s XXX.XXX.XX.XXX
+# -b
+# -s XXX.XXX.XX.XXX:exampledomain.com
+# -s XXX.XXX.XX.XXX:exampledomain.com"
+
+# example: dnrd user
+#
+
+# DNRD_USER="user"
+#
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init
new file mode 100644
index 000000000..2fe583fcf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.init
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# Startup script for dnrd
+#
+# Copyright 2008, Rakesh Pandit <rakesh.pandit@gmail.com>
+#
+# This source is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This source is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# chkconfig: - 85 15
+# description: dnrd is a proxying nameserver. It forwards DNS queries to the
+# appropriate nameserver, but can also act as the primary nameserver for
+# a subnet behind a firewall. It also has features such as caching DNS
+# requests, support for DNS servers, cache poisoning prevention, TCP
+# support, etc..
+
+# processname: dnrd
+# pidfile: /var/run/dnrd.pid
+# config: /etc/dnrd/dnrd.conf
+
+# Provides: dnrd
+# Required-Start:
+# Should-Start:
+# Required-Stop:
+# Default-Stop: 0 1 2 6
+# Short-Description: Start dnrd daemon
+# Description: Domain Name Relay Daemon
+# END INIT INFO
+
+exe=/usr/sbin/dnrd
+pfile=/etc/passwd
+
+# Source function library.
+. /etc/init.d/functions
+
+# Source conf file
+. /etc/dnrd/dnrd.conf
+
+[ -x $exe ] || exit 1
+[ -r "/etc/dnrd/dnrd.conf" ] || exit 1
+if [ $DNRD_USER ]
+then
+ grep "^${LOGIN}:" $pfile >/dev/null 2>&1
+ if [ $? -eq 0 ];then
+ echo "$DNRD_USER specified in /etc/dnrd/dnrd.conf does not exist!"
+ fi
+else
+ echo "DNRD_USER not set at /etc/dnrd/dnrd.conf!"
+ exit 1
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting dnrd: "
+ daemon dnrd $DNRD_OPTS -u $DNRD_USER
+ echo
+ touch /var/lock/subsys/dnrd
+ ;;
+ stop)
+ echo -n "Shutting down dnrd: "
+ killproc dnrd
+ echo
+ rm -f /var/lock/subsys/dnrd
+ rm -f /var/run/dnrd.pid
+ ;;
+ status)
+ status dnrd
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ reload)
+ echo -n "Reloading dnrd: "
+ killproc dnrd -HUP
+ echo
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|status}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service
new file mode 100644
index 000000000..9c9fa6639
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/dnrd/dnrd/dnrd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Domain Name Relay Daemon
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/dnrd.pid
+EnvironmentFile=/etc/dnrd/dnrd.conf
+ExecStart=/usr/sbin/dnrd $DNRD_OPTS -u $DNRD_USER
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch
new file mode 100644
index 000000000..82cdc36ac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy/0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch
@@ -0,0 +1,25 @@
+From a557651a08e21e3c7c7f5eca9f5405f86624903f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 22:42:51 -0700
+Subject: [PATCH] src/igmpproxy.h: Include sys/types.h for u_short/u_init
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/igmpproxy.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/igmpproxy.h b/src/igmpproxy.h
+index 4dabd1c..4454729 100644
+--- a/src/igmpproxy.h
++++ b/src/igmpproxy.h
+@@ -46,6 +46,7 @@
+ #include <stdbool.h>
+
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <sys/un.h>
+ #include <sys/time.h>
+ #include <sys/ioctl.h>
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
new file mode 100644
index 000000000..5424dc455
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/igmpproxy/igmpproxy_0.1.bb
@@ -0,0 +1,16 @@
+SUMMARY = "simple dynamic multicast routing daemon that only uses IGMP signalling"
+HOMEPAGE = "http://sourceforge.net/projects/igmpproxy/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1e995e2799bb0d27d63069b97f805420"
+
+SRC_URI = "http://sourceforge.net/projects/igmpproxy/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://0001-src-igmpproxy.h-Include-sys-types.h-for-u_short-u_in.patch \
+ "
+
+SRC_URI[md5sum] = "c56f41ec195bc1fe016369bf74efc5a1"
+SRC_URI[sha256sum] = "ee18ff3d8c3ae3a29dccb7e5eedf332337330020168bd95a11cece8d7d7ee6ae"
+
+inherit autotools pkgconfig
+
+CFLAGS += "-D_GNU_SOURCE"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch
new file mode 100644
index 000000000..e96762125
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-Respect-flags-from-env.patch
@@ -0,0 +1,56 @@
+From 4848b9e4d516a9203c08432901a7b40419e8f43c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 15:54:35 -0700
+Subject: [PATCH 1/3] Respect flags from env
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ cli/Makefile | 2 +-
+ pppd/Makefile | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a05a000..439a978 100644
+--- a/Makefile
++++ b/Makefile
+@@ -81,8 +81,8 @@ LIBS.dmalloc= -ldmalloc
+ export USE_DMALLOC
+ endif
+
+-CPPFLAGS= $(CPPFLAGS.ippooltest)
+-CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
++CPPFLAGS+= $(CPPFLAGS.ippooltest)
++CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+ LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+ LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+
+diff --git a/cli/Makefile b/cli/Makefile
+index 4b5dd59..56fbf2f 100644
+--- a/cli/Makefile
++++ b/cli/Makefile
+@@ -7,7 +7,7 @@ CLI_SRCS_TEST.o= $(CLI_SRCS_TEST.c:%.c=%.o)
+
+ LDFLAGS.cli_test= -L.. -L. $(READLINE_LDFLAGS) -lcli -lusl -lreadline -lcurses -lc
+
+-CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS)
++CFLAGS= $(CFLAGS.optimize) -MMD -Wall -Werror -I.. $(READLINE_CFLAGS) $(CPPFLAGS)
+
+ .PHONY: all test clean
+
+diff --git a/pppd/Makefile b/pppd/Makefile
+index 106deca..7fd815f 100644
+--- a/pppd/Makefile
++++ b/pppd/Makefile
+@@ -10,7 +10,7 @@ endif
+
+ # END CONFIGURABLE SETTINGS
+
+-CFLAGS += -g -I.. -I/usr/include/pppd $(CFLAGS.pppd) -fPIC
++CFLAGS += -g -I.. -I=/usr/include/pppd $(CFLAGS.pppd) -fPIC
+ LDFLAGS += -shared
+
+ all: ippool.so
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch
new file mode 100644
index 000000000..7d3f9acb6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-read-returns-ssize_t.patch
@@ -0,0 +1,31 @@
+From e4e0aae139b6489dc582fd14e54e562126482ce2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:23:53 -0700
+Subject: [PATCH 1/3] read() returns ssize_t
+
+Fixes
+usl_fd.c:284:10: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
+ if (nb < 0) {
+ ~~ ^ ~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_fd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usl/usl_fd.c b/usl/usl_fd.c
+index 3b7a813..04ba48c 100644
+--- a/usl/usl_fd.c
++++ b/usl/usl_fd.c
+@@ -280,7 +280,7 @@ size_t usl_fd_read(int fd, void *buf, size_t count)
+ char *ptr = buf;
+
+ for (chars_read = 0; chars_read < count; ) {
+- size_t nb = read(fd, ptr, count - chars_read);
++ ssize_t nb = read(fd, ptr, count - chars_read);
+ if (nb < 0) {
+ if (errno == EINTR)
+ continue;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
new file mode 100644
index 000000000..6fb7cc5c4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0001-usl_timer-Check-for-return-value-of-write-API.patch
@@ -0,0 +1,28 @@
+From 5d7f20c045b3c74dad2c53d65e30bd4840250082 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 15:17:19 -0700
+Subject: [PATCH] usl_timer: Check for return value of write() API
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_timer.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index fda752b..d8414a6 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -94,7 +94,9 @@ void usl_timer_tick(void)
+
+ if (!usl_tick_pending) {
+ usl_tick_pending = 1;
+- write(usl_tick_pipe[1], &msg, sizeof(msg));
++ if (write(usl_tick_pipe[1], &msg, sizeof(msg)) != sizeof(msg)) {
++ fprintf(stderr, "write to fd %i failed: %s\n", usl_tick_pipe[1], strerror(errno));
++ }
+ }
+ }
+
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch
new file mode 100644
index 000000000..6e2bd523d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-Mark-first-element-of-a-string-as-null.patch
@@ -0,0 +1,31 @@
+From cf25576428903168cd41b183fb1ca9c2b7e2666e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:28:10 -0700
+Subject: [PATCH 2/3] Mark first element of a string as null
+
+Fixes
+cli_lib.c:427:20: error: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Werror,-Wnon-literal-null-conversion]
+ values[arg] = '\0';
+ ^~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_lib.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cli/cli_lib.c b/cli/cli_lib.c
+index 41a0b06..e4d2fd5 100644
+--- a/cli/cli_lib.c
++++ b/cli/cli_lib.c
+@@ -424,7 +424,7 @@ int cli_find_args(int argc, char *argv[], struct cli_node *cmd, struct cli_node
+ if (arg_string[1] == '\0') {
+ /* no arg value - only allowed for string args */
+ if (node->arg->parser == cli_arg_parse_string) {
+- values[arg] = '\0';
++ *values[arg] = '\0';
+ } else {
+ result = -EINVAL;
+ break;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch
new file mode 100644
index 000000000..d80f7b436
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0002-link-with-libtirpc.patch
@@ -0,0 +1,30 @@
+From 47aef26198431f7ad568c2277dded158bda3e36f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 16:00:35 -0700
+Subject: [PATCH 2/3] link with libtirpc
+
+musl needs it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 439a978..ea821eb 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,8 +83,8 @@ endif
+
+ CPPFLAGS+= $(CPPFLAGS.ippooltest)
+ CFLAGS+= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+-LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+-LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc -ltirpc
++LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses $(LIBS.dmalloc) -lc -ltirpc
+
+ OPT_CFLAGS?= -O
+
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch
new file mode 100644
index 000000000..3854b1133
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-cli-Mark-return-of-strtol-as-long-int.patch
@@ -0,0 +1,58 @@
+From 994d9575374d3cdb34b1b0f70c3c53ae76fe578e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:41:05 -0700
+Subject: [PATCH 3/3] cli: Mark return of strtol as long int
+
+strtol does not return unsigned long
+
+error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
+ if ((*endp == '\0') && (labs(tmp) < 32768)) {
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_lib.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/cli/cli_lib.c b/cli/cli_lib.c
+index e4d2fd5..5f487dc 100644
+--- a/cli/cli_lib.c
++++ b/cli/cli_lib.c
+@@ -522,7 +522,7 @@ int cli_arg_parse_int32(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
+ {
+ int16_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -539,7 +539,7 @@ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_int8(struct cli_node *arg, const char *val, void *result)
+ {
+ int8_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -573,7 +573,7 @@ int cli_arg_parse_uint32(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
+ {
+ uint16_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+@@ -590,7 +590,7 @@ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
+ int cli_arg_parse_uint8(struct cli_node *arg, const char *val, void *result)
+ {
+ uint8_t *intval = result;
+- unsigned long tmp;
++ long tmp;
+ char *endp;
+ int ret = 0;
+
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch
new file mode 100644
index 000000000..3cd5259fa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/0003-musl-fixes.patch
@@ -0,0 +1,283 @@
+From eb345047decba665e3f39908336a83f039e1ece2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Jul 2017 16:01:32 -0700
+Subject: [PATCH 3/3] musl fixes
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 7 +-
+ ippool_api.c | 9 ++-
+ net/ppp_defs.h | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ usl/usl.h | 4 ++
+ 4 files changed, 208 insertions(+), 6 deletions(-)
+ create mode 100644 net/ppp_defs.h
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 2812e6e..542935c 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -17,13 +17,14 @@
+ * Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/file.h>
+ #include <sys/stat.h>
+-#include <sys/errno.h>
++#include <fcntl.h>
++#include <errno.h>
+ #include <signal.h>
+
+ #include <readline/readline.h>
+@@ -630,7 +631,7 @@ static void cli_rl_uninstall_signal_handlers(void)
+
+ static int cli_rl_install_signal_handlers(void)
+ {
+- __sighandler_t handler;
++ sighandler_t handler;
+
+ rl_catch_signals = 0;
+ rl_clear_signals();
+diff --git a/ippool_api.c b/ippool_api.c
+index 2c10c47..d1127a9 100644
+--- a/ippool_api.c
++++ b/ippool_api.c
+@@ -181,10 +181,13 @@ int ippool_api_rpc_check_request(SVCXPRT *xprt)
+ * non-loopback interface, reject the request.
+ */
+ if ((!ippool_opt_remote_rpc) &&
+- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
+- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
++ ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
++ (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
++ char straddr[INET6_ADDRSTRLEN];
++ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
++
+ if (ippool_opt_debug) {
+- ippool_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
++ ippool_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
+ }
+ svcerr_auth(xprt, AUTH_TOOWEAK);
+ return -EPERM;
+diff --git a/net/ppp_defs.h b/net/ppp_defs.h
+new file mode 100644
+index 0000000..b06eda5
+--- /dev/null
++++ b/net/ppp_defs.h
+@@ -0,0 +1,194 @@
++/* $Id: ppp_defs.h,v 1.17 2002/12/06 09:49:15 paulus Exp $ */
++
++/*
++ * ppp_defs.h - PPP definitions.
++ *
++ * Copyright (c) 1984 Paul Mackerras. All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ *
++ * 1. Redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer.
++ *
++ * 2. Redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in
++ * the documentation and/or other materials provided with the
++ * distribution.
++ *
++ * 3. The name(s) of the authors of this software must not be used to
++ * endorse or promote products derived from this software without
++ * prior written permission.
++ *
++ * 4. Redistributions of any form whatsoever must retain the following
++ * acknowledgment:
++ * "This product includes software developed by Paul Mackerras
++ * <paulus@samba.org>".
++ *
++ * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
++ * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
++ * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
++ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
++ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#ifndef _PPP_DEFS_H_
++#define _PPP_DEFS_H_
++
++/*
++ * The basic PPP frame.
++ */
++#define PPP_HDRLEN 4 /* octets for standard ppp header */
++#define PPP_FCSLEN 2 /* octets for FCS */
++
++/*
++ * Packet sizes
++ *
++ * Note - lcp shouldn't be allowed to negotiate stuff outside these
++ * limits. See lcp.h in the pppd directory.
++ * (XXX - these constants should simply be shared by lcp.c instead
++ * of living in lcp.h)
++ */
++#define PPP_MTU 1500 /* Default MTU (size of Info field) */
++#define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN)
++#define PPP_MINMTU 64
++#define PPP_MRU 1500 /* default MRU = max length of info field */
++#define PPP_MAXMRU 65000 /* Largest MRU we allow */
++#define PPP_MINMRU 128
++
++#define PPP_ADDRESS(p) (((u_char *)(p))[0])
++#define PPP_CONTROL(p) (((u_char *)(p))[1])
++#define PPP_PROTOCOL(p) ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
++
++/*
++ * Significant octet values.
++ */
++#define PPP_ALLSTATIONS 0xff /* All-Stations broadcast address */
++#define PPP_UI 0x03 /* Unnumbered Information */
++#define PPP_FLAG 0x7e /* Flag Sequence */
++#define PPP_ESCAPE 0x7d /* Asynchronous Control Escape */
++#define PPP_TRANS 0x20 /* Asynchronous transparency modifier */
++
++/*
++ * Protocol field values.
++ */
++#define PPP_IP 0x21 /* Internet Protocol */
++#define PPP_AT 0x29 /* AppleTalk Protocol */
++#define PPP_IPX 0x2b /* IPX protocol */
++#define PPP_VJC_COMP 0x2d /* VJ compressed TCP */
++#define PPP_VJC_UNCOMP 0x2f /* VJ uncompressed TCP */
++#define PPP_IPV6 0x57 /* Internet Protocol Version 6 */
++#define PPP_COMP 0xfd /* compressed packet */
++#define PPP_IPCP 0x8021 /* IP Control Protocol */
++#define PPP_ATCP 0x8029 /* AppleTalk Control Protocol */
++#define PPP_IPXCP 0x802b /* IPX Control Protocol */
++#define PPP_IPV6CP 0x8057 /* IPv6 Control Protocol */
++#define PPP_CCP 0x80fd /* Compression Control Protocol */
++#define PPP_ECP 0x8053 /* Encryption Control Protocol */
++#define PPP_LCP 0xc021 /* Link Control Protocol */
++#define PPP_PAP 0xc023 /* Password Authentication Protocol */
++#define PPP_LQR 0xc025 /* Link Quality Report protocol */
++#define PPP_CHAP 0xc223 /* Cryptographic Handshake Auth. Protocol */
++#define PPP_CBCP 0xc029 /* Callback Control Protocol */
++#define PPP_EAP 0xc227 /* Extensible Authentication Protocol */
++
++/*
++ * Values for FCS calculations.
++ */
++#define PPP_INITFCS 0xffff /* Initial FCS value */
++#define PPP_GOODFCS 0xf0b8 /* Good final FCS value */
++#define PPP_FCS(fcs, c) (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
++
++/*
++ * A 32-bit unsigned integral type.
++ */
++
++#if !defined(__BIT_TYPES_DEFINED__) && !defined(_BITYPES) \
++ && !defined(__FreeBSD__) && (NS_TARGET < 40)
++#ifdef UINT32_T
++typedef UINT32_T u_int32_t;
++#else
++typedef unsigned int u_int32_t;
++typedef unsigned short u_int16_t;
++#endif
++#endif
++
++/*
++ * Extended asyncmap - allows any character to be escaped.
++ */
++typedef u_int32_t ext_accm[8];
++
++/*
++ * What to do with network protocol (NP) packets.
++ */
++enum NPmode {
++ NPMODE_PASS, /* pass the packet through */
++ NPMODE_DROP, /* silently drop the packet */
++ NPMODE_ERROR, /* return an error */
++ NPMODE_QUEUE /* save it up for later. */
++};
++
++/*
++ * Statistics.
++ */
++struct pppstat {
++ unsigned int ppp_ibytes; /* bytes received */
++ unsigned int ppp_ipackets; /* packets received */
++ unsigned int ppp_ierrors; /* receive errors */
++ unsigned int ppp_obytes; /* bytes sent */
++ unsigned int ppp_opackets; /* packets sent */
++ unsigned int ppp_oerrors; /* transmit errors */
++};
++
++struct vjstat {
++ unsigned int vjs_packets; /* outbound packets */
++ unsigned int vjs_compressed; /* outbound compressed packets */
++ unsigned int vjs_searches; /* searches for connection state */
++ unsigned int vjs_misses; /* times couldn't find conn. state */
++ unsigned int vjs_uncompressedin; /* inbound uncompressed packets */
++ unsigned int vjs_compressedin; /* inbound compressed packets */
++ unsigned int vjs_errorin; /* inbound unknown type packets */
++ unsigned int vjs_tossed; /* inbound packets tossed because of error */
++};
++
++struct ppp_stats {
++ struct pppstat p; /* basic PPP statistics */
++ struct vjstat vj; /* VJ header compression statistics */
++};
++
++struct compstat {
++ unsigned int unc_bytes; /* total uncompressed bytes */
++ unsigned int unc_packets; /* total uncompressed packets */
++ unsigned int comp_bytes; /* compressed bytes */
++ unsigned int comp_packets; /* compressed packets */
++ unsigned int inc_bytes; /* incompressible bytes */
++ unsigned int inc_packets; /* incompressible packets */
++ unsigned int ratio; /* recent compression ratio << 8 */
++};
++
++struct ppp_comp_stats {
++ struct compstat c; /* packet compression statistics */
++ struct compstat d; /* packet decompression statistics */
++};
++
++/*
++ * The following structure records the time in seconds since
++ * the last NP packet was sent or received.
++ */
++struct ppp_idle {
++ time_t xmit_idle; /* time since last NP packet sent */
++ time_t recv_idle; /* time since last NP packet received */
++};
++
++#ifndef __P
++#ifdef __STDC__
++#define __P(x) x
++#else
++#define __P(x) ()
++#endif
++#endif
++
++#endif /* _PPP_DEFS_H_ */
+diff --git a/usl/usl.h b/usl/usl.h
+index cdc16db..88d2714 100644
+--- a/usl/usl.h
++++ b/usl/usl.h
+@@ -38,6 +38,10 @@
+ #include "usl_fsm.h"
+ #include "usl_list.h"
+
++#ifndef WAIT_ANY
++#define WAIT_ANY (-1)
++#endif
++
+ #define USL_VERSION "0.6"
+
+ #ifdef DEBUG
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch
new file mode 100644
index 000000000..e475276c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/always_syslog.patch
@@ -0,0 +1,22 @@
+ippool: always log to syslog
+
+Even when running in the foreground, send log messages to syslog.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+
+--- a/ippool_main.c
++++ b/ippool_main.c
+@@ -251,9 +251,8 @@ void ippool_vlog(int level, const char *
+ if (ippool_opt_nodaemon) {
+ vprintf(fmt, ap);
+ printf("\n");
+- } else {
+- vsyslog(level, fmt, ap);
+ }
++ vsyslog(level, fmt, ap);
+ DMALLOC_VMESSAGE(fmt, ap);
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service
new file mode 100644
index 000000000..e5917fc14
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=ip address pool allocator
+Requires=rpcbind.service
+After=rpcbind.service
+
+[Service]
+Type=simple
+# Start ippoold in the foreground!
+ExecStart=@SBINDIR@/ippoold -f
+# Normal output will go to syslog, so suppress stdout.
+StandardOutput=null
+StandardError=syslog
+# ExecStop is not needed. systemd will send SIGTERM
+# and ippoold will exit status 1.
+SuccessExitStatus=1
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch
new file mode 100644
index 000000000..14a768d0f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_init.d.patch
@@ -0,0 +1,65 @@
+Fix start error if lsb init-functions doesn't exist
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/debian/init.d b/debian/init.d
+index 363ba89..0327fec 100644
+--- a/debian/init.d
++++ b/debian/init.d
+@@ -10,6 +10,9 @@
+ # Description: Start ippool daemon
+ ### END INIT INFO
+
++# Source function library.
++. /etc/init.d/functions
++
+ DAEMON=/usr/sbin/ippoold
+ NAME=ippoold
+ MODULE=pppol2tp
+@@ -18,7 +21,23 @@ MODULE=pppol2tp
+ test -x $DAEMON || exit 0
+
+ # Get lsb functions
+-. /lib/lsb/init-functions
++if [ -f /lib/lsb/init-functions ]
++then
++ . /lib/lsb/init-functions
++else
++ log_begin_msg() {
++ echo -n $*
++ }
++
++ log_end_msg() {
++ if [ $1 -eq 0 ]; then
++ echo "done"
++ else
++ echo "failed"
++ fi
++ }
++fi
++
+ . /etc/default/rcS
+
+ case "$1" in
+@@ -35,6 +54,10 @@ case "$1" in
+ fi
+ log_end_msg $?
+ ;;
++ status)
++ status /usr/sbin/ippoold;
++ exit $?
++ ;;
+ restart)
+ $0 stop
+ sleep 1
+@@ -46,7 +69,7 @@ case "$1" in
+ log_end_msg $?
+ ;;
+ *)
+- log_success_msg "Usage: /etc/init.d/ippoold {start|stop|restart|reload|force-reload}"
++ log_success_msg "Usage: /etc/init.d/ippoold {start|stop|status|restart|reload|force-reload}"
+ exit 1
+ esac
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch
new file mode 100644
index 000000000..1ebd95ea1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_parallel_make_and_pic.patch
@@ -0,0 +1,89 @@
+1)add -fPIC for $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
+2)add sub target for subdirs-all, and those dependencies below
+ pppd plugin directory build depends on $(IPPOOL_RPC_STEM)_xdr.o
+$(IPPOOL_RPC_STEM)_client.o ippool_rpc.h
+
+ ippoold depends on libusl
+ ippoolconfig depends on libcli
+
+ $(IPPOOL_RPC_STEM)_xdr.o, $(IPPOOL_RPC_STEM)_client.o
+$(IPPOOL_RPC_STEM)_server.o *.o in main directory depends on ippool_rpc.h
+as those all directly or indirectly include ippool_rpc.h which is
+dynamically generated by rpcgen
+
+to make parallel make working.
+3)include dependency files for pppd.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+diff --git a/Makefile b/Makefile
+index 73aa72f..4f7af1d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -106,14 +106,14 @@ all: generated-files $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o \
+ subdirs-all $(PROGS.sbin) $(PROGS.bin)
+
+ # Compile without -Wall because rpcgen-generated code is full of warnings
+-$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_xdr.o: $(IPPOOL_RPC_STEM)_xdr.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+-$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_client.o: $(IPPOOL_RPC_STEM)_client.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+-$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c
+- $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $<
++$(IPPOOL_RPC_STEM)_server.o: $(IPPOOL_RPC_STEM)_server.c $(IPPOOL_RPC_STEM).h
++ $(CC) -I. -MMD -g -c -w $(CPPFLAGS) $(CFLAGS.optimize) $< -fPIC
+
+ $(IPPOOL_RPC_STEM)_xdr.c: $(IPPOOL_RPC_STEM).x
+ -$(RM) $@
+@@ -136,8 +136,12 @@ $(IPPOOL_RPC_STEM).h: $(IPPOOL_RPC_STEM).x
+
+ generated-files: $(RPC_FILES)
+
+-subdirs-all:
+- @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
++subdirs-all: $(patsubst %,%-dir, $(SUBDIRS))
++
++pppd-dir: $(IPPOOL_RPC_STEM)_xdr.o $(IPPOOL_RPC_STEM)_client.o $(IPPOOL_RPC_STEM).h
++
++$(patsubst %,%-dir,$(SUBDIRS)):
++ @for d in $(patsubst %-dir,%,$@); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" all; if [ $$? -ne 0 ]; then exit 1; fi; done
+
+ clean:
+ @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; if [ $$? -ne 0 ]; then exit 1; fi; done
+@@ -151,13 +155,13 @@ TAGS:
+ @for d in $(SUBDIRS); do $(MAKE) -C $$d $(MFLAGS) $@; done
+ etags -t $(wildcard *.c) $(wildcard *.h)
+
+-ippoold: $(IPPOOLD_SRCS.o)
+- $(CC) -o $@ $^ $(LDFLAGS.ippoold)
++ippoold: $(IPPOOLD_SRCS.o) usl-dir
++ $(CC) -o $@ $(IPPOOLD_SRCS.o) $(LDFLAGS.ippoold)
+
+-ippoolconfig: $(IPPOOLCONFIG_SRCS.o)
+- $(CC) -o $@ $^ $(LDFLAGS.ippoolconfig)
++ippoolconfig: $(IPPOOLCONFIG_SRCS.o) cli-dir
++ $(CC) -o $@ $(IPPOOLCONFIG_SRCS.o) $(LDFLAGS.ippoolconfig)
+
+-%.o: %.c
++%.o: %.c $(IPPOOL_RPC_STEM).h
+ $(CC) -c $(CFLAGS) $< -o $@
+
+ install: all
+diff --git a/pppd/Makefile b/pppd/Makefile
+index 78d9b33..106deca 100644
+--- a/pppd/Makefile
++++ b/pppd/Makefile
+@@ -24,3 +24,5 @@ install: ippool.so
+
+ clean:
+ -rm -rf *.o *.so
++
++include $(wildcard *.d /dev/null)
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch
new file mode 100644
index 000000000..ca0e3320c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/ippool_usl_timer.patch
@@ -0,0 +1,49 @@
+include limits.h to avoid UINT_MAX undefined compiling error.
+remove the unused assign which caused compiling error with -Werror.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+
+diff --git a/usl/usl_timer.c b/usl/usl_timer.c
+index 734b820..fda752b 100644
+--- a/usl/usl_timer.c
++++ b/usl/usl_timer.c
+@@ -42,6 +42,7 @@
+ #include <signal.h>
+ #include <string.h>
+ #include <sys/time.h>
++#include <limits.h>
+
+ #include "usl.h"
+
+@@ -87,14 +88,13 @@ void (*usl_timer_tick_hook)(void);
+ */
+ void usl_timer_tick(void)
+ {
+- int result;
+ char msg = '\0';
+
+ usl_tick++;
+
+ if (!usl_tick_pending) {
+ usl_tick_pending = 1;
+- result = write(usl_tick_pipe[1], &msg, sizeof(msg));
++ write(usl_tick_pipe[1], &msg, sizeof(msg));
+ }
+ }
+
+@@ -111,11 +111,10 @@ static void usl_timer_tick_handler(int fd, void *arg)
+ struct usl_ord_list_head *tmp;
+ struct usl_list_head *iwalk;
+ struct usl_list_head *itmp;
+- int result;
+ char msg;
+ USL_LIST_HEAD(expire_list);
+
+- result = usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
++ usl_fd_read(usl_tick_pipe[0], &msg, sizeof(msg));
+ usl_tick_pending = 0;
+
+ usl_list_for_each(walk, tmp, &usl_timer_list) {
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch
new file mode 100644
index 000000000..7d5b715ae
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/makefile-add-ldflags.patch
@@ -0,0 +1,21 @@
+Add LDFLAGS variable to Makefile so that extra linker flags can be sent via this variable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 4f7af1d..a05a000 100644
+--- a/Makefile
++++ b/Makefile
+@@ -83,8 +83,8 @@ endif
+
+ CPPFLAGS= $(CPPFLAGS.ippooltest)
+ CFLAGS= -I. -Iusl -Icli -MMD -Wall -g $(CPPFLAGS) $(CPPFLAGS.dmalloc)
+-LDFLAGS.ippoold= -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
+-LDFLAGS.ippoolconfig= -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoold= $(LDFLAGS) -Wl,-E -L. -Lusl -lusl -lnsl -ldl $(LIBS.dmalloc) -lc
++LDFLAGS.ippoolconfig= $(LDFLAGS) -Lcli -lcli -lreadline -lcurses -lnsl $(LIBS.dmalloc) -lc
+
+ OPT_CFLAGS?= -O
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh
new file mode 100644
index 000000000..f91f58237
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool/runtest.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+BANNER="----------------------------------------------------------------------------"
+TCLSH="tclsh all.tcl -preservecore 3 -verbose bps -tmpdir ./results -outfile test-ippool.result"
+
+test_setup() {
+ if [ -d ./results ]; then rm -fr ./results; fi
+ mkdir ./results
+}
+
+test_ippool() {
+ echo "${BANNER}"
+ eval $TCLSH -constraints "ipPool"
+}
+test_postprocess() {
+ echo "${BANNER}"
+ (failed=`grep FAILED results/*.result | wc -l`; \
+ let failed2=failed/2 ;\
+ passed=`grep PASSED results/*.result | wc -l`; \
+ echo "TEST SUMMARY: $passed tests PASSED, $failed2 tests FAILED" ;\
+ exit $failed2)
+}
+
+test_setup
+test_ippool
+test_postprocess
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
new file mode 100644
index 000000000..6e4748357
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ippool/ippool_1.3.bb
@@ -0,0 +1,113 @@
+SUMMARY = "An IP address pool manager"
+DESCRIPTION = "IpPool is implemented as a separate server daemon \
+to allow any application to use its address pools. This makes it possible \
+to define address pools that are shared by PPP, L2TP, PPTP etc. It may be \
+useful in some VPN server setups. IpPool comes with a command line \
+management application, ippoolconfig to manage and query address pool \
+status. A pppd plugin is supplied which allows pppd to request IP \
+addresses from ippoold. \
+"
+HOMEPAGE = "http://www.openl2tp.org/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+
+SRC_URI = "https://sourceforge.net/projects/openl2tp/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://runtest.sh \
+ file://ippool.service \
+ file://ippool_usl_timer.patch \
+ file://ippool_parallel_make_and_pic.patch \
+ file://ippool_init.d.patch \
+ file://always_syslog.patch \
+ file://makefile-add-ldflags.patch \
+ file://0001-usl_timer-Check-for-return-value-of-write-API.patch \
+ file://0001-Respect-flags-from-env.patch \
+ file://0001-read-returns-ssize_t.patch \
+ file://0002-Mark-first-element-of-a-string-as-null.patch \
+ file://0003-cli-Mark-return-of-strtol-as-long-int.patch \
+ "
+SRC_URI_append_libc-musl = "\
+ file://0002-link-with-libtirpc.patch \
+ file://0003-musl-fixes.patch \
+ "
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4c59283b82fc2b166455e0fc23c71c6f"
+SRC_URI[md5sum] = "e2401e65db26a3764585b97212888fae"
+SRC_URI[sha256sum] = "d3eab7d6cad5da8ccc9d1e31d5303e27a39622c07bdb8fa3618eea314412075b"
+
+inherit systemd
+
+DEPENDS = "readline ppp ncurses gzip-native"
+DEPENDS_append_libc-musl = " libtirpc"
+RDEPENDS_${PN} = "rpcbind"
+
+EXTRA_OEMAKE = "CC='${CC}' AS='${AS}' LD='${LD}' AR='${AR}' NM='${NM}' STRIP='${STRIP}'"
+EXTRA_OEMAKE += "PPPD_VERSION=${PPPD_VERSION} SYS_LIBDIR=${libdir}"
+# enable self tests
+EXTRA_OEMAKE += "IPPOOL_TEST=y"
+
+CPPFLAGS += "${SELECTED_OPTIMIZATION}"
+CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+
+SYSTEMD_SERVICE_${PN} = "ippool.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+
+do_compile_prepend() {
+ # fix the CFLAGS= and CPPFLAGS= in main Makefile, to have the extra CFLAGS in env
+ sed -i -e "s/^CFLAGS=/CFLAGS+=/" ${S}/Makefile
+ sed -i -e "s/^CPPFLAGS=/CPPFLAGS+=/" ${S}/Makefile
+
+ sed -i -e "s:-I/usr/include/pppd:-I=/usr/include/pppd:" ${S}/pppd/Makefile
+
+}
+
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+
+ install -D -m 0755 ${S}/debian/init.d ${D}${sysconfdir}/init.d/ippoold
+ install -D -m 0644 ${WORKDIR}/ippool.service ${D}${systemd_system_unitdir}/ippool.service
+ sed -i -e 's:@SBINDIR@:${sbindir}:g' ${D}${systemd_system_unitdir}/ippool.service
+
+ # install self test
+ install -d ${D}/opt/${BPN}
+ install ${S}/test/all.tcl ${S}/test/ippool.test \
+ ${S}/test/test_procs.tcl ${D}/opt/${BPN}
+ install ${WORKDIR}/runtest.sh ${D}/opt/${BPN}
+ # fix the ../ippoolconfig in test_procs.tcl
+ sed -i -e "s:../ippoolconfig:ippoolconfig:" \
+ ${D}/opt/${BPN}/test_procs.tcl
+}
+
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN} += "${libdir}/pppd/${PPPD_VERSION}/ippool.so"
+FILES_${PN}-dbg += "${libdir}/pppd/${PPPD_VERSION}/.debug/ippool.so"
+FILES_${PN}-test = "/opt/${BPN}"
+
+# needs tcl to run tests
+RDEPENDS_${PN}-test += "tcl ${BPN}"
+
+PPPD_VERSION="${@get_ppp_version(d)}"
+
+def get_ppp_version(d):
+ import re
+
+ pppd_plugin = d.expand('${STAGING_LIBDIR}/pppd')
+ if not os.path.isdir(pppd_plugin):
+ return None
+
+ bb.debug(1, "pppd plugin dir %s" % pppd_plugin)
+ r = re.compile("\d*\.\d*\.\d*")
+ for f in os.listdir(pppd_plugin):
+ if os.path.isdir(os.path.join(pppd_plugin, f)):
+ ma = r.match(f)
+ if ma:
+ bb.debug(1, "pppd version dir %s" % f)
+ return f
+ else:
+ bb.debug(1, "under pppd plugin dir %s" % f)
+
+ return None
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch
new file mode 100644
index 000000000..f5e1bec8a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch
@@ -0,0 +1,25 @@
+From cfee58d5863a535b61aa54690ae205b876f57944 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 22:53:29 -0800
+Subject: [PATCH 1/2] libopeniscsiusr: Include limit.h for PATH_MAX
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libopeniscsiusr/iface.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libopeniscsiusr/iface.c b/libopeniscsiusr/iface.c
+index 79898df..a48ef36 100644
+--- a/libopeniscsiusr/iface.c
++++ b/libopeniscsiusr/iface.c
+@@ -30,6 +30,7 @@
+ #include <netdb.h>
+ #include <assert.h>
+ #include <inttypes.h>
++#include <limits.h>
+
+ #include "libopeniscsiusr/libopeniscsiusr.h"
+ #include "misc.h"
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch
new file mode 100644
index 000000000..174aa50d2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0001-qedi.c-Removed-unused-linux-ethtool.h.patch
@@ -0,0 +1,25 @@
+From 197713ad7e3e944102bbd792e1ab9ec4a67100c0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:25:21 -0800
+Subject: [PATCH 1/4] qedi.c: Removed unused linux/ethtool.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ iscsiuio/src/unix/libs/qedi.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/iscsiuio/src/unix/libs/qedi.c b/iscsiuio/src/unix/libs/qedi.c
+index b81fecd..24cb89a 100644
+--- a/iscsiuio/src/unix/libs/qedi.c
++++ b/iscsiuio/src/unix/libs/qedi.c
+@@ -49,7 +49,6 @@
+ #include <arpa/inet.h>
+ #include <linux/types.h>
+ #include <linux/sockios.h>
+-#include <linux/ethtool.h>
+ #include <linux/netlink.h>
+ #include <sys/mman.h>
+ #include <sys/ioctl.h>
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch
new file mode 100644
index 000000000..aecede6ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch
@@ -0,0 +1,25 @@
+From 2b39f85dcf020647544002cb0b0e734748391dfb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:27:25 -0800
+Subject: [PATCH 2/4] idbm.c: Include fcnl.h for O_RDWR and O_CREAT definitions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usr/idbm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/usr/idbm.c b/usr/idbm.c
+index 5532202..0a51b85 100644
+--- a/usr/idbm.c
++++ b/usr/idbm.c
+@@ -27,6 +27,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <limits.h>
++#include <fcntl.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch
new file mode 100644
index 000000000..836ed6048
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch
@@ -0,0 +1,29 @@
+From 29571f71692e28ce9a17d1450097a98492f3b465 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 22:54:04 -0800
+Subject: [PATCH 2/2] libopeniscsiusr: Add CFLAGS to linker cmdline
+
+This will ensure that -fPIC is passed to linker as
+well
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libopeniscsiusr/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libopeniscsiusr/Makefile b/libopeniscsiusr/Makefile
+index 8b9b523..4f1d0d6 100644
+--- a/libopeniscsiusr/Makefile
++++ b/libopeniscsiusr/Makefile
+@@ -49,7 +49,7 @@ LIBADD =
+ all: $(LIBS) $(LIBS_MAJOR) $(TESTS) doc
+
+ $(LIBS): $(OBJS)
+- $(CC) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
++ $(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ -o $@ $(OBJS) $(LIBADD)
+ ln -sf $@ $(DEVLIB)
+
+ $(LIBS_MAJOR): $(LIBS)
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch
new file mode 100644
index 000000000..0ce155f7a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch
@@ -0,0 +1,49 @@
+From 9b7a32903b56ce4d41f264a345ca59a0b00d53b3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:28:33 -0800
+Subject: [PATCH 3/4] bnx2x.c: Reorder the includes to avoid duplicate defines
+ with musl
+
+including nic.h before linux/ethtool.h avoids redefinitions of
+eth structs
+
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
+usr/include/netinet/if_ether.h:104:8: error: redefinition of 'struct ethhdr'
+ struct ethhdr {
+ ^~~~~~
+In file included from /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.
+876-r0/recipe-sysroot/usr/include/linux/ethtool.h:19:0,
+ from qedi.c:52:
+/mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-musleabi/iscsi-initiator-utils/2.0.876-r0/recipe-sysroot/
+usr/include/linux/if_ether.h:154:8: note: originally defined here
+ struct ethhdr {
+ ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ iscsiuio/src/unix/libs/bnx2x.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
+index 3df6d5f..62530d1 100644
+--- a/iscsiuio/src/unix/libs/bnx2x.c
++++ b/iscsiuio/src/unix/libs/bnx2x.c
+@@ -36,6 +36,7 @@
+ * bnx2x.c - bnx2x user space driver
+ *
+ */
++#include "nic.h"
+ #include <errno.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -58,7 +59,6 @@
+ #include "bnx2x.h"
+ #include "cnic.h"
+ #include "logger.h"
+-#include "nic.h"
+ #include "nic_id.h"
+ #include "nic_utils.h"
+ #include "options.h"
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch
new file mode 100644
index 000000000..57bdc8cb6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch
@@ -0,0 +1,28 @@
+From 6f9c1a04d250388d1574cfaf20a1ff66a64beb48 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 23:42:12 -0800
+Subject: [PATCH 4/4] fwparam_ppc.c: Do not use __compar_fn_t
+
+__compar_fn_t is not defined in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ utils/fwparam_ibft/fwparam_ppc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/fwparam_ibft/fwparam_ppc.c b/utils/fwparam_ibft/fwparam_ppc.c
+index c298b8c..391faa2 100644
+--- a/utils/fwparam_ibft/fwparam_ppc.c
++++ b/utils/fwparam_ibft/fwparam_ppc.c
+@@ -356,7 +356,7 @@ static int loop_devs(const char *devtree)
+ * Sort the nics into "natural" order. The proc fs
+ * device-tree has them in somewhat random, or reversed order.
+ */
+- qsort(niclist, nic_count, sizeof(char *), (__compar_fn_t)nic_cmp);
++ qsort(niclist, nic_count, sizeof(char *), nic_cmp);
+
+ snprintf(prefix, sizeof(prefix), "%s/%s", devtree, "aliases");
+ dev_count = 0;
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils
new file mode 100644
index 000000000..42fdd602f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/99_iscsi-initiator-utils
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d root root 0755 /var/lock/iscsi none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian
new file mode 100644
index 000000000..99a763861
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/initd.debian
@@ -0,0 +1,119 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:
+# Short-Description: Starts and stops the iSCSI initiator services and logins to default targets
+### END INIT INFO
+#set -x
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/iscsid
+ADM=/usr/sbin/iscsiadm
+PIDFILE=/var/run/iscsid.pid
+
+[ -x "$DAEMON" ] || exit 0
+
+if [ ! -d /sys/class/ ]; then
+ echo "Failure:" "iSCSI requires a mounted sysfs, not started."
+ exit 1
+fi
+
+nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p'
+
+RETVAL=0
+
+start() {
+ echo "Starting iSCSI initiator service" "iscsid"
+ modprobe -q iscsi_tcp 2>/dev/null || :
+ modprobe -q ib_iser 2>/dev/null || :
+ if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
+ INITIATORNAME=$(iscsi-iname)
+ cat >/etc/iscsi/initiatorname.iscsi <<EOF
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator. The InitiatorName must be unique
+## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
+InitiatorName=$INITIATORNAME
+EOF
+ fi
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
+ RETVAL=$?
+ starttargets
+}
+
+starttargets() {
+ echo "Setting up iSCSI targets"
+ $ADM -m node --loginall=automatic
+}
+
+stoptargets() {
+ echo "Disconnecting iSCSI targets"
+ sync
+ $ADM -m node --logoutall=all
+ RETVAL=$?
+ #if RETVAL is 21, means no active sessions, consider ok
+ if [ "$RETVAL" = "21" ]; then
+ RETVAL=0
+ fi
+}
+
+stop() {
+ stoptargets
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Could not stop all targets, try again later"
+ return $RETVAL
+ fi
+
+ echo "Stopping iSCSI initiator service"
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
+ rm -f $PIDFILE
+ status=0
+ modprobe -r ib_iser 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+ modprobe -r iscsi_tcp 2>/dev/null
+ if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
+ status=1
+ fi
+}
+
+restart() {
+ stop
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Stopping iSCSI initiator service failed, not starting"
+ return $RETVAL
+ fi
+ start
+}
+
+restarttargets() {
+ stoptargets
+ if [ $RETVAL -ne 0 ]; then
+ echo "Failure:" "Could not stop all targets, try again later"
+ return $RETVAL
+ fi
+ starttargets
+}
+
+status() {
+ #XXX FIXME: what to do here?
+ #status iscsid
+ # list active sessions
+ echo Current active iSCSI sessions:
+ $ADM -m session
+}
+
+case "$1" in
+ start|starttargets|stop|stoptargets|restart|restarttargets|status)
+ $1
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status}"
+ exit 1
+ ;;
+esac
+exit $RETVAL
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator
new file mode 100644
index 000000000..7fa49a2d6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator
@@ -0,0 +1,4 @@
+# default command line settings for open-iscsi's iscsid
+
+OPTS_ISCSID=""
+OPTS_ISCSIADM=""
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service
new file mode 100644
index 000000000..564b2d21d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator-targets.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Open-iSCSI initiator (i.e. client) target bindings
+After=iscsi-initiator.service
+Requires=iscsi-initiator.service
+
+[Service]
+Type=oneshot
+EnvironmentFile=/etc/default/iscsi-initiator
+ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM
+ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service
new file mode 100644
index 000000000..3790daebd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/iscsi-initiator.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Open-iSCSI initiator (i.e. client) service
+After=syslog.target
+
+[Service]
+EnvironmentFile=/etc/default/iscsi-initiator
+ExecStartPre=/sbin/modprobe iscsi_tcp
+ExecStartPre=/usr/lib/iscsi/set_initiatorname
+ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname
new file mode 100644
index 000000000..a196c6b79
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/files/set_initiatorname
@@ -0,0 +1,12 @@
+#!/bin/sh
+if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then
+ INITIATORNAME=$(iscsi-iname)
+ cat >/etc/iscsi/initiatorname.iscsi <<EOF
+## DO NOT EDIT OR REMOVE THIS FILE!
+## If you remove this file, the iSCSI daemon will not start.
+## If you change the InitiatorName, existing access control lists
+## may reject this initiator. The InitiatorName must be unique
+## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.
+InitiatorName=$INITIATORNAME
+EOF
+fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb
new file mode 100644
index 000000000..823227c46
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/iscsi-initiator-utils/iscsi-initiator-utils_2.0.876.bb
@@ -0,0 +1,117 @@
+SUMMARY = "iSCSI daemon and utility programs"
+DESCRIPTION = "Open-iSCSI project is a high performance, transport \
+independent, multi-platform implementation of RFC3720. The iscsi package \
+provides the server daemon for the iSCSI protocol, as well as the utility \
+programs used to manage it. iSCSI is a protocol for distributed \
+disk access using SCSI commands sent over Internet Protocol networks."
+HOMEPAGE = "http://www.open-iscsi.com/"
+LICENSE = "GPLv2 & LGPLv2.1"
+SECTION = "net"
+DEPENDS = "openssl flex-native bison-native open-isns util-linux"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV ?= "24580adc4c174bbc5dde3ae7594a46d57635e906"
+
+SRC_URI = "git://github.com/open-iscsi/open-iscsi \
+ file://initd.debian \
+ file://99_iscsi-initiator-utils \
+ file://iscsi-initiator \
+ file://iscsi-initiator.service \
+ file://iscsi-initiator-targets.service \
+ file://set_initiatorname \
+ file://0001-libopeniscsiusr-Include-limit.h-for-PATH_MAX.patch \
+ file://0002-libopeniscsiusr-Add-CFLAGS-to-linker-cmdline.patch \
+ file://0001-qedi.c-Removed-unused-linux-ethtool.h.patch \
+ file://0002-idbm.c-Include-fcnl.h-for-O_RDWR-and-O_CREAT-definit.patch \
+ file://0003-bnx2x.c-Reorder-the-includes-to-avoid-duplicate-defi.patch \
+ file://0004-fwparam_ppc.c-Do-not-use-__compar_fn_t.patch \
+"
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build"
+
+inherit update-rc.d systemd autotools
+
+EXTRA_OECONF = " \
+ --target=${TARGET_SYS} \
+ --host=${BUILD_SYS} \
+"
+
+EXTRA_OEMAKE = ' \
+ OS="${TARGET_SYS}" \
+ TARGET="${TARGET_OS}" \
+ BASE="${prefix}" \
+ MANDIR="${mandir}" \
+'
+
+do_configure () {
+ cd ${S}/iscsiuio ; autoreconf --install; ./configure ${EXTRA_OECONF}
+}
+
+do_compile () {
+ # Make sure we DO NOT regenerate prom_lex.c.
+ if [ -f ${S}/utils/fwparam_ibft/prom_lex.l ]; then
+ mv ${S}/utils/fwparam_ibft/prom_lex.l ${S}/utils/fwparam_ibft/prom_lex.l.unused
+ fi
+ oe_runmake -C ${S} ${EXTRA_OEMAKE} user
+}
+
+do_install () {
+ #install necessary directories
+ install -d ${D}${sbindir} \
+ ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/iscsi \
+ ${D}${localstatedir}/lib/iscsi/nodes \
+ ${D}${localstatedir}/lib/iscsi/send_targets \
+ ${D}${localstatedir}/lib/iscsi/static \
+ ${D}${localstatedir}/lib/iscsi/isns \
+ ${D}${localstatedir}/lib/iscsi/slp \
+ ${D}${localstatedir}/lib/iscsi/ifaces \
+ ${D}${libdir} \
+ ${D}${mandir}/man8
+
+ install -p -m 755 ${S}/usr/iscsid ${S}/usr/iscsiadm \
+ ${S}/utils/iscsi-iname \
+ ${S}/usr/iscsistart ${D}/${sbindir}
+
+ cp -dR ${S}/libopeniscsiusr/libopeniscsiusr.so* ${D}${libdir}
+ install -p -m 644 ${S}/doc/iscsiadm.8 ${S}/doc/iscsid.8 ${D}/${mandir}/man8
+ install -p -m 644 ${S}/etc/iscsid.conf ${D}${sysconfdir}/iscsi
+ install -p -m 755 ${WORKDIR}/initd.debian ${D}${sysconfdir}/init.d/iscsid
+
+ sed -i -e "s:= /sbin/iscsid:= ${sbindir}/iscsid:" ${D}${sysconfdir}/iscsi/iscsid.conf
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /run/${BPN}/lock - - - -" \
+ > ${D}${sysconfdir}/tmpfiles.d/iscsi.conf
+ install -d ${D}/etc/default/
+ install -p -m 755 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/iscsi-initiator.service \
+ ${WORKDIR}/iscsi-initiator-targets.service \
+ ${D}${systemd_unitdir}/system/
+ install -d ${D}${nonarch_libdir}/iscsi
+ install -m 0755 ${WORKDIR}/set_initiatorname ${D}${nonarch_libdir}/iscsi
+ else
+ install -d ${D}/etc/default/volatiles
+ install -m 0644 ${WORKDIR}/99_iscsi-initiator-utils ${D}/etc/default/volatiles
+ fi
+}
+
+pkg_postinst_${PN}() {
+ if [ "x$D" = "x" ]; then
+ if [ -e /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ elif command -v systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/iscsi.conf
+ fi
+ fi
+}
+
+SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
+INITSCRIPT_NAME = "iscsid"
+INITSCRIPT_PARAMS = "start 30 1 2 3 4 5 . stop 70 0 1 2 3 4 5 6 ."
+
+FILES_${PN} += "${nonarch_libdir}/iscsi"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb b/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb
new file mode 100644
index 000000000..36417b72a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/keepalived/keepalived_1.4.2.bb
@@ -0,0 +1,48 @@
+SUMMARY = "High Availability monitor built upon LVS, VRRP and service pollers"
+DESCRIPTION = "Keepalived is a routing software written in C. The main goal \
+of this project is to provide simple and robust facilities for loadbalancing \
+and high-availability to Linux system and Linux based infrastructures. \
+Loadbalancing framework relies on well-known and widely used Linux Virtual \
+Server (IPVS) kernel module providing Layer4 loadbalancing \
+"
+HOMEPAGE = "http://www.keepalived.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://www.keepalived.org/software/${BP}.tar.gz"
+SRC_URI[md5sum] = "610af6e04071f02d3469191de7499f4e"
+SRC_URI[sha256sum] = "4e2d7cc01a6ee29a3955f5c622d47704ba7d9dd758189f15e9def016a2d1faa3"
+
+DEPENDS = "libnfnetlink openssl"
+
+inherit autotools pkgconfig systemd update-rc.d
+
+PACKAGECONFIG ??= "libnl snmp \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+"
+PACKAGECONFIG[libnl] = "--enable-libnl,--disable-libnl,libnl"
+PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
+PACKAGECONFIG[systemd] = "--with-init=systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--with-init=SYSV,systemd"
+
+EXTRA_OECONF = "--disable-libiptc"
+EXTRA_OEMAKE = "initdir=${sysconfdir}/init.d"
+
+do_install_append() {
+ if [ -f ${D}${sysconfdir}/init.d/${BPN} ]; then
+ chmod 0755 ${D}${sysconfdir}/init.d/${BPN}
+ sed -i 's#rc.d/##' ${D}${sysconfdir}/init.d/${BPN}
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0644 ${B}/${BPN}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
+ fi
+}
+
+FILES_${PN} += "${datadir}/snmp/mibs/KEEPALIVED-MIB.txt"
+
+INITSCRIPT_NAME = "keepalived"
+INITSCRIPT_PARAMS = "remove"
+
+SYSTEMD_SERVICE_${PN} = "keepalived.service"
+SYSTEMD_AUTO_ENABLE ?= "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default
new file mode 100644
index 000000000..3acacfd90
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.default
@@ -0,0 +1,2 @@
+# Uncomment to start SNMP subagent and enable CDP, SONMP and EDP protocol
+#DAEMON_ARGS="-x -c -s -e"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d
new file mode 100644
index 000000000..88bf95898
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/lldpd.init.d
@@ -0,0 +1,128 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides: lldpd
+# Required-Start: $remote_fs $network $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: LLDP daemon
+# Description: lldpd is a 802.1AB implementation, a L2 network
+# discovery protocol. It also supports CDP, EDP and
+# various other protocols.
+### END INIT INFO
+
+# Do NOT "set -e"
+
+log_daemon_msg() {
+ echo $*
+}
+
+log_end_msg() {
+ if [ $1 -eq 0 ]; then
+ success $*
+ else
+ failure $*
+ fi
+}
+
+log_failure_msg() {
+ echo $*
+}
+
+log_success_msg() {
+ echo $*
+}
+
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="LLDP daemon"
+NAME=lldpd
+DAEMON=/usr/sbin/$NAME
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+CHROOT=/var/run/$NAME
+
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 0
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+# LSB log_* functions
+. /etc/init.d/functions
+
+do_start()
+{
+ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
+ $DAEMON_ARGS \
+ || return 2
+}
+
+do_stop()
+{
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+ RETVAL="$?"
+ [ "$RETVAL" = 2 ] && return 2
+ start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
+ [ "$?" = 2 ] && return 2
+ rm -f $PIDFILE
+ return "$RETVAL"
+}
+
+do_reload() {
+ start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+ return 0
+}
+
+case "$1" in
+ start)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+ do_start
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ stop)
+ [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+ esac
+ ;;
+ reload)
+ log_daemon_msg "Reloading $DESC" "$NAME"
+ do_reload
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC" "$NAME"
+ do_stop
+ case "$?" in
+ 0|1)
+ do_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ 1) log_end_msg 1 ;; # Old process is still running
+ *) log_end_msg 1 ;; # Failed to start
+ esac
+ ;;
+ *)
+ # Failed to stop
+ log_end_msg 1
+ ;;
+ esac
+ ;;
+ status)
+ status_of_proc $DAEMON $NAME -p $PIDFILE && exit 0 || exit $?
+ ;;
+ *)
+ echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
+ exit 3
+ ;;
+esac
+
+:
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch
new file mode 100644
index 000000000..4876e1794
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/files/src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch
@@ -0,0 +1,32 @@
+From f9f3e4dd31588cce5f655730da7b5c3f56a9bdc1 Mon Sep 17 00:00:00 2001
+From: Fabio Berton <fabio.berton@ossystems.com.br>
+Date: Tue, 26 Sep 2017 09:19:51 -0300
+Subject: [PATCH] src/daemon/lldpd.service.in: Use fixed path for mkdir command
+Organization: O.S. Systems Software LTDA.
+
+@mkdir_p@ is expanded to host tools path ../build/tmp/hosttools/mkdir that
+doesn't exist on target. Remove @mkdir_p@ and use /bin/mkdir -p to
+create /var/run/lldpd directory.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
+---
+ src/daemon/lldpd.service.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/daemon/lldpd.service.in b/src/daemon/lldpd.service.in
+index fdb7338..4291830 100644
+--- a/src/daemon/lldpd.service.in
++++ b/src/daemon/lldpd.service.in
+@@ -9,7 +9,7 @@ Type=notify
+ NotifyAccess=main
+ EnvironmentFile=-/etc/default/lldpd
+ EnvironmentFile=-/etc/sysconfig/lldpd
+-ExecStartPre=@mkdir_p@ @PRIVSEP_CHROOT@
++ExecStartPre=/bin/mkdir -p @PRIVSEP_CHROOT@
+ ExecStart=@sbindir@/lldpd $DAEMON_ARGS $LLDPD_OPTIONS
+ Restart=on-failure
+ PrivateTmp=yes
+--
+2.14.2
diff --git a/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb b/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb
new file mode 100644
index 000000000..dbd84cf67
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/lldpd/lldpd_0.9.8.bb
@@ -0,0 +1,65 @@
+SUMMARY = "A 802.1ab implementation (LLDP) to help you locate neighbors of all your equipments"
+SECTION = "net/misc"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"
+
+DEPENDS = "libbsd libevent"
+
+SRC_URI = "\
+ http://media.luffy.cx/files/${BPN}/${BPN}-${PV}.tar.gz \
+ file://lldpd.init.d \
+ file://lldpd.default \
+ file://src-daemon-lldpd.service.in-Use-fixed-path-for-mkdir.patch \
+ "
+
+SRC_URI[md5sum] = "8809600492f6b73149eb19158e819c1f"
+SRC_URI[sha256sum] = "9ee494e91bc33938575b2c09b26188c486ef8eac6e2155d250c189cc4e988c4f"
+
+inherit autotools update-rc.d useradd systemd pkgconfig bash-completion
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system -g lldpd --shell /bin/false lldpd"
+GROUPADD_PARAM_${PN} = "--system lldpd"
+
+EXTRA_OECONF += "--without-embedded-libevent \
+ --disable-oldies \
+ --with-privsep-user=lldpd \
+ --with-privsep-group=lldpd \
+ --with-systemdsystemunitdir=${systemd_system_unitdir} \
+ --without-sysusersdir \
+"
+
+PACKAGECONFIG ??= "cdp fdp edp sonmp lldpmed dot1 dot3"
+PACKAGECONFIG[xml] = "--with-xml,--without-xml,libxm2"
+PACKAGECONFIG[snmp] = "--with-snmp,--without-snmp,net-snmp"
+PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline"
+PACKAGECONFIG[seccomp] = "--with-seccomp,--without-seccomp,libseccomp"
+PACKAGECONFIG[cdp] = "--enable-cdp,--disable-cdp"
+PACKAGECONFIG[fdp] = "--enable-fdp,--disable-fdp"
+PACKAGECONFIG[edp] = "--enable-edp,--disable-edp"
+PACKAGECONFIG[sonmp] = "--enable-sonmp,--disable-sonmp"
+PACKAGECONFIG[lldpmed] = "--enable-lldpmed,--disable-lldpmed"
+PACKAGECONFIG[dot1] = "--enable-dot1,--disable-dot1"
+PACKAGECONFIG[dot3] = "--enable-dot3,--disable-dot3"
+PACKAGECONFIG[custom] = "--enable-custom,--disable-custom"
+
+INITSCRIPT_NAME = "lldpd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "lldpd.service"
+
+do_install_append() {
+ install -Dm 0755 ${WORKDIR}/lldpd.init.d ${D}${sysconfdir}/init.d/lldpd
+ install -Dm 0644 ${WORKDIR}/lldpd.default ${D}${sysconfdir}/default/lldpd
+ # Make an empty configuration file
+ touch ${D}${sysconfdir}/lldpd.conf
+}
+
+PACKAGES =+ "${PN}-zsh-completion"
+
+FILES_${PN} += "${libdir}/sysusers.d"
+RDEPENDS_${PN} += "os-release"
+
+FILES_${PN}-zsh-completion += "${datadir}/zsh/"
+# FIXME: zsh is broken in meta-oe so this cannot be enabled for now
+#RDEPENDS_${PN}-zsh-completion += "zsh"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch
new file mode 100644
index 000000000..aa590175c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/ncftp-configure-use-BUILD_CC-for-ccdv.patch
@@ -0,0 +1,32 @@
+From 043e1a9ec83a59671ef8c4cad679dbf781e5ef98 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Sun, 29 Nov 2015 23:37:06 -0800
+Subject: [PATCH] configure: use BUILD_CC for ccdv
+
+ccdv is intended to be invoked from Makefiles only,
+it doesn't work for the cross compiling, so compile
+it with $BUILD_CC and corresponding CFLAGS.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 2f0fae0..a7e9112 100755
+--- a/configure
++++ b/configure
+@@ -11286,7 +11286,7 @@ panic:
+ } /* main */
+ /* eof ccdv.c */
+ EOF
+- ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1
++ ${BUILD_CC} $DEFS ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} "ccdv.c" -o "ccdv" >/dev/null 2>&1
+ rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz
+ strip ./ccdv >/dev/null 2>&1
+ ./ccdv >/dev/null 2>&1
+--
+2.3.5
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch
new file mode 100644
index 000000000..1c8146eda
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp/unistd.patch
@@ -0,0 +1,32 @@
+This patch is needed to avoid double definitions of functions
+especially when building with security flags turned on. The double
+definitions causes the sed.sh script in configure to fail since it
+starts to spit out double outputs e.g.
+
+wi_cv_gethostname_size_t size_t size_t
+
+which then caused almost all subsequent compile time tests to fail since
+this gets into confdefs.h file
+
+removing this include causes only one definitions to be emitted into
+the genrated protos.h file and thus avoiding the above failure.
+
+Other solution would to fix sed.sh to ignore double definitions
+
+Upstream-Status: Pending
+
+Signed-of-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: ncftp-3.2.6/configure
+===================================================================
+--- ncftp-3.2.6.orig/configure
++++ ncftp-3.2.6/configure
+@@ -7859,7 +7859,6 @@ chmod 755 "$wi_tmpdir/prpp.pl"
+ cat << 'EOF' > "$wi_tmpdir/unistd.c"
+ #include <confdefs.h>
+
+-#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb
new file mode 100644
index 000000000..5f92f27fd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ncftp/ncftp_3.2.6.bb
@@ -0,0 +1,35 @@
+DESCRIPTION = "A sophisticated console ftp client"
+HOMEPAGE = "http://ncftp.com/"
+SECTION = "net"
+LICENSE = "ClArtistic"
+LIC_FILES_CHKSUM = "file://ncftp/cmds.c;beginline=3;endline=4;md5=9c2390809f71465aa7ff76e03dc14d91"
+DEPENDS = "ncurses"
+
+SRC_URI = "ftp://ftp.ncftp.com/${BPN}/${BP}-src.tar.xz \
+ file://ncftp-configure-use-BUILD_CC-for-ccdv.patch \
+ file://unistd.patch \
+"
+SRC_URI[md5sum] = "42d0f896d69a4d603ec097546444245f"
+SRC_URI[sha256sum] = "5f200687c05d0807690d9fb770327b226f02dd86155b49e750853fce4e31098d"
+
+inherit autotools-brokensep pkgconfig
+
+CFLAGS += "-DNO_SSLv2 -D_FILE_OFFSET_BITS=64 -Wall"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[ccdv] = "--enable-ccdv,--disable-ccdv,,"
+
+EXTRA_OECONF = "--disable-precomp"
+TARGET_CC_ARCH_append = " ${SELECTED_OPTIMIZATION}"
+
+do_configure() {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+}
+do_install () {
+ install -d ${D}${bindir} ${D}${sysconfdir} ${D}${mandir}
+ oe_runmake 'prefix=${D}${prefix}' 'BINDIR=${D}${bindir}' \
+ 'SYSCONFDIR=${D}${sysconfdir}' 'mandir=${D}${mandir}' \
+ install
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch
new file mode 100644
index 000000000..4f493f7b8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-Fix-build-failures-with-gcc7.patch
@@ -0,0 +1,49 @@
+From 398c6db66c643ed6133cc2b028ab1e27a17c5295 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 1 May 2017 19:10:09 +0000
+Subject: [PATCH] Fix build failures with gcc7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ plugins/ipmidirect/ipmi_mc_vendor.cpp | 2 +-
+ plugins/ipmidirect/ipmi_resource.cpp | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/ipmidirect/ipmi_mc_vendor.cpp b/plugins/ipmidirect/ipmi_mc_vendor.cpp
+index 2c6c090..557771c 100644
+--- a/plugins/ipmidirect/ipmi_mc_vendor.cpp
++++ b/plugins/ipmidirect/ipmi_mc_vendor.cpp
+@@ -322,7 +322,7 @@ cIpmiMcVendor::CreateResources( cIpmiDomain *domain, cIpmiMc *source_mc, cIpmiSd
+ if ( addr.m_channel != source_mc->GetChannel() )
+ stdlog << "WARNING : SDR channel " << addr.m_channel << " NOT equal to MC channel " << source_mc->GetChannel() << "\n";
+
+- if ( FindOrCreateResource( domain, source_mc, fru_id, sdr, sdrs ) == false ) {
++ if ( !FindOrCreateResource( domain, source_mc, fru_id, sdr, sdrs ) ) {
+ return false;
+ }
+ }
+diff --git a/plugins/ipmidirect/ipmi_resource.cpp b/plugins/ipmidirect/ipmi_resource.cpp
+index c438e74..2552673 100644
+--- a/plugins/ipmidirect/ipmi_resource.cpp
++++ b/plugins/ipmidirect/ipmi_resource.cpp
+@@ -73,7 +73,7 @@ cIpmiResource::SendCommandReadLock( const cIpmiMsg &msg, cIpmiMsg &rsp,
+
+ domain->ReadLock();
+
+- if ( domain->VerifyResource( resource ) == false )
++ if ( !domain->VerifyResource( resource ) )
+ return SA_ERR_HPI_NOT_PRESENT;
+
+ return rv;
+@@ -91,7 +91,7 @@ cIpmiResource::SendCommandReadLock( cIpmiRdr *rdr, const cIpmiMsg &msg, cIpmiMsg
+
+ domain->ReadLock();
+
+- if ( domain->VerifyRdr( rdr ) == false )
++ if ( !domain->VerifyRdr( rdr ) )
+ return SA_ERR_HPI_NOT_PRESENT;
+
+ return rv;
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch
new file mode 100644
index 000000000..4d56f6535
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-ipmidirect-Replace-__STRING.patch
@@ -0,0 +1,31 @@
+From be40b3f11460cf495bbbef45692e7763afda0c2b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Sep 2017 17:56:31 -0700
+Subject: [PATCH] ipmidirect: Replace __STRING
+
+__STRING is not universally available e.g.
+musl does not define it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ plugins/ipmidirect/t/test.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/ipmidirect/t/test.h b/plugins/ipmidirect/t/test.h
+index 8d71381..978d5ff 100644
+--- a/plugins/ipmidirect/t/test.h
++++ b/plugins/ipmidirect/t/test.h
+@@ -22,7 +22,7 @@ TestFunction( const char *str, const char *file, int line, bool expr )
+ }
+
+
+-#define Test(expr) TestFunction( __STRING(expr), __FILE__, __LINE__, expr )
++#define Test(expr) TestFunction( #expr, __FILE__, __LINE__, expr )
+
+
+ static int
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch
new file mode 100644
index 000000000..0f033ac85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch
@@ -0,0 +1,47 @@
+From be665d9513cca7e8b64c79ae424cf44ac166b052 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Sep 2017 17:07:58 -0700
+Subject: [PATCH] plugins: Check for PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ before use
+
+musl does not define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+so we can not assume that all Linux systems support PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+its a glibc specific define so check for it being defined before using it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ plugins/dynamic_simulator/thread.cpp | 2 +-
+ plugins/ipmidirect/thread.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/dynamic_simulator/thread.cpp b/plugins/dynamic_simulator/thread.cpp
+index d663be0..9210fd7 100644
+--- a/plugins/dynamic_simulator/thread.cpp
++++ b/plugins/dynamic_simulator/thread.cpp
+@@ -229,7 +229,7 @@ cThread::Exit( void *rv )
+ /**
+ * Constructor
+ **/
+-#if ( defined(__sun) && defined(__SVR4) ) || defined(__FreeBSD__)
++#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ cThreadLock::cThreadLock()
+ {
+ pthread_mutexattr_t attr;
+diff --git a/plugins/ipmidirect/thread.cpp b/plugins/ipmidirect/thread.cpp
+index 5c52557..48e83fa 100644
+--- a/plugins/ipmidirect/thread.cpp
++++ b/plugins/ipmidirect/thread.cpp
+@@ -167,7 +167,7 @@ cThread::Exit( void *rv )
+ // cThreadLock
+ //////////////////////////////////////////////////
+
+-#if ( defined(__sun) && defined(__SVR4) ) || defined(__FreeBSD__)
++#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+ cThreadLock::cThreadLock()
+ {
+ pthread_mutexattr_t attr;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch
new file mode 100644
index 000000000..0549d5977
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/c++11.patch
@@ -0,0 +1,12 @@
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -44,6 +44,7 @@ AC_PROG_CPP
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
++AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
+
+ enabled_non32bit="no"
+ AC_ARG_ENABLE([non32bit-int],
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch
new file mode 100644
index 000000000..9b35a0cce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch
@@ -0,0 +1,1288 @@
+Index: openhpi-3.6.1/plugins/dynamic_simulator/new_sim.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/dynamic_simulator/new_sim.cpp
++++ openhpi-3.6.1/plugins/dynamic_simulator/new_sim.cpp
+@@ -415,7 +415,7 @@ extern "C" {
+ /**
+ * Alias for @ref öh_open(), implemented by @ref NewSimulatorOpen().
+ **/
+-static void * NewSimulatorOpen( GHashTable *, unsigned int, oh_evt_queue * ) __attribute__((used));
++static void * NewSimulatorOpen( GHashTable *, unsigned int, oh_evt_queue * ) __asm__("NewSimulatorOpen") __attribute__((used));
+
+ /**
+ * @fn NewSimulatorOpen( GHashTable *handler_config, unsigned int hid,
+@@ -530,7 +530,7 @@ static void * NewSimulatorOpen( GHashTab
+ /**
+ * Alias for @ref öh_close(), implemented by @ref NewSimulatorClose().
+ **/
+-static void NewSimulatorClose( void * ) __attribute__((used));
++static void NewSimulatorClose( void * ) __asm__("NewSimulatorClose") __attribute__((used));
+
+ /**
+ * @relate NewSimulatorClose
+@@ -585,7 +585,7 @@ static void NewSimulatorClose( void *hnd
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorGetEvent( void * ) __attribute__((used));
++static SaErrorT NewSimulatorGetEvent( void * ) __asm__("NewSimulatorGetEvent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetEvent( void *hnd ) {
+ dbg( "NewSimulatorGetEvent" );
+@@ -613,7 +613,7 @@ static SaErrorT NewSimulatorGetEvent( vo
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorDiscoverResources( void * ) __attribute__((used));
++static SaErrorT NewSimulatorDiscoverResources( void * ) __asm__("NewSimulatorDiscoverResources") __attribute__((used));
+
+ static SaErrorT NewSimulatorDiscoverResources( void *hnd ) {
+ dbg( "NewSimulatorDiscoverResources" );
+@@ -641,7 +641,7 @@ static SaErrorT NewSimulatorDiscoverReso
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __attribute__((used));
++static SaErrorT NewSimulatorSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __asm__("NewSimulatorSetResourceTag") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResourceTag( void *hnd, SaHpiResourceIdT id,
+ SaHpiTextBufferT *tag ) {
+@@ -669,7 +669,7 @@ static SaErrorT NewSimulatorSetResourceT
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __attribute__((used));
++static SaErrorT NewSimulatorSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __asm__("NewSimulatorSetResourceSeverity") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResourceSeverity( void *hnd, SaHpiResourceIdT id,
+ SaHpiSeverityT sev ) {
+@@ -703,7 +703,7 @@ static SaErrorT NewSimulatorGetSensorRea
+ SaHpiResourceIdT id,
+ SaHpiSensorNumT num,
+ SaHpiSensorReadingT *data,
+- SaHpiEventStateT *state ) __attribute__((used));
++ SaHpiEventStateT *state ) __asm__("NewSimulatorGetSensorReading") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorReading( void *hnd,
+ SaHpiResourceIdT id,
+@@ -738,7 +738,7 @@ static SaErrorT NewSimulatorGetSensorRea
+ static SaErrorT NewSimulatorGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiSensorThresholdsT * ) __attribute__((used));
++ SaHpiSensorThresholdsT * ) __asm__("NewSimulatorGetSensorThresholds") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT id,
+@@ -777,7 +777,7 @@ static SaErrorT NewSimulatorGetSensorThr
+ static SaErrorT NewSimulatorSetSensorThresholds( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- const SaHpiSensorThresholdsT * ) __attribute__((used));
++ const SaHpiSensorThresholdsT * ) __asm__("NewSimulatorSetSensorThresholds") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorThresholds( void *hnd,
+ SaHpiResourceIdT id,
+@@ -815,7 +815,7 @@ static SaErrorT NewSimulatorSetSensorThr
+ static SaErrorT NewSimulatorGetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("NewSimulatorGetSensorEnable") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEnable( void *hnd,
+ SaHpiResourceIdT id,
+@@ -849,7 +849,7 @@ static SaErrorT NewSimulatorGetSensorEna
+ static SaErrorT NewSimulatorSetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("NewSimulatorSetSensorEnable") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEnable( void *hnd,
+ SaHpiResourceIdT id,
+@@ -883,7 +883,7 @@ static SaErrorT NewSimulatorSetSensorEna
+ static SaErrorT NewSimulatorGetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("NewSimulatorGetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEventEnables( void *hnd,
+ SaHpiResourceIdT id,
+@@ -916,7 +916,7 @@ static SaErrorT NewSimulatorGetSensorEve
+ static SaErrorT NewSimulatorSetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("NewSimulatorSetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEventEnables( void *hnd,
+ SaHpiResourceIdT id,
+@@ -952,7 +952,7 @@ static SaErrorT NewSimulatorGetSensorEve
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+ SaHpiEventStateT *,
+- SaHpiEventStateT * ) __attribute__((used));
++ SaHpiEventStateT * ) __asm__("NewSimulatorGetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSensorEventMasks( void *hnd,
+ SaHpiResourceIdT id,
+@@ -990,7 +990,7 @@ static SaErrorT NewSimulatorSetSensorEve
+ SaHpiSensorNumT,
+ SaHpiSensorEventMaskActionT,
+ SaHpiEventStateT,
+- SaHpiEventStateT ) __attribute__((used));
++ SaHpiEventStateT ) __asm__("NewSimulatorSetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSensorEventMasks( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1026,7 +1026,7 @@ static SaErrorT NewSimulatorSetSensorEve
+ static SaErrorT NewSimulatorGetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT *,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("NewSimulatorGetControlState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetControlState( void *hnd, SaHpiResourceIdT id,
+ SaHpiCtrlNumT num,
+@@ -1061,7 +1061,7 @@ static SaErrorT NewSimulatorGetControlSt
+ static SaErrorT NewSimulatorSetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("NewSimulatorSetControlState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetControlState( void *hnd, SaHpiResourceIdT id,
+ SaHpiCtrlNumT num,
+@@ -1099,7 +1099,7 @@ static SaErrorT NewSimulatorGetNextAnnou
+ SaHpiAnnunciatorNumT,
+ SaHpiSeverityT,
+ SaHpiBoolT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorGetNextAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetNextAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1135,7 +1135,7 @@ static SaErrorT NewSimulatorGetNextAnnou
+ static SaErrorT NewSimulatorGetAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorGetAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1171,7 +1171,7 @@ static SaErrorT NewSimulatorGetAnnouncem
+ static SaErrorT NewSimulatorAckAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiSeverityT) __attribute__((used));
++ SaHpiSeverityT) __asm__("NewSimulatorAckAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorAckAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1205,7 +1205,7 @@ static SaErrorT NewSimulatorAckAnnouncem
+ **/
+ static SaErrorT NewSimulatorAddAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnouncementT *) __attribute__((used));
++ SaHpiAnnouncementT *) __asm__("NewSimulatorAddAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1239,7 +1239,7 @@ static SaErrorT NewSimulatorAddAnnouncem
+ static SaErrorT NewSimulatorDelAnnouncement(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+ SaHpiEntryIdT,
+- SaHpiSeverityT) __attribute__((used));
++ SaHpiSeverityT) __asm__("NewSimulatorDelAnnouncement") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelAnnouncement(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1273,7 +1273,7 @@ static SaErrorT NewSimulatorDelAnnouncem
+ **/
+ static SaErrorT NewSimulatorGetAnnMode(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnunciatorModeT *) __attribute__((used));
++ SaHpiAnnunciatorModeT *) __asm__("NewSimulatorGetAnnMode") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAnnMode(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1306,7 +1306,7 @@ static SaErrorT NewSimulatorGetAnnMode(v
+ **/
+ static SaErrorT NewSimulatorSetAnnMode(void *, SaHpiResourceIdT,
+ SaHpiAnnunciatorNumT,
+- SaHpiAnnunciatorModeT) __attribute__((used));
++ SaHpiAnnunciatorModeT) __asm__("NewSimulatorSetAnnMode") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAnnMode(void *hnd, SaHpiResourceIdT id,
+ SaHpiAnnunciatorNumT num,
+@@ -1340,7 +1340,7 @@ static SaErrorT NewSimulatorSetAnnMode(v
+ static SaErrorT NewSimulatorGetIdrInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrInfoT * ) __attribute__((used));
++ SaHpiIdrInfoT * ) __asm__("NewSimulatorGetIdrInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1380,7 +1380,7 @@ static SaErrorT NewSimulatorGetIdrAreaHe
+ SaHpiIdrAreaTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrAreaHeaderT * ) __attribute__((used));
++ SaHpiIdrAreaHeaderT * ) __asm__("NewSimulatorGetIdrAreaHeader") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrAreaHeader( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1419,7 +1419,7 @@ static SaErrorT NewSimulatorAddIdrArea(
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT * ) __attribute__((used));
++ SaHpiEntryIdT * ) __asm__("NewSimulatorAddIdrArea") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrArea( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1456,7 +1456,7 @@ static SaErrorT NewSimulatorAddIdrAreaBy
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorAddIdrAreaById") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrAreaById( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1490,7 +1490,7 @@ static SaErrorT NewSimulatorAddIdrAreaBy
+ static SaErrorT NewSimulatorDelIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorDelIdrArea") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelIdrArea( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1532,7 +1532,7 @@ static SaErrorT NewSimulatorGetIdrField(
+ SaHpiIdrFieldTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorGetIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1570,7 +1570,7 @@ static SaErrorT NewSimulatorGetIdrField(
+ static SaErrorT NewSimulatorAddIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorAddIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1604,7 +1604,7 @@ static SaErrorT NewSimulatorAddIdrField(
+ static SaErrorT NewSimulatorAddIdrFieldById( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorAddIdrFieldById") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddIdrFieldById( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1637,7 +1637,7 @@ static SaErrorT NewSimulatorAddIdrFieldB
+ static SaErrorT NewSimulatorSetIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("NewSimulatorSetIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1672,7 +1672,7 @@ static SaErrorT NewSimulatorDelIdrField(
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiEntryIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("NewSimulatorDelIdrField") __attribute__((used));
+
+ static SaErrorT NewSimulatorDelIdrField( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1704,7 +1704,7 @@ static SaErrorT NewSimulatorDelIdrField(
+ **/
+ static SaErrorT NewSimulatorGetSelInfo( void *,
+ SaHpiResourceIdT,
+- SaHpiEventLogInfoT * ) __attribute__((used));
++ SaHpiEventLogInfoT * ) __asm__("NewSimulatorGetSelInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -1736,7 +1736,7 @@ static SaErrorT NewSimulatorGetSelInfo(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __attribute__((used));
++static SaErrorT NewSimulatorSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __asm__("NewSimulatorSetSelTime") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSelTime( void *hnd, SaHpiResourceIdT id, SaHpiTimeT t ) {
+ SaErrorT rv = SA_ERR_HPI_INTERNAL_ERROR;
+@@ -1766,7 +1766,7 @@ static SaErrorT NewSimulatorSetSelTime(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorAddSelEntry( void *, SaHpiResourceIdT, const SaHpiEventT * ) __attribute__((used));
++static SaErrorT NewSimulatorAddSelEntry( void *, SaHpiResourceIdT, const SaHpiEventT * ) __asm__("NewSimulatorAddSelEntry") __attribute__((used));
+
+ static SaErrorT NewSimulatorAddSelEntry( void *hnd, SaHpiResourceIdT id,
+ const SaHpiEventT *Event ) {
+@@ -1809,7 +1809,7 @@ static SaErrorT NewSimulatorGetSelEntry(
+ SaHpiEventLogEntryIdT *,
+ SaHpiEventLogEntryT *,
+ SaHpiRdrT *,
+- SaHpiRptEntryT * ) __attribute__((used));
++ SaHpiRptEntryT * ) __asm__("NewSimulatorGetSelEntry") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelEntry( void *hnd, SaHpiResourceIdT id,
+ SaHpiEventLogEntryIdT current,
+@@ -1844,7 +1844,7 @@ static SaErrorT NewSimulatorGetSelEntry(
+ *
+ * @return HPI error code
+ **/
+-static SaErrorT NewSimulatorClearSel( void *, SaHpiResourceIdT ) __attribute__((used));
++static SaErrorT NewSimulatorClearSel( void *, SaHpiResourceIdT ) __asm__("NewSimulatorClearSel") __attribute__((used));
+
+ static SaErrorT NewSimulatorClearSel( void *hnd, SaHpiResourceIdT id ) {
+ SaErrorT rv = SA_ERR_HPI_INTERNAL_ERROR;
+@@ -1875,7 +1875,7 @@ static SaErrorT NewSimulatorClearSel( vo
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetSelState(void *, SaHpiResourceIdT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorSetSelState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetSelState( void *hnd, SaHpiResourceIdT id,
+ SaHpiBoolT state ) {
+@@ -1907,7 +1907,7 @@ static SaErrorT NewSimulatorSetSelState(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetSelState(void *, SaHpiResourceIdT,
+- SaHpiBoolT *) __attribute__((used));
++ SaHpiBoolT *) __asm__("NewSimulatorGetSelState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelState( void *hnd, SaHpiResourceIdT id,
+ SaHpiBoolT *state ) {
+@@ -1939,7 +1939,7 @@ static SaErrorT NewSimulatorGetSelState(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetSelCapability(void *, SaHpiResourceIdT,
+- SaHpiEventLogCapabilitiesT *) __attribute__((used));
++ SaHpiEventLogCapabilitiesT *) __asm__("NewSimulatorGetSelCapability") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetSelCapability( void *hnd, SaHpiResourceIdT id,
+ SaHpiEventLogCapabilitiesT *caps ) {
+@@ -1970,7 +1970,7 @@ static SaErrorT NewSimulatorGetSelCapabi
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorResetSelOverflow(void *, SaHpiResourceIdT)
+- __attribute__((used));
++ __asm__("NewSimulatorResetSelOverflow") __attribute__((used));
+
+ static SaErrorT NewSimulatorResetSelOverflow( void *hnd, SaHpiResourceIdT id ) {
+
+@@ -2002,7 +2002,7 @@ static SaErrorT NewSimulatorResetSelOver
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorHotswapPolicyCancel( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorHotswapPolicyCancel") __attribute__((used));
+
+ static SaErrorT NewSimulatorHotswapPolicyCancel( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT timeout) {
+@@ -2032,7 +2032,7 @@ static SaErrorT NewSimulatorHotswapPolic
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetHotswapState( void *, SaHpiResourceIdT ,
+- SaHpiHsStateT * ) __attribute__((used));
++ SaHpiHsStateT * ) __asm__("NewSimulatorGetHotswapState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetHotswapState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsStateT *state ) {
+@@ -2063,7 +2063,7 @@ static SaErrorT NewSimulatorGetHotswapSt
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetHotswapState( void *, SaHpiResourceIdT,
+- SaHpiHsStateT ) __attribute__((used));
++ SaHpiHsStateT ) __asm__("NewSimulatorSetHotswapState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetHotswapState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsStateT state ) {
+@@ -2105,7 +2105,7 @@ static SaErrorT NewSimulatorSetHotswapSt
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorRequestHotswapAction( void *, SaHpiResourceIdT,
+- SaHpiHsActionT ) __attribute__((used));
++ SaHpiHsActionT ) __asm__("NewSimulatorRequestHotswapAction") __attribute__((used));
+
+ static SaErrorT NewSimulatorRequestHotswapAction( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsActionT act ) {
+@@ -2139,7 +2139,7 @@ static SaErrorT NewSimulatorRequestHotsw
+ static SaErrorT NewSimulatorGetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("NewSimulatorGetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetWatchdogInfo(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2170,7 +2170,7 @@ static SaErrorT NewSimulatorGetWatchdogI
+ static SaErrorT NewSimulatorSetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("NewSimulatorSetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetWatchdogInfo(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2199,7 +2199,7 @@ static SaErrorT NewSimulatorSetWatchdogI
+ **/
+ static SaErrorT NewSimulatorResetWatchdog(void *,
+ SaHpiResourceIdT,
+- SaHpiWatchdogNumT) __attribute__((used));
++ SaHpiWatchdogNumT) __asm__("NewSimulatorResetWatchdog") __attribute__((used));
+
+ static SaErrorT NewSimulatorResetWatchdog(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2229,7 +2229,7 @@ static SaErrorT NewSimulatorResetWatchdo
+ static SaErrorT NewSimulatorGetFumiSpec(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiSpecInfoT *) __attribute__((used));
++ SaHpiFumiSpecInfoT *) __asm__("NewSimulatorGetFumiSpec") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSpec(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2260,7 +2260,7 @@ static SaErrorT NewSimulatorGetFumiSpec(
+ static SaErrorT NewSimulatorGetFumiServImpact(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiServiceImpactDataT *) __attribute__((used));
++ SaHpiFumiServiceImpactDataT *) __asm__("NewSimulatorGetFumiServImpact") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiServImpact(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2294,7 +2294,7 @@ static SaErrorT NewSimulatorSetFumiSourc
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiTextBufferT *) __attribute__((used));
++ SaHpiTextBufferT *) __asm__("NewSimulatorSetFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2327,7 +2327,7 @@ static SaErrorT NewSimulatorSetFumiSourc
+ static SaErrorT NewSimulatorValidateFumiSource(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorValidateFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorValidateFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2361,7 +2361,7 @@ static SaErrorT NewSimulatorGetFumiSourc
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiSourceInfoT *) __attribute__((used));
++ SaHpiFumiSourceInfoT *) __asm__("NewSimulatorGetFumiSource") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSource(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2400,7 +2400,7 @@ static SaErrorT NewSimulatorGetFumiSourc
+ SaHpiBankNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiComponentInfoT *) __attribute__((used));
++ SaHpiFumiComponentInfoT *) __asm__("NewSimulatorGetFumiSourceComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiSourceComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2437,7 +2437,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiBankInfoT *) __attribute__((used));
++ SaHpiFumiBankInfoT *) __asm__("NewSimulatorGetFumiTarget") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiTarget(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2476,7 +2476,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ SaHpiBankNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiComponentInfoT *) __attribute__((used));
++ SaHpiFumiComponentInfoT *) __asm__("NewSimulatorGetFumiTargetComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiTargetComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2511,7 +2511,7 @@ static SaErrorT NewSimulatorGetFumiTarge
+ static SaErrorT NewSimulatorGetFumiLogicalTarget(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiFumiLogicalBankInfoT *) __attribute__((used));
++ SaHpiFumiLogicalBankInfoT *) __asm__("NewSimulatorGetFumiLogicalTarget") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiLogicalTarget(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2547,7 +2547,7 @@ static SaErrorT NewSimulatorGetFumiLogic
+ SaHpiFumiNumT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiFumiLogicalComponentInfoT *) __attribute__((used));
++ SaHpiFumiLogicalComponentInfoT *) __asm__("NewSimulatorGetFumiLogicalTargetComponent") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiLogicalTargetComponent(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2579,7 +2579,7 @@ static SaErrorT NewSimulatorGetFumiLogic
+ **/
+ static SaErrorT NewSimulatorStartFumiBackup(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiBackup") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiBackup(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2612,7 +2612,7 @@ static SaErrorT NewSimulatorSetFumiBankO
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiUint32T) __attribute__((used));
++ SaHpiUint32T) __asm__("NewSimulatorSetFumiBankOrder") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiBankOrder(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2647,7 +2647,7 @@ static SaErrorT NewSimulatorStartFumiBan
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiBankCopy") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiBankCopy(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2680,7 +2680,7 @@ static SaErrorT NewSimulatorStartFumiBan
+ static SaErrorT NewSimulatorStartFumiInstall(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiInstall") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiInstall(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2714,7 +2714,7 @@ static SaErrorT NewSimulatorGetFumiStatu
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+ SaHpiBankNumT,
+- SaHpiFumiUpgradeStatusT *) __attribute__((used));
++ SaHpiFumiUpgradeStatusT *) __asm__("NewSimulatorGetFumiStatus") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiStatus(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2747,7 +2747,7 @@ static SaErrorT NewSimulatorGetFumiStatu
+ static SaErrorT NewSimulatorStartFumiVerification(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorStartFumiVerification") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiVerification(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2776,7 +2776,7 @@ static SaErrorT NewSimulatorStartFumiVer
+ **/
+ static SaErrorT NewSimulatorStartFumiVerificationMain(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiVerificationMain") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiVerificationMain(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2807,7 +2807,7 @@ static SaErrorT NewSimulatorStartFumiVer
+ static SaErrorT NewSimulatorCancelFumiUpgrade(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorCancelFumiUpgrade") __attribute__((used));
+
+ static SaErrorT NewSimulatorCancelFumiUpgrade(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2838,7 +2838,7 @@ static SaErrorT NewSimulatorCancelFumiUp
+ static SaErrorT NewSimulatorGetFumiRollback(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT *) __attribute__((used));
++ SaHpiBoolT *) __asm__("NewSimulatorGetFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2870,7 +2870,7 @@ static SaErrorT NewSimulatorGetFumiRollb
+ static SaErrorT NewSimulatorSetFumiRollback(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorSetFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2900,7 +2900,7 @@ static SaErrorT NewSimulatorSetFumiRollb
+ **/
+ static SaErrorT NewSimulatorStartFumiRollback(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorStartFumiRollback") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiRollback(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2929,7 +2929,7 @@ static SaErrorT NewSimulatorStartFumiRol
+ **/
+ static SaErrorT NewSimulatorActivateFumi(void *,
+ SaHpiResourceIdT,
+- SaHpiFumiNumT) __attribute__((used));
++ SaHpiFumiNumT) __asm__("NewSimulatorActivateFumi") __attribute__((used));
+
+ static SaErrorT NewSimulatorActivateFumi(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2960,7 +2960,7 @@ static SaErrorT NewSimulatorActivateFumi
+ static SaErrorT NewSimulatorStartFumiActivation(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBoolT) __attribute__((used));
++ SaHpiBoolT) __asm__("NewSimulatorStartFumiActivation") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartFumiActivation(void *hnd,
+ SaHpiResourceIdT id,
+@@ -2992,7 +2992,7 @@ static SaErrorT NewSimulatorStartFumiAct
+ static SaErrorT NewSimulatorCleanupFumi(void *,
+ SaHpiResourceIdT,
+ SaHpiFumiNumT,
+- SaHpiBankNumT) __attribute__((used));
++ SaHpiBankNumT) __asm__("NewSimulatorCleanupFumi") __attribute__((used));
+
+ static SaErrorT NewSimulatorCleanupFumi(void *hnd,
+ SaHpiResourceIdT id,
+@@ -3023,7 +3023,7 @@ static SaErrorT NewSimulatorCleanupFumi(
+ static SaErrorT NewSimulatorGetDimiInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+- SaHpiDimiInfoT *) __attribute__((used));
++ SaHpiDimiInfoT *) __asm__("NewSimulatorGetDimiInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3057,7 +3057,7 @@ static SaErrorT NewSimulatorGetDimiTestI
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiTestT *) __attribute__((used));
++ SaHpiDimiTestT *) __asm__("NewSimulatorGetDimiTestInfo") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestInfo( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3092,7 +3092,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiReadyT *) __attribute__((used));
++ SaHpiDimiReadyT *) __asm__("NewSimulatorGetDimiTestReadiness") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestReadiness( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3129,7 +3129,7 @@ static SaErrorT NewSimulatorStartDimiTes
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+ SaHpiUint8T,
+- SaHpiDimiTestVariableParamsT *) __attribute__((used));
++ SaHpiDimiTestVariableParamsT *) __asm__("NewSimulatorStartDimiTest") __attribute__((used));
+
+ static SaErrorT NewSimulatorStartDimiTest( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3163,7 +3163,7 @@ static SaErrorT NewSimulatorStartDimiTes
+ static SaErrorT NewSimulatorCancelDimiTest( void *,
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+- SaHpiDimiTestNumT) __attribute__((used));
++ SaHpiDimiTestNumT) __asm__("NewSimulatorCancelDimiTest") __attribute__((used));
+
+ static SaErrorT NewSimulatorCancelDimiTest( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3199,7 +3199,7 @@ static SaErrorT NewSimulatorGetDimiTestS
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+ SaHpiDimiTestPercentCompletedT *,
+- SaHpiDimiTestRunStatusT *) __attribute__((used));
++ SaHpiDimiTestRunStatusT *) __asm__("NewSimulatorGetDimiTestStatus") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestStatus( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3234,7 +3234,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ SaHpiResourceIdT,
+ SaHpiDimiNumT,
+ SaHpiDimiTestNumT,
+- SaHpiDimiTestResultsT *) __attribute__((used));
++ SaHpiDimiTestResultsT *) __asm__("NewSimulatorGetDimiTestResults") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetDimiTestResults( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3263,7 +3263,7 @@ static SaErrorT NewSimulatorGetDimiTestR
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetAutoInsertTimeout( void *,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorSetAutoInsertTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAutoInsertTimeout( void *hnd, SaHpiTimeoutT timeout) {
+ NewSimulator *newsim = VerifyNewSimulator( hnd );
+@@ -3289,7 +3289,7 @@ static SaErrorT NewSimulatorSetAutoInser
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT * ) __attribute__((used));
++ SaHpiTimeoutT * ) __asm__("NewSimulatorGetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT *timeout ) {
+@@ -3319,7 +3319,7 @@ static SaErrorT NewSimulatorGetAutoExtra
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("NewSimulatorSetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+ SaHpiTimeoutT timeout ) {
+@@ -3350,7 +3350,7 @@ static SaErrorT NewSimulatorSetAutoExtra
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT * ) __attribute__((used));
++ SaHpiPowerStateT * ) __asm__("NewSimulatorGetPowerState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetPowerState( void *hnd, SaHpiResourceIdT id,
+ SaHpiPowerStateT *state ) {
+@@ -3382,7 +3382,7 @@ static SaErrorT NewSimulatorGetPowerStat
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT ) __attribute__((used));
++ SaHpiPowerStateT ) __asm__("NewSimulatorSetPowerState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetPowerState( void *hnd, SaHpiResourceIdT id,
+ SaHpiPowerStateT state ) {
+@@ -3414,7 +3414,7 @@ static SaErrorT NewSimulatorSetPowerStat
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT * ) __attribute__((used));
++ SaHpiHsIndicatorStateT * ) __asm__("NewSimulatorGetIndicatorState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetIndicatorState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsIndicatorStateT *state ) {
+@@ -3446,7 +3446,7 @@ static SaErrorT NewSimulatorGetIndicator
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorSetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT ) __attribute__((used));
++ SaHpiHsIndicatorStateT ) __asm__("NewSimulatorSetIndicatorState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetIndicatorState( void *hnd, SaHpiResourceIdT id,
+ SaHpiHsIndicatorStateT state ) {
+@@ -3479,7 +3479,7 @@ static SaErrorT NewSimulatorSetIndicator
+ **/
+ static SaErrorT NewSimulatorControlParm( void *,
+ SaHpiResourceIdT,
+- SaHpiParmActionT ) __attribute__((used));
++ SaHpiParmActionT ) __asm__("NewSimulatorControlParm") __attribute__((used));
+
+ static SaErrorT NewSimulatorControlParm( void *hnd,
+ SaHpiResourceIdT id,
+@@ -3512,7 +3512,7 @@ static SaErrorT NewSimulatorControlParm(
+ * @return HPI error code
+ **/
+ static SaErrorT NewSimulatorGetResetState( void *, SaHpiResourceIdT,
+- SaHpiResetActionT * ) __attribute__((used));
++ SaHpiResetActionT * ) __asm__("NewSimulatorGetResetState") __attribute__((used));
+
+ static SaErrorT NewSimulatorGetResetState( void *hnd, SaHpiResourceIdT id,
+ SaHpiResetActionT *act ) {
+@@ -3545,7 +3545,7 @@ static SaErrorT NewSimulatorGetResetStat
+ **/
+ static SaErrorT NewSimulatorSetResetState( void *,
+ SaHpiResourceIdT,
+- SaHpiResetActionT ) __attribute__((used));
++ SaHpiResetActionT ) __asm__("NewSimulatorSetResetState") __attribute__((used));
+
+ static SaErrorT NewSimulatorSetResetState( void *hnd,
+ SaHpiResourceIdT id,
+Index: openhpi-3.6.1/plugins/dynamic_simulator/new_sim_file.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/dynamic_simulator/new_sim_file.cpp
++++ openhpi-3.6.1/plugins/dynamic_simulator/new_sim_file.cpp
+@@ -44,9 +44,9 @@
+ ///< Global skip characters for oh_scanner_config
+ static gchar skip_characters[] = " \t\n";
+ ///< Global identifier_first for oh_scanner_config
+-static gchar identifier_first[] = G_CSET_a_2_z"_/."G_CSET_A_2_Z;
++static gchar identifier_first[] = G_CSET_a_2_z "_/." G_CSET_A_2_Z;
+ ///< Global identifier_nth for oh_scanner_config
+-static gchar identifier_nth[] = G_CSET_a_2_z"_-0123456789/."G_CSET_A_2_Z;
++static gchar identifier_nth[] = G_CSET_a_2_z "_-0123456789/." G_CSET_A_2_Z;
+ ///< Global comment signs for oh_scanner_config
+ static gchar comment_single[] = "#\n";
+
+Index: openhpi-3.6.1/plugins/ipmidirect/ipmi.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/ipmi.cpp
++++ openhpi-3.6.1/plugins/ipmidirect/ipmi.cpp
+@@ -279,7 +279,7 @@ extern "C" {
+ // ABI Interface functions
+
+ static void *
+-IpmiOpen( GHashTable *, unsigned int, oh_evt_queue * ) __attribute__((used));
++IpmiOpen( GHashTable *, unsigned int, oh_evt_queue * ) __asm__("IpmiOpen") __attribute__((used));
+
+ static void *
+ IpmiOpen( GHashTable *handler_config, unsigned int hid, oh_evt_queue *eventq )
+@@ -388,7 +388,7 @@ IpmiOpen( GHashTable *handler_config, un
+
+
+ static void
+-IpmiClose( void * ) __attribute__((used));
++IpmiClose( void * ) __asm__("IpmiClose") __attribute__((used));
+
+ static void
+ IpmiClose( void *hnd )
+@@ -436,7 +436,7 @@ IpmiClose( void *hnd )
+
+
+ static SaErrorT
+-IpmiGetEvent( void * ) __attribute__((used));
++IpmiGetEvent( void * ) __asm__("IpmiGetEvent") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetEvent( void *hnd )
+@@ -458,7 +458,7 @@ IpmiGetEvent( void *hnd )
+
+
+ static SaErrorT
+-IpmiDiscoverResources( void * ) __attribute__((used));
++IpmiDiscoverResources( void * ) __asm__("IpmiDiscoverResources") __attribute__((used));
+
+ static SaErrorT
+ IpmiDiscoverResources( void *hnd )
+@@ -479,7 +479,7 @@ IpmiDiscoverResources( void *hnd )
+
+
+ static SaErrorT
+-IpmiSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __attribute__((used));
++IpmiSetResourceTag( void *, SaHpiResourceIdT, SaHpiTextBufferT * ) __asm__("IpmiSetResourceTag") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResourceTag( void *hnd, SaHpiResourceIdT id, SaHpiTextBufferT *tag )
+@@ -499,7 +499,7 @@ IpmiSetResourceTag( void *hnd, SaHpiReso
+
+
+ static SaErrorT
+-IpmiSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __attribute__((used));
++IpmiSetResourceSeverity( void *, SaHpiResourceIdT, SaHpiSeverityT ) __asm__("IpmiSetResourceSeverity") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResourceSeverity( void *hnd, SaHpiResourceIdT id, SaHpiSeverityT sev )
+@@ -523,7 +523,7 @@ IpmiGetSensorReading( void *,
+ SaHpiResourceIdT id,
+ SaHpiSensorNumT num,
+ SaHpiSensorReadingT *data,
+- SaHpiEventStateT *state ) __attribute__((used));
++ SaHpiEventStateT *state ) __asm__("IpmiGetSensorReading") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorReading( void *hnd,
+@@ -550,7 +550,7 @@ static SaErrorT
+ IpmiGetSensorThresholds( void *hnd,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiSensorThresholdsT * ) __attribute__((used));
++ SaHpiSensorThresholdsT * ) __asm__("IpmiGetSensorThresholds") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorThresholds( void *hnd,
+@@ -581,7 +581,7 @@ static SaErrorT
+ IpmiSetSensorThresholds( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- const SaHpiSensorThresholdsT * ) __attribute__((used));
++ const SaHpiSensorThresholdsT * ) __asm__("IpmiSetSensorThresholds") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorThresholds( void *hnd,
+@@ -612,7 +612,7 @@ static SaErrorT
+ IpmiGetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("IpmiGetSensorEnable") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEnable( void *hnd,
+@@ -638,7 +638,7 @@ static SaErrorT
+ IpmiSetSensorEnable( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("IpmiSetSensorEnable") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEnable( void *hnd,
+@@ -664,7 +664,7 @@ static SaErrorT
+ IpmiGetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT * ) __attribute__((used));
++ SaHpiBoolT * ) __asm__("IpmiGetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEventEnables( void *hnd,
+@@ -690,7 +690,7 @@ static SaErrorT
+ IpmiSetSensorEventEnables( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+- SaHpiBoolT ) __attribute__((used));
++ SaHpiBoolT ) __asm__("IpmiSetSensorEventEnables") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEventEnables( void *hnd,
+@@ -717,7 +717,7 @@ IpmiGetSensorEventMasks( void *,
+ SaHpiResourceIdT,
+ SaHpiSensorNumT,
+ SaHpiEventStateT *,
+- SaHpiEventStateT * ) __attribute__((used));
++ SaHpiEventStateT * ) __asm__("IpmiGetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSensorEventMasks( void *hnd,
+@@ -747,7 +747,7 @@ IpmiSetSensorEventMasks( void *,
+ SaHpiSensorNumT,
+ SaHpiSensorEventMaskActionT,
+ SaHpiEventStateT,
+- SaHpiEventStateT ) __attribute__((used));
++ SaHpiEventStateT ) __asm__("IpmiSetSensorEventMasks") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSensorEventMasks( void *hnd,
+@@ -776,7 +776,7 @@ static SaErrorT
+ IpmiGetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT *,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("IpmiGetControlState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetControlState( void *hnd, SaHpiResourceIdT id,
+@@ -802,7 +802,7 @@ static SaErrorT
+ IpmiSetControlState( void *, SaHpiResourceIdT,
+ SaHpiCtrlNumT,
+ SaHpiCtrlModeT,
+- SaHpiCtrlStateT * ) __attribute__((used));
++ SaHpiCtrlStateT * ) __asm__("IpmiSetControlState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetControlState( void *hnd, SaHpiResourceIdT id,
+@@ -828,7 +828,7 @@ static SaErrorT
+ IpmiGetIdrInfo( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrInfoT * ) __attribute__((used));
++ SaHpiIdrInfoT * ) __asm__("IpmiGetIdrInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrInfo( void *hnd,
+@@ -857,7 +857,7 @@ IpmiGetIdrAreaHeader( void *,
+ SaHpiIdrAreaTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrAreaHeaderT * ) __attribute__((used));
++ SaHpiIdrAreaHeaderT * ) __asm__("IpmiGetIdrAreaHeader") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrAreaHeader( void *hnd,
+@@ -887,7 +887,7 @@ IpmiAddIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiIdrAreaTypeT,
+- SaHpiEntryIdT * ) __attribute__((used));
++ SaHpiEntryIdT * ) __asm__("IpmiAddIdrArea") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddIdrArea( void *hnd,
+@@ -914,7 +914,7 @@ static SaErrorT
+ IpmiDelIdrArea( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("IpmiDelIdrArea") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelIdrArea( void *hnd,
+@@ -944,7 +944,7 @@ IpmiGetIdrField( void *,
+ SaHpiIdrFieldTypeT,
+ SaHpiEntryIdT,
+ SaHpiEntryIdT *,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiGetIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIdrField( void *hnd,
+@@ -974,7 +974,7 @@ static SaErrorT
+ IpmiAddIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiAddIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddIdrField( void *hnd,
+@@ -1000,7 +1000,7 @@ static SaErrorT
+ IpmiSetIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+- SaHpiIdrFieldT * ) __attribute__((used));
++ SaHpiIdrFieldT * ) __asm__("IpmiSetIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetIdrField( void *hnd,
+@@ -1027,7 +1027,7 @@ IpmiDelIdrField( void *,
+ SaHpiResourceIdT,
+ SaHpiIdrIdT,
+ SaHpiEntryIdT,
+- SaHpiEntryIdT ) __attribute__((used));
++ SaHpiEntryIdT ) __asm__("IpmiDelIdrField") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelIdrField( void *hnd,
+@@ -1053,7 +1053,7 @@ IpmiDelIdrField( void *hnd,
+ static SaErrorT
+ IpmiGetSelInfo( void *,
+ SaHpiResourceIdT,
+- SaHpiEventLogInfoT * ) __attribute__((used));
++ SaHpiEventLogInfoT * ) __asm__("IpmiGetSelInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSelInfo( void *hnd,
+@@ -1075,7 +1075,7 @@ IpmiGetSelInfo( void *hnd,
+
+
+ static SaErrorT
+-IpmiSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __attribute__((used));
++IpmiSetSelTime( void *, SaHpiResourceIdT, SaHpiTimeT ) __asm__("IpmiSetSelTime") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetSelTime( void *hnd, SaHpiResourceIdT id, SaHpiTimeT t )
+@@ -1096,7 +1096,7 @@ IpmiSetSelTime( void *hnd, SaHpiResource
+
+ static SaErrorT
+ IpmiAddSelEntry( void *, SaHpiResourceIdT,
+- const SaHpiEventT * ) __attribute__((used));
++ const SaHpiEventT * ) __asm__("IpmiAddSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiAddSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1118,7 +1118,7 @@ IpmiAddSelEntry( void *hnd, SaHpiResourc
+ #ifdef NOTUSED
+ static SaErrorT
+ IpmiDelSelEntry( void *, SaHpiResourceIdT,
+- SaHpiEventLogEntryIdT ) __attribute__((used));
++ SaHpiEventLogEntryIdT ) __asm__("IpmiDelSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiDelSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1145,7 +1145,7 @@ IpmiGetSelEntry( void *hnd, SaHpiResourc
+ SaHpiEventLogEntryIdT *, SaHpiEventLogEntryIdT *,
+ SaHpiEventLogEntryT *,
+ SaHpiRdrT *,
+- SaHpiRptEntryT * ) __attribute__((used));
++ SaHpiRptEntryT * ) __asm__("IpmiGetSelEntry") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetSelEntry( void *hnd, SaHpiResourceIdT id,
+@@ -1170,7 +1170,7 @@ IpmiGetSelEntry( void *hnd, SaHpiResourc
+
+
+ static SaErrorT
+-IpmiClearSel( void *, SaHpiResourceIdT ) __attribute__((used));
++IpmiClearSel( void *, SaHpiResourceIdT ) __asm__("IpmiClearSel") __attribute__((used));
+
+ static SaErrorT
+ IpmiClearSel( void *hnd, SaHpiResourceIdT id )
+@@ -1190,7 +1190,7 @@ IpmiClearSel( void *hnd, SaHpiResourceId
+
+ static SaErrorT
+ IpmiHotswapPolicyCancel( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("IpmiHotswapPolicyCancel") __attribute__((used));
+
+ static SaErrorT
+ IpmiHotswapPolicyCancel( void *hnd, SaHpiResourceIdT id,
+@@ -1210,7 +1210,7 @@ IpmiHotswapPolicyCancel( void *hnd, SaHp
+ }
+
+ static SaErrorT
+-IpmiSetAutoInsertTimeout( void *, SaHpiTimeoutT ) __attribute__((used));
++IpmiSetAutoInsertTimeout( void *, SaHpiTimeoutT ) __asm__("IpmiSetAutoInsertTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetAutoInsertTimeout( void *hnd, SaHpiTimeoutT timeout)
+@@ -1229,7 +1229,7 @@ IpmiSetAutoInsertTimeout( void *hnd, SaH
+
+ static SaErrorT
+ IpmiGetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT * ) __attribute__((used));
++ SaHpiTimeoutT * ) __asm__("IpmiGetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+@@ -1250,7 +1250,7 @@ IpmiGetAutoExtractTimeout( void *hnd, Sa
+
+ static SaErrorT
+ IpmiSetAutoExtractTimeout( void *, SaHpiResourceIdT,
+- SaHpiTimeoutT ) __attribute__((used));
++ SaHpiTimeoutT ) __asm__("IpmiSetAutoExtractTimeout") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetAutoExtractTimeout( void *hnd, SaHpiResourceIdT id,
+@@ -1271,7 +1271,7 @@ IpmiSetAutoExtractTimeout( void *hnd, Sa
+
+ static SaErrorT
+ IpmiGetHotswapState( void *, SaHpiResourceIdT ,
+- SaHpiHsStateT * ) __attribute__((used));
++ SaHpiHsStateT * ) __asm__("IpmiGetHotswapState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetHotswapState( void *hnd, SaHpiResourceIdT id,
+@@ -1293,7 +1293,7 @@ IpmiGetHotswapState( void *hnd, SaHpiRes
+
+ static SaErrorT
+ IpmiSetHotswapState( void *, SaHpiResourceIdT,
+- SaHpiHsStateT ) __attribute__((used));
++ SaHpiHsStateT ) __asm__("IpmiSetHotswapState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetHotswapState( void *hnd, SaHpiResourceIdT id,
+@@ -1315,7 +1315,7 @@ IpmiSetHotswapState( void *hnd, SaHpiRes
+
+ static SaErrorT
+ IpmiRequestHotswapAction( void *, SaHpiResourceIdT,
+- SaHpiHsActionT ) __attribute__((used));
++ SaHpiHsActionT ) __asm__("IpmiRequestHotswapAction") __attribute__((used));
+
+ static SaErrorT
+ IpmiRequestHotswapAction( void *hnd, SaHpiResourceIdT id,
+@@ -1337,7 +1337,7 @@ IpmiRequestHotswapAction( void *hnd, SaH
+
+ static SaErrorT
+ IpmiGetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT * ) __attribute__((used));
++ SaHpiPowerStateT * ) __asm__("IpmiGetPowerState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetPowerState( void *hnd, SaHpiResourceIdT id,
+@@ -1359,7 +1359,7 @@ IpmiGetPowerState( void *hnd, SaHpiResou
+
+ static SaErrorT
+ IpmiSetPowerState( void *, SaHpiResourceIdT,
+- SaHpiPowerStateT ) __attribute__((used));
++ SaHpiPowerStateT ) __asm__("IpmiSetPowerState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetPowerState( void *hnd, SaHpiResourceIdT id,
+@@ -1381,7 +1381,7 @@ IpmiSetPowerState( void *hnd, SaHpiResou
+
+ static SaErrorT
+ IpmiGetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT * ) __attribute__((used));
++ SaHpiHsIndicatorStateT * ) __asm__("IpmiGetIndicatorState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetIndicatorState( void *hnd, SaHpiResourceIdT id,
+@@ -1403,7 +1403,7 @@ IpmiGetIndicatorState( void *hnd, SaHpiR
+
+ static SaErrorT
+ IpmiSetIndicatorState( void *, SaHpiResourceIdT,
+- SaHpiHsIndicatorStateT ) __attribute__((used));
++ SaHpiHsIndicatorStateT ) __asm__("IpmiSetIndicatorState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetIndicatorState( void *hnd, SaHpiResourceIdT id,
+@@ -1426,7 +1426,7 @@ IpmiSetIndicatorState( void *hnd, SaHpiR
+ static SaErrorT
+ IpmiControlParm( void *,
+ SaHpiResourceIdT,
+- SaHpiParmActionT ) __attribute__((used));
++ SaHpiParmActionT ) __asm__("IpmiControlParm") __attribute__((used));
+
+ static SaErrorT
+ IpmiControlParm( void *hnd,
+@@ -1449,7 +1449,7 @@ IpmiControlParm( void *hnd,
+
+ static SaErrorT
+ IpmiGetResetState( void *, SaHpiResourceIdT,
+- SaHpiResetActionT * ) __attribute__((used));
++ SaHpiResetActionT * ) __asm__("IpmiGetResetState") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetResetState( void *hnd, SaHpiResourceIdT id,
+@@ -1472,7 +1472,7 @@ IpmiGetResetState( void *hnd, SaHpiResou
+ static SaErrorT
+ IpmiSetResetState( void *,
+ SaHpiResourceIdT,
+- SaHpiResetActionT ) __attribute__((used));
++ SaHpiResetActionT ) __asm__("IpmiSetResetState") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetResetState( void *hnd,
+@@ -1496,7 +1496,7 @@ static SaErrorT
+ IpmiGetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("IpmiGetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiGetWatchdogInfo(void *hnd,
+@@ -1517,7 +1517,7 @@ static SaErrorT
+ IpmiSetWatchdogInfo(void *,
+ SaHpiResourceIdT,
+ SaHpiWatchdogNumT,
+- SaHpiWatchdogT *) __attribute__((used));
++ SaHpiWatchdogT *) __asm__("IpmiSetWatchdogInfo") __attribute__((used));
+
+ static SaErrorT
+ IpmiSetWatchdogInfo(void *hnd,
+@@ -1537,7 +1537,7 @@ IpmiSetWatchdogInfo(void *hnd,
+ static SaErrorT
+ IpmiResetWatchdog(void *,
+ SaHpiResourceIdT,
+- SaHpiWatchdogNumT) __attribute__((used));
++ SaHpiWatchdogNumT) __asm__("IpmiResetWatchdog") __attribute__((used));
+
+ static SaErrorT
+ IpmiResetWatchdog(void *hnd,
+Index: openhpi-3.6.1/plugins/ipmidirect/ipmi_auth.h
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/ipmi_auth.h
++++ openhpi-3.6.1/plugins/ipmidirect/ipmi_auth.h
+@@ -32,7 +32,7 @@ class cIpmiAuthSg
+ {
+ public:
+ void *data; /* NULL to terminate. */
+- int len;
++ unsigned int len;
+ };
+
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch
new file mode 100644
index 000000000..4c545708f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/fix-narrowing-warning.patch
@@ -0,0 +1,20 @@
+Fix
+
+sensor_factors_000.cpp:66:5: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned char' in initializer list [-Wc++11-narrowing]
+((dRExp << 4) & 0xf0) | (dBExp & 0x0f ), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
+===================================================================
+--- openhpi-3.6.1.orig/plugins/ipmidirect/t/sensor_factors_000.cpp
++++ openhpi-3.6.1/plugins/ipmidirect/t/sensor_factors_000.cpp
+@@ -63,7 +63,7 @@ static cIpmiSdr sdr =
+ dB & 0xff,
+ ((dB >> 2) & 0xc0) | (dAccuracy & 0x3f),
+ ((dAccuracy >> 2) & 0xf0) | ((dAccuracyExp << 2) & 0x0c),
+- ((dRExp << 4) & 0xf0) | (dBExp & 0x0f ),
++ (unsigned char)(((dRExp << 4) & 0xf0) | (dBExp & 0x0f )),
+ 0,
+ 0,
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
new file mode 100644
index 000000000..4644910b7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-add-libnetsnmp-when-link.patch
@@ -0,0 +1,25 @@
+[PATCH] add libnetsnmp when link
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ plugins/snmp_bc/t/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/snmp_bc/t/Makefile.am b/plugins/snmp_bc/t/Makefile.am
+index 57e77ac..9894620 100644
+--- a/plugins/snmp_bc/t/Makefile.am
++++ b/plugins/snmp_bc/t/Makefile.am
+@@ -74,7 +74,7 @@ nodist_libsnmp_bc_la_SOURCES = $(GENERATED_EVENT_CODE) $(REMOTE_SIM_SOURCES)
+ # libopenhpi_la_LIBADD = $(top_builddir)/utils/libopenhpiutils.la
+ # libopenhpi_la_LDFLAGS = -L$(top_builddir)/utils -version-info @HPI_LIB_VERSION@ -export-symbols $(top_srcdir)/src/hpi.sym
+
+-libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la
++libsnmp_bc_la_LIBADD = -luuid @SNMPLIBS@ $(top_builddir)/utils/libopenhpiutils.la -lnetsnmp
+ libsnmp_bc_la_LDFLAGS = -L$(top_builddir)/utils -module -version-info @HPI_LIB_VERSION@
+ # libsnmp_bc_la_LDFLAGS = -version 0:0:0
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
new file mode 100644
index 000000000..077e26cbf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-alignment-issue.patch
@@ -0,0 +1,23 @@
+Fix alignment issue in ipmi_inventory.c
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/plugins/ipmi/ipmi_inventory.c b/plugins/ipmi/ipmi_inventory.c
+index 5382186..01655c6 100644
+--- a/plugins/ipmi/ipmi_inventory.c
++++ b/plugins/ipmi/ipmi_inventory.c
+@@ -2546,8 +2546,11 @@ static SaErrorT modify_inventory(SaHpiIdrFieldT *field,
+ if (tb->DataLength == 0) {
+ rv = ipmi_fru_set_board_info_mfg_time(fru, 0);
+ } else {
++ time_t the_time;
++ /* tb->Data is not aligned -- copy to temp */
++ memcpy(&the_time, tb->Data, sizeof(the_time));
+ rv = ipmi_fru_set_board_info_mfg_time(fru,
+- *(time_t *)tb->Data);
++ the_time);
+ }
+ break;
+ case SAHPI_IDR_FIELDTYPE_MANUFACTURER:
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
new file mode 100644
index 000000000..97c515e00
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-host-gcc.patch
@@ -0,0 +1,24 @@
+fix host gcc warnings
+
+Remove gcc warnings when gcc is v3.2
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -656,11 +656,6 @@ AC_ARG_ENABLE([werror],
+ fi],
+ [])
+
+-if test -n "`gcc --version | grep ' 3.2'`" ; then
+- CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+- CXX_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wno-strict-aliasing//g'`
+-fi
+-
+ case $host_os in
+ solaris*)
+ CC_WARNINGS=`echo $CC_WARNINGS | sed -e 's/-Wcast-qual//g'`
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
new file mode 100644
index 000000000..60e2e7919
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-fix-testfail-errors.patch
@@ -0,0 +1,33 @@
+Fix for saftest failures.
+
+Upstream-Status: Pending
+
+Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
+
+Index: openhpi-3.6.1/openhpid/safhpi.c
+===================================================================
+--- openhpi-3.6.1.orig/openhpid/safhpi.c
++++ openhpi-3.6.1/openhpid/safhpi.c
+@@ -1933,7 +1933,7 @@ SaErrorT SAHPI_API saHpiSensorThresholds
+ oh_release_domain(d); /* Unlock domain */
+
+ OH_CALL_ABI(h, set_sensor_thresholds, SA_ERR_HPI_INVALID_CMD, rv,
+- ResourceId, SensorNum, SensorThresholds);
++ ResourceId, SensorNum, &tmp);
+ oh_release_handler(h);
+
+ return rv;
+Index: openhpi-3.6.1/utils/sahpi_struct_utils.c
+===================================================================
+--- openhpi-3.6.1.orig/utils/sahpi_struct_utils.c
++++ openhpi-3.6.1/utils/sahpi_struct_utils.c
+@@ -3861,6 +3861,9 @@ SaHpiBoolT oh_valid_textbuffer(SaHpiText
+ /* found a unpaired surrogate */
+ return SAHPI_FALSE;
+ }
++ } else {
++ /*the first 2 bytes wrong*/
++ return SAHPI_FALSE;
+ }
+ }
+ break;
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
new file mode 100644
index 000000000..1627c9797
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-glib-cross-compile.patch
@@ -0,0 +1,33 @@
+Fix glib cross compile
+
+Uses proper PKG_CONFIG_PATH when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index b5f5aad..f5a5b74 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,13 +110,13 @@ else
+ *** GLIB is always available from ftp://ftp.gtk.org/.])
+ fi
+
+-exact_version=`pkg-config --modversion $GLIB`;
+-GLIB_CFLAGS=`pkg-config --cflags $GLIB $GTHREAD`
+-GLIB_LIBS=`pkg-config --libs $GLIB $GTHREAD`
+-GLIB_ONLY_CFLAGS=`pkg-config --cflags $GLIB`
+-GLIB_ONLY_LIBS=`pkg-config --libs $GLIB`
+-GMODULE_ONLY_CFLAGS=`pkg-config --cflags $GMODULE`
+-GMODULE_ONLY_LIBS=`pkg-config --libs $GMODULE`
++exact_version=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --modversion $GLIB`;
++GLIB_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB $GTHREAD`
++GLIB_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB $GTHREAD`
++GLIB_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GLIB`
++GLIB_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GLIB`
++GMODULE_ONLY_CFLAGS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --cflags $GMODULE`
++GMODULE_ONLY_LIBS=`PKG_CONFIG_PATH=$PKG_CONFIG_PATH pkg-config --libs $GMODULE`
+
+ # On some versions of Solaris the pkg-config file for gthread-2.0 contains a
+ # compiler option, '-mt', that is incompatible with gcc
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
new file mode 100644
index 000000000..cc21ff8c7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-hpi-shell-thread-fix.patch
@@ -0,0 +1,29 @@
+commit e9f9a73c9dba8dd59f3d6c3acd9988ec8361d55a
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Mon Dec 17 16:23:45 2012 -0500
+
+ Correct dangling g_thread_exit in session.c
+
+ hpi_shell's session.c has its progress_bar
+ thread created using pthread_create but
+ exited using g_thread_exit. Use pthread_exit
+ instead to avoid unpredictable GLIB thread
+ errors.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/hpi_shell/session.c
+===================================================================
+--- openhpi-3.6.1.orig/hpi_shell/session.c
++++ openhpi-3.6.1/hpi_shell/session.c
+@@ -73,7 +73,7 @@ static void* progress_bar(void *unused)
+ if (i < (PROGRESS_BUF_SIZE - mes_len - 1)) i++;
+ t++;
+ };
+- g_thread_exit(0);
++ pthread_exit(0);
+ return (void *)1;
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
new file mode 100644
index 000000000..d03c97e18
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-invalide-session.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Submitted
+
+Package saftest run a test case to pass invalid session id to function
+saHpiResourceIdGet that expect return SA_ERR_HPI_INVALID_SESSION. But the check
+for SA_ERR_HPI_INVALID_SESSION is missed somehow in function saHpiResourceIdGet.
+
+Add check for SA_ERR_HPI_INVALID_SESSION.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+-----
+--- openhpi-3.4.0/baselib/safhpi.cpp.orig 2014-02-25 10:45:20.911734868 +0800
++++ openhpi-3.4.0/baselib/safhpi.cpp 2014-02-25 10:46:05.366925389 +0800
+@@ -477,6 +477,8 @@
+ &rpt_update_count );
+ if ( rv == SA_ERR_HPI_NOT_PRESENT ) {
+ return SA_ERR_HPI_NOT_PRESENT;
++ } else if ( rv == SA_ERR_HPI_INVALID_SESSION) {
++ return SA_ERR_HPI_INVALID_SESSION;
+ } else if ( rv != SA_OK ) {
+ return SA_ERR_HPI_UNKNOWN;
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
new file mode 100644
index 000000000..c848b3502
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-libxml2-cross-compile.patch
@@ -0,0 +1,21 @@
+Fix libxml2 for cross-compiling
+
+Use proper XML2_INCLUDE path when cross-compiling
+
+Upstream-Status: Pending
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -177,7 +177,7 @@ AC_CHECK_HEADERS([openssl/md2.h openssl/
+
+ dnl xml is used for XML-based communication in ilo2_ribcl and oa_soap
+ AC_CHECK_LIB([xml2],[xmlParseMemory],[XML2_LIB=-lxml2],[XML2_LIB=])
+-AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="-I/usr/include/libxml2"],[XML2_INCLUDE])
++AC_CHECK_HEADERS([libxml2/libxml/xmlexports.h],[XML2_INCLUDE="$XML2_INCLUDE"],[XML2_INCLUDE])
+ AC_SUBST(XML2_LIB)
+ AC_SUBST(XML2_INCLUDE)
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
new file mode 100644
index 000000000..3222f5d13
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-linkfix.patch
@@ -0,0 +1,33 @@
+Fix ipmi plugin's test dir compilation
+
+The ipmi plugin's test dir is not included
+in compilation since it does not compile
+properly with SSL
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ plugins/ipmi/Makefile.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/ipmi/Makefile.in b/plugins/ipmi/Makefile.in
+index 7c6b0a4..6204dbe 100644
+--- a/plugins/ipmi/Makefile.in
++++ b/plugins/ipmi/Makefile.in
+@@ -448,7 +448,9 @@ top_srcdir = @top_srcdir@
+ MAINTAINERCLEANFILES = Makefile.in
+ AM_CPPFLAGS = -DG_LOG_DOMAIN=\"ipmi\" @OPENHPI_INCLUDES@
+ EXTRA_DIST = ipmi.sym ekeyfru.h
+-SUBDIRS = t
++#SUBDIRS = t
++#Tests don't compile wih SSL properly so comment them out
++SUBDIRS =
+ AM_CFLAGS = @OPENIPMI_CFLAGS@
+ pkglib_LTLIBRARIES = libipmi.la
+ libipmi_la_SOURCES = ipmi.c \
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
new file mode 100644
index 000000000..95b0abc91
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-netsnmp-cross-compile.patch
@@ -0,0 +1,48 @@
+Fix net-snmp when cross-compiling
+
+Remove irrelevant references to net-snmp libs and flags
+when cross-compiling net-snmp
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ acinclude.m4 | 4 ++--
+ configure | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 82c33f6..727e461 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -160,8 +160,8 @@ AC_DEFUN([OH_CHECK_NETSNMP],
+ ],
+ [
+ have_netsnmp=yes
+- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++ SNMPFLAGS=""
++ SNMPLIBS=""
+ AC_MSG_RESULT(yes)
+ ],
+ [AC_MSG_RESULT(no. No SNMP based plugins can be built!)])
+diff --git a/configure b/configure
+index 00067bc..36b913c 100755
+--- a/configure
++++ b/configure
+@@ -15949,8 +15949,8 @@ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
+ have_netsnmp=yes
+- SNMPFLAGS=`${net_snmp_config:-net-snmp-config} --cflags | perl -p -e 's/-O\S*//g'`
+- SNMPLIBS=`${net_snmp_config:-net-snmp-config} --libs`
++ SNMPFLAGS=""
++ SNMPLIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
new file mode 100644
index 000000000..38d9a6742
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-sysfs-cross-compile.patch
@@ -0,0 +1,23 @@
+Fix sysfs when cross-compiling
+
+Use proper paths for sysfs plugins when cross-compiling
+
+Signed-of-by: Aws Ismail <aws.ismail@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+diff --git a/plugins/sysfs/sysfs2hpi.c b/plugins/sysfs/sysfs2hpi.c
+index a745214..3685598 100644
+--- a/plugins/sysfs/sysfs2hpi.c
++++ b/plugins/sysfs/sysfs2hpi.c
+@@ -18,7 +18,7 @@
+
+ #include <stdlib.h>
+ #include <string.h>
+-#include <libsysfs.h>
++#include <sysfs/libsysfs.h>
+
+ #include <SaHpi.h>
+ #include <oh_utils.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 000000000..3e09180d4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,28 @@
+From 36fbaa27e7299f63c1324b0ad22b970e9365d6a7 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 24 Dec 2014 10:54:59 +0800
+Subject: [PATCH] openhpi: use serial-tests config needed by ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -7,7 +7,7 @@ dnl various hacks by Sean Dague <http:
+ AC_PREREQ(2.57)
+ AC_INIT(openhpi, 3.6.1)
+ AC_CONFIG_SRCDIR(openhpi.spec.in)
+-AM_INIT_AUTOMAKE([1.8])
++AM_INIT_AUTOMAKE([1.8 serial-tests])
+
+ AM_CONFIG_HEADER(config.h)
+ AH_TOP([#ifndef __OPENHPI_CONFIG_H
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
new file mode 100755
index 000000000..3a5f4a06a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpi.init
@@ -0,0 +1,230 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides: openhpid
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Should-Start: $named
+# Should-Stop: $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start OpenHPI daemon at boot time
+# Description: Enable OpenHPI service which is provided by openhpid.
+### END INIT INFO
+#
+# openhpid.sh Start/Stop the openhpi daemon.
+#
+# description: openhpid is standard UNIX program which uses the OpenHPI \
+# APIs and provides a standard internet server to access those \
+# APIs for client programs.
+# processname: openhpid
+# config: the standard openhpi conf file specified on the command line or the env.
+# pidfile: /var/run/openhpid.pid
+#
+# Author(s):
+# W. David Ashley <dashley@us.ibm.com>
+# Daniel de Araujo <ddearauj@us.ibm.com>
+
+# Source function library.
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+prog="OpenHPI"
+
+# If the openhpid executable is not available, we can't do any of this
+test -f /usr/sbin/openhpid || exit 0
+
+# Determine whether the lsb package is installed
+# If it is, determine which lsb is installed:
+# redhat, suse, or standard lsb
+
+if test -f /etc/init.d/functions
+then
+ lsbtype="rh"
+ . /etc/init.d/functions
+elif test -f /etc/rc.status
+then
+ lsbtype="suse"
+ . /etc/rc.status
+elif test -f /lib/lsb/init-functions
+then
+ lsbtype="lsb"
+ . /lib/lsb/init-functions
+elif test -f /etc/gentoo-release
+then
+ lsbtype="gentoo"
+ . /sbin/functions.sh
+else
+ lsbtype="nolsb"
+fi
+
+print_outcome()
+{
+
+ case "${lsbtype}" in
+
+ suse)
+ rc_status -v
+ ;;
+
+ lsb)
+ if test "$?" -eq 0
+ then
+ log_success_msg "success"
+ else
+ log_failure_msg "failed"
+ fi
+ ;;
+
+ gentoo)
+ eend $?
+ ;;
+
+ nolsb | rh)
+ if test "$?" -eq 0
+ then
+ echo " ... success"
+ fi
+ if test "$?" -ne 0
+ then
+ echo " ... failed"
+ fi
+ ;;
+ esac
+}
+
+start() {
+ case "${lsbtype}" in
+
+ suse)
+ echo -n "Starting $prog: "
+ startproc /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ lsb)
+ echo -n "Starting $prog: "
+ start_daemon /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ gentoo | rh)
+ echo "Starting $prog: "
+ start-stop-daemon --start --quiet --exec /usr/sbin/openhpid -- -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+ nolsb)
+ echo -n "Starting $prog: "
+ /usr/sbin/openhpid -c /etc/openhpi/openhpi.conf
+ RETVAL=$?
+ ;;
+
+ esac
+
+ print_outcome
+
+}
+
+stop() {
+ case "${lsbtype}" in
+
+ lsb | suse)
+ echo -n "Stopping $prog: "
+ killproc /usr/sbin/openhpid
+ RETVAL=$?
+ ;;
+
+ gentoo)
+ echo "Stopping $prog: "
+ start-stop-daemon --stop --quiet --exec /usr/sbin/openhpid
+ RETVAL=$?
+ ;;
+
+ nolsb | rh)
+ echo -n "Stopping $prog: "
+ if test -f /var/run/openhpid.pid && test "`cat /var/run/openhpid.pid`" != ""
+ then
+ kill "`cat /var/run/openhpid.pid`"
+ RETVAL=$?
+ else
+ RETVAL=0
+ fi
+ ;;
+
+ esac
+
+ print_outcome
+
+ if test "$RETVAL" -eq 0 && test -f /var/run/openhpid.pid
+ then
+ rm -f /var/lock/openhpid
+ rm -f /var/run/openhpid.pid
+ fi
+
+}
+
+dstatus() {
+ echo "Checking for $prog daemon: "
+
+ case "${lsbtype}" in
+
+ suse)
+ checkproc /usr/sbin/openhpid
+ rc_status -v
+ ;;
+ lsb)
+ pid="`pidofproc /usr/sbin/openhpid`"
+ if test "${pid}" != ""
+ then
+ log_success_msg "$prog is running"
+ else
+ log_success_msg "$prog is not running"
+ fi
+ ;;
+ gentoo | nolsb | rh)
+ if test -f /var/run/openhpid.pid &&
+ test "`cat /var/run/openhpid.pid`" != "" &&
+ kill -s 0 "`cat /var/run/openhpid.pid`"
+ then
+ echo "$prog is running"
+ else
+ echo "$prog is not running"
+ fi
+
+ ;;
+
+ esac
+
+
+
+}
+
+restart() {
+ stop
+ start
+}
+
+force_reload() {
+ # We don't currently support a reload, but can do a restart
+ stop
+ start
+}
+
+# See how we were called.
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ dstatus
+ ;;
+ force-reload)
+ force_reload
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|status|force-reload}"
+ exit 1
+esac
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
new file mode 100644
index 000000000..cd4168f8e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/openhpid.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daemon providing access to the SAF Hardware Platform Interface
+After=syslog.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/openhpid.pid
+ExecStart=@SBINDIR@/openhpid -c @SYSCONFDIR@/openhpi/openhpi.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
new file mode 100755
index 000000000..5b187d908
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/files/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+for x in `find ./ -name Makefile`;
+do
+ make -C `dirname ${x}` -k runtest-TESTS
+done
diff --git a/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb b/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
new file mode 100644
index 000000000..ecf71d70f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb
@@ -0,0 +1,115 @@
+SUMMARY = "Hardware Platform Interface Library and Tools"
+
+DESCRIPTION = "\
+OpenHPI is an open source project created with the intent of providing an \
+implementation of the SA Forum's Hardware Platform Interface (HPI). HPI \
+provides an abstracted interface to managing computer hardware, typically for \
+chassis and rack based servers. HPI includes resource modeling; access to and \
+control over sensor, control, watchdog, and inventory data associated with \
+resources; abstracted System Event Log interfaces; hardware events and alerts; \
+and a managed hotswap interface. \
+\
+OpenHPI provides a modular mechanism for adding new hardware and device support \
+easily. Many plugins exist in the OpenHPI source tree to provide access to \
+various types of hardware. This includes, but is not limited to, IPMI based \
+servers, Blade Center, and machines which export data via sysfs. \
+"
+
+HOMEPAGE = "http://openhpi.sourceforge.net/Home"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
+
+DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs autoconf-archive-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
+ file://openhpi.init \
+ file://openhpid.service \
+ file://run-ptest \
+ file://openhpi-netsnmp-cross-compile.patch \
+ file://openhpi-sysfs-cross-compile.patch \
+ file://openhpi-libxml2-cross-compile.patch \
+ file://openhpi-glib-cross-compile.patch \
+ file://openhpi-linkfix.patch \
+ file://openhpi-fix-host-gcc.patch \
+ file://openhpi-hpi-shell-thread-fix.patch \
+ file://openhpi-fix-testfail-errors.patch \
+ file://openhpi-add-libnetsnmp-when-link.patch \
+ file://openhpi-invalide-session.patch \
+ file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
+ file://openhpi-fix-alignment-issue.patch \
+ file://0001-Fix-build-failures-with-gcc7.patch \
+ file://c++11.patch \
+ file://clang-c++11.patch \
+ file://fix-narrowing-warning.patch \
+ file://0001-plugins-Check-for-PTHREAD_RECURSIVE_MUTEX_INITIALIZE.patch \
+ file://0001-ipmidirect-Replace-__STRING.patch \
+ "
+
+SRC_URI[md5sum] = "4718b16e0f749b5ad214a9b04f45dd23"
+SRC_URI[sha256sum] = "e0a810cb401c4bdcfc9551f2e6afd5a8ca4b411f5ee3bc60c19f82fd6e84a3dc"
+
+inherit autotools pkgconfig ptest update-rc.d systemd
+
+PACKAGES =+ "${PN}-libs"
+
+FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
+
+INSANE_SKIP_${PN}-libs = "dev-so"
+RDEPENDS_${PN} += "${PN}-libs"
+
+PACKAGECONFIG ??= "libgcrypt non32bit"
+PACKAGECONFIG[sysfs] = "--enable-sysfs,--disable-sysfs,sysfsutils,"
+PACKAGECONFIG[libgcrypt] = "--enable-encryption,--disable-encryption,libgcrypt,"
+PACKAGECONFIG[non32bit] = "--enable-non32bit-int,--disable-non32bit-int,,"
+
+do_install_append () {
+ install -m 0755 -d ${D}${sysconfdir}/${BPN}
+ install -m 0755 ${S}/openhpiclient.conf.example ${D}${sysconfdir}/${BPN}/openhpiclient.conf
+ install -m 0700 ${S}/openhpi.conf.example ${D}${sysconfdir}/${BPN}/openhpi.conf
+ install -m 0755 ${S}/simulation.data.example ${D}${sysconfdir}/${BPN}/simulation.data
+ install -m 0755 ${S}/test_agent.data.example ${D}${sysconfdir}/${BPN}/test_agent.data
+ install -m 0755 ${WORKDIR}/openhpi.init ${D}${sysconfdir}/init.d/openhpid
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/openhpid.service ${D}${systemd_unitdir}/system
+ sed -i -e "s,@SBINDIR@,${sbindir},g" -e "s,@SYSCONFDIR@,${sysconfdir},g" \
+ ${D}${systemd_unitdir}/system/openhpid.service
+}
+
+do_compile_ptest () {
+ for x in `find ${B} -name Makefile -exec grep -l buildtest-TESTS {} \;`; do
+ dir=`dirname ${x}`
+ upper=`dirname ${dir}`
+ if [ `basename ${upper}` != "cpp" ]; then
+ oe_runmake -C ${dir} buildtest-TESTS
+ fi
+ done
+}
+
+do_install_ptest () {
+ cp -rf ${B}/openhpid/t/ohpi/.libs/* ${B}/openhpid/t/ohpi/
+ TESTS="utils marshal openhpid"
+ for subtest in ${TESTS}; do
+ mkdir -p ${D}${PTEST_PATH}/${subtest}/t
+ cp -rf ${B}/${subtest}/t/* ${D}${PTEST_PATH}/${subtest}/t
+ done
+
+ for x in `find ${D}${PTEST_PATH} -name Makefile`; do
+ sed -i "s:${S}:${PTEST_PATH}/:g" ${x};
+ sed -i "s/^Makefile:/MM:/g" ${x};
+ done;
+
+ mkdir -p ${D}${PTEST_PATH}/plugins/watchdog/
+ cp -L ${D}/${libdir}/${BPN}/libwatchdog.so ${D}${PTEST_PATH}/plugins/watchdog/
+ cp -L ${D}/${libdir}/${BPN}/libsimulator.so ${D}${PTEST_PATH}/plugins/watchdog/
+ find ${D}${PTEST_PATH}/ -name "*.c" -exec rm {} \;
+ find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \;
+ find ${D}${PTEST_PATH}/ -name "*.h" -exec rm {} \;
+}
+
+INITSCRIPT_NAME = "openhpid"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "openhpid.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
new file mode 100644
index 000000000..effe25c85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Disable-format-overflow-if-supported-by-gc.patch
@@ -0,0 +1,123 @@
+From ab00d6f5793b2d850f975bcb6d5d0aa6d7a9eaa4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 12:34:37 -0700
+Subject: [PATCH] configure: Disable format-overflow if supported by gcc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am | 6 ++--
+ configure.ac | 2 ++
+ m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 79 insertions(+), 3 deletions(-)
+ create mode 100644 m4/ax_check_compile_flag.m4
+
+Index: opensaf-5.18.02/Makefile.am
+===================================================================
+--- opensaf-5.18.02.orig/Makefile.am
++++ opensaf-5.18.02/Makefile.am
+@@ -52,10 +52,10 @@ AM_CPPFLAGS = \
+ -pthread \
+ -D_GNU_SOURCE -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"' \
+ $(CORE_INCLUDES) \
+- $(all_includes)
++ $(all_includes) @NOWARNINGS@
+
+-AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
+-AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror
++AM_CFLAGS = -pipe -std=gnu11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
++AM_CXXFLAGS = -pipe -std=gnu++11 @OSAF_HARDEN_FLAGS@ -Wall -Wformat=2 -Werror @NOWARNINGS@
+
+ if ENABLE_GCOV
+ AM_CFLAGS += --coverage
+Index: opensaf-5.18.02/configure.ac
+===================================================================
+--- opensaf-5.18.02.orig/configure.ac
++++ opensaf-5.18.02/configure.ac
+@@ -593,6 +593,8 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+
++AX_CHECK_COMPILE_FLAG([-Werror=format-overflow],[NOWARNINGS=-Wno-error=format-overflow])
++AC_SUBST(NOWARNINGS)
+ #############################################
+ # List the output Makefiles
+ #############################################
+Index: opensaf-5.18.02/m4/ax_check_compile_flag.m4
+===================================================================
+--- /dev/null
++++ opensaf-5.18.02/m4/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# Check whether the given FLAG works with the current language's compiler
++# or gives an error. (Warnings, however, are ignored)
++#
++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++# success/failure.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
new file mode 100644
index 000000000..5756a027b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-configure-Pass-linker-specific-options-with-Wl.patch
@@ -0,0 +1,29 @@
+From 6248b717b4861d16b80235fd8e57d64e4f636428 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 17:39:07 -0700
+Subject: [PATCH] configure: Pass linker specific options with -Wl
+
+This helps make it pass the options to linker correctly
+and we can use non-gcc compilers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index df4fc58..02771c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -553,7 +553,7 @@ if test -z "$OSAF_HARDEN_FLAGS"; then
+ if echo "${CFLAGS} ${CXXFLAGS}" | grep -q -- -O0; then
+ OSAF_HARDEN_FLAGS=""
+ fi
+- OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -zrelro -znow"
++ OSAF_HARDEN_FLAGS="${OSAF_HARDEN_FLAGS} -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now"
+ fi
+ AC_SUBST(OSAF_HARDEN_FLAGS)
+
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch
new file mode 100644
index 000000000..76c47c658
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch
@@ -0,0 +1,34 @@
+From 508ea7c0d67243feb1684eaa83569cb687561d64 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Sep 2017 10:09:03 -0700
+Subject: [PATCH] immpbe_dump.cc: Use sys/wait.h instead of wait.h
+
+Fixes
+redirecting incorrect #include <wait.h> to <sys/wait.h>
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/imm/common/immpbe_dump.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
+index 100222f37..33e47ce3c 100644
+--- a/src/imm/common/immpbe_dump.cc
++++ b/src/imm/common/immpbe_dump.cc
+@@ -26,12 +26,12 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <time.h>
+-#include <wait.h>
+ #include <unistd.h>
+ #include <iostream>
+ #include <sstream>
+ #include <stdint.h>
+ #include <sys/stat.h>
++#include <sys/wait.h>
+ #include <libgen.h>
+
+ #include <saAis.h>
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch
new file mode 100644
index 000000000..4a2a825f9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf/0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch
@@ -0,0 +1,122 @@
+From 6442b57a855e273aa5a3d93e8596783cea128073 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 15 Sep 2017 09:39:40 -0700
+Subject: [PATCH] src: Add missing header limits.h for _POSIX_HOST_NAME_MAX
+
+Use _GNU_SOURCE instead of libc internal __USE_GNU
+Do not use the deprecated headers under include/sys
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/base/os_defs.h | 5 +++--
+ src/mds/mds_dt_tcp.c | 1 -
+ src/mds/mds_dt_tcp_disc.h | 2 +-
+ src/mds/mds_dt_tipc.c | 1 -
+ src/mds/mds_dt_tipc.h | 2 +-
+ src/mds/mds_dt_trans.c | 1 -
+ src/ntf/ntfd/NtfLogger.cc | 2 +-
+ 7 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/base/os_defs.h b/src/base/os_defs.h
+index 50a9bf5fc..af6842863 100644
+--- a/src/base/os_defs.h
++++ b/src/base/os_defs.h
+@@ -47,17 +47,18 @@
+ #include <sys/stat.h>
+ #include <sys/msg.h> /* Added for message-queues : PM : 28/10/03 */
+ #include <syslog.h>
+-#ifndef __USE_GNU
++#include <limits.h>
++#ifndef _GNU_SOURCE
+ struct msgbuf {
+ long int mtype;
+ char mtext[1];
+ };
+ #endif /* else defined in <sys/msg.h> */
+ #include <sys/time.h>
+-#include <sys/fcntl.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+
++#include <fcntl.h>
+ #include <signal.h>
+ #include <pthread.h>
+
+diff --git a/src/mds/mds_dt_tcp.c b/src/mds/mds_dt_tcp.c
+index 1407eb1ab..a87c22faa 100644
+--- a/src/mds/mds_dt_tcp.c
++++ b/src/mds/mds_dt_tcp.c
+@@ -27,7 +27,6 @@
+
+ #include <stdlib.h>
+ #include <sched.h>
+-#include <sys/poll.h>
+ #include <poll.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+diff --git a/src/mds/mds_dt_tcp_disc.h b/src/mds/mds_dt_tcp_disc.h
+index a6249d73e..574f52681 100644
+--- a/src/mds/mds_dt_tcp_disc.h
++++ b/src/mds/mds_dt_tcp_disc.h
+@@ -24,7 +24,7 @@
+ #include "base/ncssysf_tsk.h"
+ #include "base/ncssysf_mem.h"
+ #include "mds_dt_tcp_disc.h"
+-#include "sys/poll.h"
++#include <poll.h>
+
+ /* mds_indentifire + mds_version + msg_type + scope_type + server_type +
+ server_instance_lower + server_instance_upper + sub_ref_val + sub_ref_val +
+diff --git a/src/mds/mds_dt_tipc.c b/src/mds/mds_dt_tipc.c
+index 37745e7f0..9b3255567 100644
+--- a/src/mds/mds_dt_tipc.c
++++ b/src/mds/mds_dt_tipc.c
+@@ -35,7 +35,6 @@
+ #include <stdbool.h>
+ #include <stdlib.h>
+ #include <sched.h>
+-#include <sys/poll.h>
+ #include <poll.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+diff --git a/src/mds/mds_dt_tipc.h b/src/mds/mds_dt_tipc.h
+index e73a11b09..401d208c2 100644
+--- a/src/mds/mds_dt_tipc.h
++++ b/src/mds/mds_dt_tipc.h
+@@ -32,7 +32,7 @@
+ #include <assert.h>
+ #include <string.h>
+ #include <sys/param.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <netdb.h>
+ #include <errno.h>
+ #include <fcntl.h>
+diff --git a/src/mds/mds_dt_trans.c b/src/mds/mds_dt_trans.c
+index 6f621e04e..5aacbd33e 100644
+--- a/src/mds/mds_dt_trans.c
++++ b/src/mds/mds_dt_trans.c
+@@ -26,7 +26,6 @@
+ #include "mds_core.h"
+ #include "base/osaf_utility.h"
+
+-#include <sys/poll.h>
+ #include <poll.h>
+
+ #define MDS_PROT_TCP 0xA0
+diff --git a/src/ntf/ntfd/NtfLogger.cc b/src/ntf/ntfd/NtfLogger.cc
+index 84014b578..31b1ccc6c 100644
+--- a/src/ntf/ntfd/NtfLogger.cc
++++ b/src/ntf/ntfd/NtfLogger.cc
+@@ -20,7 +20,7 @@
+ * INCLUDE FILES
+ * ========================================================================
+ */
+-#include <sys/poll.h>
++#include <poll.h>
+
+ #include "base/osaf_utility.h"
+ #include <saAis.h>
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb
new file mode 100644
index 000000000..4b556ce8c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/opensaf/opensaf_5.18.02.bb
@@ -0,0 +1,67 @@
+SUMMARY = "OpenSAF is an open source implementation of the SAF AIS specification"
+DESCRIPTION = "OpenSAF is an open source project established to develop a base platform \
+middleware consistent with Service Availability Forum (SA Forum) \
+specifications, under the LGPLv2.1 license. The OpenSAF Foundation was \
+established by leading Communications and Enterprise Computing Companies to \
+facilitate the OpenSAF Project and to accelerate the adoption of the OpenSAF \
+code base in commercial products. \
+The OpenSAF project was launched in mid 2007 and has been under development by \
+an informal group of supporters of the OpenSAF initiative. The OpenSAF \
+Foundation was founded on January 22nd 2008 with Emerson Network Power, \
+Ericsson, Nokia Siemens Networks, HP and Sun Microsystems as founding members."
+HOMEPAGE = "http://www.opensaf.org"
+SECTION = "admin"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7"
+
+DEPENDS = "libxml2 python"
+TOOLCHAIN = "gcc"
+
+SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \
+ file://0001-configure-Pass-linker-specific-options-with-Wl.patch \
+ file://0001-configure-Disable-format-overflow-if-supported-by-gc.patch \
+ file://0001-src-Add-missing-header-limits.h-for-_POSIX_HOST_NAME.patch \
+ file://0001-immpbe_dump.cc-Use-sys-wait.h-instead-of-wait.h.patch \
+"
+SRC_URI[md5sum] = "42064f5ddbc7f560bfc5ff93ea9eecc7"
+SRC_URI[sha256sum] = "f9e24897f9cfd63bb3115f6275c706de1702d3d9bae2fc423227db72b23c37f0"
+
+inherit autotools useradd systemd pkgconfig
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-f -r opensaf"
+USERADD_PARAM_${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf"
+
+SYSTEMD_SERVICE_${PN} += "opensafd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+PACKAGECONFIG[systemd] = ",,systemd"
+PACKAGECONFIG[openhpi] = "--with-hpi-interface=B03 --enable-ais-plm,,openhpi"
+
+PACKAGECONFIG_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}"
+
+PKGLIBDIR="${libdir}"
+
+LDFLAGS += "-Wl,--as-needed -latomic -Wl,--no-as-needed"
+
+do_install_append() {
+ cp -av --no-preserve=ownership ${B}/lib/.libs/*.so* ${D}${libdir}
+ rm -fr "${D}${localstatedir}/lock"
+ rm -fr "${D}${localstatedir}/run"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+ rmdir --ignore-fail-on-non-empty "${D}${datadir}/java"
+ if [ ! -d "${D}${sysconfdir}/init.d" ]; then
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${B}/osaf/services/infrastructure/nid/scripts/opensafd ${D}${sysconfdir}/init.d/
+ fi
+}
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a"
+
+INSANE_SKIP_${PN} = "dev-so"
+
+RDEPENDS_${PN} += "bash python"
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch
new file mode 100644
index 000000000..6b86e3925
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch
@@ -0,0 +1,26 @@
+From 63619acf25151d4dade6d65732722ec4a710a5ac Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 09:54:25 -0700
+Subject: [PATCH] Check for glibc before setting CANT_USE_SEND_RECV_MSG
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/util/sys_defs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/sys_defs.h b/src/util/sys_defs.h
+index f720e2a..7314c63 100644
+--- a/src/util/sys_defs.h
++++ b/src/util/sys_defs.h
+@@ -813,7 +813,7 @@ extern int initgroups(const char *, int);
+ #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
+ #endif
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
+- || (__GLIBC__ < 2)
++ || (defined(__GLIBC__) && (__GLIBC__ < 2))
+ #define CANT_USE_SEND_RECV_MSG
+ #define DEF_SMTP_CACHE_DEMAND 0
+ #else
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch
new file mode 100644
index 000000000..763a4a9b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch
@@ -0,0 +1,64 @@
+From a0d0de10e4c5ab55bc2fa48798079e2876b1211d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 10:29:37 -0700
+Subject: [PATCH] makedefs: Use native compiler to build makedefs.test
+
+Its a binary used during build
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ makedefs | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/makedefs b/makedefs
+index 9fd4bc2..5ee7747 100644
+--- a/makedefs
++++ b/makedefs
+@@ -526,7 +526,7 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ fi;;
+ esac
+@@ -762,7 +762,7 @@ int main(int argc, char **argv)
+ exit(0);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+ ./makedefs.test 2>/dev/null ||
+ CCARGS="$CCARGS -DNO_SIGSETJMP"
+ rm -f makedefs.test makedefs.test.[co]
+@@ -796,7 +796,7 @@ int main(int argc, char **argv)
+ &error) != 14);
+ }
+ EOF
+- ${CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
++ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
+ $icu_ldflags >/dev/null 2>&1
+ if ./makedefs.test 2>/dev/null ; then
+ CCARGS="$CCARGS $icu_cppflags"
+@@ -911,7 +911,7 @@ int main(void)
+ exit(ferror(stdout) ? 1 : 0);
+ }
+ EOF
+- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
++ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ ./makedefs.test || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ }
+@@ -1067,7 +1067,7 @@ int main(void)
+ exit(ferror(stdout) ? 1 : 0);
+ }
+ EOF
+- eval ${CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
++ eval ${BUILD_CC-gcc} ${CCARGS} -o makedefs.test makedefs.test.c || exit 1
+ parm_val=`./makedefs.test` || exit 1
+ rm -f makedefs.test makedefs.test.[co]
+ eval ${parm_name}=\""\$parm_val"\"
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb
new file mode 100755
index 000000000..855a64f70
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/aliasesdb
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+ALIASESDB_STAMP=/var/lib/misc/postfix.aliasesdb-stamp
+
+make_aliasesdb() {
+ if [ "$(/usr/sbin/postconf -h alias_database)" = "hash:/etc/aliases" ]
+ then
+ # /etc/aliases.db may be used by other MTA, make sure nothing
+ # has touched it since our last newaliases call
+ [ /etc/aliases -nt /etc/aliases.db ] ||
+ [ "$ALIASESDB_STAMP" -nt /etc/aliases.db ] ||
+ [ "$ALIASESDB_STAMP" -ot /etc/aliases.db ] || return 0
+ /usr/bin/newaliases
+ touch -r /etc/aliases.db "$ALIASESDB_STAMP"
+ else
+ /usr/bin/newaliases
+ fi
+}
+
+make_aliasesdb
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh
new file mode 100755
index 000000000..37a0dd088
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/check_hostname.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+HOSTNAME=$(/bin/hostname)
+
+if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ]; then
+ # If hostname is invalid, and myhostname not existed in main.cf
+ /usr/sbin/postconf -h "myhostname" 2>/dev/null
+ if [ $? -ne 0 ]; then
+ # Set "localhost" to main.cf
+ /usr/sbin/postconf -e "myhostname=localhost"
+ fi
+fi
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch
new file mode 100644
index 000000000..9bd9c2f03
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/icu-config.patch
@@ -0,0 +1,21 @@
+do not entertain cppflags from icu, this is because
+icu-config feeds the -I path without sysroot which
+caused native headers to be included and build is
+corrupted in any case its just adding -I/usr/include
+to the CCARGS which we loose nothing if its not
+entertained.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: postfix-3.2.2/makedefs
+===================================================================
+--- postfix-3.2.2.orig/makedefs
++++ postfix-3.2.2/makedefs
+@@ -799,7 +799,6 @@ EOF
+ ${BUILD_CC-gcc} -o makedefs.test makedefs.test.c $icu_cppflags \
+ $icu_ldflags >/dev/null 2>&1
+ if ./makedefs.test 2>/dev/null ; then
+- CCARGS="$CCARGS $icu_cppflags"
+ SYSLIBS="$SYSLIBS $icu_ldflags"
+ else
+ CCARGS="$CCARGS -DNO_EAI"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch
new file mode 100644
index 000000000..d023680f3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/install.patch
@@ -0,0 +1,93 @@
+From 190650e1cd5700cd6950ead3fcb17ebcec192a2e Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 19 Jun 2015 17:14:58 +0900
+Subject: [PATCH] Change fixed postconf to a variable for cross-compiling
+
+Upstreamstatus: Inappropriate [embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+ postfix-install | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/postfix-install b/postfix-install
+index 1662c3d..d11fa12 100644
+--- a/postfix-install
++++ b/postfix-install
+@@ -226,8 +226,8 @@ test -z "$non_interactive" -a ! -t 0 && {
+ exit 1
+ }
+
+-test -x bin/postconf || {
+- echo $0: Error: no bin/postconf file. Did you forget to run \"make\"? 1>&2
++test -x "$POSTCONF" || {
++ echo $0: Error: no $POSTCONF file. Did you forget to run \"make\"? 1>&2
+ exit 1
+ }
+
+@@ -248,7 +248,7 @@ do
+ case "$junk" in
+ *MAIL_VERSION*)
+ case "$mail_version" in
+- "") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++ "") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
+ esac
+ val=`echo "$junk" | sed 's/MAIL_VERSION$/'"$mail_version/g"` || exit 1
+ case "$val" in
+@@ -434,7 +434,7 @@ template files main.cf.proto and master.cf.proto."
+
+ : ${install_root=/}
+ : ${tempdir=`pwd`}
+-: ${config_directory=`bin/postconf -c conf -h -d config_directory`}
++: ${config_directory=`$POSTCONF -c conf -h -d config_directory`}
+
+ # Find out the location of installed configuration files.
+
+@@ -500,7 +500,7 @@ test -f $CONFIG_DIRECTORY/main.cf && {
+ case "$junk" in
+ "") eval unset $name;;
+ esac
+- eval : \${$name=\`bin/postconf -c $CONFIG_DIRECTORY -hx $name\`} ||
++ eval : \${$name=\`$POSTCONF -c $CONFIG_DIRECTORY -hx $name\`} ||
+ exit 1
+ done
+ }
+@@ -513,7 +513,7 @@ do
+ case "$junk" in
+ "") eval unset $name;;
+ esac
+- eval : \${$name=\`bin/postconf -c conf -d -hx $name\`} || exit 1
++ eval : \${$name=\`$POSTCONF -c conf -d -hx $name\`} || exit 1
+ done
+
+ # Override settings manually.
+@@ -639,6 +639,8 @@ README_DIRECTORY=$install_root$readme_directory
+ SHLIB_DIRECTORY=$install_root$shlib_directory
+ META_DIRECTORY=$install_root$meta_directory
+
++test "x$POSTCONF" != "x" || POSTCONF="bin/postconf"
++
+ # Avoid repeated tests for existence of these; default permissions suffice.
+
+ test -d $DAEMON_DIRECTORY || mkdir -p $DAEMON_DIRECTORY || exit 1
+@@ -810,7 +812,7 @@ IFS="$BACKUP_IFS"
+ # the wrong place when Postfix is being upgraded.
+
+ case "$mail_version" in
+-"") mail_version="`bin/postconf -dhx mail_version`" || exit 1
++"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
+ esac
+
+ # Undo MAIL_VERSION expansion at the end of a parameter value. If
+@@ -830,7 +832,7 @@ do
+ esac
+ done
+
+-bin/postconf -c $CONFIG_DIRECTORY -e \
++"$POSTCONF" -c $CONFIG_DIRECTORY -e \
+ "daemon_directory = $daemon_directory" \
+ "data_directory = $data_directory" \
+ "command_directory = $command_directory" \
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient
new file mode 100644
index 000000000..6a8f2681b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/internal_recipient
@@ -0,0 +1 @@
+root@ permit_mynetworks,reject
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf
new file mode 100644
index 000000000..e75c6fc0d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/main.cf
@@ -0,0 +1,105 @@
+compatibility_level = 2
+smtputf8_enable = no
+
+# Configure your domain and accounts
+#mydomain=sample.com
+#FQDN from gethostname
+#myhostname =
+mydomain=localdomain
+mydestination = $myhostname, localhost.localdomain localhost
+mynetworks = 127.0.0.1/8
+inet_interfaces = 127.0.0.1
+
+virtual_mailbox_domains = sample.com, other.net
+virtual_mailbox_maps = hash:/etc/postfix/virtual
+virtual_alias_maps = hash:/etc/postfix/virtual_alias
+
+alias_maps = hash:/etc/aliases
+
+# You'll start with the following lines for maildir storage
+virtual_mailbox_base = /var/spool/vmail
+virtual_uid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 3`
+virtual_gid_maps = static:`grep vmail /etc/passwd | cut -d ":" -f 4`
+
+
+# You'll start with the following lines for IMAP storage
+#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp
+
+
+# General stuff here again
+#config_directory = /etc/postfix
+sample_directory = /etc/postfix
+queue_directory = /var/spool/postfix
+mail_spool_directory = /var/spool/mail
+readme_directory = no
+command_directory = /usr/sbin
+daemon_directory = @LIBEXECDIR@/postfix
+mail_owner = postfix
+setgid_group = postdrop
+unknown_local_recipient_reject_code = 450
+mynetworks_style = host
+debug_peer_level = 2
+sendmail_path = /usr/sbin/sendmail
+newaliases_path = /usr/bin/newaliases
+mailq_path = /usr/bin/mailq
+
+smtpd_data_restrictions =
+ permit_mynetworks,
+ reject_unauth_pipelining,
+ permit
+
+smtpd_client_restrictions =
+ permit_mynetworks,
+ # reject_unknown_client, # This can cause a lot of false rejects.
+ reject_invalid_hostname,
+ reject_rbl_client list.dsbl.org,
+ reject_rbl_client sbl.spamhaus.org,
+ reject_rbl_client cbl.abuseat.org,
+ reject_rbl_client dul.dnsbl.sorbs.net,
+ permit
+
+smtpd_helo_required = yes
+smtpd_helo_restrictions =
+ permit_mynetworks,
+ reject_unauth_pipelining,
+ # reject_non_fqdn_hostname, # This can cause a lot of false rejects.
+ # reject_unknown_hostname, # This can cause a lot of false rejects.
+ reject_invalid_hostname,
+ permit
+
+smtpd_sender_restrictions =
+ permit_mynetworks,
+ reject_non_fqdn_sender,
+ # check_sender_access hash:/etc/postfix/access_domains,
+ reject_unknown_sender_domain,
+ permit
+
+smtpd_recipient_restrictions =
+ permit_mynetworks,
+ permit_sasl_authenticated,
+ reject_unauth_destination,
+
+ # check_recipient_access pcre:/etc/postfix/recipient_checks.pcre,
+ # check_helo_access pcre:/etc/postfix/helo_checks.pcre,
+
+ # check_client_access hash:/etc/postfix/maps/access_client,
+ # check_client_access hash:/etc/postfix/maps/exceptions_client,
+ # check_helo_access hash:/etc/postfix/maps/access_helo,
+ # check_helo_access hash:/etc/postfix/maps/verify_helo,
+ # check_sender_access hash:/etc/postfix/maps/access_sender,
+ # check_sender_access hash:/etc/postfix/maps/verify_sender,
+ # check_recipient_access hash:/etc/postfix/maps/access_recipient,
+
+ # reject_multi_recipient_bounce,
+ reject_non_fqdn_recipient,
+ reject_unknown_recipient_domain,
+ # reject_unlisted_recipient,
+ #check_policy_service unix:private/policy,
+
+ # check_sender_access hash:/etc/postfix/maps/no_verify_sender,
+ # check_sender_access hash:/etc/postfix/access_domains,
+ # reject_unverified_sender,
+ # reject_unverified_recipient
+ check_recipient_access hash:/etc/postfix/internal_recipient
+
+disable_vrfy_command = yes
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch
new file mode 100644
index 000000000..98d5f7ed6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/makedefs.patch
@@ -0,0 +1,116 @@
+From 4f49e2ce420fb3c17415937530493158ef312733 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 19 Jun 2015 16:45:54 +0900
+Subject: [PATCH] 1)remove RANLIB, SYSLIBS, AR and get them from env.
+
+2)reference sysroot when searching header files
+3)include sysroot path instead of absolute include path
+for Linux2 and Linux3 systems.
+4)for non-native build, search STAGING_BASELIBDIR/LIBDIR
+ native build, search host library path for nsl and resolv library
+ which comes from libc
+
+Upstreamstatus: Inappropriate [embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+ makedefs | 27 +++++++++++----------------
+ 1 file changed, 11 insertions(+), 16 deletions(-)
+
+diff --git a/makedefs b/makedefs
+index 8b84e47..893fb0d 100644
+--- a/makedefs
++++ b/makedefs
+@@ -170,9 +170,6 @@ echo "# pie=$pie"
+
+ # Defaults for most sane systems
+
+-RANLIB=ranlib
+-SYSLIBS=
+-AR=ar
+ ARFL=rv
+
+ # Ugly function to make our error message more visible among the
+@@ -424,12 +421,12 @@ case "$SYSTEM.$RELEASE" in
+ case "$CCARGS" in
+ *-DNO_DB*) ;;
+ *-DHAS_DB*) ;;
+- *) if [ -f /usr/include/db.h ]
++ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
+ then
+ : we are all set
+- elif [ -f /usr/include/db/db.h ]
++ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
+ then
+- CCARGS="$CCARGS -I/usr/include/db"
++ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
+ else
+ # No, we're not going to try db1 db2 db3 etc.
+ # On a properly installed system, Postfix builds
+@@ -438,12 +435,12 @@ case "$SYSTEM.$RELEASE" in
+ echo "Install the appropriate db*-devel package first." 1>&2
+ exit 1
+ fi
+- SYSLIBS="-ldb"
++ SYSLIBS="$SYSLIBS -ldb"
+ ;;
+ esac
+ for name in nsl resolv $GDBM_LIBS
+ do
+- for lib in /usr/lib64 /lib64 /usr/lib /lib
++ for lib in $BUILD_SYSROOT_NSL_PATH
+ do
+ test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
+ SYSLIBS="$SYSLIBS -l$name"
+@@ -463,7 +460,7 @@ case "$SYSTEM.$RELEASE" in
+ if [ `expr "X$CCARGS" : "X.*-DNO_EPOLL"` -gt 0 ]
+ then
+ :
+- elif [ ! -e /usr/include/sys/epoll.h ]
++ elif [ ! -e "$BUILD_SYSROOT"/usr/include/sys/epoll.h ]
+ then
+ echo CCARGS="$CCARGS -DNO_EPOLL"
+ else
+@@ -487,8 +484,6 @@ int main(int argc, char **argv)
+ }
+ EOF
+ ${CC-gcc} -o makedefs.test makedefs.test.c || exit 1
+- ./makedefs.test 2>/dev/null ||
+- CCARGS="$CCARGS -DNO_EPOLL"
+ rm -f makedefs.test makedefs.test.[co]
+ fi;;
+ esac
+@@ -504,12 +499,12 @@ EOF
+ case "$CCARGS" in
+ *-DNO_DB*) ;;
+ *-DHAS_DB*) ;;
+- *) if [ -f /usr/include/db.h ]
++ *) if [ -f "$BUILD_SYSROOT"/usr/include/db.h ]
+ then
+ : we are all set
+- elif [ -f /usr/include/db/db.h ]
++ elif [ -f "$BUILD_SYSROOT"/usr/include/db/db.h ]
+ then
+- CCARGS="$CCARGS -I/usr/include/db"
++ CCARGS="$CCARGS -I"$BUILD_SYSROOT"/usr/include/db"
+ else
+ # On a properly installed system, Postfix builds
+ # by including <db.h> and by linking with -ldb
+@@ -517,12 +512,12 @@ EOF
+ echo "Install the appropriate db*-devel package first." 1>&2
+ exit 1
+ fi
+- SYSLIBS="-ldb"
++ SYSLIBS="$SYSLIBS -ldb"
+ ;;
+ esac
+ for name in nsl resolv
+ do
+- for lib in /usr/lib64 /lib64 /usr/lib /usr/lib/* /lib /lib/*
++ for lib in $BUILD_SYSROOT_NSL_PATH
+ do
+ test -e $lib/lib$name.a -o -e $lib/lib$name.so && {
+ SYSLIBS="$SYSLIBS -l$name"
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix
new file mode 100755
index 000000000..8c7a60175
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix
@@ -0,0 +1,94 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: postfix MTA
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: start and stop postfix
+# Description: Postfix is a Mail Transport Agent, which is the program
+# that moves mail from one machine to another.
+### END INIT INFO
+
+success() {
+ echo " Successful"
+ exit 0
+}
+
+fail() {
+ echo " Failed"
+ exit 1
+
+}
+
+check_return () {
+ local ret="$1"
+
+ if [ "$ret" = "0" ]; then
+ success
+ else
+ fail
+ fi
+}
+
+PIDFile=/var/spool/postfix/pid/master.pid
+case "$1" in
+
+ start)
+ echo -n "Starting Postfix..."
+ if [ ! -e /etc/aliases.db ]; then
+ # The alias database is necessary for postfix to work correctly.
+ echo "Creating aliases database ..."
+ newaliases
+ fi
+ if ! postfix status >/dev/null 2>&1; then
+ /usr/sbin/check_hostname.sh
+ postfix start
+ check_return $?
+ else
+ success
+ fi
+ ;;
+
+ stop)
+ echo -n "Stopping Postfix..."
+ if postfix status >/dev/null 2>&1; then
+ postfix stop
+ check_return $?
+ else
+ success
+ fi
+ ;;
+
+ reload)
+ echo -n "Reloading Postfix..."
+ if postfix status >/dev/null 2>&1; then
+ postfix reload
+ check_return $?
+ else
+ postfix start
+ check_return $?
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ status)
+ if postfix status >/dev/null 2>&1; then
+ pid=`sed -e 's/\s//g' $PIDFile`
+ echo "The Postfix mail system is running (PID: $pid)"
+ exit 0
+ else
+ echo "The Postfix mail system is not running"
+ exit 1
+ fi
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|status|reload|restart}"
+ exit 1
+ ;;
+esac
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch
new file mode 100644
index 000000000..45479bd52
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix-install.patch
@@ -0,0 +1,26 @@
+Index: postfix-3.2.2/postfix-install
+===================================================================
+--- postfix-3.2.2.orig/postfix-install
++++ postfix-3.2.2/postfix-install
+@@ -843,7 +843,7 @@ IFS="$BACKUP_IFS"
+ # the wrong place when Postfix is being upgraded.
+
+ case "$mail_version" in
+-"") mail_version="`$POSTCONF -dhx mail_version`" || exit 1
++"") mail_version="`$POSTCONF -c $CONFIG_DIRECTORY -dhx mail_version`" || exit 1
+ esac
+
+ # Undo MAIL_VERSION expansion at the end of a parameter value. If
+Index: postfix-3.2.2/Makefile.in
+===================================================================
+--- postfix-3.2.2.orig/Makefile.in
++++ postfix-3.2.2/Makefile.in
+@@ -20,7 +20,7 @@ META = meta/main.cf.proto meta/master.cf
+ EXPAND = sed -e "s;\$${LIB_PREFIX};$(LIB_PREFIX);" \
+ -e "s;\$${LIB_SUFFIX};$(LIB_SUFFIX);"
+ SHLIB_DIR_OVERRIDE = \
+- $${shlib_directory:-`$(SHLIB_ENV) bin/postconf -dhx shlib_directory`}
++ $${shlib_directory:-`$(SHLIB_ENV) $(POSTCONF) -dhx shlib_directory`}
+
+ default: update
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service
new file mode 100644
index 000000000..30d54a440
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/files/postfix.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Postfix Mail Transport Agent
+After=syslog.target network.target
+Conflicts=sendmail.service exim.service
+
+[Service]
+Type=forking
+PIDFile=@LOCALSTATEDIR@/spool/postfix/pid/master.pid
+ExecStartPre=-@SBINDIR@/check_hostname.sh
+ExecStartPre=-@LIBEXECDIR@/postfix/aliasesdb
+ExecStart=@SBINDIR@/postfix start
+ExecReload=@SBINDIR@/postfix reload
+ExecStop=@SBINDIR@/postfix stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
new file mode 100644
index 000000000..09447d50a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix.inc
@@ -0,0 +1,262 @@
+SUMMARY = "Postfix Mail Transport Agent"
+DESCRIPTION = "Postfix is Wietse Venema's mail server that started life at \
+IBM research as an alternative to the widely-used Sendmail program. \
+Postfix attempts to be fast, easy to administer, and secure. The outsidei \
+has a definite Sendmail-ish flavor, but the inside is completely different."
+
+HOMEPAGE= "http://www.postfix.org"
+SECTION = "mail"
+DEPENDS = "db icu libpcre openssl postfix-native \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', 'openldap', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', 'cyrus-sasl', '', d)} \
+"
+DEPENDS_class-native = "db-native icu-native openssl-native libpcre-native"
+
+LICENSE = "IPL-1.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=64375f37431336ea1b1b3005fe3fa354"
+
+SRC_URI = "ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-${PV}.tar.gz \
+ file://makedefs.patch \
+ file://install.patch \
+ file://main.cf \
+ file://postfix \
+ file://internal_recipient \
+ file://postfix.service \
+ file://aliasesdb \
+ file://check_hostname.sh \
+"
+
+S = "${WORKDIR}/postfix-${PV}"
+
+CLEANBROKEN = "1"
+
+BBCLASSEXTEND = "native"
+
+inherit update-rc.d useradd update-alternatives systemd
+
+INITSCRIPT_NAME = "postfix"
+INITSCRIPT_PARAMS = "start 58 3 4 5 . stop 13 0 1 6 ."
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = \
+"-d /var/spool/postfix -r -g postfix --shell /bin/false postfix; \
+ -d /var/spool/vmail -r -g vmail --shell /bin/false vmail \
+"
+GROUPADD_PARAM_${PN} = "--system postfix;--system postdrop;--system vmail"
+
+export SYSLIBS = "${LDFLAGS}"
+
+# CCARGS specifies includes, defines
+# AUXLIBS specifies libraries
+# Linux2/Linux3 has HAS_DB defined
+# makedefs will make CC to be CC+CCARGS
+
+# ldap support
+export CCARGS-ldap = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-DHAS_LDAP', '', d)}"
+export AUXLIBS-ldap = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ldap', '-lldap -llber', '', d)}"
+
+# no native openldap
+export CCARGS-ldap_class-native = ""
+export AUXLIBS-ldap_class-native = ""
+
+export CCARGS-nonis_libc-musl = "-DNO_NIS"
+export CCARGS-nonis = ""
+
+# SASL support -DUSE_LDAP_SASL -DUSE_SASL_AUTH
+# current openldap didn't enable SASL
+export CCARGS-sasl = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${STAGING_INCDIR}/sasl', '', d)}"
+export AUXLIBS-sasl = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sasl', '-lsasl2', '', d)}"
+export CCARGS-sasl_class-native = ""
+export AUXLIBS-sasl_class-native = ""
+
+# PCRE, TLS support default
+export CCARGS = "${CFLAGS} -DHAS_PCRE -DUSE_TLS -I${STAGING_INCDIR}/openssl ${CCARGS-ldap} ${CCARGS-sasl} ${CCARGS-nonis}"
+export AUXLIBS = "-lpcre -lssl -lcrypto ${AUXLIBS-sasl} ${AUXLIBS-ldap}"
+export POSTCONF = "${STAGING_DIR_NATIVE}${sbindir_native}/postconf"
+
+export CCARGS-nonis_libc-musl = "-DNO_NIS"
+# OPT,DEBUG is aready in CFLAGS
+# ignore the OPTS="CC=$CC" in Makefile it will not use the CC=$CC $CCARGS
+EXTRA_OEMAKE += "OPT= DEBUG= OPTS= "
+
+do_compile () {
+ unset CFLAGS CPPFLAGS CXXFLAGS
+ local native_build
+
+ native_build="${@['0', '1'][bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d)]}"
+
+ # if not native build, then pass SYSTEM and RELEASE to makedefs
+ if [ "${native_build}" != "1" ]; then
+ # uname -s for target
+ SYSTEM="Linux"
+
+ # uname -r, use 2.6 as bottomline, even target kernel ver > 2.6
+ RELEASE="2.6.34"
+ sed -i -e \
+ "s:\$(SHELL) makedefs):\$(SHELL) makedefs $SYSTEM $RELEASE):" \
+ ${S}/Makefile.in
+ export BUILD_SYSROOT="${STAGING_DIR_HOST}"
+ export BUILD_SYSROOT_NSL_PATH="${STAGING_BASELIBDIR} \
+ ${STAGING_LIBDIR}"
+ else
+ # native build
+ export BUILD_SYSROOT="${STAGING_DIR_NATIVE}"
+
+ # ubuntu x86 host: /lib/x86_64-linux-gnu(64) /lib/i386-linux-gnu (32)
+ # on 64 bits, 32 libs in i386-linux-gnu
+ # let makedefs finds nsl and resolv libs, host CC will link
+ # the correct libraries
+ BUILD_SYSROOT_NSL_PATH="$(${CC} -print-search-dirs 2>/dev/null | \
+ sed -n '/^libraries: =/s/libraries: =//p' | \
+ sed -e 's/:/\n/g' | xargs -n1 readlink -f | \
+ grep -v 'gcc\|/[0-9.]\+$' | sort -u)"
+ if [ -z "$BUILD_SYSROOT_NSL_PATH" ]; then
+ BUILD_SYSROOT_NSL_PATH="/usr/lib64 /lib64 \
+ /lib/x86_64-linux-gnu \
+ /usr/lib /lib \
+ /lib/i386-linux-gnu"
+ fi
+ export BUILD_SYSROOT_NSL_PATH
+ fi
+
+ oe_runmake makefiles
+ oe_runmake
+}
+
+do_install_prepend_class-native() {
+ export POSTCONF="bin/postconf"
+}
+
+SYSTEMD_SERVICE_${PN} = "postfix.service"
+
+do_install () {
+ sh ./postfix-install 'install_root=${D}' \
+ 'config_directory=${sysconfdir}/postfix' \
+ 'daemon_directory=${libexecdir}/postfix' \
+ 'command_directory=${sbindir}' \
+ 'queue_directory=${localstatedir}/spool/postfix' \
+ 'sendmail_path=${sbindir}/sendmail.postfix' \
+ 'newaliases_path=${bindir}/newaliases' \
+ 'mailq_path=${bindir}/mailq' \
+ 'manpage_directory=${mandir}' \
+ 'readme_directory=${datadir}/doc/postfix' \
+ 'data_directory=${localstatedir}/lib/postfix' \
+ -non-interactive
+ rm -rf ${D}${localstatedir}/spool/postfix
+ mv ${D}${sysconfdir}/postfix/main.cf ${D}${sysconfdir}/postfix/sample-main.cf
+ install -m 755 ${S}/bin/smtp-sink ${D}/${sbindir}/
+ install -d ${D}${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/main.cf ${D}${sysconfdir}/postfix/main.cf
+ sed -i 's#@LIBEXECDIR@#${libexecdir}#' ${D}${sysconfdir}/postfix/main.cf
+
+ install -m 755 ${WORKDIR}/check_hostname.sh ${D}${sbindir}/
+
+ install -m 755 ${WORKDIR}/postfix ${D}${sysconfdir}/init.d/postfix
+ install -m 644 ${WORKDIR}/internal_recipient ${D}${sysconfdir}/postfix/internal_recipient
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/postfix.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@LIBEXECDIR@#${libexecdir}#g' ${D}${systemd_unitdir}/system/postfix.service
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/postfix.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/postfix.service
+
+ install -m 0755 ${WORKDIR}/aliasesdb ${D}${libexecdir}/postfix
+
+ install -m 770 -d ${D}${localstatedir}/spool/postfix
+ chown postfix:postfix ${D}${localstatedir}/spool/postfix
+
+ install -m 0755 -d ${D}${localstatedir}/lib/postfix
+ chown postfix:nogroup ${D}${localstatedir}/lib/postfix
+ install -m 0755 -d ${D}${localstatedir}/spool/postfix
+ chown root:postfix ${D}${localstatedir}/spool/postfix
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/active
+ chown postfix:root ${D}${localstatedir}/spool/postfix/active
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/bounce
+ chown postfix:root ${D}${localstatedir}/spool/postfix/bounce
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/corrupt
+ chown postfix:root ${D}${localstatedir}/spool/postfix/corrupt
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/defer
+ chown postfix:root ${D}${localstatedir}/spool/postfix/defer
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/deferred
+ chown postfix:root ${D}${localstatedir}/spool/postfix/deferred
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/flush
+ chown postfix:root ${D}${localstatedir}/spool/postfix/flush
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/hold
+ chown postfix:root ${D}${localstatedir}/spool/postfix/hold
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/incoming
+ chown postfix:root ${D}${localstatedir}/spool/postfix/incoming
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/saved
+ chown postfix:root ${D}${localstatedir}/spool/postfix/saved
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/trace
+ chown postfix:root ${D}${localstatedir}/spool/postfix/trace
+ install -m 0730 -d ${D}${localstatedir}/spool/postfix/maildrop
+ chown postfix:postdrop ${D}${localstatedir}/spool/postfix/maildrop
+ install -m 0755 -d ${D}${localstatedir}/spool/postfix/pid
+ chown root:root ${D}${localstatedir}/spool/postfix/pid
+ install -m 0700 -d ${D}${localstatedir}/spool/postfix/private
+ chown postfix:root ${D}${localstatedir}/spool/postfix/private
+ install -m 0710 -d ${D}${localstatedir}/spool/postfix/public
+ chown postfix:postdrop ${D}${localstatedir}/spool/postfix/public
+ install -m 0755 -d ${D}${localstatedir}/spool/vmail
+ chown vmail:vmail ${D}${localstatedir}/spool/vmail
+
+ chown :postdrop ${D}${sbindir}/postqueue
+ chown :postdrop ${D}${sbindir}/postdrop
+ chmod g+s ${D}${sbindir}/postqueue
+ chmod g+s ${D}${sbindir}/postdrop
+}
+
+do_install_append_class-native() {
+ ln -sf ../sbin/sendmail.postfix ${D}${bindir}/newaliases
+ ln -sf ../sbin/sendmail.postfix ${D}${bindir}/mailq
+}
+
+do_install_append_class-target() {
+ # Remove references to buildmachine paths in target makedefs.out
+ sed -i 's:-fdebug-prefix-map[^ ]*::g; s:--sysroot=${STAGING_DIR_TARGET}::g' ${D}/etc/postfix/makedefs.out
+}
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${sbindir}/sendmail.postfix"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "120"
+
+ALTERNATIVE_${PN}-doc += "mailq.1 newaliases.1 sendmail.1"
+ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1"
+ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
+ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"
+
+PACKAGE_WRITE_DEPS += "postfix-native"
+pkg_postinst_${PN} () {
+ if [ "x$D" = "x" ]; then
+ touch /etc/aliases
+ newaliases
+
+ # generate virtual_alias, default is hash
+ touch /etc/postfix/virtual_alias
+ postmap /etc/postfix/virtual_alias
+ else
+ if ${@'true' if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) else 'false'}; then
+ # /usr/lib/sendmail is required by LSB core test
+ [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+ fi
+
+ touch $D/etc/aliases
+ # This can fail depending on host setup
+ if ! newaliases -C $D/etc/postfix/main.cf -oA$D/etc/aliases; then
+ $INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
+ exit 0
+ fi
+ touch $D/etc/postfix/virtual_alias
+ postmap -c $D/etc/postfix $D/etc/postfix/virtual_alias
+
+ fi
+}
+
+# Exclude .debug directories from the main package
+FILES_${PN} = "${sysconfdir} ${localstatedir} ${bindir}/* ${sbindir}/* \
+ ${libexecdir}/* ${systemd_unitdir}/*"
+FILES_${PN}-dbg += "${libexecdir}/postfix/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb
new file mode 100644
index 000000000..89af406ac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/postfix/postfix_3.2.2.bb
@@ -0,0 +1,9 @@
+require postfix.inc
+
+SRC_URI += "file://0001-Check-for-glibc-before-setting-CANT_USE_SEND_RECV_MS.patch \
+ file://0001-makedefs-Use-native-compiler-to-build-makedefs.test.patch \
+ file://postfix-install.patch \
+ file://icu-config.patch \
+ "
+SRC_URI[md5sum] = "aea073a9b0bea5bdb590460a270a4aa0"
+SRC_URI[sha256sum] = "d06849418d119d09366997b2b481bb23f737629769b4e4a52da42fb3ad8b0576"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
new file mode 100644
index 000000000..4967bed1e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [configuration]
+
+proftpd tries to get the IP address from the hostname.
+Unluckily now the hostname is not properly configured in /etc/hosts.
+We can use this patch as a workaround.
+
+Author: Dexuan Cui <dexuan.cui@intel.com>
+Tue Oct 25 12:59:27 CST 2011
+
+--- proftpd-1.3.3c.orig/sample-configurations/basic.conf
++++ proftpd-1.3.3c/sample-configurations/basic.conf
+@@ -7,6 +7,9 @@
+ ServerType standalone
+ DefaultServer on
+
++#By default we bind to all interfaces.
++DefaultAddress 0.0.0.0
++
+ # Port 21 is the standard FTP port.
+ Port 21
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch
new file mode 100644
index 000000000..9816d4d22
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/build_fixup.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Inappropriate [configuration]
+
+combined the following patches into one:
+make, move-pidfile-to-var-run, move-runfile-to-var-run
+
+move pidfile to /var/run
+redefine PR_RUN_DIR as ${localstatedir}/run
+
+Signed-off-By: Armin Kuster <akuster808@gmail.com>
+
+
+Index: proftpd-1.3.6/Make.rules.in
+===================================================================
+--- proftpd-1.3.6.orig/Make.rules.in
++++ proftpd-1.3.6/Make.rules.in
+@@ -30,9 +30,9 @@ INSTALL=@INSTALL@
+ INSTALL_STRIP=@INSTALL_STRIP@
+ INSTALL_USER=@install_user@
+ INSTALL_GROUP=@install_group@
+-INSTALL_BIN=$(INSTALL) $(INSTALL_STRIP) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
+-INSTALL_SBIN=$(INSTALL) $(INSTALL_STRIP) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755
+-INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644
++INSTALL_BIN=$(INSTALL) -m 0755
++INSTALL_SBIN=$(INSTALL) -m 0755
++INSTALL_MAN=$(INSTALL) -m 0644
+
+ RM=rm -f
+ SHELL=@CONFIG_SHELL@
+Index: proftpd-1.3.6/Makefile.in
+===================================================================
+--- proftpd-1.3.6.orig/Makefile.in
++++ proftpd-1.3.6/Makefile.in
+@@ -105,7 +105,6 @@ check: proftpd$(EXEEXT)
+ $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8:
+ @if [ ! -d $@ ]; then \
+ mkdir -p $@; \
+- chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \
+ chmod 0755 $@; \
+ fi
+
+@@ -115,7 +114,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc
+ rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \
+ fi
+ ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd
+- -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd
+
+ install-libs: $(DESTDIR)$(libdir)/proftpd
+ cd lib/ && $(MAKE) install
+@@ -152,11 +150,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE
+ $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut
+ $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop
+ $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
++ $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs
+
+ install-conf: $(DESTDIR)$(sysconfdir)
+ if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \
++ $(INSTALL) -m 0644 \
+ $(top_srcdir)/sample-configurations/basic.conf \
+ $(DESTDIR)$(sysconfdir)/proftpd.conf ; \
+ fi
+Index: proftpd-1.3.6/configure
+===================================================================
+--- proftpd-1.3.6.orig/configure
++++ proftpd-1.3.6/configure
+@@ -41777,7 +41777,7 @@ _ACEOF
+
+
+ cat >>confdefs.h <<_ACEOF
+-#define PR_RUN_DIR "`eval echo "${localstatedir}"`"
++#define PR_RUN_DIR "`eval echo "${localstatedir}"/run/`"
+ _ACEOF
+
+
+@@ -41787,7 +41787,7 @@ _ACEOF
+
+
+ cat >>confdefs.h <<_ACEOF
+-#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/proftpd.pid"`"
++#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/run/proftpd.pid"`"
+ _ACEOF
+
+
+Index: proftpd-1.3.6/configure.in
+===================================================================
+--- proftpd-1.3.6.orig/configure.in
++++ proftpd-1.3.6/configure.in
+@@ -3833,8 +3833,8 @@ locale_dir="`eval echo ${locale_dir}`"
+ AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`", [Define the locale directory])
+
+ AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`", [Define the run directory])
+-AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`", [Define the configuration file path])
+-AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`", [Define the PID file path])
++AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/run/proftpd.conf"`", [Define the configuration file path])
++AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`", [Define the PID file path])
+
+ prefix="$pr_saved_prefix"
+ exec_prefix="$pr_saved_exec_prefix"
+Index: proftpd-1.3.6/lib/libcap/Makefile
+===================================================================
+--- proftpd-1.3.6.orig/lib/libcap/Makefile
++++ proftpd-1.3.6/lib/libcap/Makefile
+@@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES))
+ all: $(LIBNAME)
+
+ _makenames: _makenames.c cap_names.sed
+- $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
++ $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch
new file mode 100644
index 000000000..c64535cac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch
@@ -0,0 +1,27 @@
+close RequireValidShell check
+
+Upstream-Status: Inappropriate [configuration]
+
+close RequireValidShell check since we like to make /bin/false as shell
+for ftp user
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ sample-configurations/basic.conf | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf
+index 314eb79..abcb284 100644
+--- a/sample-configurations/basic.conf
++++ b/sample-configurations/basic.conf
+@@ -53,6 +53,7 @@ AllowOverwrite on
+ # We want clients to be able to login with "anonymous" as well as "ftp"
+ UserAlias anonymous ftp
+
++ RequireValidShell off
+ # Limit the maximum number of anonymous logins
+ MaxClients 10
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch
new file mode 100644
index 000000000..7e2a8e3ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/contrib.patch
@@ -0,0 +1,42 @@
+The contrib directory now contains its own Makefile which is
+used during installation. It was required to pass DESTDIR through
+when it gets called from the base Makefile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com>
+---
+ Makefile.in | 2 +-
+ contrib/Makefile.in | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 5b2e683..ee72fe1 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir)
+ test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install)
+
+ install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir)
+- cd contrib/ && $(MAKE) install-utils
++ cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils
+ $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount
+ $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl
+ $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub
+diff --git a/contrib/Makefile.in b/contrib/Makefile.in
+index 5bcc038..51d248c 100644
+--- a/contrib/Makefile.in
++++ b/contrib/Makefile.in
+@@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status
+ cd ../ && ./config.status
+
+ install-utils:
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
+- $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
++ $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd
++ $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail
++ $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default
new file mode 100644
index 000000000..b31f36ce2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/default
@@ -0,0 +1,9 @@
+# Defaults for proftpd initscript
+
+# Master system-wide proftpd switch. The initscript
+# will not run if it is not set to yes.
+RUN="yes"
+
+# Default options.
+# For more exhaustive logging, try "-d 3".
+OPTIONS=""
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
new file mode 100644
index 000000000..01c998c92
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init
@@ -0,0 +1,220 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: proftpd
+# Required-Start: $remote_fs $syslog $local_fs $network
+# Required-Stop: $remote_fs $syslog $local_fs $network
+# Should-Start: $named
+# Should-Stop: $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts ProFTPD daemon
+# Description: This script runs the FTP service offered
+# by the ProFTPD daemon
+### END INIT INFO
+
+# Start the proftpd FTP daemon.
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/sbin/proftpd
+NAME=proftpd
+
+# Defaults
+RUN="no"
+OPTIONS=""
+CONFIG_FILE=/etc/proftpd.conf
+
+PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'`
+if [ "x$PIDFILE" = "x" ];
+then
+ PIDFILE=/var/run/proftpd.pid
+fi
+
+# Read config (will override defaults)
+[ -r /etc/default/proftpd ] && . /etc/default/proftpd
+
+trap "" 1
+trap "" 15
+
+test -f $DAEMON || exit 0
+
+. /etc/init.d/functions
+
+#
+# Servertype could be inetd|standalone|none.
+# In all cases check against inetd and xinetd support.
+#
+if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE
+then
+ if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \
+ egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \
+ egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null
+ then
+ RUN="no"
+ INETD="yes"
+ else
+ if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE
+ then
+ RUN="yes"
+ INETD="no"
+ else
+ RUN="no"
+ INETD="no"
+ fi
+ fi
+fi
+
+# /var/run could be on a tmpfs
+
+[ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd
+
+inetd_check()
+{
+ if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then
+ echo "Neither inetd nor xinetd appears installed: check your configuration."
+ fi
+}
+
+start()
+{
+ set -e
+ echo -n "Starting ftp server $NAME... "
+ start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS
+ echo "done."
+}
+
+signal()
+{
+
+ if [ "$1" = "stop" ]; then
+ SIGNAL="TERM"
+ echo -n "Stopping ftp server $NAME... "
+ else
+ if [ "$1" = "reload" ]; then
+ SIGNAL="HUP"
+ echo -n "Reloading ftp server $NAME... "
+ else
+ echo "ERR: wrong parameter given to signal()"
+ exit 1
+ fi
+ fi
+ if [ -f "$PIDFILE" ]; then
+ start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
+ if [ $? = 0 ]; then
+ echo "done."
+ return
+ else
+ SIGNAL="KILL"
+ start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE"
+ if [ $? != 0 ]; then
+ echo
+ [ $2 != 0 ] || exit 0
+ else
+ echo "done."
+ return
+ fi
+ fi
+ if [ "$SIGNAL" = "KILL" ]; then
+ rm -f "$PIDFILE"
+ fi
+ else
+ echo "done."
+ return
+ fi
+}
+
+case "$1" in
+ start)
+ if [ "x$RUN" = "xyes" ] ; then
+ start
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ force-start)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)."
+ inetd_check
+ fi
+ start
+ ;;
+
+ stop)
+ if [ "x$RUN" = "xyes" ] ; then
+ signal stop 0
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ force-stop)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)."
+ inetd_check
+ fi
+ signal stop 0
+ ;;
+
+ reload)
+ signal reload 0
+ ;;
+
+ force-reload|restart)
+ if [ "x$RUN" = "xyes" ] ; then
+ signal stop 1
+ sleep 2
+ start
+ else
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ else
+ echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration."
+ fi
+ fi
+ ;;
+
+ status)
+ if [ "x$INETD" = "xyes" ] ; then
+ echo "ProFTPD is started from inetd/xinetd."
+ inetd_check
+ exit 0
+ else
+ if [ -f "$PIDFILE" ]; then
+ pid=$(cat $PIDFILE)
+ else
+ pid="x"
+ fi
+ if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then
+ echo "ProFTPD is started in standalone mode, currently running."
+ exit 0
+ else
+ echo "ProFTPD is started in standalone mode, currently not running."
+ exit 3
+ fi
+ fi
+ ;;
+
+ check-config)
+ $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0
+ exit 1
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service
new file mode 100644
index 000000000..18764385e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/files/proftpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=proftpd Daemon
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/proftpd -c @SYSCONFDIR@/proftpd.conf
+StandardError=syslog
+
+[Install]
+WantedBy=default.target
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb b/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb
new file mode 100644
index 000000000..409947265
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/proftpd/proftpd_1.3.6.bb
@@ -0,0 +1,138 @@
+SUMMARY = "Secure and configurable FTP server"
+SECTION = "net"
+HOMEPAGE = "http://www.proftpd.org"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184"
+
+SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \
+ file://basic.conf.patch \
+ file://proftpd-basic.init \
+ file://default \
+ file://close-RequireValidShell-check.patch \
+ file://contrib.patch \
+ file://build_fixup.patch \
+ file://proftpd.service \
+ "
+iSRC_URI[md5sum] = "13270911c42aac842435f18205546a1b"
+SRC_URI[sha256sum] = "91ef74b143495d5ff97c4d4770c6804072a8c8eb1ad1ecc8cc541b40e152ecaf"
+
+inherit autotools-brokensep useradd update-rc.d systemd
+
+PACKAGECONFIG ??= "shadow \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
+ "
+
+PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses, --disable-curses --disable-ncurses, ncurses"
+PACKAGECONFIG[openssl] = "--enable-openssl, --disable-openssl, openssl, openssl"
+PACKAGECONFIG[pam] = "--enable-auth-pam, --disable-auth-pam, libpam, libpam"
+PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6"
+PACKAGECONFIG[shadow] = "--enable-shadow, --disable-shadow"
+PACKAGECONFIG[pcre] = "--enable-pcre, --disable-pcre, libpcre "
+
+# enable POSIX.1e capabilities
+PACKAGECONFIG[cap] = "--enable-cap, --disable-cap, libcap, libcap"
+
+#enable support for POSIX ACLs
+PACKAGECONFIG[acl] = "--enable-facl, --disable-facl"
+
+#enable proftpd controls via ftpdct
+PACKAGECONFIG[ctrls] = "--enable-ctrls, --disable-crtls"
+
+#prevent proftpd from using its bundled getopt implementation.
+PACKAGECONFIG[getopt] = "--with-getopt, --without-getopt"
+
+#do not strip debugging symbols from installed code
+PACKAGECONFIG[strip] = "--enable-strip, --disable-strip"
+
+#enable SIA authentication support (Tru64)
+PACKAGECONFIG[sia] = "--enable-sia, --disable-sia"
+PACKAGECONFIG[sendfile] = "-enable-sendfile, --disable-sendfile"
+
+#enable Native Language Support (NLS)
+PACKAGECONFIG[nls] = "--enable-nls, --disable-nls"
+
+#add mod_dso to core modules
+PACKAGECONFIG[dso] = "--enable-dso, --disable-dso"
+PACKAGECONFIG[largefile] = "--enable-largefile, --disable-largefile"
+
+#omit mod_auth_file from core modules
+PACKAGECONFIG[auth] = "--enable-auth-file, --disable-auth-file"
+
+
+# proftpd uses libltdl which currently makes configuring using
+# autotools.bbclass a pain...
+do_configure () {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ oe_runconf
+ cp ${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool ${S}/libtool
+}
+
+FTPUSER = "ftp"
+FTPGROUP = "ftp"
+
+do_install () {
+ oe_runmake DESTDIR=${D} install
+ rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale
+ [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir}
+ sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf
+ sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd
+
+ # create the pub directory
+ mkdir -p ${D}/home/${FTPUSER}/pub/
+ chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'true', 'false', d)}; then
+ # install proftpd pam configuration
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 644 ${S}/contrib/dist/rpm/ftp.pamd ${D}${sysconfdir}/pam.d/proftpd
+ sed -i '/ftpusers/d' ${D}${sysconfdir}/pam.d/proftpd
+ # specify the user Authentication config
+ sed -i '/^MaxInstances/a\AuthPAM on\nAuthPAMConfig proftpd' \
+ ${D}${sysconfdir}/proftpd.conf
+ fi
+
+ install -d ${D}/${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
+ sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -i ${D}${systemd_unitdir}/system/*.service
+
+ sed -e 's|--sysroot=${STAGING_DIR_HOST}||g' \
+ -e 's|${STAGING_DIR_NATIVE}||g' \
+ -e 's|-fdebug-prefix-map=[^ ]*||g' \
+ -i ${D}/${bindir}/prxs
+
+ # ftpmail perl script, which reads the proftpd log file and sends
+ # automatic email notifications once an upload finishs,
+ # depends on an old perl Mail::Sendmail
+ # The Mail::Sendmail has not been maintained for almost 10 years
+ # Other distribution not ship with ftpmail, so do the same to
+ # avoid confusion about having it fails to run
+ rm -rf ${D}${bindir}/ftpmail
+ rm -rf ${D}${mandir}/man1/ftpmail.1
+}
+
+INITSCRIPT_NAME = "proftpd"
+INITSCRIPT_PARAM = "defaults 85 15"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "proftpd.service"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
+USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \
+ --shell /bin/false ${FTPUSER}"
+
+FILES_${PN} += "/home/${FTPUSER}"
+
+RDEPENDS_${PN} += "perl"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch
new file mode 100644
index 000000000..e4578dda7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd-use-pkgconfig.patch
@@ -0,0 +1,35 @@
+From 4c850b92a1cf8cfa19677c66bcde2edfab1a4490 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 24 Feb 2015 23:02:14 -0500
+Subject: [PATCH] ptpd: use pkgconfig
+
+Yocto uses pkg-config for libpcap, rather than pcap-config, so use that
+instead as the source for libs and cflags.
+
+Upstream-status: Inappropriate [ embedded specific ]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc9541f..288f547 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -112,10 +112,10 @@ case "$try_pcap" in
+ yes)
+ case "$PATH_PCAP_CONFIG" in
+ /*)
+- PCAP_LIBS=`$PATH_PCAP_CONFIG --libs`
++ PCAP_LIBS=`$PATH_PCAP_CONFIG --libs libpcap`
+ AC_SUBST([PCAP_LIBS])
+ # Separate CPPFLAGS and CFLAGS
+- foo=`$PATH_PCAP_CONFIG --cflags`
++ foo=`$PATH_PCAP_CONFIG --cflags libpcap`
+ PCAP_CPPFLAGS=
+ PCAP_CFLAGS=
+ for i in $foo; do
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf
new file mode 100644
index 000000000..ddd571036
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.conf
@@ -0,0 +1,7 @@
+#
+# PTPD Configuration
+#
+# See man ptpd2 for arguments.
+#
+# Example arguments
+PTPDARGS="-d 1 -i eth0"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service
new file mode 100644
index 000000000..f84799eb5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd/ptpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=ptpd time precision daemon
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/ptpd
+ExecStart=@BINDIR@/ptpd2 $PTPDARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
new file mode 100644
index 000000000..e13619320
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/ptpd/ptpd_2.3.1.bb
@@ -0,0 +1,58 @@
+SUMMARY = "The PTP daemon (PTPd)"
+DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \
+defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \
+and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \
+time coordination of LAN connected computers."
+HOMEPAGE = "http://sourceforge.net/projects/ptpd"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://README;md5=0733e1b3788ab2ebbc63bf33a020da1d"
+
+DEPENDS = "libpcap"
+
+inherit autotools pkgconfig systemd
+
+# return something like '1.2.3' or '1.2.3/rc1'
+#
+def get_sub(d):
+ parts = d.getVar('PV').split('-')
+ try:
+ return parts[0] + '/' + parts[1]
+ except:
+ return parts[0]
+
+SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \
+ file://ptpd-use-pkgconfig.patch \
+ file://ptpd.service \
+ file://ptpd.conf \
+"
+
+SRC_URI[md5sum] = "253bab7ab51d969616ea811be1f132f3"
+SRC_URI[sha256sum] = "0dbf54dd2c178bd9fe62481d2c37513ee36636d8bf137cfdad96891490cdbf93"
+
+S = "${WORKDIR}/ptpd-${PV}"
+
+EXTRA_OEMAKE = ""
+
+EXTRA_OECONF += "--disable-snmp --with-pcap-config=pkg-config"
+
+do_install() {
+ install -d ${D}${bindir} ${D}${mandir}/man8
+ install -m 0755 ${B}/src/ptpd2 ${D}${bindir}
+ install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ptpd.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/ptpd.service
+ sed -i -e 's#@BINDIR@#${bindir}#g' ${D}${systemd_unitdir}/system/ptpd.service
+
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/ptpd.conf ${D}${sysconfdir}/default/ptpd
+ fi
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "ptpd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch
new file mode 100644
index 000000000..76523fb99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch
@@ -0,0 +1,39 @@
+From 1bafadf2502334a3e972ff667061469316d0d2ca Mon Sep 17 00:00:00 2001
+From: Tudor Florea <tudor.florea@enea.com>
+Date: Tue, 4 Aug 2015 02:46:39 +0200
+Subject: [PATCH] Remove hardcoded /usr/local includes from configure.ac
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+---
+ configure.ac | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6c78e8c..851d45d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -100,18 +100,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter)
+ python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin"
+ AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path)
+
+-if test -d /usr/local/include; then
+- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+-fi
+-
+-if test -d /usr/kerberos/include; then
+- CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"
+-fi
+-
+-if test -d /usr/local/lib; then
+- LDFLAGS="$LDFLAGS -L/usr/local/lib"
+-fi
+-
+ CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"
+
+ dnl Checks for header files
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch
new file mode 100644
index 000000000..4cb33bc5c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch
@@ -0,0 +1,31 @@
+From 0290bd6f4ceddff2c52dff833c9d31d24de7d0e1 Mon Sep 17 00:00:00 2001
+From: Tudor Florea <tudor.florea@enea.com>
+Date: Tue, 4 Aug 2015 03:07:01 +0200
+Subject: [PATCH] Don't mess with CFLAGS and LDFLAGS when --with-minimal is specified
+
+We especially don't want stripping enabled.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+---
+ configure.ac | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 851d45d..dc410a1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -423,8 +423,6 @@ AC_ARG_WITH(minimal,
+ AC_DEFINE(NO_FTP_USERS)
+ AC_DEFINE(WITHOUT_ASCII)
+ AC_DEFINE(BORING_MODE)
+- CFLAGS="$CFLAGS -Os -fomit-frame-pointer -fno-unroll-loops "
+- LDFLAGS="$LDFLAGS -s "
+ fi ])
+
+ AC_ARG_WITH(paranoidmsg,
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb
new file mode 100644
index 000000000..c1f150405
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.42.bb
@@ -0,0 +1,22 @@
+SUMMARY = "FTP Server with a strong focus on software security"
+DESCRIPTION = "Pure-FTPd is a free (BSD license), secure, production-quality and standard-conformant FTP server."
+HOMEPAGE = "http://www.pureftpd.org/project/pure-ftpd"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90352fb2bfe17f4261687a0d6e09f489"
+
+DEPENDS = "libcap"
+
+
+SRC_URI = "http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${PV}.tar.gz \
+ file://0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch \
+ file://nostrip.patch \
+"
+SRC_URI[md5sum] = "4195af8f0e5ee2a798b1014071dae3a3"
+SRC_URI[sha256sum] = "7be73a8e58b190a7054d2ae00c5e650cb9e091980420082d02ec3c3b68d8e7f9"
+
+inherit autotools
+
+EXTRA_OECONF = "--with-minimal"
+PACKAGECONFIG[libsodium] ="ac_cv_lib_sodium_crypto_pwhash_scryptsalsa208sha256_str=yes, \
+ ac_cv_lib_sodium_crypto_pwhash_scryptsalsa208sha256_str=no, libsodium"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default
new file mode 100644
index 000000000..7cb73c771
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.default
@@ -0,0 +1 @@
+OPTIONS="-u radvd"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init
new file mode 100755
index 000000000..8b26317ee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.init
@@ -0,0 +1,135 @@
+#! /bin/sh
+#
+### BEGIN INIT INFO
+# Provides: radvd
+# Required-Start: $remote_fs $named $syslog
+# Required-Stop: $remote_fs $named $syslog
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Description: router advertisement daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/radvd
+NAME=radvd
+DESC=radvd
+CONFIG=/etc/radvd.conf
+SAVED_SETTINGS=/var/run/radvd/saved-settings
+PIDFILE=/var/run/radvd/radvd.pid
+OPTIONS="-u radvd -p $PIDFILE"
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Check for IPv6 support in kernel
+if test \! -e /proc/sys/net/ipv6; then
+ echo "IPv6 support must be enabled in the kernel for $DESC to work."
+ exit
+fi
+
+save_settings()
+{
+ local file=$1
+
+ rm -f $file
+ for if_conf in /proc/sys/net/ipv6/conf/*; do
+ echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file
+ done
+ return 0
+}
+
+restore_settings()
+{
+ file=$1
+
+ if [ ! -f $file ]; then
+ echo "$0: warning: cannot restore settings"
+ return
+ fi
+
+ (
+ while read f value; do
+ if [ -w $f ]; then
+ echo $value > $f
+ fi
+ done
+ ) < $file
+}
+
+chkconfig() {
+ if [ ! -e $CONFIG -o ! -s $CONFIG ]; then
+ echo ""
+ echo "* $CONFIG does not exist or is empty."
+ echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple"
+ echo "* configuration suitable for most systems, and radvd.conf(5)"
+ echo "* for configuration file syntax. radvd will *not* be started."
+ exit 0
+ fi
+}
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ chkconfig
+ save_settings $SAVED_SETTINGS
+
+ # We must enable IPv6 forwarding for radvd to work
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+
+ # Check for stale pidfile; radvd won't start if one is lying around
+ if [ -f $PIDFILE ] && ! ps `cat $PIDFILE` > /dev/null; then
+ rm -f $PIDFILE
+ fi
+ if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \
+ --exec $DAEMON -- $OPTIONS; then
+ echo "failed." && exit 1
+ fi
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ if ! [ -f $PIDFILE ] ; then
+ echo "not running."
+ exit 0
+ fi
+ start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
+ --exec $DAEMON
+ restore_settings $SAVED_SETTINGS
+ rm -f $SAVED_SETTINGS
+ echo "$NAME."
+ ;;
+ status)
+ status $DAEMON;
+ exit $?
+ ;;
+ reload|force-reload)
+ echo "Reloading $DESC configuration files."
+ start-stop-daemon --stop --signal HUP --quiet --pidfile \
+ $PIDFILE --exec $DAEMON
+ ;;
+ restart)
+ chkconfig
+ echo -n "Restarting $DESC: "
+ if ! start-stop-daemon --stop --quiet --pidfile \
+ $PIDFILE --exec $DAEMON; then
+ # stop failed, so we were not running
+ save_settings $SAVED_SETTINGS
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+ fi
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile \
+ $PIDFILE --exec $DAEMON -- $OPTIONS
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service
new file mode 100644
index 000000000..e60798a6b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/radvd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Router advertisement daemon for IPv6
+After=network.target
+ConditionPathExists=@SYSCONFDIR@/radvd.conf
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/radvd
+ExecStart=@SBINDIR@/radvd -n $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd
new file mode 100644
index 000000000..89256a40e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d radvd root 0755 /var/run/radvd none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc
new file mode 100644
index 000000000..06d16a4ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd.inc
@@ -0,0 +1,67 @@
+SUMMARY = "IPv6 router advertisement daemon"
+DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \
+listens to router solicitations and sends router \
+advertisements as described in RFC 2461, Neighbor \
+Discovery for IP Version 6 (IPv6). With these \
+advertisements hosts can automatically configure their \
+addresses and some other parameters. They also can \
+choose a default router based on these advertisements."
+HOMEPAGE = "http://www.litech.org/radvd/"
+SECTION = "net"
+DEPENDS = "flex-native bison-native libdaemon "
+
+# License is BSD-Style (with advertising clause) but also has an additional 0th clause
+LICENSE = "radvd"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db"
+
+SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \
+ file://radvd.init \
+ file://radvd.service \
+ file://volatiles.03_radvd \
+ file://radvd.default"
+
+inherit autotools update-rc.d useradd pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "radvd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append () {
+ install -m 0755 -d ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/default/volatiles \
+ ${D}${docdir}/radvd
+ # Install init script and volatiles
+ install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd
+
+ install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd
+
+ # Install systemd service files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/radvd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' \
+ -e 's#@SBINDIR@#${sbindir}#g' \
+ -e 's#@BASE_BINDIR@#${base_bindir}#g' ${D}${systemd_unitdir}/system/radvd.service
+
+ # Install default environment file
+ install -m 0644 ${WORKDIR}/radvd.default ${D}${sysconfdir}/default/radvd
+
+ # Documentation
+ for i in radvd.conf.example README; do \
+ install -m 0644 ${S}/$i ${D}${docdir}/radvd; \
+ done
+}
+
+INITSCRIPT_NAME = "radvd"
+INITSCRIPT_PARAMS = "defaults 20 80"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd"
+
+pkg_postinst_${PN} () {
+ if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then
+ /etc/init.d/populate-volatile.sh update
+ fi
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb
new file mode 100644
index 000000000..4baea01d0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/radvd/radvd_2.17.bb
@@ -0,0 +1,5 @@
+
+require radvd.inc
+
+SRC_URI[md5sum] = "64ee3fdb5544bcddef1c6cd80d77fa0a"
+SRC_URI[sha256sum] = "53757e7f2164899e1145482f1ae91829600a6e2f6fec29cfb3b350a3bb45bd5d"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
new file mode 100644
index 000000000..f482f8088
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch
@@ -0,0 +1,46 @@
+From 27e10667bf27baf5f119a791e3473bb9435a786a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 10:28:28 -0700
+Subject: [PATCH] SquidNew: use noexcept instead of throw for C++11 compilers
+
+Fixes errors with gcc7 which is more pedantic about c++11
+conformance regarding deprecated features
+
+include/SquidNew.h:21:51: error: dynamic exception specifications are deprecated in C++11
+_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
+ ^~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ include/SquidNew.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/include/SquidNew.h b/include/SquidNew.h
+index 39fcee0..c960347 100644
+--- a/include/SquidNew.h
++++ b/include/SquidNew.h
+@@ -18,19 +18,19 @@
+ */
+ #include <new>
+
+-_SQUID_EXTERNNEW_ void *operator new(size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new(size_t size) noexcept(false)
+ {
+ return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete (void *address) noexcept(true)
+ {
+ xfree(address);
+ }
+-_SQUID_EXTERNNEW_ void *operator new[] (size_t size) throw (std::bad_alloc)
++_SQUID_EXTERNNEW_ void *operator new[] (size_t size) noexcept(false)
+ {
+ return xmalloc(size);
+ }
+-_SQUID_EXTERNNEW_ void operator delete[] (void *address) throw()
++_SQUID_EXTERNNEW_ void operator delete[] (void *address) noexcept(true)
+ {
+ xfree(address);
+ }
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
new file mode 100644
index 000000000..302136a03
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-configure-Check-for-Wno-error-format-truncation-comp.patch
@@ -0,0 +1,118 @@
+From c21adbb0b230ffba97cf5d059e2bd024e13a37df Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 11:54:57 -0700
+Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler
+ option
+
+If this option is supported by compiler then disable it ( gcc7+)
+Fixes
+client.c:834:23: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Werror=format-truncation=]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ acinclude/ax_check_compile_flag.m4 | 74 ++++++++++++++++++++++++++++++++++++++
+ configure.ac | 2 ++
+ 2 files changed, 76 insertions(+)
+ create mode 100644 acinclude/ax_check_compile_flag.m4
+
+diff --git a/acinclude/ax_check_compile_flag.m4 b/acinclude/ax_check_compile_flag.m4
+new file mode 100644
+index 0000000..dcabb92
+--- /dev/null
++++ b/acinclude/ax_check_compile_flag.m4
+@@ -0,0 +1,74 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# Check whether the given FLAG works with the current language's compiler
++# or gives an error. (Warnings, however, are ignored)
++#
++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++# success/failure.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation, either version 3 of the License, or (at your
++# option) any later version.
++#
++# This program is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
++# Public License for more details.
++#
++# You should have received a copy of the GNU General Public License along
++# with this program. If not, see <https://www.gnu.org/licenses/>.
++#
++# As a special exception, the respective Autoconf Macro's copyright owner
++# gives unlimited permission to copy, distribute and modify the configure
++# scripts that are the output of Autoconf when processing the Macro. You
++# need not follow the terms of the GNU General Public License when using
++# or distributing such scripts, even though portions of the text of the
++# Macro appear in them. The GNU General Public License (GPL) does govern
++# all other use of the material that constitutes the Autoconf Macro.
++#
++# This special exception to the GPL applies to versions of the Autoconf
++# Macro released by the Autoconf Archive. When you make and distribute a
++# modified version of the Autoconf Macro, you may extend this special
++# exception to the GPL to apply to your modified version as well.
++
++#serial 5
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
+diff --git a/configure.ac b/configure.ac
+index ff4688c..9382fdf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -26,6 +26,7 @@ m4_include([acinclude/pkg.m4])
+ m4_include([acinclude/lib-checks.m4])
+ m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
+ m4_include([acinclude/ax_cxx_0x_types.m4])
++m4_include([acinclude/ax_check_compile_flag.m4])
+
+ HOSTCXX="$BUILD_CXX"
+ PRESET_CFLAGS="$CFLAGS"
+@@ -44,6 +45,7 @@ AC_PROG_CXX
+ AC_LANG([C++])
+ AC_CANONICAL_HOST
+
++AX_CHECK_COMPILE_FLAG([-Werror=format-truncation],[CFLAGS="$CFLAGS -Wno-error=format-truncation" CXXFLAGS="$CXXFLAGS -Wno-error=format-truncation"])
+ # Clang 3.2 on some CPUs requires -march-native to detect correctly.
+ # GCC 4.3+ can also produce faster executables when its used.
+ # But building inside a virtual machine environment has been found to
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch
new file mode 100644
index 000000000..8ea55d0e1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/0001-tools.cc-fixed-unused-result-warning.patch
@@ -0,0 +1,32 @@
+From faaa796a138cbd5033b1e53f33faac0cf4162bf5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 25 Jun 2017 00:59:24 -0700
+Subject: [PATCH] tools.cc: fixed unused-result warning
+
+fix
+| ../../squid-3.5.26/src/tools.cc: In function 'void enter_suid()':
+| ../../squid-3.5.26/src/tools.cc:616:11: error: ignoring return value of 'int setuid(__uid_t)', declared with attribute warn_unused_result [-Werror=unused-result]
+| setuid(0);
+| ~~~~~~^~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/tools.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools.cc b/src/tools.cc
+index 8137a03..843e266 100644
+--- a/src/tools.cc
++++ b/src/tools.cc
+@@ -612,8 +612,8 @@ enter_suid(void)
+ if (setresuid((uid_t)-1, 0, (uid_t)-1) < 0)
+ debugs (21, 3, "enter_suid: setresuid failed: " << xstrerror ());
+ #else
+-
+- setuid(0);
++ if (setuid(0) < 0)
++ debugs(50, DBG_IMPORTANT, "WARNING: no_suid: setuid(0): " << xstrerror());
+ #endif
+ #if HAVE_PRCTL && defined(PR_SET_DUMPABLE)
+ /* Set Linux DUMPABLE flag */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch
new file mode 100644
index 000000000..25f68aff8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Fix-flawed-dynamic-ldb-link-test-in-configure.patch
@@ -0,0 +1,40 @@
+From b4943594654cd340b95aabdc2f3750a4705cc0de Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Mon, 21 Oct 2013 12:50:44 -0400
+Subject: [PATCH] Fix flawed dynamic -ldb link test in configure
+
+The test uses dbopen, but just ignores the fact
+that this function may not exist in the db version
+used. This leads to the dynamic link test failing
+and the configure script just making assumptions
+about why and setting the need for -ldb incorrectly.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+
+---
+ configure.ac | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 57cd1ac..3827222 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3229,8 +3229,16 @@ AC_CHECK_DECL(dbopen,,,[
+ #include <db.h>
+ #endif])
+
+-dnl 1.85
+-SQUID_CHECK_DBOPEN_NEEDS_LIBDB
++if test "x$ac_cv_have_decl_dbopen" = "xyes"; then
++ dnl 1.85
++ SQUID_CHECK_DBOPEN_NEEDS_LIBDB
++else
++ # dbopen isn't there. So instead of running a compile/link test that
++ # uses it and is thus guaranteed to fail, we just assume that we will
++ # need to link in the db library, rather than fabricate some other
++ # dynamic compile/link test.
++ ac_cv_dbopen_libdb="yes"
++fi
+ if test "x$ac_cv_dbopen_libdb" = "xyes"; then
+ LIB_DB="-ldb"
+ fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch
new file mode 100644
index 000000000..3852f7c25
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Set-up-for-cross-compilation.patch
@@ -0,0 +1,28 @@
+From 995aaf30799fa972441354b6feb45f0621968929 Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Wed, 16 Oct 2013 16:41:03 -0400
+Subject: [PATCH] Set up for cross compilation
+
+Message-Id: <17e5a28667f667859c48bee25e575a072d39ee1b.1381956170.git.Jim.Somerville@windriver.com>
+
+Set the host compiler to BUILD_CXX so
+proper cross compilation can occur.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index fe80ee0..57cd1ac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,6 +27,7 @@ m4_include([acinclude/lib-checks.m4])
+ m4_include([acinclude/ax_cxx_compile_stdcxx_11.m4])
+ m4_include([acinclude/ax_cxx_0x_types.m4])
+
++HOSTCXX="$BUILD_CXX"
+ PRESET_CFLAGS="$CFLAGS"
+ PRESET_CXXFLAGS="$CXXFLAGS"
+ PRESET_LDFLAGS="$LDFLAGS"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch
new file mode 100644
index 000000000..6a3352548
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/Skip-AC_RUN_IFELSE-tests.patch
@@ -0,0 +1,65 @@
+From a85311965707ba2fa78f7ce044e6f61e65e66fd0 Mon Sep 17 00:00:00 2001
+From: Jim Somerville <Jim.Somerville@windriver.com>
+Date: Tue, 14 Oct 2014 02:56:08 -0400
+Subject: [PATCH] Skip AC_RUN_IFELSE tests
+
+Upstream-Status: Inappropriate [cross compiling specific]
+
+Such tests are not supported in a cross compile
+environment. Choose sane defaults.
+
+Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ acinclude/krb5.m4 | 10 +++++++++-
+ acinclude/lib-checks.m4 | 8 ++++++--
+ 2 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/acinclude/krb5.m4 b/acinclude/krb5.m4
+index 5c83d88..c264118 100644
+--- a/acinclude/krb5.m4
++++ b/acinclude/krb5.m4
+@@ -61,7 +61,15 @@ main(void)
+
+ return 0;
+ }
+-]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ])
++]])], [ squid_cv_broken_heimdal_krb5_h=yes ], [ squid_cv_broken_heimdal_krb5_h=no ],
++[
++ dnl Can't test in cross compiled env - so assume good
++ squid_cv_broken_heimdal_krb5_h=no
++])
++ ],
++ [
++ dnl Can't test in cross compiled env - so assume good
++ squid_cv_broken_heimdal_krb5_h=no
+ ])
+ ])
+ ]) dnl SQUID_CHECK_KRB5_HEIMDAL_BROKEN_KRB5_H
+diff --git a/acinclude/lib-checks.m4 b/acinclude/lib-checks.m4
+index c4874da..ba72982 100644
+--- a/acinclude/lib-checks.m4
++++ b/acinclude/lib-checks.m4
+@@ -177,7 +177,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_CONST_SSL_METHOD],[
+ [
+ AC_MSG_RESULT([no])
+ ],
+- [])
++ [
++ AC_MSG_RESULT([skipped - can't test in cross-compiled env])
++ ])
+
+ SQUID_STATE_ROLLBACK(check_const_SSL_METHOD)
+ ]
+@@ -265,7 +267,9 @@ AC_DEFUN([SQUID_CHECK_OPENSSL_TXTDB],[
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(SQUID_USE_SSLLHASH_HACK, 1)
+ ],
+-[])
++[
++ AC_MSG_RESULT([skipped - can't test in cross-compiled env])
++])
+
+ SQUID_STATE_ROLLBACK(check_TXTDB)
+ ])
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch
new file mode 100644
index 000000000..2feca4986
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/gcc7-fixes.patch
@@ -0,0 +1,26 @@
+From 660fce9cfa00a57e5b7cec46116a31e21595c306 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 19 Jun 2017 23:47:01 -0700
+Subject: [PATCH] squid: Upgrade to 3.5.26
+
+../../squid-3.5.26/src/DiskIO/DiskThreads/aiops.cc: In function 'void squidaio_init()': ../../squid-3.5.26/src/DiskIO/DiskThreads/DiskThreads.h:30:50: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] #define NUMTHREADS (Config.cacheSwap.n_configured*16)
+
+Upstream-Status: Backport
+
+---
+ src/DiskIO/DiskThreads/aiops.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/DiskIO/DiskThreads/aiops.cc b/src/DiskIO/DiskThreads/aiops.cc
+index b44adfa..e11f948 100644
+--- a/src/DiskIO/DiskThreads/aiops.cc
++++ b/src/DiskIO/DiskThreads/aiops.cc
+@@ -290,7 +290,7 @@ squidaio_init(void)
+ /* Create threads and get them to sit in their wait loop */
+ squidaio_thread_pool = memPoolCreate("aio_thread", sizeof(squidaio_thread_t));
+
+- assert(NUMTHREADS);
++ assert(NUMTHREADS != 0);
+
+ for (i = 0; i < NUMTHREADS; ++i) {
+ threadp = (squidaio_thread_t *)squidaio_thread_pool->alloc();
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest b/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest
new file mode 100644
index 000000000..de79a293c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+#
+make -C test-suite -k runtest-TESTS
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch
new file mode 100644
index 000000000..e990480a6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/set_sysroot_patch.patch
@@ -0,0 +1,41 @@
+From 702bd881b66dc034e711c0ff47805f2da40b6e0d Mon Sep 17 00:00:00 2001
+From: Yue Tao <yue.tao@windriver.com>
+Date: Mon, 8 Aug 2016 16:04:33 +0800
+Subject: [PATCH] Set the SYSROOT for libxml2 header file to avoid host
+ contamination.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+---
+ configure.ac | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 504a844..ff4688c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -974,15 +974,15 @@ if test "x$squid_opt_use_esi" = "xyes" -a "x$with_libxml2" != "xno" ; then
+ dnl Find the main header and include path...
+ AC_CACHE_CHECK([location of libxml2 include files], [ac_cv_libxml2_include], [
+ AC_CHECK_HEADERS([libxml/parser.h], [], [
+- AC_MSG_NOTICE([Testing in /usr/include/libxml2])
++ AC_MSG_NOTICE([Testing in $SYSROOT/usr/include/libxml2])
+ SAVED_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="-I/usr/include/libxml2 $CPPFLAGS"
++ CPPFLAGS="-I$SYSROOT/usr/include/libxml2 $CPPFLAGS"
+ unset ac_cv_header_libxml_parser_h
+- AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/include/libxml2"], [
+- AC_MSG_NOTICE([Testing in /usr/local/include/libxml2])
+- CPPFLAGS="-I/usr/local/include/libxml2 $SAVED_CPPFLAGS"
++ AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I$SYSROOT/usr/include/libxml2"], [
++ AC_MSG_NOTICE([Testing in $SYSROOT/usr/local/include/libxml2])
++ CPPFLAGS="-I$SYSROOT/usr/local/include/libxml2 $SAVED_CPPFLAGS"
+ unset ac_cv_header_libxml_parser_h
+- AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I/usr/local/include/libxml2"], [
++ AC_CHECK_HEADERS([libxml/parser.h], [ac_cv_libxml2_include="-I$SYSROOT/usr/local/include/libxml2"], [
+ AC_MSG_NOTICE([Failed to find libxml2 header file libxml/parser.h])
+ ])
+ ])
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch
new file mode 100644
index 000000000..e5267ea2b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-don-t-do-squid-conf-tests-at-build-time.patch
@@ -0,0 +1,61 @@
+From 8786b91488dae3f6dfeadd686e80d2ffc5c29320 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 25 Aug 2016 15:22:57 +0800
+Subject: [PATCH] squid: don't do squid-conf-tests at build time
+
+* squid-conf-tests is a test to run "squid -k parse -f"
+ to perse the config files, which should not be run
+ at build time since we are cross compiling, so remove
+ it but it will be added back for the runtime ptest.
+
+* Fix the directories of the conf files for squid-conf-tests
+ so that it can run on the target board.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ test-suite/Makefile.am | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
+index 061a463..350dfb2 100644
+--- a/test-suite/Makefile.am
++++ b/test-suite/Makefile.am
+@@ -41,8 +41,7 @@ TESTS += debug \
+ MemPoolTest\
+ mem_node_test\
+ mem_hdr_test\
+- $(ESI_TESTS) \
+- squid-conf-tests
++ $(ESI_TESTS)
+
+ ## Sort by alpha - any build failures are significant.
+ check_PROGRAMS += debug \
+@@ -125,19 +124,19 @@ VirtualDeleteOperator_SOURCES = VirtualDeleteOperator.cc $(DEBUG_SOURCE)
+ ##$(TARGLIB): $(LIBOBJS)
+ ## $(AR_R) $(TARGLIB) $(LIBOBJS)
+
+-squid-conf-tests: $(top_builddir)/src/squid.conf.default $(srcdir)/squidconf/*
++squid-conf-tests: $(sysconfdir)/squid.conf.default squidconf/*
+ @failed=0; cfglist="$?"; rm -f $@ || $(TRUE); \
+ for cfg in $$cfglist ; do \
+- $(top_builddir)/src/squid -k parse -f $$cfg || \
++ squid -k parse -f $$cfg || \
+ { echo "FAIL: squid.conf test: $$cfg" | \
+- sed s%$(top_builddir)/src/%% | \
+- sed s%$(srcdir)/squidconf/%% ; \
++ sed s%$(sysconfdir)/%% | \
++ sed s%squidconf/%% ; \
+ failed=1; break; \
+ }; \
+ if test "$$failed" -eq 0; then \
+ echo "PASS: squid.conf test: $$cfg" | \
+- sed s%$(top_builddir)/src/%% | \
+- sed s%$(srcdir)/squidconf/%% ; \
++ sed s%$(sysconfdir)/%% | \
++ sed s%squidconf/%% ; \
+ else break; fi; \
+ done; \
+ if test "$$failed" -eq 0; then cp $(TRUE) $@ ; fi
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch
new file mode 100644
index 000000000..9c75f17e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/squid-use-serial-tests-config-needed-by-ptest.patch
@@ -0,0 +1,29 @@
+From 9bcec221a2bb438d8a9ed59aed846ffe3be9cffa Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 19 Jul 2016 01:56:23 -0400
+Subject: [PATCH] squid: use serial-tests config needed by ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Upstream-Status: Inappropriate [default automake behavior incompatible with ptest]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3827222..504a844 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -10,7 +10,7 @@ AC_PREREQ(2.61)
+ AC_CONFIG_HEADERS([include/autoconf.h])
+ AC_CONFIG_AUX_DIR(cfgaux)
+ AC_CONFIG_SRCDIR([src/main.cc])
+-AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects])
++AM_INIT_AUTOMAKE([tar-ustar nostdinc subdir-objects serial-tests])
+ AC_REVISION($Revision$)dnl
+ AC_PREFIX_DEFAULT(/usr/local/squid)
+ AM_MAINTAINER_MODE
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid b/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid
new file mode 100644
index 000000000..83e1f8b7a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/files/volatiles.03_squid
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d squid squid 0755 /var/run/squid none
+d squid squid 0750 /var/log/squid none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb b/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb
new file mode 100644
index 000000000..3ee96abb7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/squid/squid_3.5.26.bb
@@ -0,0 +1,114 @@
+SUMMARY = "A fully-featured http proxy and web-cache daemon for Linux"
+DESCRIPTION = "A fully-featured http proxy and web-cache daemon for Linux. \
+Squid offers a rich access control, authorization and logging environment to \
+develop web proxy and content serving applications. \
+Squid offers a rich set of traffic optimization options, most of which are \
+enabled by default for simpler installation and high performance. \
+"
+HOMEPAGE = "http://www.squid-cache.org"
+SECTION = "web"
+LICENSE = "GPLv2+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
+MIN_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://www.squid-cache.org/Versions/v${MAJ_VER}/${MIN_VER}/${BPN}-${PV}.tar.bz2 \
+ file://Set-up-for-cross-compilation.patch \
+ file://Skip-AC_RUN_IFELSE-tests.patch \
+ file://Fix-flawed-dynamic-ldb-link-test-in-configure.patch \
+ file://squid-use-serial-tests-config-needed-by-ptest.patch \
+ file://run-ptest \
+ file://volatiles.03_squid \
+ file://set_sysroot_patch.patch \
+ file://squid-don-t-do-squid-conf-tests-at-build-time.patch \
+ file://0001-SquidNew-use-noexcept-instead-of-throw-for-C-11-comp.patch \
+ file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
+ file://gcc7-fixes.patch \
+ file://0001-tools.cc-fixed-unused-result-warning.patch \
+ "
+
+SRC_URI_remove_toolchain-clang = "file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch"
+
+SRC_URI[md5sum] = "dc1830cd361e077814aa39bcc3691d8b"
+SRC_URI[sha256sum] = "41d8845863dcd026c856508cd1599d417c8947ffd96e86e24085f9893cb8b8c2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c492e2d6d32ec5c1aad0e0609a141ce9 \
+ file://errors/COPYRIGHT;md5=8861130fae91400bcf99b66f133172b3 \
+ "
+DEPENDS = "libtool krb5 openldap db cyrus-sasl openssl expat libxml2"
+
+inherit autotools pkgconfig useradd ptest perlnative
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir /var/run/squid --shell /bin/false --user-group squid"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('TARGET_ARCH', 'powerpc', 'noatomics', '', d)} \
+ ${@bb.utils.contains('TARGET_ARCH', 'mips', 'noatomics', '', d)} \
+ ${@bb.utils.contains('TARGET_ARCH', 'mipsel', 'noatomics', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+ "
+PACKAGECONFIG[libnetfilter-conntrack] = "--with-netfilter-conntrack=${includedir}, --without-netfilter-conntrack, libnetfilter-conntrack"
+PACKAGECONFIG[noatomics] = "squid_cv_gnu_atomics=no,squid_cv_gnu_atomics=yes,,"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+BASIC_AUTH = "DB SASL LDAP"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+BASIC_AUTH += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'PAM', '', d)}"
+
+EXTRA_OECONF += "--with-default-user=squid --enable-auth-basic='${BASIC_AUTH}' \
+ --sysconfdir=${sysconfdir}/${BPN} \
+ --with-logdir=${localstatedir}/log/${BPN} \
+ 'PERL=${USRBINPATH}/env perl'"
+
+export BUILDCXXFLAGS="${BUILD_CXXFLAGS}"
+
+TESTDIR = "test-suite"
+
+do_configure_prepend() {
+ export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+do_compile_ptest() {
+ oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+ cp -rf ${B}/${TESTDIR} ${D}${PTEST_PATH}
+ cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}
+
+ # do NOT need to rebuild Makefile itself
+ sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # Add squid-conf-tests for runtime tests
+ sed -e 's/^\(runtest-TESTS:\)/\1 squid-conf-tests/' \
+ -e "s/\(list=' \$(TESTS)\)/\1 squid-conf-tests/" \
+ -i ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+
+ # Ensure the path for command true is correct
+ sed -i 's:^TRUE = .*$:TRUE = /bin/true:' ${D}${PTEST_PATH}/${TESTDIR}/Makefile
+}
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/run/${BPN} 0755 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ echo "d ${localstatedir}/log/${BPN} 0750 squid squid -" >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/volatiles.03_squid ${D}${sysconfdir}/default/volatiles/03_squid
+
+ rmdir "${D}${localstatedir}/run/${BPN}"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/run"
+
+ rmdir "${D}${localstatedir}/log/${BPN}"
+ rmdir --ignore-fail-on-non-empty "${D}${localstatedir}/log"
+}
+
+FILES_${PN} += "${libdir} ${datadir}/errors ${datadir}/icons"
+FILES_${PN}-dbg += "/usr/src/debug"
+FILES_${PN}-doc += "${datadir}/*.txt"
+
+RDEPENDS_${PN} += "perl"
+RDEPENDS_${PN}-ptest += "make"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
new file mode 100644
index 000000000..cead977e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/0001-__progname-is-provided-by-libc.patch
@@ -0,0 +1,62 @@
+From 941038fc05be21202cab7a7a9434097fb55ecbe0 Mon Sep 17 00:00:00 2001
+From: Thorsten Glaser <tg@mirbsd.de>
+Date: Thu, 31 Jul 2014 16:29:41 +0930
+Subject: [PATCH] __progname[] is provided by libc
+
+Rename local variable to tftpd_progname to avoid a clash with glibc
+global symbols and work around Debian bug #519006 (Closes: #564052).
+
+[ hpa: specifically, double-underscore symbols in C are reserved for
+ the implementation, i.e. compiler/libc. ]
+
+Signed-off-by: Ron Lee <ron@debian.org>
+Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
+---
+ tftpd/tftpd.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
+index e247b97..5fec7bf 100644
+--- a/tftpd/tftpd.c
++++ b/tftpd/tftpd.c
+@@ -76,7 +76,7 @@ static int ai_fam = AF_INET;
+ #define TRIES 6 /* Number of attempts to send each packet */
+ #define TIMEOUT_LIMIT ((1 << TRIES)-1)
+
+-const char *__progname;
++const char *tftpd_progname;
+ static int peer;
+ static unsigned long timeout = TIMEOUT; /* Current timeout value */
+ static unsigned long rexmtval = TIMEOUT; /* Basic timeout value */
+@@ -395,9 +395,9 @@ int main(int argc, char **argv)
+ /* basename() is way too much of a pain from a portability standpoint */
+
+ p = strrchr(argv[0], '/');
+- __progname = (p && p[1]) ? p + 1 : argv[0];
++ tftpd_progname = (p && p[1]) ? p + 1 : argv[0];
+
+- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
++ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+
+ srand(time(NULL) ^ getpid());
+
+@@ -946,14 +946,14 @@ int main(int argc, char **argv)
+ syslog daemon gets restarted by the time we get here. */
+ if (secure && standalone) {
+ closelog();
+- openlog(__progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
++ openlog(tftpd_progname, LOG_PID | LOG_NDELAY, LOG_DAEMON);
+ }
+
+ #ifdef HAVE_TCPWRAPPERS
+ /* Verify if this was a legal request for us. This has to be
+ done before the chroot, while /etc is still accessible. */
+ request_init(&wrap_request,
+- RQ_DAEMON, __progname,
++ RQ_DAEMON, tftpd_progname,
+ RQ_FILE, fd,
+ RQ_CLIENT_SIN, &from, RQ_SERVER_SIN, &myaddr, 0);
+ sock_methods(&wrap_request);
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch
@@ -0,0 +1,81 @@
+From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Thu, 22 Aug 2013 08:56:09 +0800
+Subject: [PATCH] tftp-hpa: add error check for disk filled up
+
+Upstream-status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html]
+
+Add error check when the write-buffer is finally flushed to the file,
+the caller can detect if the disk filled up (or had an i/o error) and
+return a NOSAPCE nak to the other side.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ common/tftpsubs.c | 8 +++++---
+ tftpd/tftpd.c | 12 ++++++++++--
+ 2 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index 8c999f6..b4d4ffe 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert)
+
+ p = buf;
+ ct = count;
++ count = 0;
+ while (ct--) { /* loop over the buffer */
+ c = *p++; /* pick up a character */
+ if (prevchar == '\r') { /* if prev char was cr */
+ if (c == '\n') /* if have cr,lf then just */
+- fseek(file, -1, 1); /* smash lf on top of the cr */
++ count = count - 1;
+ else if (c == '\0') /* if have cr,nul then */
+ goto skipit; /* just skip over the putc */
+ /* else just fall through and allow it */
+ }
+- putc(c, file);
++ buf[count] = c;
++ count ++;
+ skipit:
+ prevchar = c;
+ }
+- return count;
++ return write(fileno(file), buf, count);
+ }
+
+ /* When an error has occurred, it is possible that the two sides
+diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c
+index 1873e70..c2adbda 100644
+--- a/tftpd/tftpd.c
++++ b/tftpd/tftpd.c
+@@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
+ syslog(LOG_WARNING, "tftpd: write(ack): %m");
+ goto abort;
+ }
+- write_behind(file, pf->f_convert);
++ if(write_behind(file, pf->f_convert) < 0) {
++ nak(ENOSPACE, NULL);
++ (void)fclose(file);
++ goto abort;
++ }
+ for (;;) {
+ n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout);
+ if (n < 0) { /* really? */
+@@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac
+ goto abort;
+ }
+ } while (size == segsize);
+- write_behind(file, pf->f_convert);
++ if(write_behind(file, pf->f_convert) < 0) {
++ nak(ENOSPACE, NULL);
++ (void)fclose(file);
++ goto abort;
++ }
+ (void)fclose(file); /* close data file */
+
+ ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default
new file mode 100644
index 000000000..1dce7fdfe
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/default
@@ -0,0 +1,3 @@
+#Defaults for tftpd-hpa
+RUN_DAEMON="yes"
+OPTIONS="-l -s /var/lib/tftpboot"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
new file mode 100644
index 000000000..452aa05f8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/fix-writing-emtpy-file.patch
@@ -0,0 +1,39 @@
+[PATCH] fix the empty file writting
+
+Upstream-Status: pending
+
+With the feature that checking the disk filled up, the return
+value of function write_behind was checked and used to detect
+the disk status. While for empty file, without data being
+written, this function will return -1 thus the disk filled up
+error was miss-raised.
+
+make write_behind to return 0 if written file is empty, to fix
+the this bug.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ common/tftpsubs.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index b4ea3f2..9f6cafc 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -198,9 +198,12 @@ int write_behind(FILE * file, int convert)
+ nextone = !nextone; /* incr for next time */
+ buf = dp->th_data;
+
+- if (count <= 0)
++ if (count < 0)
+ return -1; /* nak logic? */
+
++ if (count == 0)
++ return 0;
++
+ if (convert == 0)
+ return write(fileno(file), buf, count);
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init
new file mode 100644
index 000000000..9e1843635
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/init
@@ -0,0 +1,105 @@
+#! /bin/sh
+#
+# Author: Jaakko Niemi <liiwi@iki.fi>
+# Modified from skeleton file in sarge
+
+### BEGIN INIT INFO
+# Provides: tftp-hpa
+# Required-Start: $local_fs $remote_fs $syslog $network
+# Required-Stop: $local_fs $remote_fs $syslog $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 1
+# Short-Description: HPA's tftp client
+# Description: tftp server to allow booting clients which support
+# the PXE protocol.
+### END INIT INFO
+
+set -e
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="HPA's tftpd"
+NAME=in.tftpd-hpa
+SCRIPTNAME=/etc/init.d/tftpd-hpa
+
+# Read config file if it is present.
+if [ -r /etc/default/tftpd-hpa ]
+then
+ . /etc/default/tftpd-hpa
+fi
+
+DAEMON=/usr/sbin/$NAME
+PIDFILE=/var/run/$NAME.pid
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+if [ "$RUN_DAEMON" != "yes" ] ; then
+ echo "tftpd-hpa disabled in /etc/default/tftpd-hpa"
+ exit 0
+fi
+
+#
+# Function that starts the daemon/service.
+#
+d_start() {
+ start-stop-daemon --start --quiet --exec $DAEMON -- $OPTIONS
+}
+
+#
+# Function that stops the daemon/service.
+#
+d_stop() {
+ start-stop-daemon --stop --quiet --name $NAME
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service.
+#
+d_reload() {
+ start-stop-daemon --stop --quiet --name $NAME --signal 1
+}
+
+case "$1" in
+ start)
+ echo "Starting $DESC: $NAME"
+ d_start
+ echo "."
+ ;;
+ stop)
+ echo "Stopping $DESC: $NAME"
+ d_stop
+ echo "."
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its configuration without
+ # restarting (for example, when it is sent a SIGHUP),
+ # then implement that here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this an "exit 0".
+ #
+ # echo -n "Reloading $DESC configuration..."
+ # d_reload
+ # echo "done."
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo "Restarting $DESC: $NAME"
+ d_stop
+ sleep 1
+ d_start
+ echo "."
+ ;;
+ *)
+ # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
new file mode 100644
index 000000000..3f690609a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch
@@ -0,0 +1,25 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/remap.c.zero tftp-hpa-0.49/tftpd/remap.c
+--- tftp-hpa-0.49/tftpd/remap.c.zero 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftpd/remap.c 2008-11-25 11:41:09.000000000 -0500
+@@ -286,6 +286,7 @@ struct rule *parserulefile(FILE * f)
+ int lineno = 0;
+ int err = 0;
+
++ memset(this_rule, '\0', sizeof(struct rule));
+ while (lineno++, fgets(line, MAXLINE, f)) {
+ rv = parseline(line, this_rule, lineno);
+ if (rv < 0)
+@@ -294,6 +295,7 @@ struct rule *parserulefile(FILE * f)
+ *last_rule = this_rule;
+ last_rule = &this_rule->next;
+ this_rule = tfmalloc(sizeof(struct rule));
++ memset(this_rule, '\0', sizeof(struct rule));
+ }
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
new file mode 100644
index 000000000..98a86b78b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch
@@ -0,0 +1,60 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd
+--- tftp-hpa-0.48/tftp-xinetd.tftpboot 2007-01-31 00:51:05.000000000 +0100
++++ tftp-hpa-0.48/tftp-xinetd 2008-05-20 12:05:53.000000000 +0200
+@@ -10,7 +10,7 @@ service tftp
+ wait = yes
+ user = root
+ server = /usr/sbin/in.tftpd
+- server_args = -s /tftpboot
++ server_args = -s /var/lib/tftpboot
+ disable = yes
+ per_source = 11
+ cps = 100 2
+diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security
+--- tftp-hpa-0.48/README.security.tftpboot 2008-05-29 17:36:32.000000000 +0200
++++ tftp-hpa-0.48/README.security 2008-05-29 17:37:21.000000000 +0200
+@@ -17,10 +17,10 @@ probably the following:
+
+ 1. Create a separate "tftpd" user and group only used for tftpd;
+ 2. Have all your boot files in a single directory tree (usually called
+- /tftpboot).
+-3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if
++ /var/lib/tftpboot).
++3. Specify "-p -u tftpd -s /var/lib/tftpboot" on the tftpd command line; if
+ you want clients to be able to create files use
+- "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever
++ "-p -c -U 002 -u tftpd -s /var/lib/tftpboot" (replace 002 with whatever
+ umask is appropriate for your setup.)
+
+ =======================================
+@@ -40,12 +40,12 @@ directly. Thus, if your /etc/inetd.conf
+ line):
+
+ tftp dgram udp wait root /usr/sbin/tcpd
+-/usr/sbin/in.tftpd -s /tftpboot -r blksize
++/usr/sbin/in.tftpd -s /var/lib/tftpboot -r blksize
+
+ ... it's better to change to ...
+
+ tftp dgram udp wait root /usr/sbin/in.tftpd
+-in.tftpd -s /tftpboot -r blksize
++in.tftpd -s /var/lib/tftpboot -r blksize
+
+ You should make sure that you are using "wait" option in tftpd; you
+ also need to have tftpd spawned as root in order for chroot (-s) to
+diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules
+--- tftp-hpa-0.48/tftpd/sample.rules.tftpboot 2008-05-29 17:38:46.000000000 +0200
++++ tftp-hpa-0.48/tftpd/sample.rules 2008-05-29 17:38:05.000000000 +0200
+@@ -30,5 +30,5 @@ rg \\ / # Convert backslashes to slash
+ rg \# @ # Convert hash marks to @ signs
+ rg /../ /..no../ # Convert /../ to /..no../
+ e ^ok/ # These are always ok
+-r ^[^/] /tftpboot/\0 # Convert non-absolute files
++r ^[^/] /var/lib/tftpboot/\0 # Convert non-absolute files
+ a \.pvt$ # Reject requests for private files
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
new file mode 100644
index 000000000..7ae1a8722
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch
@@ -0,0 +1,21 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c
+--- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes 2009-01-15 15:28:50.000000000 +0100
++++ tftp-hpa-0.49/tftpd/tftpd.c 2009-01-15 15:31:36.000000000 +0100
+@@ -932,7 +932,10 @@ int main(int argc, char **argv)
+ exit(EX_OSERR);
+ }
+ #ifdef __CYGWIN__
+- chdir("/"); /* Cygwin chroot() bug workaround */
++ if (chdir("/") < 0) { /* Cygwin chroot() bug workaround */
++ syslog(LOG_ERR, "chroot: %m");
++ exit(EX_OSERR);
++ }
+ #endif
+ }
+ #ifdef HAVE_SETREGID
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch
new file mode 100644
index 000000000..6b8ceaaeb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch
@@ -0,0 +1,165 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h
+--- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200
++++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200
+@@ -291,6 +291,7 @@ typedef int socklen_t;
+ /* Prototypes for libxtra functions */
+
+ void *xmalloc(size_t);
++void *xrealloc(void *, size_t);
+ char *xstrdup(const char *);
+
+ #ifndef HAVE_BSD_SIGNAL
+diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in
+--- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200
++++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200
+@@ -152,6 +152,7 @@ OBJROOT=`pwd`
+
+ XTRA=false
+ PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty)
++PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty)
+ PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty)
+ PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal)
+ PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long)
+diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c
+--- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200
++++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200
+@@ -0,0 +1,20 @@
++/*
++ * xrealloc.c
++ *
++ * Simple error-checking version of realloc()
++ *
++ */
++
++#include "config.h"
++
++void *xrealloc(void *ptr, size_t size)
++{
++ void *p = realloc(ptr, size);
++
++ if (!p) {
++ fprintf(stderr, "Out of memory!\n");
++ exit(128);
++ }
++
++ return p;
++}
+diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c
+--- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200
++++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200
+@@ -89,11 +89,14 @@ int connected;
+ const struct modes *mode;
+ #ifdef WITH_READLINE
+ char *line = NULL;
++char *remote_pth = NULL;
+ #else
+ char line[LBUFLEN];
++char remote_pth[LBUFLEN];
+ #endif
+ int margc;
+-char *margv[20];
++char **margv;
++int sizeof_margv=0;
+ const char *prompt = "tftp> ";
+ sigjmp_buf toplevel;
+ void intr(int);
+@@ -379,6 +382,10 @@ static void getmoreargs(const char *part
+ free(line);
+ line = NULL;
+ }
++ if (remote_pth) {
++ free(remote_pth);
++ remote_pth = NULL;
++ }
+ line = xmalloc(len + elen + 1);
+ strcpy(line, partial);
+ strcpy(line + len, eline);
+@@ -535,6 +542,7 @@ void put(int argc, char *argv[])
+ int fd;
+ int n, err;
+ char *cp, *targ;
++ long dirlen, namelen, lastlen=0;
+
+ if (argc < 2) {
+ getmoreargs("send ", "(file) ");
+@@ -588,9 +596,22 @@ void put(int argc, char *argv[])
+ }
+ /* this assumes the target is a directory */
+ /* on a remote unix system. hmmmm. */
+- cp = strchr(targ, '\0');
+- *cp++ = '/';
++ dirlen = strlen(targ)+1;
++#ifdef WITH_READLINE
++ remote_pth = xmalloc(dirlen+1);
++#endif
++ strcpy(remote_pth, targ);
++ remote_pth[dirlen-1] = '/';
++ cp = remote_pth + dirlen;
+ for (n = 1; n < argc - 1; n++) {
++#ifdef WITH_READLINE
++ namelen = strlen(tail(argv[n])) + 1;
++ if (namelen > lastlen) {
++ remote_pth = xrealloc(remote_pth, dirlen + namelen + 1);
++ cp = remote_pth + dirlen;
++ lastlen = namelen;
++ }
++#endif
+ strcpy(cp, tail(argv[n]));
+ fd = open(argv[n], O_RDONLY | mode->m_openflags);
+ if (fd < 0) {
+@@ -600,9 +621,9 @@ void put(int argc, char *argv[])
+ }
+ if (verbose)
+ printf("putting %s to %s:%s [%s]\n",
+- argv[n], hostname, targ, mode->m_mode);
++ argv[n], hostname, remote_pth, mode->m_mode);
+ sa_set_port(&peeraddr, port);
+- tftp_sendfile(fd, targ, mode->m_mode);
++ tftp_sendfile(fd, remote_pth, mode->m_mode);
+ }
+ }
+
+@@ -801,6 +822,10 @@ static void command(void)
+ free(line);
+ line = NULL;
+ }
++ if (remote_pth) {
++ free(remote_pth);
++ remote_pth = NULL;
++ }
+ line = readline(prompt);
+ if (!line)
+ exit(0); /* EOF */
+@@ -872,7 +897,13 @@ struct cmd *getcmd(char *name)
+ static void makeargv(void)
+ {
+ char *cp;
+- char **argp = margv;
++ char **argp;
++
++ if (!sizeof_margv) {
++ sizeof_margv = 20;
++ margv = xmalloc(sizeof_margv * sizeof(char *));
++ }
++ argp = margv;
+
+ margc = 0;
+ for (cp = line; *cp;) {
+@@ -882,6 +913,11 @@ static void makeargv(void)
+ break;
+ *argp++ = cp;
+ margc += 1;
++ if (margc == sizeof_margv) {
++ sizeof_margv += 20;
++ margv = xrealloc(margv, sizeof_margv * sizeof(char *));
++ argp = margv + margc;
++ }
+ while (*cp != '\0' && !isspace(*cp))
+ cp++;
+ if (*cp == '\0')
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
new file mode 100644
index 000000000..85110eb28
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch
@@ -0,0 +1,24 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c
+--- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500
+@@ -350,6 +350,14 @@ int main(int argc, char **argv)
+ const char *pidfile = NULL;
+ u_short tp_opcode;
+
++ time_t my_time = 0;
++ struct tm* p_tm;
++ char envtz[10];
++ my_time = time(NULL);
++ p_tm = localtime(&my_time);
++ snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600);
++ setenv("TZ", envtz, 0);
++
+ /* basename() is way too much of a pain from a portability standpoint */
+
+ p = strrchr(argv[0], '/');
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch
@@ -0,0 +1,32 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c
+--- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400
++++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400
+@@ -279,15 +279,16 @@
+ struct tftphdr *tp, const char *mode)
+ {
+ char *cp;
++ size_t len;
+
+ tp->th_opcode = htons((u_short) request);
+ cp = (char *)&(tp->th_stuff);
+- strcpy(cp, name);
+- cp += strlen(name);
+- *cp++ = '\0';
+- strcpy(cp, mode);
+- cp += strlen(mode);
+- *cp++ = '\0';
++ len = strlen(name) + 1;
++ memcpy(cp, name, len);
++ cp += len;
++ len = strlen(mode) + 1;
++ memcpy(cp, mode, len);
++ cp += len;
+ return (cp - (char *)tp);
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
new file mode 100644
index 000000000..720cd69de
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch
@@ -0,0 +1,20 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-0.49/tftp/tftp.c.stats tftp-hpa-0.49/tftp/tftp.c
+--- tftp-hpa-0.49/tftp/tftp.c.stats 2011-01-03 15:38:34.217918067 +0100
++++ tftp-hpa-0.49/tftp/tftp.c 2011-01-03 15:38:37.498917014 +0100
+@@ -400,8 +400,8 @@ static void printstats(const char *direc
+ {
+ double delta;
+
+- delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) -
+- (tstart.tv_sec + (tstart.tv_usec / 100000.0));
++ delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) -
++ (tstart.tv_sec + (tstart.tv_usec / 1000000.0));
+ if (verbose) {
+ printf("%s %lu bytes in %.1f seconds", direction, amount, delta);
+ printf(" [%.0f bit/s]", (amount * 8.) / delta);
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
new file mode 100644
index 000000000..216349d26
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch
@@ -0,0 +1,29 @@
+Patch originally from Fedora
+
+http://pkgs.fedoraproject.org/cgit/tftp.git/
+
+Upstream-Status: Pending
+
+diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c
+--- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100
++++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100
+@@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un
+
+ /* Try to enable getting the return address */
+ #ifdef IP_RECVDSTADDR
+- if (from->sa_family == AF_INET)
++ if (from->sa_family == AF_INET || !from->sa_family)
+ setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on));
+ #endif
+ #ifdef IP_PKTINFO
+- if (from->sa_family == AF_INET)
++ if (from->sa_family == AF_INET || !from->sa_family)
+ setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on));
+ #endif
+ #ifdef HAVE_IPV6
+ #ifdef IPV6_RECVPKTINFO
+- if (from->sa_family == AF_INET6)
++ if (from->sa_family == AF_INET6 || !from->sa_family)
+ setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on));
+ #endif
+ #endif
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-bug-fix-on-separated-CR-and-LF.patch
@@ -0,0 +1,38 @@
+From 6ed1eb8829dee351b54e183bc42c007cb306aaa5 Mon Sep 17 00:00:00 2001
+From: Zhang Xiao <xiao.zhang@windriver.com>
+Date: Wed, 11 Jun 2014 14:01:16 +0800
+Subject: [PATCH] tftp-hpa: bug fix on separated CR and LF
+
+In ascii mode, if the CR and LF was separated into different transfer
+blocks, LF will be just dropped instead of replacing the previous CR.
+Add a checking on the first character to fix it.
+
+Upstream-Status: pending
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+ common/tftpsubs.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/common/tftpsubs.c b/common/tftpsubs.c
+index b4d4ffe..b4ea3f2 100644
+--- a/common/tftpsubs.c
++++ b/common/tftpsubs.c
+@@ -207,6 +207,14 @@ int write_behind(FILE * file, int convert)
+ p = buf;
+ ct = count;
+ count = 0;
++
++ /* Check the first character together with prevchar */
++ c = *p;
++ if ((prevchar == '\r') && (c == '\n')) {
++ lseek(fileno(file), -1, SEEK_CUR);
++ count++;
++ }
++
+ while (ct--) { /* loop over the buffer */
+ c = *p++; /* pick up a character */
+ if (prevchar == '\r') { /* if prev char was cr */
+--
+1.8.5.2.233.g932f7e4
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
new file mode 100644
index 000000000..fe7016396
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd
@@ -0,0 +1,18 @@
+# default: off
+# description: The tftp server serves files using the trivial file transfer \
+# protocol. The tftp protocol is often used to boot diskless \
+# workstations, download configuration files to network-aware printers, \
+# and to start the installation process for some operating systems.
+service tftp
+{
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = root
+ server = /usr/sbin/in.tftpd-hpa
+ server_args = -s /var/lib/tftpboot
+ disable = yes
+ per_source = 11
+ cps = 100 2
+ flags = IPv6
+}
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service
new file mode 100644
index 000000000..97d56586b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Tftp Server
+Requires=tftpd-hpa.socket
+
+[Service]
+ExecStart=@SBINDIR@/in.tftpd-hpa -s /var/lib/tftpboot
+StandardInput=socket
+
+[Install]
+Also=tftpd-hpa.socket
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket
new file mode 100644
index 000000000..8764c1de3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=Tftp Server Activation Socket
+
+[Socket]
+ListenDatagram=69
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
new file mode 100644
index 000000000..132972b33
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb
@@ -0,0 +1,91 @@
+SUMMARY = "Client for the Trivial File Transfer Protocol"
+DESCRIPTION = \
+"The Trivial File Transfer Protocol (TFTP) is normally used only for \
+booting diskless workstations. The tftp package provides the user \
+interface for TFTP, which allows users to transfer files to and from a \
+remote machine. This program and TFTP provide very little security, \
+and should not be enabled unless it is expressly needed."
+DEPENDS = "tcp-wrappers readline"
+SECTION = "net"
+HOMEPAGE = "http://freecode.com/projects/tftp-hpa"
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \
+ file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4"
+
+
+SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \
+ file://tftp-0.40-remap.patch \
+ file://tftp-0.42-tftpboot.patch \
+ file://tftp-0.49-chk_retcodes.patch \
+ file://tftp-0.49-cmd_arg.patch \
+ file://tftp-hpa-0.39-tzfix.patch \
+ file://tftp-hpa-0.49-fortify-strcpy-crash.patch \
+ file://tftp-hpa-0.49-stats.patch \
+ file://tftp-hpa-5.2-pktinfo.patch \
+ file://default \
+ file://init \
+ file://add-error-check-for-disk-filled-up.patch \
+ file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \
+ file://fix-writing-emtpy-file.patch \
+ file://0001-__progname-is-provided-by-libc.patch \
+ file://tftpd-hpa.socket \
+ file://tftpd-hpa.service \
+"
+
+SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21"
+SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269"
+
+inherit autotools-brokensep update-rc.d update-alternatives systemd
+
+export AR = "${HOST_PREFIX}ar cq"
+
+EXTRA_OECONF += "--disable-option-checking"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# configure.in has errors
+do_configure() {
+ oe_runconf
+}
+
+do_install() {
+ oe_runmake install INSTALLROOT=${D}
+ mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa
+ mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa
+
+ install -m 755 -d ${D}${localstatedir}/lib/tftpboot/
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service
+}
+
+FILES_${PN} = "${bindir}"
+
+PACKAGES += "tftp-hpa-server"
+SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol"
+FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}"
+CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa"
+
+INITSCRIPT_PACKAGES = "tftp-hpa-server"
+INITSCRIPT_NAME = "tftpd-hpa"
+INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ."
+
+ALTERNATIVE_${PN} = "tftp"
+ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa"
+ALTERNATIVE_PRIORITY = "60"
+
+SYSTEMD_PACKAGES = "tftp-hpa-server"
+SYSTEMD_SERVICE_tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service"
+SYSTEMD_AUTO_ENABLE_tftp-hpa-server = "enable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch
new file mode 100644
index 000000000..d2eb15614
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/cross.patch
@@ -0,0 +1,16 @@
+Remove CC and CFLAGS values, we set these ourselves
+
+Upstream-Status: Inappropriate [config]
+
+diff -urN vblade-19.old//makefile vblade-19//makefile
+--- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100
++++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000
+@@ -9,8 +9,6 @@
+ mandir = ${sharedir}/man
+
+ O=aoe.o bpf.o ${PLATFORM}.o ata.o
+-CFLAGS += -Wall -g -O2
+-CC = gcc
+
+ vblade: $O
+ ${CC} -o vblade $O
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch
new file mode 100644
index 000000000..a74452db6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/makefile b/makefile
+index 98008da..c328ba7 100644
+--- a/makefile
++++ b/makefile
+@@ -11,7 +11,7 @@ mandir = ${sharedir}/man
+ O=aoe.o bpf.o ${PLATFORM}.o ata.o
+
+ vblade: $O
+- ${CC} -o vblade $O
++ ${CC} ${LDFLAGS} -o vblade $O
+
+ aoe.o : aoe.c config.h dat.h fns.h makefile
+ ${CC} ${CFLAGS} -c $<
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf
new file mode 100644
index 000000000..e8b93ec37
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.conf
@@ -0,0 +1,2 @@
+# network_device shelf slot file/disk/partition mac[,mac[,mac]]
+#eth0 0 0 /dev/sdb 00:11:22:33:44:55
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init
new file mode 100644
index 000000000..0298c8001
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.init
@@ -0,0 +1,193 @@
+#!/bin/sh
+#
+# Init script for vblade (ATA over Ethernet daemon)
+#
+# chkconfig: - 30 70
+# description: vblade AoE daemon
+#
+# processname: vblade
+# config: /etc/vblade.conf
+#
+# Shamelessly hacked together from other init scripts (sshd, mostly)
+# integrate vblade.init from Fedora's vblade-14-6.fc12.src.rpm
+#
+
+RETVAL=0
+prog=vblade
+
+spawn_vblade() {
+ ALLOWMACS=""
+ [ -n "$5" ] && ALLOWMACS="-m $5"
+ ID="$1-e$2.$3"
+ if [ ! -d "/var/run/$prog" ]; then
+ mkdir /var/run/$prog
+ fi
+ PID_FILE=/var/run/$prog/${ID}.pid
+ $prog $ALLOWMACS $2 $3 $1 $4 >> /var/log/$prog.log 2>&1 &
+ pid=$!
+ RETVAL=$?
+ echo $pid > $PID_FILE
+ echo -n $"$4 (e$2.$3@$1) [pid $pid]"
+ [ "$RETVAL" = 0 ] && echo "success" || echo "failure"
+ echo
+}
+
+start() {
+ local ret
+
+ echo $"Starting up $prog: "
+
+ #/var/lock/subsys/$prog exists?
+ status $prog 2>&1 > /dev/null
+ ret=$?
+
+ if [ "$ret" = "2" ]; then
+ echo "$prog dead but subsys locked"
+ echo
+ return 2
+ else
+ if [ "$ret" = "0" ]; then
+ #is running
+ echo "already running"
+ return 0
+ fi
+ fi
+
+ if [ 0 -ne `grep -vc '^#\|^$' /etc/$prog.conf` ]
+ then
+ grep -v '^#' /etc/$prog.conf | sed -e 's/ / /g' -e 's/ / /g' | while read line
+ do
+ spawn_vblade $line
+ done
+ touch /var/lock/subsys/$prog
+ else
+ echo -n "empty $prog.conf?"
+ echo " passed"
+ echo
+ fi
+}
+
+stop() {
+ echo -n $"Shutting down $prog: "
+ for pidfile in `ls /var/run/$prog/*.pid 2>/dev/null`
+ do
+ kill -TERM `cat $pidfile`
+ rm -f $pidfile
+ done
+ echo "success"
+ echo
+ rm -f /var/lock/subsys/$prog
+}
+
+__pids_var_run() {
+ local base=${1##*/}
+ local pid_file=${2:-/var/run/$base.pid}
+
+ pid=
+ if [ -f "$pid_file" ] ; then
+ local line p
+
+ while : ; do
+ read line
+ [ -z "$line" ] && break
+ for p in $line ; do
+ [ -z "${p//[0-9]/}" -a -d "/proc/$p" ] && pid="$pid $p"
+ done
+ done < "$pid_file"
+
+ if [ -n "$pid" ]; then
+ return 0
+ fi
+ return 1 # "Program is dead and /var/run pid file exists"
+ fi
+ return 3 # "Program is not running"
+}
+
+__pids_pidof() {
+ pidof "$1" || pidof "${1##*/}"
+}
+
+status() {
+ local base pid lock_file= pid_file=
+
+ # Test syntax.
+ if [ "$#" = 0 ] ; then
+ echo $"Usage: status [-p pidfile] {program}"
+ return 1
+ fi
+ if [ "$1" = "-p" ]; then
+ pid_file=$2
+ shift 2
+ fi
+ if [ "$1" = "-l" ]; then
+ lock_file=$2
+ shift 2
+ fi
+ base=${1##*/}
+
+ # First try "pidof"
+ __pids_var_run "$1" "$pid_file"
+ RC=$?
+ if [ -z "$pid_file" -a -z "$pid" ]; then
+ pid="$(__pids_pidof "$1")"
+ fi
+ if [ -n "$pid" ]; then
+ echo $"${base} (pid $pid) is running..."
+ return 0
+ fi
+
+ case "$RC" in
+ 0)
+ echo $"${base} (pid $pid) is running..."
+ return 0
+ ;;
+ 1)
+ echo $"${base} dead but pid file exists"
+ return 1
+ ;;
+ esac
+ if [ -z "${lock_file}" ]; then
+ lock_file=${base}
+ fi
+ # See if /var/lock/subsys/${lock_file} exists
+ if [ -f /var/lock/subsys/${lock_file} ]; then
+ echo $"${base} dead but subsys locked"
+ return 2
+ fi
+ echo $"${base} is stopped"
+ return 3
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ reload)
+ # yes, this sucks, but the vblade processes die on SIGHUP
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$prog ]; then
+ stop
+ # avoid race
+ sleep 3
+ start
+ fi
+ ;;
+ status)
+ status $prog
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+ RETVAL=1
+esac
+exit $RETVAL
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service
new file mode 100644
index 000000000..83a4d5dcb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/vblade.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Virtual EtherDrive blade AoE target
+After=syslog.target network.target
+
+[Service]
+Type=forking
+ExecStart=@BINDIR@/vblade.init start
+ExecStop=@BINDIR@/vblade.init stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade
new file mode 100644
index 000000000..64a5881c0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/files/volatiles.99_vblade
@@ -0,0 +1 @@
+d root root 0755 /var/run/vblade none
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb b/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb
new file mode 100644
index 000000000..d7b1dfaad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vblade/vblade_22.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Virtual EtherDrive blade AoE target"
+SECTION = "admin"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/aoetools/${BP}.tar.gz \
+ file://cross.patch \
+ file://makefile-add-ldflags.patch \
+ file://${BPN}.conf \
+ file://${BPN}.init \
+ file://${BPN}.service \
+ file://volatiles.99_vblade \
+ "
+
+SRC_URI[md5sum] = "510d98ba0f231284a5fbe2da11cb2d6e"
+SRC_URI[sha256sum] = "a990378f273f10eb431e42954a871aed52714035bbab28c54cef600c458356bb"
+
+inherit autotools-brokensep update-rc.d systemd
+
+do_install() {
+ install -D -m 0755 ${S}/vblade ${D}/${sbindir}/vblade
+ install -D -m 0755 ${S}/vbladed ${D}/${sbindir}/vbladed
+ install -D -m 0644 ${S}/vblade.8 ${D}/${mandir}/man8/vblade.8
+
+ install -D -m 0644 ${WORKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN}.conf
+ install -D -m 0755 ${WORKDIR}/${BPN}.init ${D}/${sysconfdir}/init.d/${BPN}
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ install -d ${D}/${sysconfdir}/default/volatiles
+ install -m 0755 ${WORKDIR}/volatiles.99_vblade ${D}/${sysconfdir}/default/volatiles/99_vblade
+ fi
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}/${bindir}
+ install -m 0755 ${WORKDIR}/${BPN}.init ${D}/${bindir}/
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/run/${BPN} 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/vblade.service ${D}${systemd_system_unitdir}
+ sed -e 's,@BINDIR@,${bindir},g' -i ${D}${systemd_system_unitdir}/*.service
+ fi
+
+}
+
+INITSCRIPT_NAME = "vblade"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "vblade.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch
new file mode 100644
index 000000000..b69de1d1c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch
@@ -0,0 +1,62 @@
+From ce2be5d4967445828d5ae9d9462cfaa78ae03c73 Mon Sep 17 00:00:00 2001
+From: Ming Liu <ming.liu@windriver.com>
+Date: Wed, 18 Sep 2013 09:44:20 +0800
+Subject: [PATCH] vsftpd: change default value of secure_chroot_dir
+
+Upstream-Status: Pending
+
+Change secure_chroot_dir pointing to a volatile directory.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+---
+ INSTALL | 6 +++---
+ tunables.c | 2 +-
+ vsftpd.conf.5 | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/INSTALL b/INSTALL
+index 4f811aa..427122a 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -27,11 +27,11 @@ user in case it does not already exist. e.g.:
+ [root@localhost root]# useradd nobody
+ useradd: user nobody exists
+
+-2b) vsftpd needs the (empty) directory /usr/share/empty in the default
++2b) vsftpd needs the (empty) directory /var/run/vsftpd/empty in the default
+ configuration. Add this directory in case it does not already exist. e.g.:
+
+-[root@localhost root]# mkdir /usr/share/empty/
+-mkdir: cannot create directory `/usr/share/empty': File exists
++[root@localhost root]# mkdir /var/run/vsftpd/empty/
++mkdir: cannot create directory `/var/run/vsftpd/empty': File exists
+
+ 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a
+ valid home directory (which is NOT owned or writable by the user "ftp").
+diff --git a/tunables.c b/tunables.c
+index 284a10d..8c63c3f 100644
+--- a/tunables.c
++++ b/tunables.c
+@@ -254,7 +254,7 @@ tunables_load_defaults()
+ /* -rw------- */
+ tunable_chown_upload_mode = 0600;
+
+- install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir);
++ install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir);
+ install_str_setting("ftp", &tunable_ftp_username);
+ install_str_setting("root", &tunable_chown_username);
+ install_str_setting("/var/log/xferlog", &tunable_xferlog_file);
+diff --git a/vsftpd.conf.5 b/vsftpd.conf.5
+index fcc6022..e4ffdee 100644
+--- a/vsftpd.conf.5
++++ b/vsftpd.conf.5
+@@ -969,7 +969,7 @@ This option should be the name of a directory which is empty. Also, the
+ directory should not be writable by the ftp user. This directory is used
+ as a secure chroot() jail at times vsftpd does not require filesystem access.
+
+-Default: /usr/share/empty
++Default: /var/run/vsftpd/empty
+ .TP
+ .B ssl_ciphers
+ This option can be used to select which SSL ciphers vsftpd will allow for
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init
new file mode 100755
index 000000000..72adf0d9a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/init
@@ -0,0 +1,50 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: vsftpd
+# Default-Start: 2345
+# Default-Stop: 016
+# Short-Description: Very Secure Ftp Daemon
+# Description: vsftpd is a Very Secure FTP daemon. It was written completely from
+# scratch
+### END INIT INFO
+
+DAEMON=/usr/sbin/vsftpd
+NAME=vsftpd
+DESC="FTP Server"
+ARGS=""
+FTPDIR=/var/lib/ftp
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "* starting $DESC: $NAME... "
+ if ! test -d $FTPDIR; then
+ mkdir -p $FTPDIR/in
+ chown ftp $FTPDIR -R
+ chmod a-w $FTPDIR
+ chmod u+w $FTPDIR/in
+ fi
+ start-stop-daemon -S -b -x $DAEMON -- $ARGS
+ echo "done."
+ ;;
+ stop)
+ echo -n "* stopping $DESC: $NAME... "
+ start-stop-daemon -K -x $DAEMON
+ echo "done."
+ ;;
+ restart)
+ echo "* restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd
new file mode 100644
index 000000000..8a602ba37
--- /dev/null
+++ b/meta-openembedded/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-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf
new file mode 100644
index 000000000..bb1929480
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf
@@ -0,0 +1,139 @@
+# Example config file /etc/vsftpd.conf
+#
+# The default compiled in settings are fairly paranoid. This sample file
+# loosens things up a bit, to make the ftp daemon more usable.
+# Please see vsftpd.conf.5 for all compiled in defaults.
+#
+# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
+# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
+# capabilities.
+
+# run standalone
+listen=YES
+
+# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
+anonymous_enable=NO
+#
+# Uncomment this to allow local users to log in.
+local_enable=YES
+#
+# Uncomment this to enable any form of FTP write command.
+write_enable=YES
+#
+# Default umask for local users is 077. You may wish to change this to 022,
+# if your users expect that (022 is used by most other ftpd's)
+local_umask=022
+#
+# Uncomment this to allow the anonymous FTP user to upload files. This only
+# has an effect if the above global write enable is activated. Also, you will
+# obviously need to create a directory writable by the FTP user.
+#anon_upload_enable=YES
+#
+# Uncomment this if you want the anonymous FTP user to be able to create
+# new directories.
+#anon_mkdir_write_enable=YES
+#
+# Activate directory messages - messages given to remote users when they
+# go into a certain directory.
+dirmessage_enable=YES
+#
+# Activate logging of uploads/downloads.
+xferlog_enable=YES
+#
+# Make sure PORT transfer connections originate from port 20 (ftp-data).
+connect_from_port_20=YES
+#
+# If you want, you can arrange for uploaded anonymous files to be owned by
+# a different user. Note! Using "root" for uploaded files is not
+# recommended!
+#chown_uploads=YES
+#chown_username=whoever
+#
+# You may override where the log file goes if you like. The default is shown
+# below.
+#xferlog_file=/var/log/vsftpd.log
+#
+# If you want, you can have your log file in standard ftpd xferlog format
+xferlog_std_format=YES
+#
+# You may change the default value for timing out an idle session.
+#idle_session_timeout=600
+#
+# You may change the default value for timing out a data connection.
+#data_connection_timeout=120
+#
+# It is recommended that you define on your system a unique user which the
+# ftp server can use as a totally isolated and unprivileged user.
+#nopriv_user=ftp
+#
+# Enable this and the server will recognise asynchronous ABOR requests. Not
+# recommended for security (the code is non-trivial). Not enabling it,
+# however, may confuse older FTP clients.
+#async_abor_enable=YES
+#
+# By default the server will pretend to allow ASCII mode but in fact ignore
+# the request. Turn on the below options to have the server actually do ASCII
+# mangling on files when in ASCII mode.
+# Beware that turning on ascii_download_enable enables malicious remote parties
+# to consume your I/O resources, by issuing the command "SIZE /big/file" in
+# ASCII mode.
+# These ASCII options are split into upload and download because you may wish
+# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
+# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
+# on the client anyway..
+#ascii_upload_enable=YES
+#ascii_download_enable=YES
+#
+# You may fully customise the login banner string:
+#ftpd_banner=Welcome to blah FTP service.
+#
+# You may specify a file of disallowed anonymous e-mail addresses. Apparently
+# useful for combatting certain DoS attacks.
+#deny_email_enable=YES
+# (default follows)
+#banned_email_file=/etc/vsftpd.banned_emails
+#
+# You may specify an explicit list of local users to chroot() to their home
+# directory. If chroot_local_user is YES, then this list becomes a list of
+# users to NOT chroot().
+#chroot_list_enable=YES
+# (default follows)
+#chroot_list_file=/etc/vsftpd.chroot_list
+#
+# You may activate the "-R" option to the builtin ls. This is disabled by
+# default to avoid remote users being able to cause excessive I/O on large
+# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
+# the presence of the "-R" option, so there is a strong case for enabling it.
+#ls_recurse_enable=YES
+#
+# This string is the name of the PAM service vsftpd will use.
+pam_service_name=vsftpd
+#
+# This option is examined if userlist_enable is activated. If you set this
+# setting to NO, then users will be denied login unless they are explicitly
+# listed in the file specified by userlist_file. When login is denied, the
+# denial is issued before the user is asked for a password.
+userlist_deny=YES
+#
+# If enabled, vsftpd will load a list of usernames, from the filename given by
+# userlist_file. If a user tries to log in using a name in this file, they
+# will be denied before they are asked for a password. This may be useful in
+# preventing cleartext passwords being transmitted. See also userlist_deny.
+userlist_enable=YES
+#
+# If enabled, vsftpd will display directory listings with the time in your
+# local time zone. The default is to display GMT. The times returned by the
+# MDTM FTP command are also affected by this option.
+use_localtime=YES
+#
+# If set to YES, local users will be (by default) placed in a chroot() jail in
+# their home directory after login. Warning: This option has security
+# implications, especially if the users have upload permission, or shell access.
+# Only enable if you know what you are doing. Note that these security implications
+# are not vsftpd specific. They apply to all FTP daemons which offer to put
+# local users in chroot() jails.
+chroot_local_user=YES
+#
+allow_writeable_chroot=YES
+#
+tcp_wrappers=YES
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers
new file mode 100644
index 000000000..096142f5d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers
@@ -0,0 +1,15 @@
+# Users that are not allowed to login via ftp
+root
+bin
+daemon
+adm
+lp
+sync
+shutdown
+halt
+mail
+news
+uucp
+operator
+games
+nobody
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service
new file mode 100644
index 000000000..e27102026
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Vsftpd ftp daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/vsftpd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list
new file mode 100644
index 000000000..d283e3d26
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list
@@ -0,0 +1,20 @@
+# vsftpd userlist
+# If userlist_deny=NO, only allow users in this file
+# If userlist_deny=YES (default), never allow users in this file, and
+# do not even prompt for a password.
+# Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers
+# for users that are denied.
+root
+bin
+daemon
+adm
+lp
+sync
+shutdown
+halt
+mail
+news
+uucp
+operator
+games
+nobody
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
new file mode 100644
index 000000000..d81c94a4a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch
@@ -0,0 +1,26 @@
+From c5caf52b9ed79da8916ef5722efe6df61a856e2f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 20:09:12 -0700
+Subject: [PATCH] sysdeputil.c: Fix with musl which does not have utmpx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ sysdeputil.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/sysdeputil.c b/sysdeputil.c
+index 06f01f4..a8cff3b 100644
+--- a/sysdeputil.c
++++ b/sysdeputil.c
+@@ -58,7 +58,9 @@
+ #define VSF_SYSDEP_HAVE_SHADOW
+ #define VSF_SYSDEP_HAVE_USERSHELL
+ #define VSF_SYSDEP_HAVE_LIBCAP
+-#define VSF_SYSDEP_HAVE_UTMPX
++#if defined(__GLIBC__)
++ #define VSF_SYSDEP_HAVE_UTMPX
++#endif
+
+ #define __USE_GNU
+ #include <utmpx.h>
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch
new file mode 100644
index 000000000..c6c0f80a1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch
@@ -0,0 +1,43 @@
+From 9c4826c19f04da533886209361a2caddf582d65c Mon Sep 17 00:00:00 2001
+From: Mingli Yu <Mingli.Yu@windriver.com>
+Date: Tue, 6 Sep 2016 17:17:44 +0800
+Subject: [PATCH] vsftpd: allow sysinfo() in the seccomp sandbox
+
+Upstream-Status: Pending
+
+* Allow sysinfo() in the seccomp sandbox otherwise
+ comes below OOPS: priv_sock_get_cmd as the syscall
+ sysinfo() not allowed
+
+tnftp 192.168.1.1
+Connected to 192.168.1.1.
+220 (vsFTPd 3.0.3)
+Name (192.168.1.1:root): anonymous
+331 Please specify the password.
+Password:
+230 Login successful.
+Remote system type is UNIX.
+Using binary mode to transfer files.
+ftp> prompt
+Interactive mode off.
+ftp> mget small*
+OOPS: priv_sock_get_cmd
+
+Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
+
+---
+ seccompsandbox.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/seccompsandbox.c b/seccompsandbox.c
+index 2c350a9..67d9ca5 100644
+--- a/seccompsandbox.c
++++ b/seccompsandbox.c
+@@ -409,6 +409,7 @@ seccomp_sandbox_setup_postlogin(const struct vsf_session* p_sess)
+ allow_nr(__NR_getcwd);
+ allow_nr(__NR_chdir);
+ allow_nr(__NR_getdents);
++ allow_nr(__NR_sysinfo);
+ /* Misc */
+ allow_nr(__NR_umask);
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch
new file mode 100644
index 000000000..5ad5c14e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-destdir.patch
@@ -0,0 +1,52 @@
+From bab3f62f1fd5b7c2ab197f4311ad191bf18816b9 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Mon, 20 Feb 2012 13:51:49 +0000
+Subject: [PATCH] Use DESTDIR within install to allow installing under a prefix
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c63ed1b..9e4f35f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -29,21 +29,21 @@ vsftpd: $(OBJS)
+ $(CC) -o vsftpd $(OBJS) $(LINK) $(LDFLAGS) $(LIBS)
+
+ install:
+- if [ -x /usr/local/sbin ]; then \
+- $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \
++ if [ -x ${DESTDIR}/usr/local/sbin ]; then \
++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \
+ else \
+- $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi
+- if [ -x /usr/local/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \
+- elif [ -x /usr/share/man ]; then \
+- $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \
++ $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi
++ if [ -x ${DESTDIR}/usr/local/man ]; then \
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \
++ elif [ -x ${DESTDIR}/usr/share/man ]; then \
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \
+ else \
+- $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \
+- $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi
+- if [ -x /etc/xinetd.d ]; then \
+- $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi
++ $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \
++ $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi
++ if [ -x ${DESTDIR}/etc/xinetd.d ]; then \
++ $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi
+
+ clean:
+ rm -f *.o *.swp vsftpd
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch
new file mode 100644
index 000000000..d2e58a325
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-libs.patch
@@ -0,0 +1,30 @@
+From 328799d0cd5c523ad7a814fefec16d8a84aa8010 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 16 Apr 2013 10:53:55 +0000
+Subject: [PATCH] Hardcode LIBS instead of using a script to determine
+ available libs
+
+We want to avoid this dynamic detection so we have a deterministic
+build.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 9e4f35f..3a5535d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,7 +8,7 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+ -D_FORTIFY_SOURCE=2 \
+ #-pedantic -Wconversion
+
+-LIBS = `./vsf_findlibs.sh`
++LIBS = -lssl -lcrypto -lnsl -lresolv
+ LINK = -Wl,-s
+ LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch
new file mode 100644
index 000000000..e59607388
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/makefile-strip.patch
@@ -0,0 +1,25 @@
+From 261874ea47973ea156141185082252fc92081906 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 16 Apr 2013 10:53:55 +0000
+Subject: [PATCH] Disable stripping at link time
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 3a5535d..e78019a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \
+ #-pedantic -Wconversion
+
+ LIBS = -lssl -lcrypto -lnsl -lresolv
+-LINK = -Wl,-s
+ LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now
+
+ OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch
new file mode 100644
index 000000000..a4387c132
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam-with-tcp_wrappers.patch
@@ -0,0 +1,26 @@
+From 71628ddc91b6efb9b922a3fcf8cc18522f5387be Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Mon, 20 Feb 2012 13:51:49 +0000
+Subject: [PATCH] Disable PAM
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+---
+ builddefs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builddefs.h b/builddefs.h
+index 0106d1a..f48a568 100644
+--- a/builddefs.h
++++ b/builddefs.h
+@@ -2,7 +2,7 @@
+ #define VSF_BUILDDEFS_H
+
+ #define VSF_BUILD_TCPWRAPPERS
+-#define VSF_BUILD_PAM
++#undef VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
+ #endif /* VSF_BUILDDEFS_H */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch
new file mode 100644
index 000000000..cf0d68e27
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/nopam.patch
@@ -0,0 +1,16 @@
+Disable PAM
+
+Upstream-Status: Inappropriate [config]
+
+diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h
+--- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200
++++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200
+@@ -2,7 +2,7 @@
+ #define VSF_BUILDDEFS_H
+
+ #undef VSF_BUILD_TCPWRAPPERS
+-#define VSF_BUILD_PAM
++#undef VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
+ #endif /* VSF_BUILDDEFS_H */
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch
new file mode 100644
index 000000000..590eb5857
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-2.1.0-filter.patch
@@ -0,0 +1,89 @@
+From b756444854c5ab3b1284fd7113043fe8860e99ec Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 24 Apr 2015 09:36:48 +0800
+Subject: [PATCH] Fix the CVE-2015-1419
+
+Upstream-Status: Pending
+
+Try to fix deny_file parsing to do more what is expected. Taken
+from fedora. CVE-2015-1419
+
+ftp://195.220.108.108/linux/fedora/linux/development/rawhide/source/SRPMS/v/vsftpd-3.0.2-13.fc22.src.rpm
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ ls.c | 26 ++++++++++++++++++++++++--
+ str.c | 11 +++++++++++
+ str.h | 1 +
+ 3 files changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/ls.c b/ls.c
+index 7e1376d..e9302dd 100644
+--- a/ls.c
++++ b/ls.c
+@@ -246,9 +246,31 @@ vsf_filename_passes_filter(const struct mystr* p_filename_str,
+ int ret = 0;
+ char last_token = 0;
+ int must_match_at_current_pos = 1;
++
++
+ str_copy(&filter_remain_str, p_filter_str);
+- str_copy(&name_remain_str, p_filename_str);
+-
++
++ if (!str_isempty (&filter_remain_str) && !str_isempty(p_filename_str)) {
++ if (str_get_char_at(p_filter_str, 0) == '/') {
++ if (str_get_char_at(p_filename_str, 0) != '/') {
++ str_getcwd (&name_remain_str);
++
++ if (str_getlen(&name_remain_str) > 1) /* cwd != root dir */
++ str_append_char (&name_remain_str, '/');
++
++ str_append_str (&name_remain_str, p_filename_str);
++ }
++ else
++ str_copy (&name_remain_str, p_filename_str);
++ } else {
++ if (str_get_char_at(p_filter_str, 0) != '{')
++ str_basename (&name_remain_str, p_filename_str);
++ else
++ str_copy (&name_remain_str, p_filename_str);
++ }
++ } else
++ str_copy(&name_remain_str, p_filename_str);
++
+ while (!str_isempty(&filter_remain_str) && *iters < VSFTP_MATCHITERS_MAX)
+ {
+ static struct mystr s_match_needed_str;
+diff --git a/str.c b/str.c
+index 6596204..ba4b92a 100644
+--- a/str.c
++++ b/str.c
+@@ -711,3 +711,14 @@ str_replace_unprintable(struct mystr* p_str, char new_char)
+ }
+ }
+
++void
++str_basename (struct mystr* d_str, const struct mystr* path)
++{
++ static struct mystr tmp;
++
++ str_copy (&tmp, path);
++ str_split_char_reverse(&tmp, d_str, '/');
++
++ if (str_isempty(d_str))
++ str_copy (d_str, path);
++}
+diff --git a/str.h b/str.h
+index ab0a9a4..3a21b50 100644
+--- a/str.h
++++ b/str.h
+@@ -100,6 +100,7 @@ void str_replace_unprintable(struct mystr* p_str, char new_char);
+ int str_atoi(const struct mystr* p_str);
+ filesize_t str_a_to_filesize_t(const struct mystr* p_str);
+ unsigned int str_octal_to_uint(const struct mystr* p_str);
++void str_basename (struct mystr* d_str, const struct mystr* path);
+
+ /* PURPOSE: Extract a line of text (delimited by \n or EOF) from a string
+ * buffer, starting at character position 'p_pos'. The extracted line will
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch
new file mode 100644
index 000000000..c558aee0a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.3/vsftpd-tcp_wrappers-support.patch
@@ -0,0 +1,26 @@
+From c026b0c0de4eebb189bc77b2d4c3b9528454ac04 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Fri, 19 Jul 2013 10:19:25 +0800
+Subject: [PATCH] Enable tcp_wrapper.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+---
+ builddefs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builddefs.h b/builddefs.h
+index e908352..0106d1a 100644
+--- a/builddefs.h
++++ b/builddefs.h
+@@ -1,7 +1,7 @@
+ #ifndef VSF_BUILDDEFS_H
+ #define VSF_BUILDDEFS_H
+
+-#undef VSF_BUILD_TCPWRAPPERS
++#define VSF_BUILD_TCPWRAPPERS
+ #define VSF_BUILD_PAM
+ #undef VSF_BUILD_SSL
+
diff --git a/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
new file mode 100644
index 000000000..7a2035601
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.3.bb
@@ -0,0 +1,112 @@
+SUMMARY = "Very Secure FTP server"
+HOMEPAGE = "https://security.appspot.com/vsftpd.html"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271"
+
+DEPENDS = "libcap openssl"
+
+SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \
+ file://makefile-destdir.patch \
+ file://makefile-libs.patch \
+ file://makefile-strip.patch \
+ file://init \
+ file://vsftpd.conf \
+ file://vsftpd.user_list \
+ file://vsftpd.ftpusers \
+ file://change-secure_chroot_dir.patch \
+ file://volatiles.99_vsftpd \
+ file://vsftpd.service \
+ file://vsftpd-2.1.0-filter.patch \
+ file://0001-vsftpd-allow-sysinfo-in-the-seccomp-sandbox.patch \
+ ${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)} \
+ file://0001-sysdeputil.c-Fix-with-musl-which-does-not-have-utmpx.patch \
+ "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \
+ file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \
+ file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb"
+SRC_URI[md5sum] = "da119d084bd3f98664636ea05b5bb398"
+SRC_URI[sha256sum] = "9d4d2bf6e6e2884852ba4e69e157a2cecd68c5a7635d66a3a8cf8d898c955ef7"
+
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}"
+PAMLIB = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}"
+WRAPLIB = "${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '-lwrap', '', d)}"
+NOPAM_SRC ="${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}"
+
+inherit update-rc.d useradd systemd
+
+CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf"
+LDFLAGS_append =" -lcrypt -lcap"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_configure() {
+ # Fix hardcoded /usr, /etc, /var mess.
+ cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \
+ |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new
+ mv tunables.c.new tunables.c
+}
+
+do_compile() {
+ oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} ${WRAPLIB}"
+}
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man8
+ install -d ${D}${mandir}/man5
+ oe_runmake 'DESTDIR=${D}' install
+ install -d ${D}${sysconfdir}
+ install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd
+ install -d ${D}/${sysconfdir}/default/volatiles
+ install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd
+
+ install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/
+ install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/
+ if ! test -z "${PAMLIB}" ; then
+ install -d ${D}${sysconfdir}/pam.d/
+ cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd
+ sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd
+ sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd
+ fi
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/run/vsftpd/empty 0755 root root -" \
+ > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+
+ # Install systemd unit files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/vsftpd.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/vsftpd.service
+}
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "vsftpd"
+INITSCRIPT_PARAMS_${PN} = "defaults 80"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \
+ --shell /bin/false ftp "
+GROUPADD_PARAM_${PN} = "-r ftp"
+
+SYSTEMD_SERVICE_${PN} = "vsftpd.service"
+
+pkg_postinst_${PN}() {
+ if [ -z "$D" ]; then
+ if type systemd-tmpfiles >/dev/null; then
+ systemd-tmpfiles --create
+ elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+ fi
+}
diff --git a/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/run-ptest b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/run-ptest
new file mode 100644
index 000000000..f1c833e6c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/run-ptest
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+
+# prepare testing config
+CONF_USERS=`readlink -f /etc/raddb/users`
+mv ${CONF_USERS} ${CONF_USERS}_orig
+echo "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS}
+cat ${CONF_USERS}_orig >> ${CONF_USERS}
+
+# restart radiusd server
+systemctl restart radiusd || /etc/init.d/radiusd restart || {
+ echo "FAIL: Start radiusd service."
+ exit 1
+}
+
+# run teests
+perl test.pl
+
+# restore the config and restart
+mv ${CONF_USERS}_orig ${CONF_USERS}
+systemctl restart radiusd || /etc/init.d/radiusd restart
diff --git a/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch
new file mode 100644
index 000000000..9798af497
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl/test.pl-adjust-for-ptest.patch
@@ -0,0 +1,90 @@
+From 829302792bf0e4935d29efc23ca1f2e9e7ee7dfd Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 7 Jan 2016 03:12:38 -0500
+Subject: [PATCH] test.pl: adjust for ptest
+
+* Don't use interactive inputs, set default test
+ settings instead.
+* Change the test results output to the ptest format
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ test.pl | 31 ++++++++++++++++++-------------
+ 1 file changed, 18 insertions(+), 13 deletions(-)
+
+diff --git a/test.pl b/test.pl
+index cfd1c1e..9b4f10e 100644
+--- a/test.pl
++++ b/test.pl
+@@ -7,11 +7,11 @@
+ # Change 1..1 below to 1..last_test_to_print .
+ # (It may become useful if the test is moved to ./t subdirectory.)
+
+-BEGIN {print "1..5\n";}
+-END {print "not ok 1\n" unless $loaded;}
++BEGIN {print "Start testing for libauthen-radius-perl\n";}
++END {print "\nFAIL: test1\n" unless $loaded;}
+ use Authen::Radius;
+ $loaded = 1;
+-print "ok 1\n";
++print "\nPASS: test1\n";
+
+ ######################### End of black magic.
+
+@@ -19,26 +19,31 @@ print "ok 1\n";
+ # (correspondingly "not ok 13") depending on the success of chunk 13
+ # of the test code):
+
++$host = "127.0.0.1";
++$secret = "testing123";
++$user = "testing";
++$pwd = "testpassword";
++
+ print "Make sure this machine is in your Radius clients file!\n";
+-print "Enter hostname[:port] of your Radius server: "; chomp ($host = <STDIN>);
+-print "Enter shared-secret of your Radius server: "; chomp ($secret = <STDIN>);
+-print "Enter a username to be validated: "; chomp ($user = <STDIN>);
+-print "Enter this user's password: "; chomp ($pwd = <STDIN>);
++print "hostname of your Radius server: $host\n";
++print "shared-secret of your Radius server: $secret\n";
++print "The username to be validated: $user\n";
++print "The user's password: $pwd\n";
+
+ $t = 2;
+ if ($host ne '') {
+ $r = new Authen::Radius(Host => $host, Secret => $secret, Debug => 1);
+- print defined($r) ? "" : "not ", "ok $t\n"; $t++;
++ print defined($r) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ #Authen::Radius->load_dictionary;
+- print $r->check_pwd($user, $pwd) ? "" : "not ", "ok $t\n"; $t++;
++ print $r->check_pwd($user, $pwd) ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ @a = $r->get_attributes;
+- print $#a != -1 ? "" : "not ", "ok $t\n"; $t++;
++ print $#a != -1 ? "\nPASS: test$t\n" : "\nFAIL: test$t\n"; $t++;
+ #for $a (@a) {
+ # print "attr: name=$a->{'Name'} value=$a->{'Value'}\n";
+ #}
+ } else {
+ foreach my $t (2..4) {
+- print "skipped $t\n";
++ print "\nSKIP test$t\n";
+ }
+ }
+
+@@ -53,9 +58,9 @@ my $data = "what do ya want for nothing?";
+ my $etalon_digest = hex_to_ascii("750c783e6ab0b503eaa86e310a5db738");
+ my $digest = Authen::Radius::hmac_md5(undef, $data, $key);
+ if ($etalon_digest eq $digest) {
+- print "ok 5\n";
++ print "\nPASS: test5\n";
+ } else {
+- print "not ok 5\n";
++ print "\nFAIL: test5\n";
+ }
+
+ exit;
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl_0.22.bb b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl_0.22.bb
new file mode 100644
index 000000000..ea5bb1b0c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-devtools/perl/libauthen/libauthen-radius-perl_0.22.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Authen::Radius - provide simple Radius client facilities"
+DESCRIPTION = "The Authen::Radius module provides a simple class that \
+ allows you to send/receive Radius requests/responses to/from a \
+ Radius server. \
+"
+
+HOMEPAGE = "http://search.cpan.org/~manowar/RadiusPerl"
+SECTION = "libs"
+
+LICENSE = "Artistic-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=78ab6ea0cba1f1ec1680ebb149e3bc11"
+
+DEPENDS = "perl"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MANOWAR/RadiusPerl-${PV}.tar.gz \
+ file://test.pl-adjust-for-ptest.patch \
+ file://run-ptest \
+"
+SRC_URI[md5sum] = "d1fe2d6ecf7ea99299e4e3a8f945aad8"
+SRC_URI[sha256sum] = "3b276506986ccaa4949d92b13ce053a0017ad11562a991cc753364923fe81ca7"
+
+S = "${WORKDIR}/Authen-Radius-${PV}"
+
+inherit cpan ptest
+
+do_install_ptest() {
+ install -m 0755 ${S}/test.pl ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN} += "\
+ libdata-hexdump-perl \
+ perl-module-digest-md5 \
+ perl-module-data-dumper \
+ perl-module-io-select \
+ perl-module-io-socket \
+"
+RDEPENDS_${PN}-ptest += "${PN} freeradius"
+
+BBCLASSEXTEND = "native"
diff --git a/meta-openembedded/meta-networking/recipes-devtools/python/python-ldap_2.4.41.bb b/meta-openembedded/meta-networking/recipes-devtools/python/python-ldap_2.4.41.bb
new file mode 100644
index 000000000..3dbc8b13e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-devtools/python/python-ldap_2.4.41.bb
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2012 Wind River Systems, Inc.
+#
+SUMMARY = "Provides a wrapper in Python to LDAP"
+DESCRIPTION = "This module provides access to the LDAP \
+(Lightweight Directory Access Protocol) through Python operations \
+instead of C API. The module mainly acts as a wrapper for the \
+OpenLDAP 2.x libraries. Errors will appear as exceptions."
+
+LICENSE = "PSF"
+HOMEPAGE = "http://www.python-ldap.org/"
+DEPENDS = "python openldap cyrus-sasl"
+
+PYPI_PACKAGE = "python-ldap"
+inherit pypi setuptools
+
+LIC_FILES_CHKSUM = "file://LICENCE;md5=a41c82edffa04912007cae1d20cac555"
+SRC_URI[md5sum] = "18db2d009150ec1864710fea3ed76173"
+SRC_URI[sha256sum] = "6d430ecf040f2fc704ee316d3390cb1f5419c191371e1e131baef54a0e42cef0"
+
+do_configure_prepend() {
+ sed -i -e 's:^library_dirs =.*::' setup.cfg
+ sed -i -e 's:^include_dirs =.*:include_dirs = =/usr/include/sasl/:' setup.cfg
+}
+
+RDEPENDS_${PN} = " \
+ ${PYTHON_PN}-pprint \
+ ${PYTHON_PN}-threading \
+"
diff --git a/meta-openembedded/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb b/meta-openembedded/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb
new file mode 100644
index 000000000..9673fa362
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/corosync/corosync_2.4.3.bb
@@ -0,0 +1,79 @@
+SUMMARY = "The Corosync Cluster Engine and Application Programming Interfaces"
+DESCRIPTION = "This package contains the Corosync Cluster Engine Executive, several default \
+APIs and libraries, default configuration files, and an init script."
+HOMEPAGE = "http://corosync.github.io/corosync/"
+
+SECTION = "base"
+
+inherit autotools pkgconfig systemd useradd
+
+SRC_URI = "http://build.clusterlabs.org/corosync/releases/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "bf0ede13018aadc8a046183bc593b0e0"
+SRC_URI[sha256sum] = "b1e7e422e8d2f7af8e5315fa329b1dbd1175fff32efaa55e8054584c80a2c597"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a85eb4ce24033adb6088dd1d6ffc5e5d"
+
+DEPENDS = "groff-native nss libqb"
+
+SYSTEMD_SERVICE_${PN} = "corosync.service corosync-notifyd.service \
+ ${@bb.utils.contains('PACKAGECONFIG', 'qdevice', 'corosync-qdevice.service', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'qnetd', 'corosync-qnetd.service', '', d)} \
+"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+INITSCRIPT_NAME = "corosync-daemon"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ dbus qdevice qnetd snmp \
+"
+
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[qdevice] = "--enable-qdevices,--disable-qdevices"
+PACKAGECONFIG[qnetd] = "--enable-qnetd,--disable-qnetd"
+PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
+PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemddir=${systemd_system_unitdir},--disable-systemd --without-systemddir,systemd"
+
+EXTRA_OECONF = "ac_cv_path_BASHPATH=${base_bindir}/bash ap_cv_cc_pie=no"
+EXTRA_OEMAKE = "tmpfilesdir_DATA="
+
+do_configure_prepend() {
+ ( cd ${S}
+ ${S}/autogen.sh )
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/sysconfig/
+ install -m 0644 ${S}/init/corosync.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync
+ install -m 0644 ${S}/tools/corosync-notifyd.sysconfig.example ${D}${sysconfdir}/sysconfig/corosync-notifyd
+
+ rm -rf "${D}${localstatedir}/run"
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ echo "d root root 0755 ${localstatedir}/log/cluster none" > ${D}${sysconfdir}/default/volatiles/05_corosync
+
+ if [ ${@bb.utils.filter('PACKAGECONFIG', 'qnetd', d)} ]; then
+ chown -R coroqnetd:coroqnetd ${D}${sysconfdir}/${BPN}/qnetd
+ echo "d coroqnetd coroqnetd 0770 /var/run/corosync-qnetd none" >> ${D}${sysconfdir}/default/volatiles/05_corosync
+ fi
+
+ if [ ${@bb.utils.filter('DISTRO_FEATURES','systemd',d)} ]; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d ${localstatedir}/log/cluster - - - -" > ${D}${sysconfdir}/tmpfiles.d/corosync.conf
+
+ if [ ${@bb.utils.filter('PACKAGECONFIG', 'qnetd', d)} ]; then
+ install -m 0644 ${S}/conf/tmpfiles.d/corosync-qnetd.conf ${D}${sysconfdir}/tmpfiles.d
+ fi
+ fi
+}
+
+RDEPENDS_${PN} += "bash ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+
+FILES_${PN}-dbg += "${libexecdir}/lcrso/.debug"
+FILES_${PN}-doc += "${datadir}/snmp/mibs/COROSYNC-MIB.txt"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system coroqnetd"
+USERADD_PARAM_${PN} = "--system -d / -M -s /bin/nologin -c 'User for corosync-qnetd' -g coroqnetd coroqnetd"
diff --git a/meta-openembedded/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch b/meta-openembedded/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
new file mode 100644
index 000000000..69b2f903c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/dlm/dlm/respect-ldflags-also-from-bin_ldflags.patch
@@ -0,0 +1,36 @@
+diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
+--- dlm-4.0.2.orig/dlm_controld/Makefile 2017-04-04 10:49:23.661320260 +0200
++++ dlm-4.0.2/dlm_controld/Makefile 2017-04-04 10:50:36.121326429 +0200
+@@ -55,7 +55,7 @@
+ BIN_CFLAGS += -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm
+
+-BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
++BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
+ BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
+
+ LIB_CFLAGS += $(BIN_CFLAGS)
+diff -uNr dlm-4.0.2.orig/dlm_tool/Makefile dlm-4.0.2/dlm_tool/Makefile
+--- dlm-4.0.2.orig/dlm_tool/Makefile 2013-07-31 17:50:26.000000000 +0200
++++ dlm-4.0.2/dlm_tool/Makefile 2017-04-04 10:50:44.617327153 +0200
+@@ -32,7 +32,7 @@
+ BIN_CFLAGS += -fPIE -DPIE
+ BIN_CFLAGS += -I../include -I../libdlm -I../dlm_controld
+
+-BIN_LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
++BIN_LDFLAGS += $(LDFLAGS) -Wl,-z,now -Wl,-z,relro -pie
+ BIN_LDFLAGS += -L../libdlm -L../dlm_controld
+ BIN_LDFLAGS += -lpthread -ldlm -ldlmcontrol
+
+diff -uNr dlm-4.0.2.orig/dlm_controld/Makefile dlm-4.0.2/dlm_controld/Makefile
+--- dlm-4.0.2.orig/dlm_controld/Makefile 2017-04-04 11:02:58.578389641 +0200
++++ dlm-4.0.2/dlm_controld/Makefile 2017-04-04 11:07:55.672414935 +0200
+@@ -59,7 +59,7 @@
+ BIN_LDFLAGS += -lpthread -lrt -lcpg -lcmap -lcfg -lquorum
+
+ LIB_CFLAGS += $(BIN_CFLAGS)
+-LIB_LDFLAGS += -Wl,-z,relro -pie
++LIB_LDFLAGS += $(LDFLAGS) -Wl,-z,relro -pie
+
+ ifeq ($(USE_SD_NOTIFY),yes)
+ BIN_CFLAGS += $(shell pkg-config --cflags libsystemd-daemon) \
diff --git a/meta-openembedded/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb b/meta-openembedded/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb
new file mode 100644
index 000000000..31e411e86
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/dlm/dlm_4.0.2.bb
@@ -0,0 +1,51 @@
+DESCRIPTION = "dlm control daemon and tool"
+
+SECTION = "utils"
+HOMEPAGE = "https://fedorahosted.org/cluster/wiki/HomePage"
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+SRC_URI = "https://git.fedorahosted.org/cgit/dlm.git/snapshot/${BP}.tar.xz \
+ file://respect-ldflags-also-from-bin_ldflags.patch \
+"
+
+SRC_URI[md5sum] = "efc2ee6093aa6aa0a88aaad83e998a3f"
+SRC_URI[sha256sum] = "b89bc557aaffbab0ac005398025f247718a5589cff6574d902eaffe2b20e683e"
+
+LICENSE = "LGPLv2+ & GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://README.license;md5=8f0bbcdd678df1bce9863492b6c8832d"
+
+DEPENDS = "corosync systemd"
+
+inherit pkgconfig systemd distro_features_check
+
+SYSTEMD_SERVICE_${PN} = "dlm.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+export EXTRA_OEMAKE = ""
+
+do_compile_prepend() {
+ sed -i "s/libsystemd-daemon/libsystemd/g" ${S}/dlm_controld/Makefile
+}
+
+do_compile () {
+ oe_runmake 'CC=${CC}'
+}
+
+do_install_append (){
+ install -d ${D}${sysconfdir}/sysconfig/
+ install -d ${D}${sysconfdir}/init.d/
+ install -m 0644 ${S}/init/dlm.sysconfig ${D}${sysconfdir}/sysconfig/dlm
+ install -m 0644 ${S}/init/dlm.init ${D}${sysconfdir}/init.d/dlm
+
+ # install systemd unit files
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/init/dlm.service ${D}${systemd_unitdir}/system
+ fi
+}
+
+do_install() {
+ oe_runmake install DESTDIR=${D} LIBDIR=${libdir}
+}
+
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch
new file mode 100644
index 000000000..4426d3552
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/0001-kernel-event-netlink_ack-now-requires-4-arguments.patch
@@ -0,0 +1,40 @@
+From cbc5f8151017f45231b75a826f18354a81c287c4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 07:52:59 -0700
+Subject: [PATCH] kernel/event: netlink_ack() now requires 4 arguments
+
+see https://patchwork.kernel.org/patch/9670181/
+
+event.c:32:4: error: too few arguments to function 'netlink_ack'
+| netlink_ack(skb, nlh, 0);
+| ^~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ kernel/event.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: iscsitarget-1.4.20.3+svn502/kernel/event.c
+===================================================================
+--- iscsitarget-1.4.20.3+svn502.orig/kernel/event.c
++++ iscsitarget-1.4.20.3+svn502/kernel/event.c
+@@ -6,6 +6,7 @@
+ * Some functions are based on audit code.
+ */
+
++#include <linux/version.h>
+ #include <linux/module.h>
+ #include <net/tcp.h>
+ #include "iet_u.h"
+@@ -29,7 +30,11 @@ static void event_recv_skb(struct sk_buf
+ ietd_pid = NETLINK_CB(skb).portid;
+ WARN_ON(ietd_pid == 0);
+ if (nlh->nlmsg_flags & NLM_F_ACK)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++ netlink_ack(skb, nlh, 0, NULL);
++#else
+ netlink_ack(skb, nlh, 0);
++#endif
+ skb_pull(skb, rlen);
+ }
+ }
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch
new file mode 100644
index 000000000..4444234b2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/access-sk_v6_daddr-iff-IPV6-defined.patch
@@ -0,0 +1,28 @@
+The element skc_v6_daddr (in struct sock_common) is defined in
+kernel source only when CONFIG_IPV6 is enabled. Hence, access
+sk_v6_daddr element (i.e __sk_common.skc_v6_daddr) only when CONFIG_IPV6
+is defined; to fix below error in world build:
+
+-- snip --
+/home/jenkins/oe/world/shr-core/tmp-glibc/work-shared/qemux86/kernel-source/include/net/sock.h:330:33: error: 'struct sock_common' has no member named 'skc_v6_daddr'
+-- CUT --
+
+Upstream-Status: Pending
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2015-12-29 21:57:50.547932217 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2015-12-29 22:47:25.254657627 -0800
+@@ -46,10 +46,12 @@ void conn_info_show(struct seq_file *seq
+ snprintf(buf, sizeof(buf),
+ "%pI4", &inet_sk(sk)->inet_daddr);
+ break;
++#if defined(CONFIG_IPV6)
+ case AF_INET6:
+ snprintf(buf, sizeof(buf), "[%pI6]",
+ &(sk)->sk_v6_daddr);
+ break;
++#endif /* defined(CONFIG_IPV6) */
+ default:
+ break;
+ }
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
new file mode 100644
index 000000000..bce38baee
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_bio_struct_of_linux_v4.3_and_above.patch
@@ -0,0 +1,108 @@
+Description: Fix source to compile with 4.3+ kernels
+ commit 4246a0b63bd8f56a1469b12eafeb875b1041a451
+ block: add a bi_error field to struct bio
+ -> Removes BIO_UPTODATE and error argument to bio_endio.
+ commit b54ffb73cadcdcff9cc1ae0e11f502407e3e2e4c
+ block: remove bio_get_nr_vecs()
+ -> Removed that call (always use BIO_MAX_PAGES)
+ commit 676d23690fb62b5d51ba5d659935e9f7d9da9f8e
+ net: Fix use after free by removing length arg from sk_data_ready callbacks.
+ -> Removes len argument from sk_data_ready() callback.
+Author: Stefan Bader <stefan.bader@canonical.com>
+
+The original patch is at http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz,
+those changes were taken using #ifs to allow compilation of iscsitarget
+package with kernel versions < 4.3.
+
+Upstream-Status: Submitted [http://launchpadlibrarian.net/227478885/iscsitarget_1.4.20.3+svn502-2ubuntu2_1.4.20.3+svn502-2ubuntu3.diff.gz]
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c 2017-01-19 00:46:28.263951115 -0800
+@@ -29,14 +29,23 @@ struct tio_work {
+ struct completion tio_complete;
+ };
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++static void blockio_bio_endio(struct bio *bio)
++#else
+ static void blockio_bio_endio(struct bio *bio, int error)
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ {
+ struct tio_work *tio_work = bio->bi_private;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ if (bio->bi_error)
++ atomic_set(&tio_work->error, bio->bi_error);
++#else
+ error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? error : -EIO;
+
+ if (error)
+ atomic_set(&tio_work->error, error);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+
+ /* If last bio signal completion */
+ if (atomic_dec_and_test(&tio_work->bios_remaining))
+@@ -61,14 +70,20 @@ blockio_make_request(struct iet_volume *
+ u32 size = tio->size;
+ u32 tio_index = 0;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ int max_pages = bdev_q ? BIO_MAX_PAGES : 1;
++#else
+ int max_pages = 1;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ int err = 0;
+
+ loff_t ppos = tio->offset;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
+ /* Calculate max_pages for bio_alloc (memory saver) */
+ if (bdev_q)
+ max_pages = bio_get_nr_vecs(bio_data->bdev);
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) */
+
+ tio_work = kzalloc(sizeof (*tio_work), GFP_KERNEL);
+ if (!tio_work)
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-19 00:39:09.737117778 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-19 00:52:30.037223901 -0800
+@@ -89,13 +89,21 @@ static void iet_state_change(struct sock
+ target->nthread_info.old_state_change(sk);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++static void iet_data_ready(struct sock *sk)
++#else
+ static void iet_data_ready(struct sock *sk, int len)
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ {
+ struct iscsi_conn *conn = sk->sk_user_data;
+ struct iscsi_target *target = conn->session->target;
+
+ nthread_wakeup(target);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ target->nthread_info.old_data_ready(sk);
++#else
+ target->nthread_info.old_data_ready(sk, len);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ }
+
+ /*
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h 2017-01-19 00:48:02.102837260 -0800
+@@ -81,7 +81,11 @@ struct network_thread_info {
+ spinlock_t nthread_lock;
+
+ void (*old_state_change)(struct sock *);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
++ void (*old_data_ready)(struct sock *);
++#else
+ void (*old_data_ready)(struct sock *, int);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0) */
+ void (*old_write_space)(struct sock *);
+ };
+
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
new file mode 100644
index 000000000..e508a5e6c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/build_with_updated_interfaces_of_linux_v4.8_and_above.patch
@@ -0,0 +1,475 @@
+Resolve build error with linux kernel 4.8
+
+The below changes in kernel source, triggered iscsitarget
+build fail with linux kernel v4.8.
+
+1. An extra 'flags' argument has been passed to vfs_readv/vfs_writev
+ syscalls in v4.8. So, set this argument to "0" for now
+ (as there is no real need for that).
+ Ref: https://github.com/torvalds/linux/commit/793b80ef14af56d20c998265287648ad34239b6f
+ Solves:
+ -- snip --
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c: In function 'write_data':
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c:350:9: error: too few arguments to function 'vfs_writev'
+ res = vfs_writev(file, (struct iovec __user *) iop, count, &off);
+ ^~~~~~~~~~
+ -- snip --
+
+2. Redefine dropped PAGE_CACHE_* and page_cache_{get,release} definitions,
+ as they have been dropped with v4.8
+ Ref: https://github.com/torvalds/linux/commit/1fa64f198b9f8d6ec0f7aec7c18dc94684391140
+ Solves:
+ -- snip --
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/param.c: In function 'sess_param_check':
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/param.c:48:41: error: 'PAGE_CACHE_SIZE' undeclared (first use in this function)
+ (u32) ((ISCSI_CONN_IOV_MAX - 1) * PAGE_CACHE_SIZE));
+ ^
+ -- snip --
+
+3. Replace crypto_hash interfaces with crypto_ahash interfaces,
+ Ref: https://github.com/torvalds/linux/commit/896545098777564212b9e91af4c973f094649aa7
+ Ref: https://www.redhat.com/archives/dm-devel/2016-January/msg00244.html
+ Solves:
+ -- snip --
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c: In function 'digest_init':
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c:42:23: error: implicit declaration of function 'crypto_alloc_hash' [-Werror=implicit-function-declaration]
+ conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
+ ^~~~~~~~~~~~~~~~~
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c: In function 'digest_cleanup':
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/digest.c:77:3: error: implicit declaration of function 'crypto_free_hash' [-Werror=implicit-function-declaration]
+ crypto_free_hash(conn->tx_hash.tfm);
+ ^~~~~~~~~~~~~~~~
+ -- snip --
+
+4. The earlier "rw" parameter has been set in "bi_rw" within
+ bio structure, hence remove "rw" argument.
+ Ref: https://github.com/torvalds/linux/commit/4e49ea4a3d276365bf7396c9b77b4d1d5923835a
+ Solves:
+-- snip --
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/block-io.c:140:14: warning: passing argument 1 of 'submit_bio' makes pointer from integer without a cast [-Wint-conversion]
+ submit_bio(rw, bio);
+ ^~
+-- snip --
+
+5. The 'len' argument from sk_data_ready() callback has been removed in
+ linux kernel v4.3 and above.
+ Ref: https://github.com/torvalds/linux/commit/676d23690fb62b5d51ba5d659935e9f7d9da9f8e
+ Solves:
+-- snip --
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c: In function 'iet_socket_bind':
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c:143:38: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
+ target->nthread_info.old_data_ready = conn->sock->sk->sk_data_ready;
+ ^
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/conn.c:144:32: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
+ conn->sock->sk->sk_data_ready = iet_data_ready;
+ ^
+-- snip --
+
+6.
+ A. The "size" argument has been dropped from sock_recvmsg syscall in v4.8,
+ as all callers have it equal to msg_data_left(msg).
+ B. 'struct user_msghdr' is being used for userland-side msghdr instead
+ of 'struct msghdr', which is used for kernel-side msghdr in linux v3.19
+ and above, so typecase it while calling sock_recvmsg syscall.
+ Ref: https://github.com/torvalds/linux/commit/2da62906b1e298695e1bb725927041cd59942c98
+ https://github.com/torvalds/linux/commit/666547ff591cebdedc4679bf6b1b3f3383a8dea3
+ Solves:
+ -- snip --
+TOPDIR/tmp-glibc/work-shared/qemux86/kernel-source/include/linux/net.h:222:5: note: expected 'struct msghdr *' but argument is of type 'struct user_msghdr *'
+ int sock_recvmsg(struct socket *sock, struct msghdr *msg, int flags);
+ ^~~~~~~~~~~~
+TOPDIR/tmp-glibc/work/qemux86-oe-linux/iscsitarget/1.4.20.3+svn502-r0/iscsitarget-1.4.20.3+svn502/kernel/nthread.c:129:8: error: too many arguments to function 'sock_recvmsg'
+ res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);
+ ^~~~~~~~~~~~
+ -- snip --
+
+Detailed error log is at: http://errors.yoctoproject.org/Errors/Details/83334/
+
+Upstream-Status: Pending
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c iscsitarget-1.4.20.3+svn502/kernel/block-io.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/block-io.c 2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/block-io.c 2017-01-19 20:32:22.977988593 -0800
+@@ -104,7 +104,11 @@ blockio_make_request(struct iet_volume *
+ /* bi_sector is ALWAYS in units of 512 bytes */
+ bio->bi_iter.bi_sector = ppos >> 9;
+ bio->bi_bdev = bio_data->bdev;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ bio->bi_end_io = (bio_end_io_t *) blockio_bio_endio;
++#else
+ bio->bi_end_io = blockio_bio_endio;
++#endif
+ bio->bi_private = tio_work;
+
+ if (tio_bio)
+@@ -139,7 +143,12 @@ blockio_make_request(struct iet_volume *
+ tio_bio = tio_bio->bi_next;
+ bio->bi_next = NULL;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ bio_set_op_attrs(bio, REQ_OP_WRITE, 0);
++ submit_bio(bio);
++#else
+ submit_bio(rw, bio);
++#endif
+ }
+
+ blk_finish_plug(&plug);
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-19 20:32:22.978988614 -0800
+@@ -148,8 +148,14 @@ static void iet_socket_bind(struct iscsi
+ target->nthread_info.old_state_change = conn->sock->sk->sk_state_change;
+ conn->sock->sk->sk_state_change = iet_state_change;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ target->nthread_info.old_data_ready = (void (*) (struct sock *)) \
++ conn->sock->sk->sk_data_ready;
++ conn->sock->sk->sk_data_ready = (void (*) (struct sock *)) iet_data_ready;
++#else
+ target->nthread_info.old_data_ready = conn->sock->sk->sk_data_ready;
+ conn->sock->sk->sk_data_ready = iet_data_ready;
++#endif
+
+ target->nthread_info.old_write_space = conn->sock->sk->sk_write_space;
+ conn->sock->sk->sk_write_space = iet_write_space;
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/digest.c iscsitarget-1.4.20.3+svn502/kernel/digest.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/digest.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/digest.c 2017-01-19 20:32:22.978988614 -0800
+@@ -30,6 +30,9 @@ void digest_alg_available(unsigned int *
+ int digest_init(struct iscsi_conn *conn)
+ {
+ int err = 0;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct crypto_ahash *tfm;
++#endif
+
+ if (!(conn->hdigest_type & DIGEST_ALL))
+ conn->hdigest_type = DIGEST_NONE;
+@@ -39,15 +42,40 @@ int digest_init(struct iscsi_conn *conn)
+
+ if (conn->hdigest_type & DIGEST_CRC32C ||
+ conn->ddigest_type & DIGEST_CRC32C) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ tfm = crypto_alloc_ahash("crc32c", 0, CRYPTO_ALG_ASYNC);
++ if (IS_ERR(tfm)) {
++ tfm = NULL;
++#else
+ conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
+ CRYPTO_ALG_ASYNC);
+ conn->rx_hash.flags = 0;
+ if (IS_ERR(conn->rx_hash.tfm)) {
+ conn->rx_hash.tfm = NULL;
++#endif
+ err = -ENOMEM;
+ goto out;
+ }
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ conn->rx_hash = ahash_request_alloc(tfm, GFP_KERNEL);
++ if (!conn->rx_hash) {
++ pr_err("ahash_request_alloc() failed for conn->rx_hash\n");
++ crypto_free_ahash(tfm);
++ err = -ENOMEM;
++ goto out;
++ }
++ ahash_request_set_callback(conn->rx_hash, 0, NULL, NULL);
++ conn->tx_hash = ahash_request_alloc(tfm, GFP_KERNEL);
++ if(!conn->tx_hash) {
++ pr_err("ahash_request_alloc() failed for conn->tx_hash\n");
++ ahash_request_free(conn->rx_hash);
++ conn->rx_hash = NULL;
++ crypto_free_ahash(tfm);
++ err = -ENOMEM;
++ goto out;
++ }
++ ahash_request_set_callback(conn->tx_hash, 0, NULL, NULL);
++#else
+ conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0,
+ CRYPTO_ALG_ASYNC);
+ conn->tx_hash.flags = 0;
+@@ -56,6 +84,7 @@ int digest_init(struct iscsi_conn *conn)
+ err = -ENOMEM;
+ goto out;
+ }
++#endif
+ }
+
+ out:
+@@ -73,10 +102,21 @@ out:
+ */
+ void digest_cleanup(struct iscsi_conn *conn)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ ahash_request_free(conn->tx_hash);
++ if (conn->rx_hash) {
++ struct crypto_ahash *tfm;
++ tfm = crypto_ahash_reqtfm(conn->rx_hash);
++ ahash_request_free(conn->rx_hash);
++ crypto_free_ahash(tfm);
++ }
++
++#else
+ if (conn->tx_hash.tfm)
+ crypto_free_hash(conn->tx_hash.tfm);
+ if (conn->rx_hash.tfm)
+ crypto_free_hash(conn->rx_hash.tfm);
++#endif
+ }
+
+ /**
+@@ -160,8 +200,13 @@ static inline void __dbg_simulate_data_d
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++static void digest_header(struct ahash_request *hash, struct iscsi_pdu *pdu,
++ u8 *crc)
++#else
+ static void digest_header(struct hash_desc *hash, struct iscsi_pdu *pdu,
+ u8 *crc)
++#endif
+ {
+ struct scatterlist sg[2];
+ unsigned int nbytes = sizeof(struct iscsi_hdr);
+@@ -174,16 +219,27 @@ static void digest_header(struct hash_de
+ nbytes += pdu->ahssize;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ crypto_ahash_init(hash);
++ ahash_request_set_crypt(hash, sg, crc, nbytes);
++ crypto_ahash_update(hash);
++ crypto_ahash_digest(hash);
++#else
+ crypto_hash_init(hash);
+ crypto_hash_update(hash, sg, nbytes);
+ crypto_hash_final(hash, crc);
++#endif
+ }
+
+ int digest_rx_header(struct iscsi_cmnd *cmnd)
+ {
+ u32 crc;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ digest_header(cmnd->conn->rx_hash, &cmnd->pdu, (u8 *) &crc);
++#else
+ digest_header(&cmnd->conn->rx_hash, &cmnd->pdu, (u8 *) &crc);
++#endif
+ if (crc != cmnd->hdigest)
+ return -EIO;
+
+@@ -192,11 +248,20 @@ int digest_rx_header(struct iscsi_cmnd *
+
+ void digest_tx_header(struct iscsi_cmnd *cmnd)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ digest_header(cmnd->conn->tx_hash, &cmnd->pdu, (u8 *) &cmnd->hdigest);
++#else
+ digest_header(&cmnd->conn->tx_hash, &cmnd->pdu, (u8 *) &cmnd->hdigest);
++#endif
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++static void digest_data(struct ahash_request *hash, struct iscsi_cmnd *cmnd,
++ struct tio *tio, u32 offset, u8 *crc)
++#else
+ static void digest_data(struct hash_desc *hash, struct iscsi_cmnd *cmnd,
+ struct tio *tio, u32 offset, u8 *crc)
++#endif
+ {
+ struct scatterlist *sg = cmnd->conn->hash_sg;
+ u32 size, length, npages;
+@@ -214,7 +279,11 @@ static void digest_data(struct hash_desc
+ BUG_ON(npages > ISCSI_CONN_IOV_MAX);
+
+ sg_init_table(sg, ARRAY_SIZE(cmnd->conn->hash_sg));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ crypto_ahash_init(hash);
++#else
+ crypto_hash_init(hash);
++#endif
+
+ for (i = 0; size > 0; i++) {
+ length = min_t(u32, PAGE_CACHE_SIZE - offset, size);
+@@ -225,8 +294,14 @@ static void digest_data(struct hash_desc
+
+ sg_mark_end(&sg[i - 1]);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ ahash_request_set_crypt(hash, sg, crc, nbytes);
++ crypto_ahash_update(hash);
++ crypto_ahash_digest(hash);
++#else
+ crypto_hash_update(hash, sg, nbytes);
+ crypto_hash_final(hash, crc);
++#endif
+ }
+
+ int digest_rx_data(struct iscsi_cmnd *cmnd)
+@@ -251,8 +326,11 @@ int digest_rx_data(struct iscsi_cmnd *cm
+ tio = cmnd->tio;
+ offset = 0;
+ }
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ digest_data(cmnd->conn->rx_hash, cmnd, tio, offset, (u8 *) &crc);
++#else
+ digest_data(&cmnd->conn->rx_hash, cmnd, tio, offset, (u8 *) &crc);
++#endif
+
+ if (!cmnd->conn->read_overflow &&
+ (cmnd_opcode(cmnd) != ISCSI_OP_PDU_REJECT)) {
+@@ -269,6 +347,11 @@ void digest_tx_data(struct iscsi_cmnd *c
+ struct iscsi_data_out_hdr *req = (struct iscsi_data_out_hdr *)&cmnd->pdu.bhs;
+
+ assert(tio);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ digest_data(cmnd->conn->tx_hash, cmnd, tio,
++ be32_to_cpu(req->buffer_offset), (u8 *) &cmnd->ddigest);
++#else
+ digest_data(&cmnd->conn->tx_hash, cmnd, tio,
+ be32_to_cpu(req->buffer_offset), (u8 *) &cmnd->ddigest);
++#endif
+ }
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h iscsitarget-1.4.20.3+svn502/kernel/iscsi.h
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.h 2017-01-19 20:19:27.400507354 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.h 2017-01-19 20:32:22.979988634 -0800
+@@ -14,6 +14,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/seq_file.h>
+ #include <linux/mm.h>
++#include <crypto/hash.h>
+ #include <linux/crypto.h>
+ #include <linux/scatterlist.h>
+ #include <net/sock.h>
+@@ -275,8 +276,13 @@ struct iscsi_conn {
+ u32 write_offset;
+ int write_state;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct ahash_request *rx_hash;
++ struct ahash_request *tx_hash;
++#else
+ struct hash_desc rx_hash;
+ struct hash_desc tx_hash;
++#endif
+ struct scatterlist hash_sg[ISCSI_CONN_IOV_MAX];
+ };
+
+@@ -552,4 +558,10 @@ enum cmnd_flags {
+ #define PRODUCT_ID "VIRTUAL-DISK"
+ #define PRODUCT_REV "0"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++#define PAGE_CACHE_SHIFT PAGE_SHIFT
++#define PAGE_CACHE_SIZE PAGE_SIZE
++#define PAGE_CACHE_MASK PAGE_MASK
++#endif
++
+ #endif /* __ISCSI_H__ */
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c 2017-01-19 20:19:27.276504928 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c 2017-01-19 20:32:22.979988634 -0800
+@@ -155,7 +155,12 @@ static int do_recv(struct iscsi_conn *co
+
+ oldfs = get_fs();
+ set_fs(get_ds());
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ res = sock_recvmsg(conn->sock, (struct msghdr *) &msg, \
++ MSG_DONTWAIT | MSG_NOSIGNAL);
++#else
+ res = sock_recvmsg(conn->sock, &msg, len, MSG_DONTWAIT | MSG_NOSIGNAL);
++#endif
+ set_fs(oldfs);
+
+ if (res <= 0) {
+@@ -376,7 +381,11 @@ static int write_data(struct iscsi_conn
+ ;
+ oldfs = get_fs();
+ set_fs(KERNEL_DS);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ res = vfs_writev(file, (struct iovec __user *) iop, count, &off, 0);
++#else
+ res = vfs_writev(file, (struct iovec __user *) iop, count, &off);
++#endif
+ set_fs(oldfs);
+ dprintk(D_DATA, "%#Lx:%u: %d(%ld)\n",
+ (unsigned long long) conn->session->sid, conn->cid,
+@@ -503,7 +512,11 @@ static int tx_ddigest(struct iscsi_cmnd
+ iov.iov_base = (char *) (&cmnd->ddigest) + (sizeof(u32) - rest);
+ iov.iov_len = rest;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ res = kernel_sendmsg(cmnd->conn->sock, (struct msghdr *) &msg, &iov, 1, rest);
++#else
+ res = kernel_sendmsg(cmnd->conn->sock, &msg, &iov, 1, rest);
++#endif
+
+ if (res > 0) {
+ cmnd->conn->write_size -= res;
+@@ -702,7 +715,12 @@ static void close_conn(struct iscsi_conn
+
+ write_lock_bh(&conn->sock->sk->sk_callback_lock);
+ conn->sock->sk->sk_state_change = target->nthread_info.old_state_change;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ conn->sock->sk->sk_data_ready = (void (*) (struct sock *)) \
++ target->nthread_info.old_data_ready;
++#else
+ conn->sock->sk->sk_data_ready = target->nthread_info.old_data_ready;
++#endif
+ conn->sock->sk->sk_write_space = target->nthread_info.old_write_space;
+ write_unlock_bh(&conn->sock->sk->sk_callback_lock);
+
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c 2017-01-19 20:19:27.276504928 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-19 20:32:22.979988634 -0800
+@@ -84,12 +84,25 @@ static int set_scsisn(struct iet_volume
+ /* Generate a MD5 hash of the target IQN and LUN number */
+ static void gen_scsiid(struct iet_volume *volume)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ struct ahash_request *hash;
++ struct crypto_ahash *tfm;
++#else
+ struct hash_desc hash;
++#endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
++#else
+ hash.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
+ hash.flags = 0;
++#endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ if (!IS_ERR(tfm)) {
++#else
+ if (!IS_ERR(hash.tfm)) {
++#endif
+ struct scatterlist sg[2];
+ unsigned int nbytes = 0;
+
+@@ -102,11 +115,19 @@ static void gen_scsiid(struct iet_volume
+ sg_set_buf(&sg[1], &volume->lun, sizeof(volume->lun));
+ nbytes += sizeof(volume->lun);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++ crypto_ahash_init(hash);
++ ahash_request_set_crypt(hash, sg, volume->scsi_id, nbytes);
++ crypto_ahash_update(hash);
++ crypto_ahash_digest(hash);
++ crypto_free_ahash(tfm);
++#else
+ crypto_hash_init(&hash);
+ crypto_hash_update(&hash, sg, nbytes);
+ crypto_hash_final(&hash, volume->scsi_id);
+
+ crypto_free_hash(hash.tfm);
++#endif
+ } else {
+ /* If no MD5 available set ID to TID and LUN */
+ memcpy(volume->scsi_id, &volume->target->tid,
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
new file mode 100644
index 000000000..c99683478
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-call-trace-of-ahash-API-calling.patch
@@ -0,0 +1,85 @@
+The previous build_with_updated_interfaces_of_linux_v4.8_and_above.patch
+does not alloc struct ahash_request before using it. This will cause the
+kernel call trace below when calling gen_scsiid on kernel 4.8 or later
+version.
+
+This patch normalizes the calling of ahash API according to the example
+in kernel doc Documentation/crypto/api-intro.txt.
+
+BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
+IP: [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+PGD dd77067 PUD dd7c067 PMD 0
+Oops: 0000 [#1] PREEMPT SMP
+Modules linked in: iscsi_trgt(O)
+CPU: 0 PID: 350 Comm: ietd Tainted: G O 4.8.12-yocto-standard #1
+Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-0-ge2fc41e-prebuilt.qemu-project.org 04/01/2014
+task: ffff88000dfe2c00 task.stack: ffff88000de88000
+RIP: 0010:[<ffffffffa0008d45>] [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+RSP: 0018:ffff88000de8bd90 EFLAGS: 00000206
+RAX: 000000000000ddfa RBX: ffff88000ddd1d78 RCX: ffffea0000000000
+RDX: 0000000000000600 RSI: 0000000000000000 RDI: ffff88000ddd1c14
+RBP: ffff88000de8be38 R08: ffff88000de44180 R09: ffff88000de8bdd0
+R10: 000000000000002c R11: 0000000000000000 R12: ffff88000ddfa600
+R13: 0000000000000000 R14: 0000000000000000 R15: ffff88000de92200
+FS: 00007f767548b700(0000) GS:ffff88000fc00000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 0000000000000020 CR3: 000000000dd2d000 CR4: 00000000000006f0
+Stack:
+ ffff88000de8bdd0 ffff88000dc1b3d0 ffff88000ddfa650 ffff88000ddfa660
+ ffff88000df8f000 ffff88000ddd1c00 ffff88000de44180 0000000000000000
+ ffffea0000377440 0000000f00000c14 0000000000000000 0000000000000000
+Call Trace:
+ [<ffffffffa0006547>] ioctl+0x217/0x390 [iscsi_trgt]
+ [<ffffffff81192574>] do_vfs_ioctl+0x94/0x5c0
+ [<ffffffff8117ff73>] ? vfs_read+0xf3/0x120
+ [<ffffffff81192b19>] SyS_ioctl+0x79/0x90
+ [<ffffffff8191a45b>] entry_SYSCALL_64_fastpath+0x13/0x8f
+Code: 4c 01 e0 0f 82 a2 01 00 00 48 b9 00 00 00 80 ff 77 00 00 48 01
+c8 45 31 f6 48 b9 00 00 00 00 00 ea ff ff 89 54 24 68 48 c1 e8 0c <49>
+8b 56 20 4c 89 44 24 20 4c 89 f7 48 c1 e0 06 c7 44 24 6c 04
+RIP [<ffffffffa0008d45>] volume_add+0x625/0x7f0 [iscsi_trgt]
+ RSP <ffff88000de8bd90>
+CR2: 0000000000000020
+end trace cd2016297df21635 ]
+ietd_response_recv 200 0 -5
+Input/output error.
+
+Upstream-Status: Pending [This patch is based on the previous one which
+has not been merged upstream.]
+
+Signed-off-by: Zhe He <zhe.he@windriver.com>
+
+--- iscsitarget-1.4.20.3+svn502_orig/kernel/volume.c 2017-01-18 08:57:56.752187402 +0800
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-18 09:02:44.164195234 +0800
+@@ -93,13 +93,14 @@ static void gen_scsiid(struct iet_volume
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+ tfm = crypto_alloc_ahash("md5", 0, CRYPTO_ALG_ASYNC);
++ hash = ahash_request_alloc(tfm, GFP_ATOMIC);
+ #else
+ hash.tfm = crypto_alloc_hash("md5", 0, CRYPTO_ALG_ASYNC);
+ hash.flags = 0;
+ #endif
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+- if (!IS_ERR(tfm)) {
++ if (tfm && !IS_ERR(tfm)) {
+ #else
+ if (!IS_ERR(hash.tfm)) {
+ #endif
+@@ -116,10 +117,13 @@ static void gen_scsiid(struct iet_volume
+ nbytes += sizeof(volume->lun);
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+- crypto_ahash_init(hash);
++ ahash_request_set_callback(hash, 0, NULL, NULL);
+ ahash_request_set_crypt(hash, sg, volume->scsi_id, nbytes);
+- crypto_ahash_update(hash);
+ crypto_ahash_digest(hash);
++ crypto_ahash_init(hash);
++ crypto_ahash_update(hash);
++ crypto_ahash_final(hash);
++ ahash_request_free(hash);
+ crypto_free_ahash(tfm);
+ #else
+ crypto_hash_init(&hash);
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
new file mode 100644
index 000000000..1e6a1d6d3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/fix-errors-observed-with-linux-3.19-and-greater.patch
@@ -0,0 +1,327 @@
+Description: Fix source to compile on 3.19 kernels
+Author: Stefan Bader <stefan.bader@canonical.com>
+Forward: no
+
+Fixes below inconsistent crash when trying to login to iSCSI target
+server, observed with linux kernel v4.1.
+
+-- snip --
+CPU: 1 PID: 29883 Comm: istd1 Tainted: G O 4.1.35-rt40-yocto-standard #1
+Hardware name: To be filled by O.E.M. To be filled by O.E.M./Larne CRB, BIOS 4.6.5.4 09/18/2014
+task: ffff88020f1f30c0 ti: ffff8800d7f3c000 task.ti: ffff8800d7f3c000
+RIP: 0010:[<ffffffff8140d1ae>] [<ffffffff8140d1ae>] copy_to_iter+0x3e/0x280
+RSP: 0018:ffff8800d7f3f728 EFLAGS: 00010246
+RAX: 00000000d7f3f928 RBX: 0000000000000030 RCX: 0000000000000030
+RDX: ffff8800d7f3f900 RSI: 0000000000000030 RDI: ffff8800d1501e82
+RBP: ffff8800d7f3f768 R08: 00000000c127d467 R09: 0000000000000000
+R10: ffff88020f29e118 R11: 0000000000000004 R12: ffff8800d7f3f900
+R13: 0000000000000030 R14: 0000000000000001 R15: 0000000000000246
+FS: 00007f86f9c4c700(0000) GS:ffff88021ec80000(0000) knlGS:00000000f7733700
+CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+CR2: 000000000000024e CR3: 00000000d38b0000 CR4: 00000000000406e0
+Stack:
+ffff880214f14ec0 ffff8800d1501e82 ffff8800d7f3f748 0000000000000030
+ffff88020f122500 0000000000000030 0000000000000000 0000000000000030
+ffff8800d7f3f7c8 ffffffff81806981 ffff8800d7f3f798 ffffffff8105d72a
+Call Trace:
+[<ffffffff81806981>] skb_copy_datagram_iter+0x71/0x2b0
+[<ffffffff8105d72a>] ? __local_bh_enable_ip+0x4a/0xb0
+[<ffffffff8186c9c0>] tcp_recvmsg+0x5e0/0xbb0
+[<ffffffff81898ded>] inet_recvmsg+0x8d/0xb0
+[<ffffffff817f49f3>] sock_recvmsg+0x13/0x20
+[<ffffffffa01655c3>] do_recv+0xe3/0x1f0 [iscsi_trgt]
+[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
+[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
+[<ffffffff81153097>] ? __mod_zone_page_state+0x77/0xb0
+[<ffffffff8140fed5>] ? find_next_bit+0x15/0x30
+[<ffffffff813fa8e0>] ? cpumask_next_and+0x30/0x50
+[<ffffffff8113f785>] ? __alloc_pages_nodemask+0x165/0x980
+[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
+[<ffffffff8195da8b>] ? _raw_spin_lock+0x1b/0x60
+[<ffffffff8109cfa8>] ? cpuacct_charge+0x58/0x70
+[<ffffffff81089039>] ? update_curr+0xb9/0x190
+[<ffffffff81417613>] ? __this_cpu_preempt_check+0x13/0x20
+[<ffffffff8112b43f>] ? __perf_event_task_sched_in+0x4f/0x90
+[<ffffffff8195dbbd>] ? _raw_spin_unlock_irq+0x1d/0x40
+[<ffffffff8107e223>] ? finish_task_switch+0x63/0xe0
+[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
+[<ffffffff8107e370>] ? preempt_count_add+0xd0/0xf0
+[<ffffffffa0165c65>] istd+0x4d5/0x1390 [iscsi_trgt]
+[<ffffffff81959e3b>] ? __schedule+0x38b/0x980
+[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
+[<ffffffffa0165790>] ? nthread_wakeup+0x40/0x40 [iscsi_trgt]
+[<ffffffff8107748b>] kthread+0xbb/0xe0
+[<ffffffff81950000>] ? wireless_dev_seq_show+0x100/0x180
+[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
+[<ffffffff8195e7a2>] ret_from_fork+0x42/0x70
+[<ffffffff810773d0>] ? kthread_worker_fn+0x170/0x170
+Code: 5a 10 48 89 7d c8 48 39 f3 48 0f 47 de 48 85 db 0f 84 6f 01 00 00 8b 02 49 89
+d4 4c 8b 72 08 4c 8b 7a 18 a8 04 0f 85 a2 00 00 00 <4d> 8b 6f 08 4d 29 f5 49 39 dd 4c 0f 47 eb a8 02 0f 85 5c 01 00
+RSP <ffff8800d7f3f728>
+CR2: 000000000000024e
+------------[ cut here ]------------
+-- snip --
+
+The original patch is at
+http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz,
+those changes were taken using #ifs, inorder to allow compilation of
+iscsitarget package with linux kernels < 3.19.
+
+Upstream-Status: Submitted [http://launchpadlibrarian.net/218100509/iscsitarget_1.4.20.3+svn499-0ubuntu2_1.4.20.3+svn499-0ubuntu2.1.diff.gz]
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/conn.c iscsitarget-1.4.20.3+svn502/kernel/conn.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/conn.c 2017-01-18 22:27:02.713167436 -0800
++++ iscsitarget-1.4.20.3+svn502/kernel/conn.c 2017-01-18 23:13:11.909214379 -0800
+@@ -129,7 +129,11 @@ static void iet_socket_bind(struct iscsi
+
+ dprintk(D_GENERIC, "%llu\n", (unsigned long long) session->sid);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ conn->sock = SOCKET_I(file_inode(conn->file));
++#else
+ conn->sock = SOCKET_I(conn->file->f_dentry->d_inode);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ conn->sock->sk->sk_user_data = conn;
+
+ write_lock_bh(&conn->sock->sk->sk_callback_lock);
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c iscsitarget-1.4.20.3+svn502/kernel/file-io.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/file-io.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/file-io.c 2017-01-18 23:54:38.505717079 -0800
+@@ -69,7 +69,11 @@ static int fileio_make_request(struct ie
+ static int fileio_sync(struct iet_volume *lu, struct tio *tio)
+ {
+ struct fileio_data *p = lu->private;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ struct inode *inode = file_inode(p->filp);
++#else
+ struct inode *inode = p->filp->f_dentry->d_inode;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ struct address_space *mapping = inode->i_mapping;
+ loff_t ppos, count;
+ int res;
+@@ -213,7 +217,11 @@ static int fileio_attach(struct iet_volu
+ eprintk("%d\n", err);
+ goto out;
+ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ inode = file_inode(p->filp);
++#else
+ inode = p->filp->f_dentry->d_inode;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+
+ if (S_ISREG(inode->i_mode))
+ ;
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c iscsitarget-1.4.20.3+svn502/kernel/iscsi.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/iscsi.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/iscsi.c 2017-01-18 23:37:36.462970326 -0800
+@@ -489,8 +489,12 @@ static void cmnd_skip_pdu(struct iscsi_c
+ }
+ conn->read_iov[i].iov_base = addr;
+ conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ conn->read_msg.msg_iov = conn->read_iov;
+ conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+
+ static void iscsi_cmnd_reject(struct iscsi_cmnd *req, int reason)
+@@ -718,7 +722,9 @@ static int cmnd_recv_pdu(struct iscsi_co
+ idx = offset >> PAGE_CACHE_SHIFT;
+ offset &= ~PAGE_CACHE_MASK;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ conn->read_msg.msg_iov = conn->read_iov;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ conn->read_size = size = (size + 3) & -4;
+ conn->read_overflow = 0;
+
+@@ -730,16 +736,25 @@ static int cmnd_recv_pdu(struct iscsi_co
+ conn->read_iov[i].iov_base = addr + offset;
+ if (offset + size <= PAGE_CACHE_SIZE) {
+ conn->read_iov[i].iov_len = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, ++i, conn->read_size);
++#else
+ conn->read_msg.msg_iovlen = ++i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ break;
+ }
+ conn->read_iov[i].iov_len = PAGE_CACHE_SIZE - offset;
+ size -= conn->read_iov[i].iov_len;
+ offset = 0;
+ if (++i >= ISCSI_CONN_IOV_MAX) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ conn->read_overflow = size;
+ conn->read_size -= size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ break;
+ }
+
+@@ -918,7 +933,9 @@ static int nop_out_start(struct iscsi_co
+
+ if ((size = cmnd->pdu.datasize)) {
+ size = (size + 3) & -4;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ conn->read_msg.msg_iov = conn->read_iov;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ if (cmnd->pdu.bhs.itt != cpu_to_be32(ISCSI_RESERVED_TAG)) {
+ struct tio *tio;
+ int pg_cnt = get_pgcnt(size);
+@@ -946,7 +963,11 @@ static int nop_out_start(struct iscsi_co
+ }
+ assert(!size);
+ conn->read_overflow = size;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, i, conn->read_size);
++#else
+ conn->read_msg.msg_iovlen = i;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+
+ out:
+@@ -986,7 +1007,11 @@ static void scsi_cmnd_start(struct iscsi
+ set_cmnd_lunit(req);
+
+ switch (req_hdr->scb[0]) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ case SERVICE_ACTION_IN_16:
++#else
+ case SERVICE_ACTION_IN:
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ if ((req_hdr->scb[1] & 0x1f) != 0x10)
+ goto error;
+ case INQUIRY:
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c iscsitarget-1.4.20.3+svn502/kernel/nthread.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/nthread.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/nthread.c 2017-01-18 23:45:03.291033881 -0800
+@@ -42,9 +42,14 @@ static inline void iscsi_conn_init_read(
+ len = (len + 3) & -4; // XXX ???
+ conn->read_iov[0].iov_base = data;
+ conn->read_iov[0].iov_len = len;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
+ conn->read_msg.msg_iov = conn->read_iov;
+ conn->read_msg.msg_iovlen = 1;
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) */
+ conn->read_size = (len + 3) & -4;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ iov_iter_init(&conn->read_msg.msg_iter, READ, conn->read_iov, 1, conn->read_size);
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+
+ static void iscsi_conn_read_ahs(struct iscsi_conn *conn, struct iscsi_cmnd *cmnd)
+@@ -83,14 +88,31 @@ static int is_data_available(struct iscs
+
+ static void forward_iov(struct msghdr *msg, int len)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ struct iovec *iov;
++
++ while (msg->msg_iter.iov->iov_len <= len) {
++ len -= msg->msg_iter.iov->iov_len;
++ msg->msg_iter.iov++;
++ msg->msg_iter.nr_segs--;
++ }
++#else
+ while (msg->msg_iov->iov_len <= len) {
+ len -= msg->msg_iov->iov_len;
+ msg->msg_iov++;
+ msg->msg_iovlen--;
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ /* XXX: discards const ... */
++ iov = msg->msg_iter.iov;
++ iov->iov_base = (char *) msg->msg_iter.iov->iov_base + len;
++ iov->iov_len -= len;
++#else
+ msg->msg_iov->iov_base = (char *) msg->msg_iov->iov_base + len;
+ msg->msg_iov->iov_len -= len;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ }
+
+ static int do_recv(struct iscsi_conn *conn, int state)
+@@ -98,6 +120,9 @@ static int do_recv(struct iscsi_conn *co
+ mm_segment_t oldfs;
+ struct msghdr msg;
+ struct iovec iov[ISCSI_CONN_IOV_MAX];
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ size_t iovlen = ISCSI_CONN_IOV_MAX;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ int i, len, res;
+
+ if (!test_bit(CONN_ACTIVE, &conn->state)) {
+@@ -110,12 +135,23 @@ static int do_recv(struct iscsi_conn *co
+ goto out;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ if (conn->read_msg.msg_iter.nr_segs < iovlen)
++ iovlen = conn->read_msg.msg_iter.nr_segs;
++
++ for (i = 0, len = 0; i < iovlen; i++) {
++ iov[i] = conn->read_msg.msg_iter.iov[i];
++ len += iov[i].iov_len;
++ }
++ iov_iter_init(&msg.msg_iter, READ, iov, iovlen, len);
++#else
+ msg.msg_iov = iov;
+ msg.msg_iovlen = min_t(size_t, conn->read_msg.msg_iovlen, ISCSI_CONN_IOV_MAX);
+ for (i = 0, len = 0; i < msg.msg_iovlen; i++) {
+ iov[i] = conn->read_msg.msg_iov[i];
+ len += iov[i].iov_len;
+ }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+
+ oldfs = get_fs();
+ set_fs(get_ds());
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c iscsitarget-1.4.20.3+svn502/kernel/target_disk.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/target_disk.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/target_disk.c 2017-01-18 23:45:51.451010417 -0800
+@@ -606,7 +606,11 @@ static int disk_execute_cmnd(struct iscs
+ case REQUEST_SENSE:
+ send_data_rsp(cmnd, build_request_sense_response);
+ break;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ case SERVICE_ACTION_IN_16:
++#else
+ case SERVICE_ACTION_IN:
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ send_data_rsp(cmnd, build_service_action_in_response);
+ break;
+ case READ_6:
+diff -Naurp iscsitarget-1.4.20.3+svn502_org/kernel/volume.c iscsitarget-1.4.20.3+svn502/kernel/volume.c
+--- iscsitarget-1.4.20.3+svn502_org/kernel/volume.c 2014-05-06 13:59:55.000000000 -0700
++++ iscsitarget-1.4.20.3+svn502/kernel/volume.c 2017-01-18 23:47:07.957561600 -0800
+@@ -398,7 +398,11 @@ int is_volume_reserved(struct iet_volume
+ case READ_CAPACITY:
+ /* allowed commands when reserved */
+ break;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ case SERVICE_ACTION_IN_16:
++#else
+ case SERVICE_ACTION_IN:
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ if ((scb[1] & 0x1F) == 0x10)
+ break;
+ /* fall through */
+@@ -465,7 +469,11 @@ int is_volume_reserved(struct iet_volume
+ if (excl_access_ro && !registered)
+ err = -EBUSY;
+ break;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
++ case SERVICE_ACTION_IN_16:
++#else
+ case SERVICE_ACTION_IN:
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) */
+ if ((scb[1] & 0x1F) == 0x10)
+ break;
+ /* fall through */
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch
new file mode 100644
index 000000000..95bd047b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/files/use-kernel-makefile-to-get-kernel-version.patch
@@ -0,0 +1,67 @@
+Get linux kernel version from Makefile of kernel source
+
+We get below messages while building iscsitarget,
+
+-- snip --
+x86_64-poky-linux-gcc: error:
+/CGE7_SHDD/project_yocto_1.8/poky/build/tmp/work-shared/qemux86-64/kernel-source/include/linux/version.h:
+No such file or directory
+x86_64-poky-linux-gcc: fatal error: no input files
+compilation terminated.
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+/bin/sh: line 0: [: too many arguments
+-- CUT --
+
+These messages are due to absence of include/linux/version.h file in
+kernel source directory and failed to compute linux kernel version.
+So, use kernel source Makefile ( i.e $(KSRC)/Makefile) to find out
+actual kernel version.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+--- iscsitarget-1.4.20.3+svn499_org/Makefile 2014-01-27 00:00:45.000000000 +0530
++++ iscsitarget-1.4.20.3+svn499/Makefile 2015-07-23 10:44:47.013600285 +0530
+@@ -18,27 +18,11 @@ ifeq ($(KSRC),)
+ endif
+
+
+-ifneq ($(wildcard $(KSRC)/include/generated/utsrelease.h),)
+- VERSION_FILE := $(KSRC)/include/generated/utsrelease.h
+-else
+- ifneq ($(wildcard $(KSRC)/include/linux/utsrelease.h),)
+- VERSION_FILE := $(KSRC)/include/linux/utsrelease.h
+- else
+- VERSION_FILE := $(KSRC)/include/linux/version.h
+- endif
+-endif
+-
+-KVER := $(shell $(CC) $(CFLAGS) $(LDFLAGS) -E -dM $(VERSION_FILE) | \
+- grep UTS_RELEASE | awk '{ print $$3 }' | sed 's/\"//g')
+-
+ KMOD := /lib/modules/$(KVER)/extra
+-
+-KMAJ := $(shell echo $(KVER) | \
+- sed -e 's/^\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*.*/\1/')
+-KMIN := $(shell echo $(KVER) | \
+- sed -e 's/^[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*.*/\1/')
+-KREV := $(shell echo $(KVER) | \
+- sed -e 's/^[0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\).*/\1/')
++KMAJ := $(shell cat $(KSRC)/Makefile | grep ^VERSION | gawk -F " " '{ print $$NF }')
++KMIN := $(shell cat $(KSRC)/Makefile | grep ^PATCHLEVEL | gawk -F " " '{ print $$NF }')
++KREV := $(shell cat $(KSRC)/Makefile | grep ^SUBLEVEL | gawk -F " " '{ print $$NF }')
++KVER := ${KMAJ}.${KMIN}.${KREV}
+
+ kver_eq = $(shell [ $(KMAJ) -eq $(1) -a $(KMIN) -eq $(2) -a $(KREV) -eq $(3) ] && \
+ echo 1 || echo 0)
diff --git a/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
new file mode 100644
index 000000000..5d1359165
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-extended/iscsitarget/iscsitarget_1.4.20.3+svn502.bb
@@ -0,0 +1,64 @@
+DESCRIPTION = "iSCSI Enterprise Target is aimed to develop an \
+ open source iSCSI target with professional features, \
+ that works well in enterprise environment under real \
+ workload, and is scalable and versatile enough to meet the \
+ challenge of future storage needs and developments."
+HOMEPAGE = "http://iscsitarget.sourceforge.net/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e233eda45c807aa29aeaa6d94bc48a2"
+DEPENDS = "openssl virtual/kernel"
+
+SRC_URI = "http://ftp.heanet.ie/mirrors/ubuntu/pool/universe/i/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://use-kernel-makefile-to-get-kernel-version.patch \
+ file://fix-errors-observed-with-linux-3.19-and-greater.patch \
+ file://access-sk_v6_daddr-iff-IPV6-defined.patch \
+ file://build_with_updated_bio_struct_of_linux_v4.3_and_above.patch \
+ file://build_with_updated_interfaces_of_linux_v4.8_and_above.patch \
+ file://fix-call-trace-of-ahash-API-calling.patch \
+ file://0001-kernel-event-netlink_ack-now-requires-4-arguments.patch \
+ "
+
+SRC_URI[md5sum] = "ef9bc823bbabd3c772208c00d5f2d089"
+SRC_URI[sha256sum] = "d3196ccb78a43266dce28587bfe30d8ab4db7566d7bce96057dfbb84100babb5"
+
+inherit module
+
+do_configure[noexec] = "1"
+
+# make_scripts requires kernel source directory to create
+# kernel scripts
+do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
+
+do_compile() {
+ oe_runmake KSRC=${STAGING_KERNEL_DIR} LDFLAGS='' V=1 kernel
+ oe_runmake KSRC=${STAGING_KERNEL_DIR} usr
+}
+
+do_install() {
+ # Module
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/iscsi
+ install -m 0644 kernel/iscsi_trgt.ko \
+ ${D}/lib/modules/${KERNEL_VERSION}/kernel/iscsi/iscsi_trgt.ko
+
+ # Userspace utilities
+ install -d ${D}${sbindir}
+ install -m 0755 usr/ietd ${D}${sbindir}/ietd
+ install -m 0755 usr/ietadm ${D}${sbindir}/ietadm
+
+ # Config files, init scripts
+ mkdir -p ${D}${sysconfdir}/iet
+ install -m 0644 etc/ietd.conf ${D}/${sysconfdir}/iet/ietd.conf
+ install -m 0644 etc/initiators.allow ${D}${sysconfdir}/iet/initiators.allow
+ install -m 0644 etc/targets.allow ${D}${sysconfdir}/iet/targets.allow
+ mkdir -p ${D}${sysconfdir}/init.d
+ install -m 0755 etc/initd/initd ${D}${sysconfdir}/init.d/iscsi-target
+ install -m 0644 etc/initiators.deny ${D}${sysconfdir}/iet/initiators.deny
+}
+
+FILES_${PN} += "${sbindir} \
+ ${sysconfdir}"
+
+RDEPENDS_${PN} = "kernel-module-iscsi-trgt"
+RRECOMMENDS_${PN} = "kernel-module-crc32c kernel-module-libcrc32c"
+
+PNBLACKLIST[iscsitarget] = "error: implicit declaration of function 'init_timer'; did you mean 'init_timers'?; 4.15 kernel issues"
diff --git a/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb b/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb
new file mode 100644
index 000000000..6fd0affdf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/arno-iptables-firewall/arno-iptables-firewall_2.0.1g.bb
@@ -0,0 +1,35 @@
+SUMMARY = "IPTables based firewall scripts"
+HOMEPAGE = "http://rocky.eld.leidenuniv.nl/joomla/index.php?option=com_content&view=article&id=45&Itemid=63"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://gpl_license.txt;md5=11c7b65c4a4acb9d5175f7e9bf99c403"
+
+SRC_URI = "http://rocky.eld.leidenuniv.nl/arno-iptables-firewall/${BPN}_${PV}.tar.gz \
+ "
+SRC_URI[md5sum] = "77eba7f148bf2840a3e35a6f50c9c353"
+SRC_URI[sha256sum] = "0bafd85ddc235752250eaec0c7fdb21e530912483f6807a97f86158ed2d301f7"
+
+S = "${WORKDIR}/${BPN}_${PV}"
+
+inherit systemd
+
+do_install() {
+ install -d ${D}${sysconfdir} ${D}${sbindir} ${D}${bindir} ${D}${systemd_unitdir}/system ${D}${sysconfdir}/init.d
+ install -d ${D}${datadir}/arno-iptables-firewall ${D}${sysconfdir}/arno-iptables-firewall
+ cp -r ${S}${sysconfdir}/arno-iptables-firewall ${D}${sysconfdir}/
+ install -m 0755 ${S}${sysconfdir}/init.d/arno-iptables-firewall ${D}${bindir}
+ install -m 0755 ${S}/bin/arno-iptables-firewall ${D}${sbindir}
+ install -m 0755 ${S}/bin/arno-fwfilter ${D}${bindir}
+ cp -r ${S}/share/arno-iptables-firewall/* ${D}${datadir}/arno-iptables-firewall
+ cp -r ${S}/etc/arno-iptables-firewall/* ${D}${sysconfdir}/arno-iptables-firewall
+ install -m 0644 ${S}/${systemd_unitdir}/system/arno-iptables-firewall.service ${D}${systemd_unitdir}/system
+ sed -i -e 's%/usr/local/sbin%${bindir}%g' ${D}${systemd_unitdir}/system/arno-iptables-firewall.service
+ sed -i -e 's%/usr/local/sbin%${sbindir}%g' ${D}${bindir}/arno-iptables-firewall
+ sed -i -e 's%/usr/local%${exec_prefix}%g' ${D}${sysconfdir}/arno-iptables-firewall/firewall.conf
+ sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${bindir}/arno-fwfilter
+ sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${datadir}/arno-iptables-firewall/plugins/traffic-accounting-helper
+ sed -i -e 's%#!/bin/bash%#!/bin/sh%g' ${D}${datadir}/arno-iptables-firewall/plugins/dyndns-host-open-helper
+}
+
+SYSTEMD_SERVICE_${PN} = "arno-iptables-firewall.service"
+FILES_${PN} += "${systemd_unitdir}/system/arno-iptables-firewall.service"
diff --git a/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb
new file mode 100644
index 000000000..8b3490d7c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.4.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Connection tracking userspace tools for Linux"
+SECTION = "net"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \
+ libnetfilter-cthelper libnetfilter-queue bison-native"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+SRC_URI = "http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \
+ file://conntrack-failover \
+ file://init \
+"
+SRC_URI[tar.md5sum] = "acd9e0b27cf16ae3092ba900e4d7560e"
+SRC_URI[tar.sha256sum] = "b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c"
+
+inherit autotools update-rc.d pkgconfig
+
+INITSCRIPT_NAME = "conntrackd"
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/conntrackd
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 0644 ${S}/doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
+ install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover
+ install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd
+
+ # Fix hardcoded paths in scripts
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample
+ sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd
+}
diff --git a/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover
new file mode 100644
index 000000000..6d92e637f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org>
+# (C) 2009 Roman I Khimov <khimov@altell.ru>
+#
+# This software may be used and distributed according to the terms
+# of the GNU General Public License, incorporated herein by reference.
+#
+# Description:
+#
+# This is the script for primary-backup setups for keepalived
+# (http://www.keepalived.org). You may adapt it to make it work with other
+# high-availability managers.
+#
+# Do not forget to include the required modifications to your keepalived.conf
+# file to invoke this script during keepalived's state transitions.
+#
+# Contributions to improve this script are welcome :).
+#
+## Modified to work as init.d script under pacemaker control
+
+CONNTRACKD_BIN=/usr/sbin/conntrackd
+CONNTRACKD_LOCK=/var/lock/conntrack.lock
+CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf
+
+case "$1" in
+ start)
+ #
+ # commit the external cache into the kernel table
+ #
+ $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c
+ if [ $? -eq 1 ]
+ then
+ logger "ERROR: failed to invoke conntrackd -c"
+ fi
+
+ #
+ # flush the internal and the external caches
+ #
+ $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f
+ if [ $? -eq 1 ]
+ then
+ logger "ERROR: failed to invoke conntrackd -f"
+ fi
+
+ #
+ # resynchronize my internal cache to the kernel table
+ #
+ $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R
+ if [ $? -eq 1 ]
+ then
+ logger "ERROR: failed to invoke conntrackd -R"
+ fi
+
+ #
+ # send a bulk update to backups
+ #
+ $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B
+ if [ $? -eq 1 ]
+ then
+ logger "ERROR: failed to invoke conntrackd -B"
+ fi
+ ;;
+ stop)
+ $CONNTRACKD_BIN -t
+ $CONNTRACKD_BIN -n
+ ;;
+ status)
+ ;;
+ *)
+ logger "ERROR: unknown command"
+ echo "Usage: conntrack-failover {start|stop|status}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/init b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/init
new file mode 100644
index 000000000..bce2075a7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/conntrack-tools/files/init
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# /etc/init.d/conntrackd
+#
+# Maximilian Wilhelm <max@rfc2324.org>
+# -- Mon, 06 Nov 2006 18:39:07 +0100
+#
+# Roman I Khimov <khimov@altell.ru>
+# -- Tue, 27 Oct 2009 14:34:00 +0300
+
+### BEGIN INIT INFO
+# Provides: conntrackd
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Description: Starts conntrackd
+# short-description: Starts conntrackd
+### END INIT INFO
+
+export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+NAME="conntrackd"
+DAEMON="/usr/sbin/conntrackd"
+CONFIG="/etc/conntrackd/conntrackd.conf"
+PIDFILE="/var/run/${NAME}.pid"
+
+
+# Gracefully exit if there is no daemon (debian way of life)
+if [ ! -x "${DAEMON}" ]; then
+ exit 0
+fi
+
+# Check for config file
+if [ ! -f /etc/conntrackd/conntrackd.conf ]; then
+ echo "Error: There is no config file for $NAME" >&2
+ exit 1;
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting $NAME: "
+ for i in nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_proto_dccp nf_conntrack_tftp \
+ nf_conntrack_sane nf_conntrack_pptp nf_conntrack_irc nf_conntrack_amanda nf_conntrack_h323 \
+ nf_conntrack_proto_udplite nf_conntrack_proto_gre nf_conntrack_proto_sctp nf_conntrack_ftp \
+ nf_conntrack_sip; do
+ modprobe $i >/dev/null 2>/dev/null &
+ done
+ start-stop-daemon --start --quiet --make-pidfile --pidfile "/var/run/${NAME}.pid" --background --exec "${DAEMON}"
+ RET=$?
+ if [ "$?" = "0" ]; then
+ sleep 2
+ # Sync with other server
+ conntrackd -n
+ echo "done."
+ else
+ echo "FAILED!"
+ fi
+ exit $RET
+ ;;
+ stop)
+ echo -n "Stopping $NAME:"
+ start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/${NAME}.pid" && echo "done." || echo "FAILED!"
+ ;;
+ status)
+ echo -n "conntrackd "
+ start-stop-daemon -q -K -t -x $DAEMON
+ RET=$?
+ if [ "$RET" = "0" ]; then
+ PID=`cat $PIDFILE`
+ echo "($PID) is running"
+ else
+ echo "is not running"
+ exit $RET
+ fi
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/conntrackd {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
new file mode 100644
index 000000000..90b69792b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0001-add-RARP-and-update-iana-url.patch
@@ -0,0 +1,45 @@
+From dd35afc9ce1004128a754d5eeb8c5c2cb32ae420 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Tue, 3 Jul 2012 18:47:32 +0000
+Subject: [PATCH 01/10] add RARP and update iana url
+
+---
+ ethertypes | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/ethertypes b/ethertypes
+index 5e700f6..813177b 100644
+--- a/ethertypes
++++ b/ethertypes
+@@ -5,6 +5,7 @@
+ #
+ # This list could be found on:
+ # http://www.iana.org/assignments/ethernet-numbers
++# http://www.iana.org/assignments/ieee-802-numbers
+ #
+ # <name> <hexnumber> <alias1>...<alias35> #Comment
+ #
+@@ -21,15 +22,16 @@ LAT 6004 # DEC LAT
+ DIAG 6005 # DEC Diagnostics
+ CUST 6006 # DEC Customer use
+ SCA 6007 # DEC Systems Comms Arch
+-TEB 6558 # Trans Ether Bridging [RFC1701]
+-RAW_FR 6559 # Raw Frame Relay [RFC1701]
++TEB 6558 # Trans Ether Bridging [RFC1701]
++RAW_FR 6559 # Raw Frame Relay [RFC1701]
++RARP 8035 # Reverse ARP [RFC903]
+ AARP 80F3 # Appletalk AARP
+-ATALK 809B # Appletalk
++ATALK 809B # Appletalk
+ 802_1Q 8100 8021q 1q 802.1q dot1q # 802.1Q Virtual LAN tagged frame
+ IPX 8137 # Novell IPX
+ NetBEUI 8191 # NetBEUI
+ IPv6 86DD ip6 # IP version 6
+-PPP 880B # PPP
++PPP 880B # PPP
+ ATMMPOA 884C # MultiProtocol over ATM
+ PPP_DISC 8863 # PPPoE discovery messages
+ PPP_SES 8864 # PPPoE session messages
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
new file mode 100644
index 000000000..87b0e9b87
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0002-fix-compilation-warning.patch
@@ -0,0 +1,25 @@
+From 2a5333fc8b4825251adfb717d980d89cefde38d6 Mon Sep 17 00:00:00 2001
+From: Petri Gynther <petri.gynther@gmail.com>
+Date: Sun, 24 Feb 2013 10:56:59 +0100
+Subject: [PATCH 02/10] fix compilation warning
+
+---
+ communication.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/communication.c b/communication.c
+index 62ed667..ba058c0 100644
+--- a/communication.c
++++ b/communication.c
+@@ -282,7 +282,7 @@ static int store_counters_in_file(char *filename, struct ebt_u_replace *repl)
+ }
+ close_file:
+ fclose(file);
+- return 0;
++ return ret;
+ }
+
+ /* Gets executed after ebt_deliver_table. Delivers the counters to the kernel
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
new file mode 100644
index 000000000..c8573a464
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0003-add-info-about-Wl-no-as-needed.patch
@@ -0,0 +1,25 @@
+From a6faf3b50d6af4768b7b853cb536944fb18e1450 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Wed, 3 Jul 2013 22:12:47 +0200
+Subject: [PATCH 03/10] add info about -Wl,-no-as-needed
+
+---
+ INSTALL | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/INSTALL b/INSTALL
+index 4a05c67..e90d5c1 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -39,6 +39,8 @@ That's all
+ You can also use a base directory different from the root directory (/),
+ using the DESTDIR option. See the Makefile for more details.
+
++You might need to set LDFLAGS=-Wl,-no-as-needed to build ebtables correctly
++on your system.
+
+ ADDITIONAL PROGRAMS:
+ ----------------------
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
new file mode 100644
index 000000000..d8f2795bc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch
@@ -0,0 +1,28 @@
+From b0617af37b8b1aafb43e8019135bea44c2d94c28 Mon Sep 17 00:00:00 2001
+From: Luis Fernando <tdthp@terra.com.br>
+Date: Wed, 3 Jul 2013 22:19:55 +0200
+Subject: [PATCH 04/10] workaround for kernel regression bug: IPv6
+ source/destination addresses are potentially not matched correctly
+
+---
+ extensions/ebt_ip6.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index 0465e77..bbdc4ae 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -312,6 +312,10 @@ static void init(struct ebt_entry_match *match)
+
+ ipinfo->invflags = 0;
+ ipinfo->bitmask = 0;
++ memset(ipinfo->saddr.s6_addr, 0, sizeof(ipinfo->saddr.s6_addr));
++ memset(ipinfo->smsk.s6_addr, 0, sizeof(ipinfo->smsk.s6_addr));
++ memset(ipinfo->daddr.s6_addr, 0, sizeof(ipinfo->daddr.s6_addr));
++ memset(ipinfo->dmsk.s6_addr, 0, sizeof(ipinfo->dmsk.s6_addr));
+ }
+
+ #define OPT_SOURCE 0x01
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
new file mode 100644
index 000000000..9585fd20e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0005-Add-noflush-command-line-support-for-ebtables-restor.patch
@@ -0,0 +1,75 @@
+From 15d3ab8a4a167dc44396b003d2ec01841949972f Mon Sep 17 00:00:00 2001
+From: Sanket Shah <sanket.shah@cyberoam.com>
+Date: Wed, 31 Jul 2013 21:40:08 +0200
+Subject: [PATCH 05/10] Add --noflush command line support for ebtables-restore
+
+---
+ ebtables-restore.c | 29 +++++++++++++++++++++++++----
+ 1 file changed, 25 insertions(+), 4 deletions(-)
+
+diff --git a/ebtables-restore.c b/ebtables-restore.c
+index ea02960..bb4d0cf 100644
+--- a/ebtables-restore.c
++++ b/ebtables-restore.c
+@@ -22,13 +22,25 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <getopt.h>
+ #include "include/ebtables_u.h"
+
++static const struct option options[] = {
++ {.name = "noflush", .has_arg = 0, .val = 'n'},
++ { 0 }
++};
++
+ static struct ebt_u_replace replace[3];
+ void ebt_early_init_once();
+
+ #define OPT_KERNELDATA 0x800 /* Also defined in ebtables.c */
+
++static void print_usage()
++{
++ fprintf(stderr, "Usage: ebtables-restore [ --noflush ]\n");
++ exit(1);
++}
++
+ static void copy_table_names()
+ {
+ strcpy(replace[0].name, "filter");
+@@ -41,11 +53,20 @@ static void copy_table_names()
+ int main(int argc_, char *argv_[])
+ {
+ char *argv[EBTD_ARGC_MAX], cmdline[EBTD_CMDLINE_MAXLN];
+- int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace;
++ int i, offset, quotemode = 0, argc, table_nr = -1, line = 0, whitespace, c, flush = 1;
+ char ebtables_str[] = "ebtables";
+
+- if (argc_ != 1)
+- ebtrest_print_error("options are not supported");
++ while ((c = getopt_long(argc_, argv_, "n", options, NULL)) != -1) {
++ switch(c) {
++ case 'n':
++ flush = 0;
++ break;
++ default:
++ print_usage();
++ break;
++ }
++ }
++
+ ebt_silent = 0;
+ copy_table_names();
+ ebt_early_init_once();
+@@ -68,7 +89,7 @@ int main(int argc_, char *argv_[])
+ ebtrest_print_error("table '%s' was not recognized", cmdline+1);
+ table_nr = i;
+ replace[table_nr].command = 11;
+- ebt_get_kernel_table(&replace[table_nr], 1);
++ ebt_get_kernel_table(&replace[table_nr], flush);
+ replace[table_nr].command = 0;
+ replace[table_nr].flags = OPT_KERNELDATA; /* Prevent do_command from initialising replace */
+ continue;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
new file mode 100644
index 000000000..21f8e588d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch
@@ -0,0 +1,69 @@
+From 85a0f6d77a9d5c0e7ef7948395f0f6b1612dc987 Mon Sep 17 00:00:00 2001
+From: Bart De Schuymer <bdschuym@pandora.be>
+Date: Mon, 14 Apr 2014 22:04:55 +0200
+Subject: [PATCH 06/10] don't print IPv6 mask if it's all ones (based on patch
+ by Mariusz Mazur <mmazur at axeos.com>)
+
+---
+ extensions/ebt_ip6.c | 4 ++--
+ include/ebtables_u.h | 1 +
+ useful_functions.c | 13 +++++++++++++
+ 3 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index bbdc4ae..e3e0956 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -449,14 +449,14 @@ static void print(const struct ebt_u_entry *entry,
+ if (ipinfo->invflags & EBT_IP6_SOURCE)
+ printf("! ");
+ printf("%s", ebt_ip6_to_numeric(&ipinfo->saddr));
+- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->smsk));
++ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->smsk));
+ }
+ if (ipinfo->bitmask & EBT_IP6_DEST) {
+ printf("--ip6-dst ");
+ if (ipinfo->invflags & EBT_IP6_DEST)
+ printf("! ");
+ printf("%s", ebt_ip6_to_numeric(&ipinfo->daddr));
+- printf("/%s ", ebt_ip6_to_numeric(&ipinfo->dmsk));
++ printf("%s ", ebt_ip6_mask_to_string(&ipinfo->dmsk));
+ }
+ if (ipinfo->bitmask & EBT_IP6_TCLASS) {
+ printf("--ip6-tclass ");
+diff --git a/include/ebtables_u.h b/include/ebtables_u.h
+index ab615c1..35a5bcc 100644
+--- a/include/ebtables_u.h
++++ b/include/ebtables_u.h
+@@ -303,6 +303,7 @@ char *ebt_mask_to_dotted(uint32_t mask);
+ void ebt_parse_ip6_address(char *address, struct in6_addr *addr,
+ struct in6_addr *msk);
+ char *ebt_ip6_to_numeric(const struct in6_addr *addrp);
++char *ebt_ip6_mask_to_string(const struct in6_addr *msk);
+
+
+ int do_command(int argc, char *argv[], int exec_style,
+diff --git a/useful_functions.c b/useful_functions.c
+index d20b68e..d14cbe9 100644
+--- a/useful_functions.c
++++ b/useful_functions.c
+@@ -411,3 +411,16 @@ char *ebt_ip6_to_numeric(const struct in6_addr *addrp)
+ static char buf[50+1];
+ return (char *)inet_ntop(AF_INET6, addrp, buf, sizeof(buf));
+ }
++
++char *ebt_ip6_mask_to_string(const struct in6_addr *msk)
++{
++ /* /0000:0000:0000:0000:0000:000.000.000.000
++ * /0000:0000:0000:0000:0000:0000:0000:0000 */
++ static char buf[51+1];
++ if (msk->s6_addr32[0] == 0xFFFFFFFFL && msk->s6_addr32[1] == 0xFFFFFFFFL &&
++ msk->s6_addr32[2] == 0xFFFFFFFFL && msk->s6_addr32[3] == 0xFFFFFFFFL)
++ *buf = '\0';
++ else
++ sprintf(buf, "/%s", ebt_ip6_to_numeric(msk));
++ return buf;
++}
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
new file mode 100644
index 000000000..6fbe7df4c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0007-extensions-Use-stdint-types.patch
@@ -0,0 +1,67 @@
+From a60c7d4a6d05387aceb8ae9c38390d0f9bae84a2 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 12:22:39 +0200
+Subject: [PATCH 07/10] extensions: Use stdint types
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ extensions/ebt_ip6.c | 4 ++--
+ extensions/ebt_limit.c | 10 +++++-----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/extensions/ebt_ip6.c b/extensions/ebt_ip6.c
+index e3e0956..dd48547 100644
+--- a/extensions/ebt_ip6.c
++++ b/extensions/ebt_ip6.c
+@@ -53,8 +53,8 @@ static const struct option opts[] =
+
+ struct icmpv6_names {
+ const char *name;
+- u_int8_t type;
+- u_int8_t code_min, code_max;
++ uint8_t type;
++ uint8_t code_min, code_max;
+ };
+
+ static const struct icmpv6_names icmpv6_codes[] = {
+diff --git a/extensions/ebt_limit.c b/extensions/ebt_limit.c
+index ee40e5c..d189a09 100644
+--- a/extensions/ebt_limit.c
++++ b/extensions/ebt_limit.c
+@@ -59,11 +59,11 @@ static void print_help(void)
+ " default %u\n", EBT_LIMIT_BURST);
+ }
+
+-static int parse_rate(const char *rate, u_int32_t *val)
++static int parse_rate(const char *rate, uint32_t *val)
+ {
+ const char *delim;
+- u_int32_t r;
+- u_int32_t mult = 1; /* Seconds by default. */
++ uint32_t r;
++ uint32_t mult = 1; /* Seconds by default. */
+
+ delim = strchr(rate, '/');
+ if (delim) {
+@@ -151,7 +151,7 @@ static void final_check(const struct ebt_u_entry *entry,
+ struct rates
+ {
+ const char *name;
+- u_int32_t mult;
++ uint32_t mult;
+ };
+
+ static struct rates g_rates[] =
+@@ -162,7 +162,7 @@ static struct rates g_rates[] =
+ { "sec", EBT_LIMIT_SCALE }
+ };
+
+-static void print_rate(u_int32_t period)
++static void print_rate(uint32_t period)
+ {
+ unsigned int i;
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
new file mode 100644
index 000000000..df3f52143
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch
@@ -0,0 +1,48 @@
+From 6ed23c8c2bc5efc3956e7bb6155afc8f45e6ae1a Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 12:31:58 +0200
+Subject: [PATCH 08/10] ethernetdb.h: Remove C++ specific compiler hint macro
+ _THROW
+
+Fixes compilation with musl libc
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/ethernetdb.h | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/include/ethernetdb.h b/include/ethernetdb.h
+index 46d8bfd..1683abe 100644
+--- a/include/ethernetdb.h
++++ b/include/ethernetdb.h
+@@ -38,21 +38,20 @@ struct ethertypeent {
+
+ /* Open ethertype data base files and mark them as staying open even
+ after a later search if STAY_OPEN is non-zero. */
+-extern void setethertypeent(int __stay_open) __THROW;
++extern void setethertypeent(int __stay_open);
+
+ /* Close ethertype data base files and clear `stay open' flag. */
+-extern void endethertypeent(void) __THROW;
++extern void endethertypeent(void);
+
+ /* Get next entry from ethertype data base file. Open data base if
+ necessary. */
+-extern struct ethertypeent *getethertypeent(void) __THROW;
++extern struct ethertypeent *getethertypeent(void);
+
+ /* Return entry from ethertype data base for network with NAME. */
+-extern struct ethertypeent *getethertypebyname(__const char *__name)
+- __THROW;
++extern struct ethertypeent *getethertypebyname(__const char *__name);
+
+ /* Return entry from ethertype data base which number is PROTO. */
+-extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW;
++extern struct ethertypeent *getethertypebynumber(int __ethertype);
+
+
+ #endif /* ethernetdb.h */
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
new file mode 100644
index 000000000..248582c18
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch
@@ -0,0 +1,48 @@
+From e6b367c0c2668341c47242d099f4d2048ae575ef Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alin=20N=C4=83stac?= <alin.nastac@gmail.com>
+Date: Thu, 22 Oct 2015 16:41:03 +0200
+Subject: [PATCH 09/10] ebtables: Allow RETURN target rules in user defined
+ chains
+
+During loop checking ebtables marks entries with '1 << NF_BR_NUMHOOKS' if
+they're called from a base chain rather than a user defined chain.
+
+This can be used by ebtables targets that can encode a special return
+value to bail out if e.g. RETURN is used from a base chain.
+
+Unfortunately, this is broken, since the '1 << NF_BR_NUMHOOKS' is also
+copied to called user-defined-chains (i.e., a user defined chain can no
+longer be distinguished from a base chain):
+
+root@OpenWrt:~# ebtables -N foo
+root@OpenWrt:~# ebtables -A OUTPUT -j foo
+root@OpenWrt:~# ebtables -A foo -j mark --mark-or 3 --mark-target RETURN
+--mark-target RETURN not allowed on base chain.
+
+This works if -A OUTPUT -j foo is omitted, but will still appear
+if we try to call foo from OUTPUT afterwards.
+
+After this patch we still reject
+'-A OUTPUT -j mark .. --mark-target RETURN'.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+ libebtc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libebtc.c b/libebtc.c
+index 17ba8f2..74830ec 100644
+--- a/libebtc.c
++++ b/libebtc.c
+@@ -1102,7 +1102,7 @@ void ebt_check_for_loops(struct ebt_u_replace *replace)
+ /* check if we've dealt with this chain already */
+ if (entries2->hook_mask & (1<<i))
+ goto letscontinue;
+- entries2->hook_mask |= entries->hook_mask;
++ entries2->hook_mask |= entries->hook_mask & ~(1 << NF_BR_NUMHOOKS);
+ /* Jump to the chain, make sure we know how to get back */
+ stack[sp].chain_nr = chain_nr;
+ stack[sp].n = j;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
new file mode 100644
index 000000000..a6ef9cd09
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/0010-Adjust-header-include-sequence.patch
@@ -0,0 +1,216 @@
+From b7cee37734007fced7a4d5ed586c3a9e5ad92878 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 26 Mar 2017 13:12:21 -0700
+Subject: [PATCH 10/10] Adjust header include sequence
+
+This fixes the build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ extensions/ebt_among.c | 2 +-
+ extensions/ebt_arpreply.c | 2 +-
+ extensions/ebt_nat.c | 2 +-
+ include/linux/if_ether.h | 126 ----------------------------------------------
+ useful_functions.c | 4 +-
+ 5 files changed, 5 insertions(+), 131 deletions(-)
+ delete mode 100644 include/linux/if_ether.h
+
+diff --git a/extensions/ebt_among.c b/extensions/ebt_among.c
+index f97d07e..b096847 100644
+--- a/extensions/ebt_among.c
++++ b/extensions/ebt_among.c
+@@ -12,8 +12,8 @@
+ #include <getopt.h>
+ #include <ctype.h>
+ #include <unistd.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include "../include/ethernetdb.h"
+ #include <linux/if_ether.h>
+ #include <linux/netfilter_bridge/ebt_among.h>
+diff --git a/extensions/ebt_arpreply.c b/extensions/ebt_arpreply.c
+index c3757f3..c5102a4 100644
+--- a/extensions/ebt_arpreply.c
++++ b/extensions/ebt_arpreply.c
+@@ -11,8 +11,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include <linux/netfilter_bridge/ebt_arpreply.h>
+
+ static int mac_supplied;
+diff --git a/extensions/ebt_nat.c b/extensions/ebt_nat.c
+index e6afbf8..8d318d1 100644
+--- a/extensions/ebt_nat.c
++++ b/extensions/ebt_nat.c
+@@ -10,8 +10,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <getopt.h>
+-#include "../include/ebtables_u.h"
+ #include <netinet/ether.h>
++#include "../include/ebtables_u.h"
+ #include <linux/netfilter_bridge/ebt_nat.h>
+
+ static int to_source_supplied, to_dest_supplied;
+diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
+deleted file mode 100644
+index 28a15ff..0000000
+--- a/include/linux/if_ether.h
++++ /dev/null
+@@ -1,126 +0,0 @@
+-/*
+- * INET An implementation of the TCP/IP protocol suite for the LINUX
+- * operating system. INET is implemented using the BSD Socket
+- * interface as the means of communication with the user level.
+- *
+- * Global definitions for the Ethernet IEEE 802.3 interface.
+- *
+- * Version: @(#)if_ether.h 1.0.1a 02/08/94
+- *
+- * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+- * Donald Becker, <becker@super.org>
+- * Alan Cox, <alan@lxorguk.ukuu.org.uk>
+- * Steve Whitehouse, <gw7rrm@eeshack3.swan.ac.uk>
+- *
+- * This program is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU General Public License
+- * as published by the Free Software Foundation; either version
+- * 2 of the License, or (at your option) any later version.
+- */
+-
+-#ifndef _LINUX_IF_ETHER_H
+-#define _LINUX_IF_ETHER_H
+-
+-#include <linux/types.h>
+-
+-/*
+- * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
+- * and FCS/CRC (frame check sequence).
+- */
+-
+-#define ETH_ALEN 6 /* Octets in one ethernet addr */
+-#define ETH_HLEN 14 /* Total octets in header. */
+-#define ETH_ZLEN 60 /* Min. octets in frame sans FCS */
+-#define ETH_DATA_LEN 1500 /* Max. octets in payload */
+-#define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */
+-#define ETH_FCS_LEN 4 /* Octets in the FCS */
+-
+-/*
+- * These are the defined Ethernet Protocol ID's.
+- */
+-
+-#define ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */
+-#define ETH_P_PUP 0x0200 /* Xerox PUP packet */
+-#define ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */
+-#define ETH_P_IP 0x0800 /* Internet Protocol packet */
+-#define ETH_P_X25 0x0805 /* CCITT X.25 */
+-#define ETH_P_ARP 0x0806 /* Address Resolution packet */
+-#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
+-#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
+-#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
+-#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
+-#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
+-#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
+-#define ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */
+-#define ETH_P_LAT 0x6004 /* DEC LAT */
+-#define ETH_P_DIAG 0x6005 /* DEC Diagnostics */
+-#define ETH_P_CUST 0x6006 /* DEC Customer use */
+-#define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */
+-#define ETH_P_TEB 0x6558 /* Trans Ether Bridging */
+-#define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */
+-#define ETH_P_ATALK 0x809B /* Appletalk DDP */
+-#define ETH_P_AARP 0x80F3 /* Appletalk AARP */
+-#define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */
+-#define ETH_P_IPX 0x8137 /* IPX over DIX */
+-#define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */
+-#define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */
+-#define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */
+-#define ETH_P_WCCP 0x883E /* Web-cache coordination protocol
+- * defined in draft-wilson-wrec-wccp-v2-00.txt */
+-#define ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */
+-#define ETH_P_PPP_SES 0x8864 /* PPPoE session messages */
+-#define ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */
+-#define ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */
+-#define ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */
+-#define ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */
+-#define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport
+- * over Ethernet
+- */
+-#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
+-#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
+-#define ETH_P_TIPC 0x88CA /* TIPC */
+-#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
+-#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
+-#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
+-#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
+-
+-/*
+- * Non DIX types. Won't clash for 1500 types.
+- */
+-
+-#define ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */
+-#define ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */
+-#define ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */
+-#define ETH_P_802_2 0x0004 /* 802.2 frames */
+-#define ETH_P_SNAP 0x0005 /* Internal only */
+-#define ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */
+-#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
+-#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
+-#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
+-#define ETH_P_CAN 0x000C /* Controller Area Network */
+-#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
+-#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
+-#define ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */
+-#define ETH_P_CONTROL 0x0016 /* Card specific control frames */
+-#define ETH_P_IRDA 0x0017 /* Linux-IrDA */
+-#define ETH_P_ECONET 0x0018 /* Acorn Econet */
+-#define ETH_P_HDLC 0x0019 /* HDLC frames */
+-#define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */
+-#define ETH_P_DSA 0x001B /* Distributed Switch Arch. */
+-#define ETH_P_TRAILER 0x001C /* Trailer switch tagging */
+-#define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */
+-#define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */
+-#define ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */
+-
+-/*
+- * This is an Ethernet frame header.
+- */
+-
+-struct ethhdr {
+- unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
+- unsigned char h_source[ETH_ALEN]; /* source ether addr */
+- __be16 h_proto; /* packet type ID field */
+-} __attribute__((packed));
+-
+-
+-#endif /* _LINUX_IF_ETHER_H */
+diff --git a/useful_functions.c b/useful_functions.c
+index d14cbe9..c304f4d 100644
+--- a/useful_functions.c
++++ b/useful_functions.c
+@@ -22,8 +22,6 @@
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+-#include "include/ebtables_u.h"
+-#include "include/ethernetdb.h"
+ #include <stdio.h>
+ #include <netinet/ether.h>
+ #include <string.h>
+@@ -33,6 +31,8 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
++#include "include/ebtables_u.h"
++#include "include/ethernetdb.h"
+
+ const unsigned char mac_type_unicast[ETH_ALEN] = {0,0,0,0,0,0};
+ const unsigned char msk_type_unicast[ETH_ALEN] = {1,0,0,0,0,0};
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch
new file mode 100644
index 000000000..c260403ea
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch
@@ -0,0 +1,50 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## debian_defaultconfig.dpatch by <hesso@pool.math.tu-berlin.de>
+##
+## DP: Debian enhancements to the ebtables "sysconfig" default settings.
+
+@DPATCH@
+
+--- ebtables-2.0.8.1.orig/ebtables-config
++++ ebtables-2.0.8.1/ebtables-config
+@@ -1,17 +1,3 @@
+-# Save (and possibly restore) in text format.
+-# Value: yes|no, default: yes
+-# Save the firewall rules in text format to __SYSCONFIG__/ebtables
+-# If EBTABLES_BINARY_FORMAT="no" then restoring the firewall rules
+-# is done using this text format.
+-EBTABLES_TEXT_FORMAT="yes"
+-
+-# Save (and restore) in binary format.
+-# Value: yes|no, default: yes
+-# Save (and restore) the firewall rules in binary format to (and from)
+-# __SYSCONFIG__/ebtables.<chain>. Enabling this option will make
+-# firewall initialisation a lot faster.
+-EBTABLES_BINARY_FORMAT="yes"
+-
+ # Unload modules on restart and stop
+ # Value: yes|no, default: yes
+ # This option has to be 'yes' to get to a sane state for a firewall
+@@ -19,6 +5,12 @@
+ # modules.
+ EBTABLES_MODULES_UNLOAD="yes"
+
++# Load firewall rules on system startup.
++# Value: yes|no, default: no
++# Restores the ebtables rulesets from the last saved state when the
++# system boots up.
++EBTABLES_LOAD_ON_START="no"
++
+ # Save current firewall rules on stop.
+ # Value: yes|no, default: no
+ # Saves all firewall rules if firewall gets stopped
+@@ -35,3 +27,9 @@
+ # Save rule counters when saving a kernel table to a file. If the
+ # rule counters were saved, they will be restored when restoring the table.
+ EBTABLES_SAVE_COUNTER="no"
++
++# Backup suffix for ruleset save files.
++# Value: <string>, default: "~"
++# Keep one backup level of saved rules.
++# Set this variable to the empty string to disable backups.
++EBTABLES_BACKUP_SUFFIX="~"
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save
new file mode 100755
index 000000000..2d7fc4ed7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables-save
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+EBTABLES="/sbin/ebtables"
+
+[ -x "$EBTABLES" ] || exit 1
+
+echo "# Generated by ebtables-save v1.0 on $(date)"
+
+cnt=""
+[ "x$EBTABLES_SAVE_COUNTER" = "xyes" ] && cnt="--Lc"
+
+for table_name in $(grep -E '^ebtable_' /proc/modules | cut -f1 -d' ' | sed s/ebtable_//); do
+ table=$($EBTABLES -t $table_name -L $cnt)
+ [ $? -eq 0 ] || { echo "$table"; exit -1; }
+
+ chain=""
+ rules=""
+ while read line; do
+ [ -z "$line" ] && continue
+
+ case "$line" in
+ Bridge\ table:\ *)
+ echo "*${line:14}"
+ ;;
+ Bridge\ chain:\ *)
+ chain="${line:14}"
+ chain="${chain%%,*}"
+ policy="${line##*policy: }"
+ echo ":$chain $policy"
+ ;;
+ *)
+ if [ "$cnt" = "--Lc" ]; then
+ line=${line/, pcnt \=/ -c}
+ line=${line/-- bcnt \=/}
+ fi
+ rules="$rules-A $chain $line\n"
+ ;;
+ esac
+ done <<EOF
+$table
+EOF
+ echo -e $rules
+done
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common
new file mode 100644
index 000000000..1ae18fed3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.common
@@ -0,0 +1,163 @@
+#!/bin/sh
+
+[ -x /sbin/ebtables ] || exit 1
+
+EBTABLES_DUMPFILE_STEM=/etc/ebtables/dump
+
+RETVAL=0
+prog="ebtables"
+desc="Ethernet bridge filtering"
+umask 0077
+
+#default configuration
+EBTABLES_MODULES_UNLOAD="yes"
+EBTABLES_LOAD_ON_START="no"
+EBTABLES_SAVE_ON_STOP="no"
+EBTABLES_SAVE_ON_RESTART="no"
+EBTABLES_SAVE_COUNTER="no"
+EBTABLES_BACKUP_SUFFIX="~"
+
+config=/etc/default/$prog
+[ -f "$config" ] && . "$config"
+
+get_supported_tables() {
+ EBTABLES_SUPPORTED_TABLES=
+ /sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission
+ if [ $? -eq 0 ]; then
+ echo "Error: insufficient privileges to access the ebtables rulesets."
+ exit 1
+ fi
+ for table in filter nat broute; do
+ /sbin/ebtables -t $table -L &> /dev/null
+ if [ $? -eq 0 ]; then
+ EBTABLES_SUPPORTED_TABLES="${EBTABLES_SUPPORTED_TABLES} $table"
+ fi
+ done
+}
+
+load() {
+ RETVAL=0
+ get_supported_tables
+ echo -n "Restoring ebtables rulesets: "
+ for table in $EBTABLES_SUPPORTED_TABLES; do
+ echo -n "$table "
+ if [ -s ${EBTABLES_DUMPFILE_STEM}.$table ]; then
+ /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-commit
+ RET=$?
+ if [ $RET -ne 0 ]; then
+ echo -n "(failed) "
+ RETVAL=$RET
+ fi
+ else
+ echo -n "(no saved state) "
+ fi
+ done
+ if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then
+ echo -n "no kernel support. "
+ else
+ echo -n "done. "
+ fi
+ if [ $RETVAL -eq 0 ]; then
+ echo "ok"
+ else
+ echo "fail"
+ fi
+}
+
+clear_rules() {
+ RETVAL=0
+ get_supported_tables
+ echo -n "Clearing ebtables rulesets: "
+ for table in $EBTABLES_SUPPORTED_TABLES; do
+ echo -n "$table "
+ /sbin/ebtables -t $table --init-table
+ done
+
+ if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then
+ for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -d' ' -f1) ebtables; do
+ rmmod $mod 2> /dev/null
+ done
+ fi
+ if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then
+ echo -n "no kernel support. "
+ else
+ echo -n "done. "
+ fi
+ if [ $RETVAL -eq 0 ]; then
+ echo "ok"
+ else
+ echo "fail"
+ fi
+}
+
+save() {
+ RETVAL=0
+ get_supported_tables
+ echo -n "Saving ebtables rulesets: "
+ for table in $EBTABLES_SUPPORTED_TABLES; do
+ echo -n "$table "
+ [ -n "$EBTABLES_BACKUP_SUFFIX" ] && [ -s ${EBTABLES_DUMPFILE_STEM}.$table ] && \
+ mv ${EBTABLES_DUMPFILE_STEM}.$table ${EBTABLES_DUMPFILE_STEM}.$table$EBTABLES_BACKUP_SUFFIX
+ /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-save
+ RET=$?
+ if [ $RET -ne 0 ]; then
+ echo -n "(failed) "
+ RETVAL=$RET
+ else
+ if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then
+ /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table -Z
+ fi
+ fi
+ done
+ if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then
+ echo -n "no kernel support. "
+ else
+ echo -n "done. "
+ fi
+ if [ $RETVAL -eq 0 ]; then
+ echo "ok"
+ else
+ echo "fail"
+ fi
+}
+
+case "$1" in
+ start)
+ [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load
+ ;;
+ stop)
+ [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
+ clear_rules
+ ;;
+ restart|reload|force-reload)
+ [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
+ clear_rules
+ [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load
+ ;;
+ load)
+ load
+ ;;
+ save)
+ save
+ ;;
+ status)
+ get_supported_tables
+ if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then
+ echo "No kernel support for ebtables."
+ RETVAL=1
+ else
+ echo -n "Ebtables support available, number of installed rules: "
+ for table in $EBTABLES_SUPPORTED_TABLES; do
+ COUNT=$(( $(/sbin/ebtables -t $table -L | sed -e "/^Bridge chain/! d" -e "s/^.*entries: //" -e "s/,.*$/ +/") 0 ))
+ echo -n "$table($COUNT) "
+ done
+ echo ok
+ RETVAL=0
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload|force-reload|load|save|status}" >&2
+ RETVAL=1
+esac
+
+exit $RETVAL
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init
new file mode 100755
index 000000000..c9a77a29e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# init script for the Ethernet Bridge filter tables
+#
+# Written by Dag Wieers <dag@wieers.com>
+# Modified by Rok Papez <rok.papez@arnes.si>
+# Bart De Schuymer <bdschuym@pandora.be>
+# Adapted to Debian by Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
+# Adapted to OpenEmbedded by Roman I Khimov <khimov@altell.ru>
+#
+# chkconfig: - 15 85
+# description: Ethernet Bridge filtering tables
+#
+### BEGIN INIT INFO
+# Provides: ebtables
+# Required-Start:
+# Required-Stop:
+# Should-Start: $local_fs
+# Should-Stop: $local_fs
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: ebtables ruleset management
+# Description: Saves and restores the state of the ebtables rulesets.
+### END INIT INFO
+
+/usr/sbin/ebtables.common $1
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service
new file mode 100644
index 000000000..3abd1fe3e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Ethernet Bridge Filtering Tables
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@SBINDIR@/ebtables.common start
+ExecStop=@SBINDIR@/ebtables.common stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch
new file mode 100644
index 000000000..bcd9bed23
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch
@@ -0,0 +1,43 @@
+diff --git a/Makefile b/Makefile
+index c1106a4..7ea6b7a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g')
+ scripts: ebtables-save ebtables.sysv ebtables-config
+ cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_
+ mkdir -p $(DESTDIR)$(BINDIR)
+- install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
++ install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save
+ cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_
+ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
+- if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
++ if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi
+ cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_
+ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi
+- if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
++ if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi
+ rm -f ebtables-save_ ebtables.sysv_ ebtables-config_
+
+ tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g')
+ $(MANDIR)/man8/ebtables.8: ebtables.8
+ mkdir -p $(DESTDIR)$(@D)
+ sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_
+- install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@
++ install -m 0644 ebtables.8_ $(DESTDIR)$@
+ rm -f ebtables.8_
+
+ $(DESTDIR)$(ETHERTYPESFILE): ethertypes
+ mkdir -p $(@D)
+- install -m 0644 -o root -g root $< $@
++ install -m 0644 $< $@
+
+ .PHONY: exec
+ exec: ebtables ebtables-restore
+ mkdir -p $(DESTDIR)$(BINDIR)
+- install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
+- install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
++ install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME)
++ install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore
+
+ .PHONY: install
+ install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch
@@ -0,0 +1,25 @@
+link ebtables with --no-as-needed and adjust the link order to fix runtime crash
+
+Program terminated with signal 11, Segmentation fault.
+#0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so
+(gdb) bt
+#0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so
+#1 0x00007ffaa83824dc in do_command () from /lib64/ebtables/libebtc.so
+#2 0x000000000040065c in ?? ()
+#3 0x00007ffaa7fed755 in __libc_start_main () from /lib64/libc.so.6
+#4 0x0000000000400691 in ?? ()
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: ebtables-v2.0.10-4/Makefile
+===================================================================
+--- ebtables-v2.0.10-4.orig/Makefile 2011-12-15 12:02:47.000000000 -0800
++++ ebtables-v2.0.10-4/Makefile 2012-12-17 22:09:45.065973753 -0800
+@@ -90,7 +90,7 @@
+ $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2)
+
+ ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so
+- $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \
++ $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \
+ -Wl,-rpath,$(LIBDIR)
+
+ ebtablesu: ebtablesu.c
diff --git a/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
new file mode 100644
index 000000000..b9dce69ba
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb
@@ -0,0 +1,103 @@
+SUMMARY = "Filtering tool for a Linux-based bridging firewall"
+HOMEPAGE = "http://sourceforge.net/projects/ebtables/"
+DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \
+ advanced logging, MAC DNAT/SNAT and brouting."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e"
+SECTION = "net"
+PR = "r4"
+
+RDEPENDS_${PN} += "bash"
+
+RRECOMMENDS_${PN} += "kernel-module-ebtables \
+ "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \
+ file://ebtables-save \
+ file://installnonroot.patch \
+ file://01debian_defaultconfig.patch \
+ file://ebtables.init \
+ file://ebtables.common \
+ file://ebtables.service \
+ file://no-as-needed.patch \
+ file://0001-add-RARP-and-update-iana-url.patch \
+ file://0002-fix-compilation-warning.patch \
+ file://0003-add-info-about-Wl-no-as-needed.patch \
+ file://0004-workaround-for-kernel-regression-bug-IPv6-source-des.patch \
+ file://0005-Add-noflush-command-line-support-for-ebtables-restor.patch \
+ file://0006-don-t-print-IPv6-mask-if-it-s-all-ones-based-on-patc.patch \
+ file://0007-extensions-Use-stdint-types.patch \
+ file://0008-ethernetdb.h-Remove-C-specific-compiler-hint-macro-_.patch \
+ file://0009-ebtables-Allow-RETURN-target-rules-in-user-defined-c.patch \
+ "
+
+SRC_URI_append_libc-musl = " file://0010-Adjust-header-include-sequence.patch"
+
+SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0"
+SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d"
+
+S = "${WORKDIR}/ebtables-v${PV}"
+
+inherit update-rc.d systemd
+
+python __anonymous () {
+ import re
+
+ karch = d.getVar('TARGET_ARCH')
+ multilib = d.getVar('MLPREFIX')
+
+ if multilib and ( karch == 'powerpc64' or karch == 'arm' ):
+ searchstr = "lib.?32"
+ reg = re.compile(searchstr)
+ if reg.search(multilib):
+ d.appendVar('CFLAGS' ,' -DKERNEL_64_USERSPACE_32 -DEBT_MIN_ALIGN=8')
+}
+
+EXTRA_OEMAKE = " \
+ BINDIR=${base_sbindir} \
+ MANDIR=${mandir} \
+ ETHERTYPESPATH=${sysconfdir} \
+ INITDIR=${sysconfdir}/init.d \
+ SYSCONFIGDIR=${sysconfdir}/default \
+ LIBDIR=${base_libdir}/ebtables \
+ 'CC=${CC}' \
+ 'CFLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS} -Wl,--no-as-needed' \
+ 'LD=${LD}' \
+"
+
+do_install () {
+ install -d ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/ebtables.common ${D}${sbindir}/ebtables.common
+ # Fix hardcoded paths in scripts
+ sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${sbindir}/ebtables.common
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sbindir}/ebtables.common
+
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
+ install -d ${D}${sysconfdir}/ebtables
+ oe_runmake DESTDIR='${D}' install
+ install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables
+ mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ebtables
+
+ # Replace upstream ebtables-save perl script with Fedora bash based rewrite
+ # http://pkgs.fedoraproject.org/cgit/rpms/ebtables.git/tree/ebtables-save
+ install -m 0755 ${WORKDIR}/ebtables-save ${D}${base_sbindir}/ebtables-save
+ sed -i 's!/sbin/!${base_sbindir}/!g' ${D}${base_sbindir}/ebtables-save
+
+ # Install systemd service files
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ebtables.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/ebtables.service
+}
+
+CONFFILES_${PN} += "${sysconfdir}/default/ebtables"
+
+INITSCRIPT_NAME = "ebtables"
+INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ."
+
+SYSTEMD_SERVICE_${PN} = "ebtables.service"
+
+FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug"
+FILES_${PN} += "${base_libdir}/ebtables/*.so"
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch
new file mode 100644
index 000000000..76d2d5d28
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch
@@ -0,0 +1,26 @@
+From 32af64e1811c74292891dc4dc8455736f7d33ccf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 13:26:56 -0700
+Subject: [PATCH] Correct typo in the location of internal.h in #include
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/libnetfilter_queue.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
+index 211a8ba..065d618 100644
+--- a/src/libnetfilter_queue.c
++++ b/src/libnetfilter_queue.c
+@@ -32,7 +32,7 @@
+
+ #include <libnfnetlink/libnfnetlink.h>
+ #include <libnetfilter_queue/libnetfilter_queue.h>
+-#include "src/internal.h"
++#include "internal.h"
+
+ /**
+ * \mainpage
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 000000000..9e0b420e0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,255 @@
+From f3e3e8fa703e88b76b22c5486277dfca3c85a24b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 14:56:18 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in | 2 +-
+ src/internal.h | 5 ++---
+ src/libnetfilter_acct.c | 41 ++++++++++++++---------------------------
+ 3 files changed, 17 insertions(+), 31 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 7f4bd04..fe64d48 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE = YES
+ EXCLUDE =
+ EXCLUDE_SYMLINKS = NO
+ EXCLUDE_PATTERNS = */.git/* .*.d
+-EXCLUDE_SYMBOLS = EXPORT_SYMBOL nfacct
++EXCLUDE_SYMBOLS = nfacct
+ EXAMPLE_PATH =
+ EXAMPLE_PATTERNS =
+ EXAMPLE_RECURSIVE = NO
+diff --git a/src/internal.h b/src/internal.h
+index f0cc2e1..e5c5ffd 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -3,10 +3,9 @@
+
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-# define __visible __attribute__((visibility("default")))
+-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
++# define __EXPORT __attribute__((visibility("default")))
+ #else
+-# define EXPORT_SYMBOL
++# define __EXPORT
+ #endif
+
+ #include <endian.h>
+diff --git a/src/libnetfilter_acct.c b/src/libnetfilter_acct.c
+index b0bcf67..0220d14 100644
+--- a/src/libnetfilter_acct.c
++++ b/src/libnetfilter_acct.c
+@@ -76,21 +76,19 @@ struct nfacct {
+ * In case of success, this function returns a valid pointer, otherwise NULL
+ * s returned and errno is appropriately set.
+ */
+-struct nfacct *nfacct_alloc(void)
++struct nfacct __EXPORT *nfacct_alloc(void)
+ {
+ return calloc(1, sizeof(struct nfacct));
+ }
+-EXPORT_SYMBOL(nfacct_alloc);
+
+ /**
+ * nfacct_free - release one accounting object
+ * \param nfacct pointer to the accounting object
+ */
+-void nfacct_free(struct nfacct *nfacct)
++void __EXPORT nfacct_free(struct nfacct *nfacct)
+ {
+ free(nfacct);
+ }
+-EXPORT_SYMBOL(nfacct_free);
+
+ /**
+ * nfacct_attr_set - set one attribute of the accounting object
+@@ -98,7 +96,7 @@ EXPORT_SYMBOL(nfacct_free);
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-void
++void __EXPORT
+ nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
+ const void *data)
+ {
+@@ -126,7 +124,6 @@ nfacct_attr_set(struct nfacct *nfacct, enum nfacct_attr_type type,
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nfacct_attr_set);
+
+ /**
+ * nfacct_attr_set_str - set one attribute the accounting object
+@@ -134,13 +131,12 @@ EXPORT_SYMBOL(nfacct_attr_set);
+ * \param type attribute type you want to set
+ * \param name string that will be used to set this attribute
+ */
+-void
++void __EXPORT
+ nfacct_attr_set_str(struct nfacct *nfacct, enum nfacct_attr_type type,
+ const char *name)
+ {
+ nfacct_attr_set(nfacct, type, name);
+ }
+-EXPORT_SYMBOL(nfacct_attr_set_str);
+
+ /**
+ * nfacct_attr_set_u64 - set one attribute the accounting object
+@@ -148,20 +144,19 @@ EXPORT_SYMBOL(nfacct_attr_set_str);
+ * \param type attribute type you want to set
+ * \param value unsigned 64-bits integer
+ */
+-void
++void __EXPORT
+ nfacct_attr_set_u64(struct nfacct *nfacct, enum nfacct_attr_type type,
+ uint64_t value)
+ {
+ nfacct_attr_set(nfacct, type, &value);
+ }
+-EXPORT_SYMBOL(nfacct_attr_set_u64);
+
+ /**
+ * nfacct_attr_unset - unset one attribute the accounting object
+ * \param nfacct pointer to the accounting object
+ * \param type attribute type you want to set
+ */
+-void
++void __EXPORT
+ nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ switch(type) {
+@@ -182,7 +177,6 @@ nfacct_attr_unset(struct nfacct *nfacct, enum nfacct_attr_type type)
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nfacct_attr_unset);
+
+ /**
+ * nfacct_attr_get - get one attribute the accounting object
+@@ -192,7 +186,7 @@ EXPORT_SYMBOL(nfacct_attr_unset);
+ * This function returns a valid pointer to the attribute data. If a
+ * unsupported attribute is used, this returns NULL.
+ */
+-const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
++const void __EXPORT *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ const void *ret = NULL;
+
+@@ -220,7 +214,6 @@ const void *nfacct_attr_get(struct nfacct *nfacct, enum nfacct_attr_type type)
+ }
+ return ret;
+ }
+-EXPORT_SYMBOL(nfacct_attr_get);
+
+ /**
+ * nfacct_attr_get_str - get one attribute the accounting object
+@@ -230,12 +223,11 @@ EXPORT_SYMBOL(nfacct_attr_get);
+ * This function returns a valid pointer to the beginning of the string.
+ * If the attribute is unsupported, this returns NULL.
+ */
+-const char *
++const char __EXPORT *
+ nfacct_attr_get_str(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ return nfacct_attr_get(nfacct, type);
+ }
+-EXPORT_SYMBOL(nfacct_attr_get_str);
+
+ /**
+ * nfacct_attr_get_u64 - get one attribute the accounting object
+@@ -245,12 +237,11 @@ EXPORT_SYMBOL(nfacct_attr_get_str);
+ * This function returns a unsigned 64-bits integer. If the attribute is
+ * unsupported, this returns NULL.
+ */
+-uint64_t nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
++uint64_t __EXPORT nfacct_attr_get_u64(struct nfacct *nfacct, enum nfacct_attr_type type)
+ {
+ const void *ret = nfacct_attr_get(nfacct, type);
+ return ret ? *((uint64_t *)ret) : 0;
+ }
+-EXPORT_SYMBOL(nfacct_attr_get_u64);
+
+ static int
+ nfacct_snprintf_plain(char *buf, size_t rem, struct nfacct *nfacct,
+@@ -424,8 +415,8 @@ err:
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
+- uint16_t type, uint16_t flags)
++int __EXPORT nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
++ uint16_t type, uint16_t flags)
+ {
+ int ret = 0;
+
+@@ -445,7 +436,6 @@ int nfacct_snprintf(char *buf, size_t size, struct nfacct *nfacct,
+ }
+ return ret;
+ }
+-EXPORT_SYMBOL(nfacct_snprintf);
+
+ /**
+ * @}
+@@ -484,7 +474,7 @@ EXPORT_SYMBOL(nfacct_snprintf);
+ * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfacct object (if
+ * unused, otherwise you hit EBUSY).
+ */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORT *
+ nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
+ {
+ struct nlmsghdr *nlh;
+@@ -502,14 +492,13 @@ nfacct_nlmsg_build_hdr(char *buf, uint8_t cmd, uint16_t flags, uint32_t seq)
+
+ return nlh;
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_build_hdr);
+
+ /**
+ * nfacct_nlmsg_build_payload - build payload from accounting object
+ * \param nlh: netlink message that you want to use to add the payload.
+ * \param nfacct: pointer to a accounting object
+ */
+-void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
++void __EXPORT nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
+ {
+ if (nfacct->bitset & (1 << NFACCT_ATTR_NAME))
+ mnl_attr_put_strz(nlh, NFACCT_NAME, nfacct->name);
+@@ -526,7 +515,6 @@ void nfacct_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfacct *nfacct)
+ if (nfacct->bitset & (1 << NFACCT_ATTR_QUOTA))
+ mnl_attr_put_u64(nlh, NFACCT_QUOTA, htobe64(nfacct->quota));
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_build_payload);
+
+ static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -563,7 +551,7 @@ static int nfacct_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int
++int __EXPORT
+ nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
+ {
+ struct nlattr *tb[NFACCT_MAX+1] = {};
+@@ -589,7 +577,6 @@ nfacct_nlmsg_parse_payload(const struct nlmsghdr *nlh, struct nfacct *nfacct)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nfacct_nlmsg_parse_payload);
+
+ /**
+ * @}
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 000000000..946f1b71d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,1229 @@
+From 06562244ac4a1a61e1a2c6b219a517658f7349bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 12:09:41 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in | 2 +-
+ src/extra/ipv4.c | 15 +++----
+ src/extra/ipv6.c | 9 ++--
+ src/extra/pktbuff.c | 42 ++++++------------
+ src/extra/tcp.c | 21 +++------
+ src/extra/udp.c | 21 +++------
+ src/internal.h | 5 +--
+ src/libnetfilter_queue.c | 108 ++++++++++++++++-------------------------------
+ src/nlmsg.c | 21 +++------
+ 9 files changed, 82 insertions(+), 162 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index a7378ca..659abee 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE = YES
+ EXCLUDE =
+ EXCLUDE_SYMLINKS = NO
+ EXCLUDE_PATTERNS =
+-EXCLUDE_SYMBOLS = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS =
+ EXAMPLE_PATH =
+ EXAMPLE_PATTERNS =
+ EXAMPLE_RECURSIVE = NO
+diff --git a/src/extra/ipv4.c b/src/extra/ipv4.c
+index a93d113..56d5dc7 100644
+--- a/src/extra/ipv4.c
++++ b/src/extra/ipv4.c
+@@ -32,7 +32,7 @@
+ * This funcion returns NULL if the IPv4 is malformed or the protocol version
+ * is not 4. On success, it returns a valid pointer to the IPv4 header.
+ */
+-struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
++struct iphdr __EXPORTED *nfq_ip_get_hdr(struct pkt_buff *pktb)
+ {
+ struct iphdr *iph;
+ unsigned int pktlen = pktb->tail - pktb->network_header;
+@@ -53,14 +53,13 @@ struct iphdr *nfq_ip_get_hdr(struct pkt_buff *pktb)
+
+ return iph;
+ }
+-EXPORT_SYMBOL(nfq_ip_get_hdr);
+
+ /**
+ * nfq_ip_set_transport_header - set transport header
+ * \param pktb: pointer to network packet buffer
+ * \param iph: pointer to the IPv4 header
+ */
+-int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
++int __EXPORTED nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
+ {
+ int doff = iph->ihl * 4;
+
+@@ -71,7 +70,6 @@ int nfq_ip_set_transport_header(struct pkt_buff *pktb, struct iphdr *iph)
+ pktb->transport_header = pktb->network_header + doff;
+ return 0;
+ }
+-EXPORT_SYMBOL(nfq_ip_set_transport_header);
+
+ /**
+ * nfq_ip_set_checksum - set IPv4 checksum
+@@ -80,14 +78,13 @@ EXPORT_SYMBOL(nfq_ip_set_transport_header);
+ * \note Call to this function if you modified the IPv4 header to update the
+ * checksum.
+ */
+-void nfq_ip_set_checksum(struct iphdr *iph)
++void __EXPORTED nfq_ip_set_checksum(struct iphdr *iph)
+ {
+ uint32_t iph_len = iph->ihl * 4;
+
+ iph->check = 0;
+ iph->check = nfq_checksum(0, (uint16_t *)iph, iph_len);
+ }
+-EXPORT_SYMBOL(nfq_ip_set_checksum);
+
+ /**
+ * nfq_ip_mangle - mangle IPv4 packet buffer
+@@ -100,7 +97,7 @@ EXPORT_SYMBOL(nfq_ip_set_checksum);
+ *
+ * \note This function recalculates the IPv4 checksum (if needed).
+ */
+-int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
++int __EXPORTED nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
+ unsigned int match_offset, unsigned int match_len,
+ const char *rep_buffer, unsigned int rep_len)
+ {
+@@ -116,7 +113,6 @@ int nfq_ip_mangle(struct pkt_buff *pkt, unsigned int dataoff,
+
+ return 1;
+ }
+-EXPORT_SYMBOL(nfq_ip_mangle);
+
+ /**
+ * nfq_pkt_snprintf_ip - print IPv4 header into buffer in iptables LOG format
+@@ -128,7 +124,7 @@ EXPORT_SYMBOL(nfq_ip_mangle);
+ * case that there is enough room in the buffer. Read snprintf manpage for more
+ * information to know more about this strange behaviour.
+ */
+-int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
++int __EXPORTED nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
+ {
+ int ret;
+ struct in_addr src = { iph->saddr };
+@@ -147,7 +143,6 @@ int nfq_ip_snprintf(char *buf, size_t size, const struct iphdr *iph)
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfq_ip_snprintf);
+
+ /**
+ * @}
+diff --git a/src/extra/ipv6.c b/src/extra/ipv6.c
+index 7c5dc9b..6641c6b 100644
+--- a/src/extra/ipv6.c
++++ b/src/extra/ipv6.c
+@@ -33,7 +33,7 @@
+ * This funcion returns NULL if an invalid header is found. On sucess, it
+ * returns a valid pointer to the header.
+ */
+-struct ip6_hdr *nfq_ip6_get_hdr(struct pkt_buff *pktb)
++struct ip6_hdr __EXPORTED *nfq_ip6_get_hdr(struct pkt_buff *pktb)
+ {
+ struct ip6_hdr *ip6h;
+ unsigned int pktlen = pktb->tail - pktb->network_header;
+@@ -50,7 +50,6 @@ struct ip6_hdr *nfq_ip6_get_hdr(struct pkt_buff *pktb)
+
+ return ip6h;
+ }
+-EXPORT_SYMBOL(nfq_ip6_get_hdr);
+
+ /**
+ * nfq_ip6_set_transport_header - set transport header pointer for IPv6 packet
+@@ -61,7 +60,7 @@ EXPORT_SYMBOL(nfq_ip6_get_hdr);
+ * This function returns 1 if the protocol has been found and the transport
+ * header has been set. Otherwise, it returns 0.
+ */
+-int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
++int __EXPORTED nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
+ uint8_t target)
+ {
+ uint8_t nexthdr = ip6h->ip6_nxt;
+@@ -115,7 +114,6 @@ int nfq_ip6_set_transport_header(struct pkt_buff *pktb, struct ip6_hdr *ip6h,
+ pktb->transport_header = cur;
+ return cur ? 1 : 0;
+ }
+-EXPORT_SYMBOL(nfq_ip6_set_transport_header);
+
+ /**
+ * nfq_ip6_snprintf - print IPv6 header into one buffer in iptables LOG format
+@@ -124,7 +122,7 @@ EXPORT_SYMBOL(nfq_ip6_set_transport_header);
+ * \param ip6_hdr: pointer to a valid IPv6 header.
+ *
+ */
+-int nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
++int __EXPORTED nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
+ {
+ int ret;
+ char src[INET6_ADDRSTRLEN];
+@@ -143,7 +141,6 @@ int nfq_ip6_snprintf(char *buf, size_t size, const struct ip6_hdr *ip6h)
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfq_ip6_snprintf);
+
+ /**
+ * @}
+diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
+index 1c15a00..54d8244 100644
+--- a/src/extra/pktbuff.c
++++ b/src/extra/pktbuff.c
+@@ -40,7 +40,7 @@
+ *
+ * \return a pointer to a new queue handle or NULL on failure.
+ */
+-struct pkt_buff *
++struct pkt_buff __EXPORTED *
+ pktb_alloc(int family, void *data, size_t len, size_t extra)
+ {
+ struct pkt_buff *pktb;
+@@ -84,120 +84,108 @@ pktb_alloc(int family, void *data, size_t len, size_t extra)
+ }
+ return pktb;
+ }
+-EXPORT_SYMBOL(pktb_alloc);
+
+ /**
+ * pktb_data - return pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-uint8_t *pktb_data(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_data(struct pkt_buff *pktb)
+ {
+ return pktb->data;
+ }
+-EXPORT_SYMBOL(pktb_data);
+
+ /**
+ * pktb_len - return length of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-uint32_t pktb_len(struct pkt_buff *pktb)
++uint32_t __EXPORTED pktb_len(struct pkt_buff *pktb)
+ {
+ return pktb->len;
+ }
+-EXPORT_SYMBOL(pktb_len);
+
+ /**
+ * pktb_free - release packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-void pktb_free(struct pkt_buff *pktb)
++void __EXPORTED pktb_free(struct pkt_buff *pktb)
+ {
+ free(pktb);
+ }
+-EXPORT_SYMBOL(pktb_free);
+
+ /**
+ * pktb_push - update pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-void pktb_push(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_push(struct pkt_buff *pktb, unsigned int len)
+ {
+ pktb->data -= len;
+ pktb->len += len;
+ }
+-EXPORT_SYMBOL(pktb_push);
+
+ /**
+ * pktb_pull - update pointer to the beginning of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-void pktb_pull(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_pull(struct pkt_buff *pktb, unsigned int len)
+ {
+ pktb->data += len;
+ pktb->len -= len;
+ }
+-EXPORT_SYMBOL(pktb_pull);
+
+ /**
+ * pktb_put - add extra bytes to the tail of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-void pktb_put(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_put(struct pkt_buff *pktb, unsigned int len)
+ {
+ pktb->tail += len;
+ pktb->len += len;
+ }
+-EXPORT_SYMBOL(pktb_put);
+
+ /**
+ * pktb_trim - set new length for this packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-void pktb_trim(struct pkt_buff *pktb, unsigned int len)
++void __EXPORTED pktb_trim(struct pkt_buff *pktb, unsigned int len)
+ {
+ pktb->len = len;
+ }
+-EXPORT_SYMBOL(pktb_trim);
+
+ /**
+ * pktb_tailroom - get room in bytes in the tail of the packet buffer
+ * \param pktb Pointer to packet buffer
+ */
+-unsigned int pktb_tailroom(struct pkt_buff *pktb)
++unsigned int __EXPORTED pktb_tailroom(struct pkt_buff *pktb)
+ {
+ return pktb->data_len - pktb->len;
+ }
+-EXPORT_SYMBOL(pktb_tailroom);
+
+ /**
+ * pktb_mac_header - return pointer to layer 2 header (if any)
+ * \param pktb Pointer to packet buffer
+ */
+-uint8_t *pktb_mac_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_mac_header(struct pkt_buff *pktb)
+ {
+ return pktb->mac_header;
+ }
+-EXPORT_SYMBOL(pktb_mac_header);
+
+ /**
+ * pktb_network_header - return pointer to layer 3 header
+ * \param pktb Pointer to packet buffer
+ */
+-uint8_t *pktb_network_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_network_header(struct pkt_buff *pktb)
+ {
+ return pktb->network_header;
+ }
+-EXPORT_SYMBOL(pktb_network_header);
+
+ /**
+ * pktb_transport_header - return pointer to layer 4 header (if any)
+ * \param pktb Pointer to packet buffer
+ */
+-uint8_t *pktb_transport_header(struct pkt_buff *pktb)
++uint8_t __EXPORTED *pktb_transport_header(struct pkt_buff *pktb)
+ {
+ return pktb->transport_header;
+ }
+-EXPORT_SYMBOL(pktb_transport_header);
+
+ static int pktb_expand_tail(struct pkt_buff *pkt, int extra)
+ {
+@@ -224,7 +212,7 @@ static int enlarge_pkt(struct pkt_buff *pkt, unsigned int extra)
+ return 1;
+ }
+
+-int pktb_mangle(struct pkt_buff *pkt,
++int __EXPORTED pktb_mangle(struct pkt_buff *pkt,
+ unsigned int dataoff,
+ unsigned int match_offset,
+ unsigned int match_len,
+@@ -258,17 +246,15 @@ int pktb_mangle(struct pkt_buff *pkt,
+ pkt->mangled = true;
+ return 1;
+ }
+-EXPORT_SYMBOL(pktb_mangle);
+
+ /**
+ * pktb_mangled - return true if packet has been mangled
+ * \param pktb Pointer to packet buffer
+ */
+-bool pktb_mangled(const struct pkt_buff *pkt)
++bool __EXPORTED pktb_mangled(const struct pkt_buff *pkt)
+ {
+ return pkt->mangled;
+ }
+-EXPORT_SYMBOL(pktb_mangled);
+
+ /**
+ * @}
+diff --git a/src/extra/tcp.c b/src/extra/tcp.c
+index d1cd79d..8038ce5 100644
+--- a/src/extra/tcp.c
++++ b/src/extra/tcp.c
+@@ -40,7 +40,7 @@
+ * \note You have to call nfq_ip_set_transport_header or
+ * nfq_ip6_set_transport_header first to access the TCP header.
+ */
+-struct tcphdr *nfq_tcp_get_hdr(struct pkt_buff *pktb)
++struct tcphdr __EXPORTED *nfq_tcp_get_hdr(struct pkt_buff *pktb)
+ {
+ if (pktb->transport_header == NULL)
+ return NULL;
+@@ -51,14 +51,13 @@ struct tcphdr *nfq_tcp_get_hdr(struct pkt_buff *pktb)
+
+ return (struct tcphdr *)pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_hdr);
+
+ /**
+ * nfq_tcp_get_payload - get the TCP packet payload
+ * \param tcph: pointer to the TCP header
+ * \param pktb: pointer to user-space network packet buffer
+ */
+-void *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
++void __EXPORTED *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
+ {
+ unsigned int len = tcph->doff * 4;
+
+@@ -72,47 +71,43 @@ void *nfq_tcp_get_payload(struct tcphdr *tcph, struct pkt_buff *pktb)
+
+ return pktb->transport_header + len;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_payload);
+
+ /**
+ * nfq_tcp_get_payload_len - get the tcp packet payload
+ * \param tcph: pointer to the TCP header
+ * \param pktb: pointer to user-space network packet buffer
+ */
+-unsigned int
++unsigned int __EXPORTED
+ nfq_tcp_get_payload_len(struct tcphdr *tcph, struct pkt_buff *pktb)
+ {
+ return pktb->tail - pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_tcp_get_payload_len);
+
+ /**
+ * nfq_tcp_set_checksum_ipv4 - computes IPv4/TCP packet checksum
+ * \param tcph: pointer to the TCP header
+ * \param iph: pointer to the IPv4 header
+ */
+-void
++void __EXPORTED
+ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph)
+ {
+ /* checksum field in header needs to be zero for calculation. */
+ tcph->check = 0;
+ tcph->check = nfq_checksum_tcpudp_ipv4(iph);
+ }
+-EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4);
+
+ /**
+ * nfq_tcp_set_checksum_ipv6 - computes IPv6/TCP packet checksum
+ * \param tcph: pointer to the TCP header
+ * \param iph: pointer to the IPv6 header
+ */
+-void
++void __EXPORTED
+ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h)
+ {
+ /* checksum field in header needs to be zero for calculation. */
+ tcph->check = 0;
+ tcph->check = nfq_checksum_tcpudp_ipv6(ip6h, tcph);
+ }
+-EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv6);
+
+ /*
+ * The union cast uses a gcc extension to avoid aliasing problems
+@@ -134,7 +129,7 @@ union tcp_word_hdr {
+ * \param tcp: pointer to a valid tcp header.
+ *
+ */
+-int nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
++int __EXPORTED nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
+ {
+ int ret, len = 0;
+
+@@ -177,7 +172,6 @@ int nfq_tcp_snprintf(char *buf, size_t size, const struct tcphdr *tcph)
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfq_tcp_snprintf);
+
+ /**
+ * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+@@ -189,7 +183,7 @@ EXPORT_SYMBOL(nfq_tcp_snprintf);
+ *
+ * \note This function recalculates the IPv4 and TCP checksums for you.
+ */
+-int
++int __EXPORTED
+ nfq_tcp_mangle_ipv4(struct pkt_buff *pkt,
+ unsigned int match_offset, unsigned int match_len,
+ const char *rep_buffer, unsigned int rep_len)
+@@ -208,7 +202,6 @@ nfq_tcp_mangle_ipv4(struct pkt_buff *pkt,
+
+ return 1;
+ }
+-EXPORT_SYMBOL(nfq_tcp_mangle_ipv4);
+
+ /**
+ * @}
+diff --git a/src/extra/udp.c b/src/extra/udp.c
+index 8c44a66..99c8faa 100644
+--- a/src/extra/udp.c
++++ b/src/extra/udp.c
+@@ -37,7 +37,7 @@
+ * This function returns NULL if invalid UDP header is found. On success,
+ * it returns the UDP header.
+ */
+-struct udphdr *nfq_udp_get_hdr(struct pkt_buff *pktb)
++struct udphdr __EXPORTED *nfq_udp_get_hdr(struct pkt_buff *pktb)
+ {
+ if (pktb->transport_header == NULL)
+ return NULL;
+@@ -48,14 +48,13 @@ struct udphdr *nfq_udp_get_hdr(struct pkt_buff *pktb)
+
+ return (struct udphdr *)pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_udp_get_hdr);
+
+ /**
+ * nfq_udp_get_payload - get the UDP packet payload.
+ * \param udph: the pointer to the UDP header.
+ * \param tail: pointer to the tail of the packet
+ */
+-void *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
++void __EXPORTED *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
+ {
+ uint16_t len = ntohs(udph->len);
+
+@@ -69,17 +68,15 @@ void *nfq_udp_get_payload(struct udphdr *udph, struct pkt_buff *pktb)
+
+ return pktb->transport_header + sizeof(struct udphdr);
+ }
+-EXPORT_SYMBOL(nfq_udp_get_payload);
+
+ /**
+ * nfq_udp_get_payload_len - get the udp packet payload.
+ * \param udp: the pointer to the udp header.
+ */
+-unsigned int nfq_udp_get_payload_len(struct udphdr *udph, struct pkt_buff *pktb)
++unsigned int __EXPORTED nfq_udp_get_payload_len(struct udphdr *udph, struct pkt_buff *pktb)
+ {
+ return pktb->tail - pktb->transport_header;
+ }
+-EXPORT_SYMBOL(nfq_udp_get_payload_len);
+
+ /**
+ * nfq_udp_set_checksum_ipv4 - computes a IPv4/TCP packet's segment
+@@ -91,14 +88,13 @@ EXPORT_SYMBOL(nfq_udp_get_payload_len);
+ * \see nfq_pkt_compute_ip_checksum
+ * \see nfq_pkt_compute_udp_checksum
+ */
+-void
++void __EXPORTED
+ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph)
+ {
+ /* checksum field in header needs to be zero for calculation. */
+ udph->check = 0;
+ udph->check = nfq_checksum_tcpudp_ipv4(iph);
+ }
+-EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
+
+ /**
+ * nfq_udp_set_checksum_ipv6 - computes a IPv6/TCP packet's segment
+@@ -110,14 +106,13 @@ EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4);
+ * \see nfq_pkt_compute_ip_checksum
+ * \see nfq_pkt_compute_udp_checksum
+ */
+-void
++void __EXPORTED
+ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h)
+ {
+ /* checksum field in header needs to be zero for calculation. */
+ udph->check = 0;
+ udph->check = nfq_checksum_tcpudp_ipv6(ip6h, udph);
+ }
+-EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
+
+ /**
+ * nfq_tcp_mangle_ipv4 - mangle TCP/IPv4 packet buffer
+@@ -129,7 +124,7 @@ EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv6);
+ *
+ * \note This function recalculates the IPv4 and TCP checksums for you.
+ */
+-int
++int __EXPORTED
+ nfq_udp_mangle_ipv4(struct pkt_buff *pkt,
+ unsigned int match_offset, unsigned int match_len,
+ const char *rep_buffer, unsigned int rep_len)
+@@ -148,7 +143,6 @@ nfq_udp_mangle_ipv4(struct pkt_buff *pkt,
+
+ return 1;
+ }
+-EXPORT_SYMBOL(nfq_udp_mangle_ipv4);
+
+ /**
+ * nfq_pkt_snprintf_udp_hdr - print udp header into one buffer in a humnan
+@@ -158,12 +152,11 @@ EXPORT_SYMBOL(nfq_udp_mangle_ipv4);
+ * \param udp: pointer to a valid udp header.
+ *
+ */
+-int nfq_udp_snprintf(char *buf, size_t size, const struct udphdr *udph)
++int __EXPORTED nfq_udp_snprintf(char *buf, size_t size, const struct udphdr *udph)
+ {
+ return snprintf(buf, size, "SPT=%u DPT=%u ",
+ htons(udph->source), htons(udph->dest));
+ }
+-EXPORT_SYMBOL(nfq_udp_snprintf);
+
+ /**
+ * @}
+diff --git a/src/internal.h b/src/internal.h
+index 558d267..79b0752 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -5,10 +5,9 @@
+ #include <stdint.h>
+ #include <stdbool.h>
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-# define __visible __attribute__((visibility("default")))
+-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
++# define __EXPORTED __attribute__((visibility("default")))
+ #else
+-# define EXPORT_SYMBOL
++# define __EXPORTED
+ #endif
+
+ struct iphdr;
+diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
+index 065d618..ab0b66b 100644
+--- a/src/libnetfilter_queue.c
++++ b/src/libnetfilter_queue.c
+@@ -133,8 +133,7 @@ struct nfq_data {
+ struct nfattr **data;
+ };
+
+-int nfq_errno;
+-EXPORT_SYMBOL(nfq_errno);
++int __EXPORTED nfq_errno;
+
+ /***********************************************************************
+ * low level stuff
+@@ -218,11 +217,10 @@ static int __nfq_rcv_pkt(struct nlmsghdr *nlh, struct nfattr *nfa[],
+
+ /* public interface */
+
+-struct nfnl_handle *nfq_nfnlh(struct nfq_handle *h)
++struct nfnl_handle __EXPORTED *nfq_nfnlh(struct nfq_handle *h)
+ {
+ return h->nfnlh;
+ }
+-EXPORT_SYMBOL(nfq_nfnlh);
+
+ /**
+ *
+@@ -294,11 +292,10 @@ EXPORT_SYMBOL(nfq_nfnlh);
+ * over the netlink connection associated with the given queue connection
+ * handle.
+ */
+-int nfq_fd(struct nfq_handle *h)
++int __EXPORTED nfq_fd(struct nfq_handle *h)
+ {
+ return nfnl_fd(nfq_nfnlh(h));
+ }
+-EXPORT_SYMBOL(nfq_fd);
+ /**
+ * @}
+ */
+@@ -349,7 +346,7 @@ EXPORT_SYMBOL(nfq_fd);
+ *
+ * \return a pointer to a new queue handle or NULL on failure.
+ */
+-struct nfq_handle *nfq_open(void)
++struct nfq_handle __EXPORTED *nfq_open(void)
+ {
+ struct nfnl_handle *nfnlh = nfnl_open();
+ struct nfq_handle *qh;
+@@ -366,7 +363,6 @@ struct nfq_handle *nfq_open(void)
+
+ return qh;
+ }
+-EXPORT_SYMBOL(nfq_open);
+
+ /**
+ * @}
+@@ -382,7 +378,7 @@ EXPORT_SYMBOL(nfq_open);
+ *
+ * \return a pointer to a new queue handle or NULL on failure.
+ */
+-struct nfq_handle *nfq_open_nfnl(struct nfnl_handle *nfnlh)
++struct nfq_handle __EXPORTED *nfq_open_nfnl(struct nfnl_handle *nfnlh)
+ {
+ struct nfnl_callback pkt_cb = {
+ .call = __nfq_rcv_pkt,
+@@ -419,7 +415,6 @@ out_free:
+ free(h);
+ return NULL;
+ }
+-EXPORT_SYMBOL(nfq_open_nfnl);
+
+ /**
+ * \addtogroup LibrarySetup
+@@ -438,7 +433,7 @@ EXPORT_SYMBOL(nfq_open_nfnl);
+ *
+ * \return 0 on success, non-zero on failure.
+ */
+-int nfq_close(struct nfq_handle *h)
++int __EXPORTED nfq_close(struct nfq_handle *h)
+ {
+ int ret;
+
+@@ -447,7 +442,6 @@ int nfq_close(struct nfq_handle *h)
+ free(h);
+ return ret;
+ }
+-EXPORT_SYMBOL(nfq_close);
+
+ /**
+ * nfq_bind_pf - bind a nfqueue handler to a given protocol family
+@@ -460,11 +454,10 @@ EXPORT_SYMBOL(nfq_close);
+ *
+ * \return integer inferior to 0 in case of failure
+ */
+-int nfq_bind_pf(struct nfq_handle *h, uint16_t pf)
++int __EXPORTED nfq_bind_pf(struct nfq_handle *h, uint16_t pf)
+ {
+ return __build_send_cfg_msg(h, NFQNL_CFG_CMD_PF_BIND, 0, pf);
+ }
+-EXPORT_SYMBOL(nfq_bind_pf);
+
+ /**
+ * nfq_unbind_pf - unbind nfqueue handler from a protocol family
+@@ -476,11 +469,10 @@ EXPORT_SYMBOL(nfq_bind_pf);
+ *
+ * This call is obsolete, Linux kernels from 3.8 onwards ignore it.
+ */
+-int nfq_unbind_pf(struct nfq_handle *h, uint16_t pf)
++int __EXPORTED nfq_unbind_pf(struct nfq_handle *h, uint16_t pf)
+ {
+ return __build_send_cfg_msg(h, NFQNL_CFG_CMD_PF_UNBIND, 0, pf);
+ }
+-EXPORT_SYMBOL(nfq_unbind_pf);
+
+
+ /**
+@@ -524,7 +516,7 @@ typedef int nfq_callback(struct nfq_q_handle *qh,
+ * The callback should return < 0 to stop processing.
+ */
+
+-struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h,
++struct nfq_q_handle __EXPORTED *nfq_create_queue(struct nfq_handle *h,
+ uint16_t num,
+ nfq_callback *cb,
+ void *data)
+@@ -555,7 +547,6 @@ struct nfq_q_handle *nfq_create_queue(struct nfq_handle *h,
+ add_qh(qh);
+ return qh;
+ }
+-EXPORT_SYMBOL(nfq_create_queue);
+
+ /**
+ * @}
+@@ -573,7 +564,7 @@ EXPORT_SYMBOL(nfq_create_queue);
+ * Removes the binding for the specified queue handle. This call also unbind
+ * from the nfqueue handler, so you don't have to call nfq_unbind_pf.
+ */
+-int nfq_destroy_queue(struct nfq_q_handle *qh)
++int __EXPORTED nfq_destroy_queue(struct nfq_q_handle *qh)
+ {
+ int ret = __build_send_cfg_msg(qh->h, NFQNL_CFG_CMD_UNBIND, qh->id, 0);
+ if (ret == 0) {
+@@ -583,7 +574,6 @@ int nfq_destroy_queue(struct nfq_q_handle *qh)
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfq_destroy_queue);
+
+ /**
+ * nfq_handle_packet - handle a packet received from the nfqueue subsystem
+@@ -597,11 +587,10 @@ EXPORT_SYMBOL(nfq_destroy_queue);
+ *
+ * \return 0 on success, non-zero on failure.
+ */
+-int nfq_handle_packet(struct nfq_handle *h, char *buf, int len)
++int __EXPORTED nfq_handle_packet(struct nfq_handle *h, char *buf, int len)
+ {
+ return nfnl_handle_packet(h->nfnlh, buf, len);
+ }
+-EXPORT_SYMBOL(nfq_handle_packet);
+
+ /**
+ * nfq_set_mode - set the amount of packet data that nfqueue copies to userspace
+@@ -618,7 +607,7 @@ EXPORT_SYMBOL(nfq_handle_packet);
+ *
+ * \return -1 on error; >=0 otherwise.
+ */
+-int nfq_set_mode(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_mode(struct nfq_q_handle *qh,
+ uint8_t mode, uint32_t range)
+ {
+ union {
+@@ -638,7 +627,6 @@ int nfq_set_mode(struct nfq_q_handle *qh,
+
+ return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_mode);
+
+ /**
+ * nfq_set_queue_flags - set flags (options) for the kernel queue
+@@ -690,7 +678,7 @@ EXPORT_SYMBOL(nfq_set_mode);
+ *
+ * \return -1 on error with errno set appropriately; =0 otherwise.
+ */
+-int nfq_set_queue_flags(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_queue_flags(struct nfq_q_handle *qh,
+ uint32_t mask, uint32_t flags)
+ {
+ union {
+@@ -711,7 +699,6 @@ int nfq_set_queue_flags(struct nfq_q_handle *qh,
+
+ return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_queue_flags);
+
+ /**
+ * nfq_set_queue_maxlen - Set kernel queue maximum length parameter
+@@ -724,7 +711,7 @@ EXPORT_SYMBOL(nfq_set_queue_flags);
+ *
+ * \return -1 on error; >=0 otherwise.
+ */
+-int nfq_set_queue_maxlen(struct nfq_q_handle *qh,
++int __EXPORTED nfq_set_queue_maxlen(struct nfq_q_handle *qh,
+ uint32_t queuelen)
+ {
+ union {
+@@ -742,7 +729,6 @@ int nfq_set_queue_maxlen(struct nfq_q_handle *qh,
+
+ return nfnl_query(qh->h->nfnlh, &u.nmh);
+ }
+-EXPORT_SYMBOL(nfq_set_queue_maxlen);
+
+ /**
+ * @}
+@@ -829,14 +815,13 @@ static int __set_verdict(struct nfq_q_handle *qh, uint32_t id,
+ *
+ * \return -1 on error; >= 0 otherwise.
+ */
+-int nfq_set_verdict(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict(struct nfq_q_handle *qh, uint32_t id,
+ uint32_t verdict, uint32_t data_len,
+ const unsigned char *buf)
+ {
+ return __set_verdict(qh, id, verdict, 0, 0, data_len, buf,
+ NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict);
+
+ /**
+ * nfq_set_verdict2 - like nfq_set_verdict, but you can set the mark.
+@@ -847,14 +832,13 @@ EXPORT_SYMBOL(nfq_set_verdict);
+ * \param data_len number of bytes of data pointed to by #buf
+ * \param buf the buffer that contains the packet data
+ */
+-int nfq_set_verdict2(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict2(struct nfq_q_handle *qh, uint32_t id,
+ uint32_t verdict, uint32_t mark,
+ uint32_t data_len, const unsigned char *buf)
+ {
+ return __set_verdict(qh, id, verdict, htonl(mark), 1, data_len,
+ buf, NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict2);
+
+ /**
+ * nfq_set_verdict_batch - issue verdicts on several packets at once
+@@ -868,13 +852,12 @@ EXPORT_SYMBOL(nfq_set_verdict2);
+ * batch support was added in Linux 3.1.
+ * These functions will fail silently on older kernels.
+ */
+-int nfq_set_verdict_batch(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_batch(struct nfq_q_handle *qh, uint32_t id,
+ uint32_t verdict)
+ {
+ return __set_verdict(qh, id, verdict, 0, 0, 0, NULL,
+ NFQNL_MSG_VERDICT_BATCH);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_batch);
+
+ /**
+ * nfq_set_verdict_batch2 - like nfq_set_verdict_batch, but you can set a mark.
+@@ -883,13 +866,12 @@ EXPORT_SYMBOL(nfq_set_verdict_batch);
+ * \param verdict verdict to return to netfilter (NF_ACCEPT, NF_DROP)
+ * \param mark mark to put on packet
+ */
+-int nfq_set_verdict_batch2(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_batch2(struct nfq_q_handle *qh, uint32_t id,
+ uint32_t verdict, uint32_t mark)
+ {
+ return __set_verdict(qh, id, verdict, htonl(mark), 1, 0,
+ NULL, NFQNL_MSG_VERDICT_BATCH);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_batch2);
+
+ /**
+ * nfq_set_verdict_mark - like nfq_set_verdict, but you can set the mark.
+@@ -905,14 +887,13 @@ EXPORT_SYMBOL(nfq_set_verdict_batch2);
+ * This function is deprecated since it is broken, its use is highly
+ * discouraged. Please, use nfq_set_verdict2 instead.
+ */
+-int nfq_set_verdict_mark(struct nfq_q_handle *qh, uint32_t id,
++int __EXPORTED nfq_set_verdict_mark(struct nfq_q_handle *qh, uint32_t id,
+ uint32_t verdict, uint32_t mark,
+ uint32_t data_len, const unsigned char *buf)
+ {
+ return __set_verdict(qh, id, verdict, mark, 1, data_len, buf,
+ NFQNL_MSG_VERDICT);
+ }
+-EXPORT_SYMBOL(nfq_set_verdict_mark);
+
+ /**
+ * @}
+@@ -947,12 +928,11 @@ EXPORT_SYMBOL(nfq_set_verdict_mark);
+ } __attribute__ ((packed));
+ \endverbatim
+ */
+-struct nfqnl_msg_packet_hdr *nfq_get_msg_packet_hdr(struct nfq_data *nfad)
++struct nfqnl_msg_packet_hdr __EXPORTED *nfq_get_msg_packet_hdr(struct nfq_data *nfad)
+ {
+ return nfnl_get_pointer_to_data(nfad->data, NFQA_PACKET_HDR,
+ struct nfqnl_msg_packet_hdr);
+ }
+-EXPORT_SYMBOL(nfq_get_msg_packet_hdr);
+
+ /**
+ * nfq_get_nfmark - get the packet mark
+@@ -960,11 +940,10 @@ EXPORT_SYMBOL(nfq_get_msg_packet_hdr);
+ *
+ * \return the netfilter mark currently assigned to the given queued packet.
+ */
+-uint32_t nfq_get_nfmark(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_nfmark(struct nfq_data *nfad)
+ {
+ return ntohl(nfnl_get_data(nfad->data, NFQA_MARK, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_nfmark);
+
+ /**
+ * nfq_get_timestamp - get the packet timestamp
+@@ -975,7 +954,7 @@ EXPORT_SYMBOL(nfq_get_nfmark);
+ *
+ * \return 0 on success, non-zero on failure.
+ */
+-int nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
++int __EXPORTED nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
+ {
+ struct nfqnl_msg_packet_timestamp *qpt;
+ qpt = nfnl_get_pointer_to_data(nfad->data, NFQA_TIMESTAMP,
+@@ -988,7 +967,6 @@ int nfq_get_timestamp(struct nfq_data *nfad, struct timeval *tv)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nfq_get_timestamp);
+
+ /**
+ * nfq_get_indev - get the interface that the packet was received through
+@@ -1001,11 +979,10 @@ EXPORT_SYMBOL(nfq_get_timestamp);
+ * \warning all nfq_get_dev() functions return 0 if not set, since linux
+ * only allows ifindex >= 1, see net/core/dev.c:2600 (in 2.6.13.1)
+ */
+-uint32_t nfq_get_indev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_indev(struct nfq_data *nfad)
+ {
+ return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_INDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_indev);
+
+ /**
+ * nfq_get_physindev - get the physical interface that the packet was received
+@@ -1015,11 +992,10 @@ EXPORT_SYMBOL(nfq_get_indev);
+ * If the returned index is 0, the packet was locally generated or the
+ * physical input interface is no longer known (ie. POSTROUTING?).
+ */
+-uint32_t nfq_get_physindev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_physindev(struct nfq_data *nfad)
+ {
+ return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_PHYSINDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_physindev);
+
+ /**
+ * nfq_get_outdev - gets the interface that the packet will be routed out
+@@ -1029,11 +1005,10 @@ EXPORT_SYMBOL(nfq_get_physindev);
+ * returned index is 0, the packet is destined for localhost or the output
+ * interface is not yet known (ie. PREROUTING?).
+ */
+-uint32_t nfq_get_outdev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_outdev(struct nfq_data *nfad)
+ {
+ return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_OUTDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_outdev);
+
+ /**
+ * nfq_get_physoutdev - get the physical interface that the packet output
+@@ -1045,11 +1020,10 @@ EXPORT_SYMBOL(nfq_get_outdev);
+ *
+ * \return The index of physical interface that the packet output will be routed out.
+ */
+-uint32_t nfq_get_physoutdev(struct nfq_data *nfad)
++uint32_t __EXPORTED nfq_get_physoutdev(struct nfq_data *nfad)
+ {
+ return ntohl(nfnl_get_data(nfad->data, NFQA_IFINDEX_PHYSOUTDEV, uint32_t));
+ }
+-EXPORT_SYMBOL(nfq_get_physoutdev);
+
+ /**
+ * nfq_get_indev_name - get the name of the interface the packet
+@@ -1089,13 +1063,12 @@ EXPORT_SYMBOL(nfq_get_physoutdev);
+ \endverbatim
+ *
+ */
+-int nfq_get_indev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_indev_name(struct nlif_handle *nlif_handle,
+ struct nfq_data *nfad, char *name)
+ {
+ uint32_t ifindex = nfq_get_indev(nfad);
+ return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_indev_name);
+
+ /**
+ * nfq_get_physindev_name - get the name of the physical interface the
+@@ -1109,13 +1082,12 @@ EXPORT_SYMBOL(nfq_get_indev_name);
+ *
+ * \return -1 in case of error, > 0 if it succeed.
+ */
+-int nfq_get_physindev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_physindev_name(struct nlif_handle *nlif_handle,
+ struct nfq_data *nfad, char *name)
+ {
+ uint32_t ifindex = nfq_get_physindev(nfad);
+ return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_physindev_name);
+
+ /**
+ * nfq_get_outdev_name - get the name of the physical interface the
+@@ -1129,13 +1101,12 @@ EXPORT_SYMBOL(nfq_get_physindev_name);
+ *
+ * \return -1 in case of error, > 0 if it succeed.
+ */
+-int nfq_get_outdev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_outdev_name(struct nlif_handle *nlif_handle,
+ struct nfq_data *nfad, char *name)
+ {
+ uint32_t ifindex = nfq_get_outdev(nfad);
+ return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_outdev_name);
+
+ /**
+ * nfq_get_physoutdev_name - get the name of the interface the
+@@ -1150,13 +1121,12 @@ EXPORT_SYMBOL(nfq_get_outdev_name);
+ * \return -1 in case of error, > 0 if it succeed.
+ */
+
+-int nfq_get_physoutdev_name(struct nlif_handle *nlif_handle,
++int __EXPORTED nfq_get_physoutdev_name(struct nlif_handle *nlif_handle,
+ struct nfq_data *nfad, char *name)
+ {
+ uint32_t ifindex = nfq_get_physoutdev(nfad);
+ return nlif_index2name(nlif_handle, ifindex, name);
+ }
+-EXPORT_SYMBOL(nfq_get_physoutdev_name);
+
+ /**
+ * nfq_get_packet_hw
+@@ -1180,12 +1150,11 @@ EXPORT_SYMBOL(nfq_get_physoutdev_name);
+ } __attribute__ ((packed));
+ \endverbatim
+ */
+-struct nfqnl_msg_packet_hw *nfq_get_packet_hw(struct nfq_data *nfad)
++struct nfqnl_msg_packet_hw __EXPORTED *nfq_get_packet_hw(struct nfq_data *nfad)
+ {
+ return nfnl_get_pointer_to_data(nfad->data, NFQA_HWADDR,
+ struct nfqnl_msg_packet_hw);
+ }
+-EXPORT_SYMBOL(nfq_get_packet_hw);
+
+ /**
+ * nfq_get_uid - get the UID of the user the packet belongs to
+@@ -1193,7 +1162,7 @@ EXPORT_SYMBOL(nfq_get_packet_hw);
+ *
+ * \return 1 if there is a UID available, 0 otherwise.
+ */
+-int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
++int __EXPORTED nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
+ {
+ if (!nfnl_attr_present(nfad->data, NFQA_UID))
+ return 0;
+@@ -1201,7 +1170,6 @@ int nfq_get_uid(struct nfq_data *nfad, uint32_t *uid)
+ *uid = ntohl(nfnl_get_data(nfad->data, NFQA_UID, uint32_t));
+ return 1;
+ }
+-EXPORT_SYMBOL(nfq_get_uid);
+
+ /**
+ * nfq_get_gid - get the GID of the user the packet belongs to
+@@ -1209,7 +1177,7 @@ EXPORT_SYMBOL(nfq_get_uid);
+ *
+ * \return 1 if there is a GID available, 0 otherwise.
+ */
+-int nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
++int __EXPORTED nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
+ {
+ if (!nfnl_attr_present(nfad->data, NFQA_GID))
+ return 0;
+@@ -1217,7 +1185,6 @@ int nfq_get_gid(struct nfq_data *nfad, uint32_t *gid)
+ *gid = ntohl(nfnl_get_data(nfad->data, NFQA_GID, uint32_t));
+ return 1;
+ }
+-EXPORT_SYMBOL(nfq_get_gid);
+
+
+ /**
+@@ -1227,7 +1194,7 @@ EXPORT_SYMBOL(nfq_get_gid);
+ *
+ * \return -1 on error, otherwise > 0
+ */
+-int nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
++int __EXPORTED nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
+ {
+ if (!nfnl_attr_present(nfad->data, NFQA_SECCTX))
+ return -1;
+@@ -1240,7 +1207,6 @@ int nfq_get_secctx(struct nfq_data *nfad, unsigned char **secdata)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nfq_get_secctx);
+
+ /**
+ * nfq_get_payload - get payload
+@@ -1253,7 +1219,7 @@ EXPORT_SYMBOL(nfq_get_secctx);
+ *
+ * \return -1 on error, otherwise > 0.
+ */
+-int nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
++int __EXPORTED nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
+ {
+ *data = (unsigned char *)
+ nfnl_get_pointer_to_data(nfad->data, NFQA_PAYLOAD, char);
+@@ -1262,7 +1228,6 @@ int nfq_get_payload(struct nfq_data *nfad, unsigned char **data)
+
+ return -1;
+ }
+-EXPORT_SYMBOL(nfq_get_payload);
+
+ /**
+ * @}
+@@ -1307,7 +1272,7 @@ do { \
+ * would have been printed into the buffer (in case that there is enough
+ * room in it). See snprintf() return value for more information.
+ */
+-int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
++int __EXPORTED nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
+ {
+ struct nfqnl_msg_packet_hdr *ph;
+ struct nfqnl_msg_packet_hw *hwph;
+@@ -1460,7 +1425,6 @@ int nfq_snprintf_xml(char *buf, size_t rem, struct nfq_data *tb, int flags)
+
+ return len;
+ }
+-EXPORT_SYMBOL(nfq_snprintf_xml);
+
+ /**
+ * @}
+diff --git a/src/nlmsg.c b/src/nlmsg.c
+index ba28c77..5582407 100644
+--- a/src/nlmsg.c
++++ b/src/nlmsg.c
+@@ -30,7 +30,7 @@
+ * @{
+ */
+
+-void nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
++void __EXPORTED nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
+ {
+ struct nfqnl_msg_verdict_hdr vh = {
+ .verdict = htonl(verdict),
+@@ -38,20 +38,17 @@ void nfq_nlmsg_verdict_put(struct nlmsghdr *nlh, int id, int verdict)
+ };
+ mnl_attr_put(nlh, NFQA_VERDICT_HDR, sizeof(vh), &vh);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put);
+
+-void nfq_nlmsg_verdict_put_mark(struct nlmsghdr *nlh, uint32_t mark)
++void __EXPORTED nfq_nlmsg_verdict_put_mark(struct nlmsghdr *nlh, uint32_t mark)
+ {
+ mnl_attr_put_u32(nlh, NFQA_MARK, htonl(mark));
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put_mark);
+
+-void
++void __EXPORTED
+ nfq_nlmsg_verdict_put_pkt(struct nlmsghdr *nlh, const void *pkt, uint32_t plen)
+ {
+ mnl_attr_put(nlh, NFQA_PAYLOAD, plen, pkt);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_verdict_put_pkt);
+
+ /**
+ * @}
+@@ -85,7 +82,7 @@ EXPORT_SYMBOL(nfq_nlmsg_verdict_put_pkt);
+ * given protocol family. Both commands are ignored by Linux kernel 3.8 and
+ * later versions.
+ */
+-void nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
++void __EXPORTED nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
+ {
+ struct nfqnl_msg_config_cmd command = {
+ .command = cmd,
+@@ -93,9 +90,8 @@ void nfq_nlmsg_cfg_put_cmd(struct nlmsghdr *nlh, uint16_t pf, uint8_t cmd)
+ };
+ mnl_attr_put(nlh, NFQA_CFG_CMD, sizeof(command), &command);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_cmd);
+
+-void nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
++void __EXPORTED nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
+ {
+ struct nfqnl_msg_config_params params = {
+ .copy_range = htonl(range),
+@@ -103,13 +99,11 @@ void nfq_nlmsg_cfg_put_params(struct nlmsghdr *nlh, uint8_t mode, int range)
+ };
+ mnl_attr_put(nlh, NFQA_CFG_PARAMS, sizeof(params), &params);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_params);
+
+-void nfq_nlmsg_cfg_put_qmaxlen(struct nlmsghdr *nlh, uint32_t queue_maxlen)
++void __EXPORTED nfq_nlmsg_cfg_put_qmaxlen(struct nlmsghdr *nlh, uint32_t queue_maxlen)
+ {
+ mnl_attr_put_u32(nlh, NFQA_CFG_QUEUE_MAXLEN, htonl(queue_maxlen));
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_cfg_put_qmaxlen);
+
+ /**
+ * @}
+@@ -179,12 +173,11 @@ static int nfq_pkt_parse_attr_cb(const struct nlattr *attr, void *data)
+ * This function returns MNL_CB_ERROR if any error occurs, or MNL_CB_OK on
+ * success.
+ */
+-int nfq_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr **attr)
++int __EXPORTED nfq_nlmsg_parse(const struct nlmsghdr *nlh, struct nlattr **attr)
+ {
+ return mnl_attr_parse(nlh, sizeof(struct nfgenmsg),
+ nfq_pkt_parse_attr_cb, attr);
+ }
+-EXPORT_SYMBOL(nfq_nlmsg_parse);
+
+ /**
+ * @}
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
new file mode 100644
index 000000000..e717d5b0e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cthelper-visibility-hidden.patch
@@ -0,0 +1,382 @@
+From f58c5b09fb59baf07c942d373fc4d522b27e73c6 Mon Sep 17 00:00:00 2001
+From: Kevin Cernekee <cernekee@chromium.org>
+Date: Wed, 4 Jan 2017 14:30:26 -0800
+Subject: Use __EXPORTED rather than EXPORT_SYMBOL
+
+clang is sensitive to the ordering of
+__attribute__((visibility("default"))) relative to the function
+body. gcc is not. So if we try to re-declare an existing function
+with default visibility, clang prints a warning and generates
+a broken .so file in which nfct_helper_* are not exported to library
+callers.
+
+Move the attribute up into the function definition to make clang happy.
+
+Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ doxygen.cfg.in | 2 +-
+ src/internal.h | 5 ++-
+ src/libnetfilter_cthelper.c | 83 ++++++++++++++++++---------------------------
+ 3 files changed, 36 insertions(+), 54 deletions(-)
+
+Index: libnetfilter_cthelper-1.0.0/doxygen.cfg.in
+===================================================================
+--- libnetfilter_cthelper-1.0.0.orig/doxygen.cfg.in
++++ libnetfilter_cthelper-1.0.0/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE = YES
+ EXCLUDE =
+ EXCLUDE_SYMLINKS = NO
+ EXCLUDE_PATTERNS = */.git/* .*.d
+-EXCLUDE_SYMBOLS = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS =
+ EXAMPLE_PATH =
+ EXAMPLE_PATTERNS =
+ EXAMPLE_RECURSIVE = NO
+Index: libnetfilter_cthelper-1.0.0/src/internal.h
+===================================================================
+--- libnetfilter_cthelper-1.0.0.orig/src/internal.h
++++ libnetfilter_cthelper-1.0.0/src/internal.h
+@@ -3,10 +3,9 @@
+
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-# define __visible __attribute__((visibility("default")))
+-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
++# define __EXPORTED __attribute__((visibility("default")))
+ #else
+-# define EXPORT_SYMBOL
++# define __EXPORTED
+ #endif
+
+ #endif
+Index: libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c
+===================================================================
+--- libnetfilter_cthelper-1.0.0.orig/src/libnetfilter_cthelper.c
++++ libnetfilter_cthelper-1.0.0/src/libnetfilter_cthelper.c
+@@ -99,17 +99,16 @@ struct nfct_helper {
+ * In case of success, this function returns a valid pointer, otherwise NULL
+ * s returned and errno is appropriately set.
+ */
+-struct nfct_helper *nfct_helper_alloc(void)
++struct nfct_helper __EXPORTED *nfct_helper_alloc(void)
+ {
+ return calloc(1, sizeof(struct nfct_helper));
+ }
+-EXPORT_SYMBOL(nfct_helper_alloc);
+
+ /**
+ * nfct_helper_free - release one helper object
+ * \param nfct_helper pointer to the helper object
+ */
+-void nfct_helper_free(struct nfct_helper *h)
++void __EXPORTED nfct_helper_free(struct nfct_helper *h)
+ {
+ int i;
+
+@@ -119,7 +118,6 @@ void nfct_helper_free(struct nfct_helper
+ free(h->expect_policy[i]);
+ }
+ }
+-EXPORT_SYMBOL(nfct_helper_free);
+
+ /**
+ * nfct_helper_policy_alloc - allocate a new helper policy object
+@@ -127,21 +125,19 @@ EXPORT_SYMBOL(nfct_helper_free);
+ * In case of success, this function returns a valid pointer, otherwise NULL
+ * s returned and errno is appropriately set.
+ */
+-struct nfct_helper_policy *nfct_helper_policy_alloc(void)
++struct nfct_helper_policy __EXPORTED *nfct_helper_policy_alloc(void)
+ {
+ return calloc(1, sizeof(struct nfct_helper_policy));
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_alloc);
+
+ /**
+ * nfct_helper_free - release one helper policy object
+ * \param nfct_helper pointer to the helper object
+ */
+-void nfct_helper_policy_free(struct nfct_helper_policy *p)
++void __EXPORTED nfct_helper_policy_free(struct nfct_helper_policy *p)
+ {
+ free(p);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_free);
+
+ /**
+ * nfct_helper_policy_attr_set - set one attribute of the helper object
+@@ -149,7 +145,7 @@ EXPORT_SYMBOL(nfct_helper_policy_free);
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set(struct nfct_helper_policy *p,
+ enum nfct_helper_policy_attr_type type,
+ const void *data)
+@@ -170,7 +166,6 @@ nfct_helper_policy_attr_set(struct nfct_
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set);
+
+ /**
+ * nfct_helper_attr_set_str - set one attribute the helper object
+@@ -178,23 +173,21 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_se
+ * \param type attribute type you want to set
+ * \param name string that will be used to set this attribute
+ */
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set_str(struct nfct_helper_policy *p,
+ enum nfct_helper_policy_attr_type type,
+ const char *name)
+ {
+ nfct_helper_policy_attr_set(p, type, name);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set_str);
+
+-void
++void __EXPORTED
+ nfct_helper_policy_attr_set_u32(struct nfct_helper_policy *p,
+ enum nfct_helper_policy_attr_type type,
+ uint32_t value)
+ {
+ nfct_helper_policy_attr_set(p, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_policy_attr_set_u32);
+
+ /**
+ * nfct_helper_attr_set - set one attribute of the helper object
+@@ -202,7 +195,7 @@ EXPORT_SYMBOL(nfct_helper_policy_attr_se
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-void
++void __EXPORTED
+ nfct_helper_attr_set(struct nfct_helper *h,
+ enum nfct_helper_attr_type type, const void *data)
+ {
+@@ -250,7 +243,6 @@ nfct_helper_attr_set(struct nfct_helper
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set);
+
+ /**
+ * nfct_helper_attr_set_str - set one attribute the helper object
+@@ -258,44 +250,40 @@ EXPORT_SYMBOL(nfct_helper_attr_set);
+ * \param type attribute type you want to set
+ * \param name string that will be used to set this attribute
+ */
+-void
++void __EXPORTED
+ nfct_helper_attr_set_str(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type,
+ const char *name)
+ {
+ nfct_helper_attr_set(nfct_helper, type, name);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_str);
+
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u8(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type, uint8_t value)
+ {
+ nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u8);
+
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u16(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type, uint16_t value)
+ {
+ nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u16);
+
+-void
++void __EXPORTED
+ nfct_helper_attr_set_u32(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type, uint32_t value)
+ {
+ nfct_helper_attr_set(nfct_helper, type, &value);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_set_u32);
+
+ /**
+ * nfct_helper_attr_unset - unset one attribute the helper object
+ * \param nfct_helper pointer to the helper object
+ * \param type attribute type you want to set
+ */
+-void
++void __EXPORTED
+ nfct_helper_attr_unset(struct nfct_helper *nfct_helper, enum nfct_helper_attr_type type)
+ {
+ switch(type) {
+@@ -307,7 +295,6 @@ nfct_helper_attr_unset(struct nfct_helpe
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_unset);
+
+ /**
+ * nfct_helper_attr_get - get one attribute the helper object
+@@ -317,8 +304,9 @@ EXPORT_SYMBOL(nfct_helper_attr_unset);
+ * This function returns a valid pointer to the attribute data. If a
+ * unsupported attribute is used, this returns NULL.
+ */
+-const void *nfct_helper_attr_get(struct nfct_helper *helper,
+- enum nfct_helper_attr_type type)
++const void __EXPORTED *
++nfct_helper_attr_get(struct nfct_helper *helper,
++ enum nfct_helper_attr_type type)
+ {
+ const void *ret = NULL;
+
+@@ -358,7 +346,6 @@ const void *nfct_helper_attr_get(struct
+ }
+ return ret;
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get);
+
+ /**
+ * nfct_helper_attr_get_str - get one attribute the helper object
+@@ -368,13 +355,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get);
+ * This function returns a valid pointer to the beginning of the string.
+ * If the attribute is unsupported, this returns NULL.
+ */
+-const char *
++const char __EXPORTED *
+ nfct_helper_attr_get_str(struct nfct_helper *nfct_helper,
+ enum nfct_helper_attr_type type)
+ {
+ return (const char *)nfct_helper_attr_get(nfct_helper, type);
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_str);
+
+ /**
+ * nfct_helper_attr_get_u8 - get one attribute the helper object
+@@ -384,12 +370,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_str);
+ * This function returns a unsigned 8-bits integer. If the attribute is
+ * unsupported, this returns NULL.
+ */
+-uint8_t nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
+- enum nfct_helper_attr_type type)
++uint8_t __EXPORTED
++nfct_helper_attr_get_u8(struct nfct_helper *nfct_helper,
++ enum nfct_helper_attr_type type)
+ {
+ return *((uint8_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u8);
+
+ /**
+ * nfct_helper_attr_get_u16 - get one attribute the helper object
+@@ -399,12 +385,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u8);
+ * This function returns a unsigned 16-bits integer. If the attribute is
+ * unsupported, this returns NULL.
+ */
+-uint16_t nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
+- enum nfct_helper_attr_type type)
++uint16_t __EXPORTED
++nfct_helper_attr_get_u16(struct nfct_helper *nfct_helper,
++ enum nfct_helper_attr_type type)
+ {
+ return *((uint16_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u16);
+
+ /**
+ * nfct_helper_attr_get_u32 - get one attribute the helper object
+@@ -414,12 +400,12 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u16);
+ * This function returns a unsigned 32-bits integer. If the attribute is
+ * unsupported, this returns NULL.
+ */
+-uint32_t nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
+- enum nfct_helper_attr_type type)
++uint32_t __EXPORTED
++nfct_helper_attr_get_u32(struct nfct_helper *nfct_helper,
++ enum nfct_helper_attr_type type)
+ {
+ return *((uint32_t *)nfct_helper_attr_get(nfct_helper, type));
+ }
+-EXPORT_SYMBOL(nfct_helper_attr_get_u32);
+
+ /**
+ * nfct_helper_snprintf - print helper object into one buffer
+@@ -431,9 +417,10 @@ EXPORT_SYMBOL(nfct_helper_attr_get_u32);
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int nfct_helper_snprintf(char *buf, size_t size,
+- struct nfct_helper *helper,
+- unsigned int type, unsigned int flags)
++int __EXPORTED
++nfct_helper_snprintf(char *buf, size_t size,
++ struct nfct_helper *helper,
++ unsigned int type, unsigned int flags)
+ {
+ int ret;
+
+@@ -454,7 +441,6 @@ int nfct_helper_snprintf(char *buf, size
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfct_helper_snprintf);
+
+ /**
+ * @}
+@@ -490,7 +476,7 @@ EXPORT_SYMBOL(nfct_helper_snprintf);
+ * - Command NFNL_MSG_ACCT_DEL, to delete one specific nfct_helper object (if
+ * unused, otherwise you hit EBUSY).
+ */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORTED *
+ nfct_helper_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ uint16_t flags, uint32_t seq)
+ {
+@@ -509,7 +495,6 @@ nfct_helper_nlmsg_build_hdr(char *buf, u
+
+ return nlh;
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_build_hdr);
+
+ static void
+ nfct_helper_nlmsg_build_policy(struct nlmsghdr *nlh,
+@@ -530,7 +515,7 @@ nfct_helper_nlmsg_build_policy(struct nl
+ * \param nlh: netlink message that you want to use to add the payload.
+ * \param nfct_helper: pointer to a helper object
+ */
+-void
++void __EXPORTED
+ nfct_helper_nlmsg_build_payload(struct nlmsghdr *nlh, struct nfct_helper *h)
+ {
+ struct nlattr *nest;
+@@ -593,7 +578,6 @@ nfct_helper_nlmsg_build_payload(struct n
+ if (h->bitset & (1 << NFCTH_ATTR_STATUS))
+ mnl_attr_put_u32(nlh, NFCTH_STATUS, ntohl(h->status));
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_build_payload);
+
+ static int
+ nfct_helper_nlmsg_parse_tuple_cb(const struct nlattr *attr, void *data)
+@@ -795,7 +779,7 @@ nfct_helper_nlmsg_parse_attr_cb(const st
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int
++int __EXPORTED
+ nfct_helper_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ struct nfct_helper *h)
+ {
+@@ -832,7 +816,6 @@ nfct_helper_nlmsg_parse_payload(const st
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nfct_helper_nlmsg_parse_payload);
+
+ /**
+ * @}
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
new file mode 100644
index 000000000..2c606c832
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/files/libnetfilter-cttimeout-visibility-hidden.patch
@@ -0,0 +1,264 @@
+From d0c4e39d12f903e06db262656cff2e24d267bed7 Mon Sep 17 00:00:00 2001
+From: Kevin Cernekee <cernekee@chromium.org>
+Date: Wed, 4 Jan 2017 14:30:25 -0800
+Subject: Use __EXPORTED rather than EXPORT_SYMBOL
+
+clang is sensitive to the ordering of
+__attribute__((visibility("default"))) relative to the function
+body. gcc is not. So if we try to re-declare an existing function
+with default visibility, clang prints a warning and generates
+a broken .so file in which nfct_timeout_* are not exported to library
+callers.
+
+Move the attribute up into the function definition to make clang happy.
+
+Signed-off-by: Kevin Cernekee <cernekee@chromium.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ doxygen.cfg.in | 2 +-
+ src/internal.h | 5 ++---
+ src/libnetfilter_cttimeout.c | 44 +++++++++++++++++---------------------------
+ 3 files changed, 20 insertions(+), 31 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 8e5d449..09c3ce0 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE = YES
+ EXCLUDE =
+ EXCLUDE_SYMLINKS = NO
+ EXCLUDE_PATTERNS = */.git/* .*.d
+-EXCLUDE_SYMBOLS = EXPORT_SYMBOL nfct_timeout _container_policy_cb
++EXCLUDE_SYMBOLS = nfct_timeout _container_policy_cb
+ EXAMPLE_PATH =
+ EXAMPLE_PATTERNS =
+ EXAMPLE_RECURSIVE = NO
+diff --git a/src/internal.h b/src/internal.h
+index 3a88d1a..5d78171 100644
+--- a/src/internal.h
++++ b/src/internal.h
+@@ -3,10 +3,9 @@
+
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-# define __visible __attribute__((visibility("default")))
+-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible
++# define __EXPORTED __attribute__((visibility("default")))
+ #else
+-# define EXPORT_SYMBOL
++# define __EXPORTED
+ #endif
+
+ #endif
+diff --git a/src/libnetfilter_cttimeout.c b/src/libnetfilter_cttimeout.c
+index 7844a1f..a0a7185 100644
+--- a/src/libnetfilter_cttimeout.c
++++ b/src/libnetfilter_cttimeout.c
+@@ -187,7 +187,7 @@ struct nfct_timeout {
+ * In case of success, this function returns a valid pointer, otherwise NULL
+ * s returned and errno is appropriately set.
+ */
+-struct nfct_timeout *nfct_timeout_alloc(void)
++struct nfct_timeout __EXPORTED *nfct_timeout_alloc(void)
+ {
+ struct nfct_timeout *t;
+
+@@ -197,19 +197,17 @@ struct nfct_timeout *nfct_timeout_alloc(void)
+
+ return t;
+ }
+-EXPORT_SYMBOL(nfct_timeout_alloc);
+
+ /**
+ * nfct_timeout_free - release one conntrack timeout object
+ * \param t pointer to the conntrack timeout object
+ */
+-void nfct_timeout_free(struct nfct_timeout *t)
++void __EXPORTED nfct_timeout_free(struct nfct_timeout *t)
+ {
+ if (t->timeout)
+ free(t->timeout);
+ free(t);
+ }
+-EXPORT_SYMBOL(nfct_timeout_free);
+
+ /**
+ * nfct_timeout_attr_set - set one attribute of the conntrack timeout object
+@@ -217,7 +215,7 @@ EXPORT_SYMBOL(nfct_timeout_free);
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
+ {
+ switch(type) {
+@@ -236,7 +234,6 @@ nfct_timeout_attr_set(struct nfct_timeout *t, uint32_t type, const void *data)
+ t->attrset |= (1 << type);
+ return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set);
+
+ /**
+ * nfct_timeout_attr_set_u8 - set one attribute of the conntrack timeout object
+@@ -244,12 +241,11 @@ EXPORT_SYMBOL(nfct_timeout_attr_set);
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set_u8(struct nfct_timeout *t, uint32_t type, uint8_t data)
+ {
+ return nfct_timeout_attr_set(t, type, &data);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
+
+ /**
+ * nfct_timeout_attr_set_u16 - set one attribute of the conntrack timeout object
+@@ -257,23 +253,21 @@ EXPORT_SYMBOL(nfct_timeout_attr_set_u8);
+ * \param type attribute type you want to set
+ * \param data pointer to data that will be used to set this attribute
+ */
+-int
++int __EXPORTED
+ nfct_timeout_attr_set_u16(struct nfct_timeout *t, uint32_t type, uint16_t data)
+ {
+ return nfct_timeout_attr_set(t, type, &data);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_set_u16);
+
+ /**
+ * nfct_timeout_attr_unset - unset one attribute of the conntrack timeout object
+ * \param t pointer to the conntrack timeout object
+ * \param type attribute type you want to set
+ */
+-void nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
++void __EXPORTED nfct_timeout_attr_unset(struct nfct_timeout *t, uint32_t type)
+ {
+ t->attrset &= ~(1 << type);
+ }
+-EXPORT_SYMBOL(nfct_timeout_attr_unset);
+
+ /**
+ * nfct_timeout_policy_attr_set_u32 - set one attribute of the policy
+@@ -281,7 +275,7 @@ EXPORT_SYMBOL(nfct_timeout_attr_unset);
+ * \param type attribute type you want to set
+ * \param data data that will be used to set this attribute
+ */
+-int
++int __EXPORTED
+ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
+ uint32_t type, uint32_t data)
+ {
+@@ -319,18 +313,17 @@ nfct_timeout_policy_attr_set_u32(struct nfct_timeout *t,
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_set_u32);
+
+ /**
+ * nfct_timeout_policy_attr_unset - unset one attribute of the policy
+ * \param t pointer to the conntrack timeout object
+ * \param type attribute type you want to set
+ */
+-void nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
++void __EXPORTED
++nfct_timeout_policy_attr_unset(struct nfct_timeout *t, uint32_t type)
+ {
+ t->attrset &= ~(1 << type);
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
+
+ /**
+ * nfct_timeout_policy_attr_to_name - get state name from protocol state number
+@@ -340,7 +333,8 @@ EXPORT_SYMBOL(nfct_timeout_policy_attr_unset);
+ * This function returns NULL if unsupported protocol or state number is passed.
+ * Otherwise, a pointer to valid string is returned.
+ */
+-const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
++const char __EXPORTED *
++nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
+ {
+ if (timeout_protocol[l4proto].state_to_name == NULL) {
+ printf("no array state name\n");
+@@ -354,7 +348,6 @@ const char *nfct_timeout_policy_attr_to_name(uint8_t l4proto, uint32_t state)
+
+ return timeout_protocol[l4proto].state_to_name[state];
+ }
+-EXPORT_SYMBOL(nfct_timeout_policy_attr_to_name);
+
+ /**
+ * @}
+@@ -438,8 +431,9 @@ nfct_timeout_snprintf_default(char *buf, size_t size,
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
+- unsigned int type, unsigned int flags)
++int __EXPORTED
++nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
++ unsigned int type, unsigned int flags)
+ {
+ int ret = 0;
+
+@@ -454,7 +448,6 @@ int nfct_timeout_snprintf(char *buf, size_t size, const struct nfct_timeout *t,
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nfct_timeout_snprintf);
+
+ /**
+ * @}
+@@ -477,7 +470,7 @@ EXPORT_SYMBOL(nfct_timeout_snprintf);
+ * - CTNL_MSG_TIMEOUT_GET: get conntrack timeout object.
+ * - CTNL_MSG_TIMEOUT_DEL: delete conntrack timeout object.
+ */
+-struct nlmsghdr *
++struct nlmsghdr __EXPORTED *
+ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
+ uint16_t flags, uint32_t seq)
+ {
+@@ -496,14 +489,13 @@ nfct_timeout_nlmsg_build_hdr(char *buf, uint8_t cmd,
+
+ return nlh;
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_hdr);
+
+ /**
+ * nfct_timeout_nlmsg_build_payload - build payload from ct timeout object
+ * \param nlh: netlink message that you want to use to add the payload.
+ * \param t: pointer to a conntrack timeout object
+ */
+-void
++void __EXPORTED
+ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
+ const struct nfct_timeout *t)
+ {
+@@ -532,7 +524,6 @@ nfct_timeout_nlmsg_build_payload(struct nlmsghdr *nlh,
+ }
+
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_build_payload);
+
+ static int
+ timeout_nlmsg_parse_attr_cb(const struct nlattr *attr, void *data)
+@@ -629,7 +620,7 @@ timeout_parse_attr_data(struct nfct_timeout *t, const struct nlattr *nest)
+ * This function returns -1 in case that some mandatory attributes are
+ * missing. On sucess, it returns 0.
+ */
+-int
++int __EXPORTED
+ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ struct nfct_timeout *t)
+ {
+@@ -654,7 +645,6 @@ nfct_timeout_nlmsg_parse_payload(const struct nlmsghdr *nlh,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nfct_timeout_nlmsg_parse_payload);
+
+ /**
+ * @}
+--
+cgit v1.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
new file mode 100644
index 000000000..974035ccc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-acct_1.0.3.bb
@@ -0,0 +1,17 @@
+SUMMARY = "libnetfilter_acct accounting infrastructure."
+DESCRIPTION = "libnetfilter_acct is the userspace library providing interface to extended accounting infrastructure."
+HOMEPAGE = "http://netfilter.org/projects/libnetfilter_acct/index.html"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+DEPENDS = "libnfnetlink libmnl"
+
+SRC_URI = "http://ftp.netfilter.org/pub/libnetfilter_acct/libnetfilter_acct-1.0.3.tar.bz2 \
+ file://0001-libnetfilter-acct-Declare-the-define-visivility-attribute-together.patch \
+"
+SRC_URI[md5sum] = "814b2972b2f5c740ff87510bc109168b"
+SRC_URI[sha256sum] = "4250ceef3efe2034f4ac05906c3ee427db31b9b0a2df41b2744f4bf79a959a1a"
+
+S = "${WORKDIR}/libnetfilter_acct-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb
new file mode 100644
index 000000000..e4e186bdb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.6.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Netfilter connection tracking library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table"
+HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libnfnetlink libmnl"
+
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar \
+"
+SRC_URI[tar.md5sum] = "7139c5f408dd9606ffecfd5dcda8175b"
+SRC_URI[tar.sha256sum] = "efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb"
+
+S = "${WORKDIR}/libnetfilter_conntrack-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
new file mode 100644
index 000000000..92cb23d6e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Netfilter connection tracking helper library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure"
+HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_cthelper/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libmnl"
+
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar \
+ file://libnetfilter-cthelper-visibility-hidden.patch \
+"
+SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd"
+SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d"
+
+S = "${WORKDIR}/libnetfilter_cthelper-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
new file mode 100644
index 000000000..ff32f3409
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Netfilter connection tracking timeout library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter fine-grain connection tracking timeout infrastructure"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libmnl"
+
+SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar \
+ file://libnetfilter-cttimeout-visibility-hidden.patch \
+"
+SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9"
+SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba"
+
+S = "${WORKDIR}/libnetfilter_cttimeout-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb
new file mode 100644
index 000000000..2f627d458
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Netfilter logging library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter log message (NFLOG)"
+HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_log/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libnfnetlink libmnl"
+SRCREV = "ba196a97e810746e5660fe3f57c87c0ed0f2b324"
+PV .= "+git${SRCPV}"
+
+SRC_URI = "git://git.netfilter.org/libnetfilter_log"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb
new file mode 100644
index 000000000..754e11d99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Netfilter packet queue access library"
+DESCRIPTION = "Userspace library providing a programming interface (API) to access the Linux kernel netfilter packet queue"
+HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_queue/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+DEPENDS = "libnfnetlink libmnl"
+
+PV .= "+git${SRCREV}"
+SRCREV = "981025e103d887fb6a9c9bb49c74ec323108d098"
+
+SRC_URI = "git://git.netfilter.org/libnetfilter_queue \
+ file://0001-Correct-typo-in-the-location-of-internal.h-in-includ.patch \
+ file://0001-libnetfilter-queue-Declare-the-define-visivility-attribute-together.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch
new file mode 100644
index 000000000..00d95cd79
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0001-build-resolve-automake-1.12-warnings.patch
@@ -0,0 +1,28 @@
+From 2e5f2b81fb8cbe0d1cd33e58caa19ac308e1f847 Mon Sep 17 00:00:00 2001
+From: Jan Engelhardt <jengelh@inai.de>
+Date: Tue, 9 Oct 2012 15:59:48 +0200
+Subject: [PATCH 1/6] build: resolve automake-1.12 warnings
+
+am/ltlibrary.am: warning: 'libnfnetlink.la': linking libtool libraries
+using a non-POSIX archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-off-by: Jan Engelhardt <jengelh@inai.de>
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index ed549df..0926a1c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -7,6 +7,7 @@ AC_CANONICAL_HOST
+
+ AM_INIT_AUTOMAKE([-Wall foreign subdir-objects
+ tar-pax no-dist-gzip dist-bzip2 1.6])
++m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+
+ dnl kernel style compile messages
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch
new file mode 100644
index 000000000..c2fb5e05a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0002-src-get-source-code-license-header-in-sync-with-curr.patch
@@ -0,0 +1,49 @@
+From 5e6b6e23a8b04475c5a9de7eddb4c18103932fe5 Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Wed, 7 Aug 2013 20:53:57 +0200
+Subject: [PATCH 2/6] src: get source code license header in sync with current
+ licensing terms
+
+Since (3956761 license: upgrade to GPLv2+), we upgraded to GPLv2+,
+propagate that changes to src/iftable.c and src/rtnl.c
+
+Reported-by: Thomas Woerner <twoerner@redhat.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ src/iftable.c | 2 +-
+ src/rtnl.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/iftable.c b/src/iftable.c
+index 0325335..5976ed8 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -3,7 +3,7 @@
+ * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com>
+ * (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org>
+ *
+- * This software is Free Software and licensed under GNU GPLv2.
++ * This software is Free Software and licensed under GNU GPLv2+.
+ */
+
+ /* IFINDEX handling */
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 5ccb272..7b4ac7d 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -1,10 +1,10 @@
+ /* rtnl - rtnetlink utility functions
+ *
+ * (C) 2004 by Astaro AG, written by Harald Welte <hwelte@astaro.com>
+- *
++ *
+ * Adapted to nfnetlink by Eric Leblond <eric@inl.fr>
+ *
+- * This software is free software and licensed under GNU GPLv2.
++ * This software is free software and licensed under GNU GPLv2+.
+ *
+ */
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch
new file mode 100644
index 000000000..6cb7ed6fa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0003-configure-uclinux-is-also-linux.patch
@@ -0,0 +1,27 @@
+From b259fe13826414c1bd5328a25c8d6d60e20e65f2 Mon Sep 17 00:00:00 2001
+From: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Date: Tue, 10 Sep 2013 16:23:29 -0300
+Subject: [PATCH 3/6] configure: uclinux is also linux
+
+Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0926a1c..b979772 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -18,7 +18,7 @@ AC_DISABLE_STATIC
+ AM_PROG_LIBTOOL
+
+ case "$host" in
+-*-*-linux*) ;;
++*-*-linux* | *-*-uclinux*) ;;
+ *) AC_MSG_ERROR([Linux only, dude!]);;
+ esac
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch
new file mode 100644
index 000000000..cf3a84135
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch
@@ -0,0 +1,39 @@
+From b142da8d2c9e2e2dfbe4e89e680dd124f6064ac8 Mon Sep 17 00:00:00 2001
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+Date: Mon, 3 Feb 2014 12:09:29 +0100
+Subject: [PATCH 4/6] libnfnetlink: initialize attribute padding to resolve
+ valgrind warnings
+
+==12195== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
+==12195== at 0x51209C3: __sendto_nocancel (syscall-template.S:81)
+==12195== by 0x53E4D12: nfnl_send (libnfnetlink.c:391)
+==12195== by 0x53E6952: nfnl_query (libnfnetlink.c:1569)
+==12195== by 0x4E344AF: __build_send_cfg_msg.isra.1 (libnetfilter_log.c:143)
+==12195== by 0x4E34710: nflog_bind_group (libnetfilter_log.c:413)
+==12195== by 0x400CB1: main (nfulnl_test.c:77)
+==12195== Address 0x7fefff3e9 is on thread 1's stack
+
+This patch sets to zero the padding that is included to align the
+attribute payload.
+
+Reported-by: Ivan Homoliak <xhomol11@gmail.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ src/libnfnetlink.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 4b2bcd0..398b7d7 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -809,6 +809,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
+ nfa->nfa_type = type;
+ nfa->nfa_len = len;
+ memcpy(NFA_DATA(nfa), data, alen);
++ memset((uint8_t *)nfa + nfa->nfa_len, 0, NFA_ALIGN(alen) - alen);
+ n->nlmsg_len = (NLMSG_ALIGN(n->nlmsg_len) + NFA_ALIGN(len));
+ return 0;
+ }
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch
new file mode 100644
index 000000000..383f0e8b3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0005-include-Sync-with-kernel-headers.patch
@@ -0,0 +1,110 @@
+From b10c90a61a5fc46f2be5aeecb9c96e84178f7717 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 14:49:07 +0200
+Subject: [PATCH 5/6] include: Sync with kernel headers
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/libnfnetlink/linux_nfnetlink.h | 44 ++++-----------------------
+ include/libnfnetlink/linux_nfnetlink_compat.h | 12 ++++----
+ 2 files changed, 12 insertions(+), 44 deletions(-)
+
+diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
+index 76a8550..44a38d6 100644
+--- a/include/libnfnetlink/linux_nfnetlink.h
++++ b/include/libnfnetlink/linux_nfnetlink.h
+@@ -25,9 +25,9 @@ enum nfnetlink_groups {
+ /* General form of address family dependent message.
+ */
+ struct nfgenmsg {
+- u_int8_t nfgen_family; /* AF_xxx */
+- u_int8_t version; /* nfnetlink version */
+- u_int16_t res_id; /* resource id */
++ __u8 nfgen_family; /* AF_xxx */
++ __u8 version; /* nfnetlink version */
++ __be16 res_id; /* resource id */
+ };
+
+ #define NFNETLINK_V0 0
+@@ -46,40 +46,8 @@ struct nfgenmsg {
+ #define NFNL_SUBSYS_CTNETLINK_EXP 2
+ #define NFNL_SUBSYS_QUEUE 3
+ #define NFNL_SUBSYS_ULOG 4
+-#define NFNL_SUBSYS_COUNT 5
++#define NFNL_SUBSYS_OSF 5
++#define NFNL_SUBSYS_IPSET 6
++#define NFNL_SUBSYS_COUNT 7
+
+-#ifdef __KERNEL__
+-
+-#include <linux/netlink.h>
+-#include <linux/capability.h>
+-#include <net/netlink.h>
+-
+-struct nfnl_callback
+-{
+- int (*call)(struct sock *nl, struct sk_buff *skb,
+- struct nlmsghdr *nlh, struct nlattr *cda[]);
+- const struct nla_policy *policy; /* netlink attribute policy */
+- const u_int16_t attr_count; /* number of nlattr's */
+-};
+-
+-struct nfnetlink_subsystem
+-{
+- const char *name;
+- __u8 subsys_id; /* nfnetlink subsystem ID */
+- __u8 cb_count; /* number of callbacks */
+- const struct nfnl_callback *cb; /* callback for individual types */
+-};
+-
+-extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
+-extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
+-
+-extern int nfnetlink_has_listeners(unsigned int group);
+-extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group,
+- int echo);
+-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
+-
+-#define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
+- MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
+-
+-#endif /* __KERNEL__ */
+ #endif /* _NFNETLINK_H */
+diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
+index e145176..74b9e55 100644
+--- a/include/libnfnetlink/linux_nfnetlink_compat.h
++++ b/include/libnfnetlink/linux_nfnetlink_compat.h
+@@ -1,6 +1,8 @@
+ #ifndef _NFNETLINK_COMPAT_H
+ #define _NFNETLINK_COMPAT_H
+-#ifndef __KERNEL__
++
++#include <linux/types.h>
++
+ /* Old nfnetlink macros for userspace */
+
+ /* nfnetlink groups: Up to 32 maximum */
+@@ -18,10 +20,9 @@
+ * ! nfnetlink use the same attributes methods. - J. Schulist.
+ */
+
+-struct nfattr
+-{
+- u_int16_t nfa_len;
+- u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
++struct nfattr {
++ __u16 nfa_len;
++ __u16 nfa_type; /* we use 15 bits for the type, and the highest
+ * bit to indicate whether the payload is nested */
+ };
+
+@@ -57,5 +58,4 @@ struct nfattr
+ + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
+ #define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
+
+-#endif /* ! __KERNEL__ */
+ #endif /* _NFNETLINK_COMPAT_H */
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch
new file mode 100644
index 000000000..72c9987d1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink/0006-src-Use-stdint-types-everywhere.patch
@@ -0,0 +1,403 @@
+From 5cb589e246c91331ee6b3926b15f5e6cfc8ad95e Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 16 May 2015 14:59:57 +0200
+Subject: [PATCH 6/6] src: Use stdint types everywhere
+
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+ include/libnfnetlink/libnfnetlink.h | 25 ++++++-------
+ src/iftable.c | 8 ++---
+ src/iftable.h | 4 +--
+ src/libnfnetlink.c | 72 ++++++++++++++++++-------------------
+ src/rtnl.c | 4 +--
+ src/rtnl.h | 2 +-
+ 6 files changed, 58 insertions(+), 57 deletions(-)
+
+diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
+index 1d8c49d..cd0be3d 100644
+--- a/include/libnfnetlink/libnfnetlink.h
++++ b/include/libnfnetlink/libnfnetlink.h
+@@ -15,6 +15,7 @@
+ #define aligned_u64 unsigned long long __attribute__((aligned(8)))
+ #endif
+
++#include <stdint.h>
+ #include <sys/socket.h> /* for sa_family_t */
+ #include <linux/netlink.h>
+ #include <libnfnetlink/linux_nfnetlink.h>
+@@ -55,7 +56,7 @@ struct nfnlhdr {
+ struct nfnl_callback {
+ int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
+ void *data;
+- u_int16_t attr_count;
++ uint16_t attr_count;
+ };
+
+ struct nfnl_handle;
+@@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void);
+ extern int nfnl_close(struct nfnl_handle *);
+
+ extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *,
+- u_int8_t, u_int8_t,
++ uint8_t, uint8_t,
+ unsigned int);
+ extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+
+@@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
+ const struct iovec *iov, unsigned int num,
+ unsigned int flags);
+ extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
+- unsigned int, u_int8_t, u_int16_t, u_int16_t,
+- u_int16_t);
++ unsigned int, uint8_t, uint16_t, uint16_t,
++ uint16_t);
+ extern __attribute__((deprecated)) int
+ nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
+ unsigned, struct nlmsghdr *,
+@@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *,
+ /* receiving */
+ extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
+ extern int nfnl_callback_register(struct nfnl_subsys_handle *,
+- u_int8_t type, struct nfnl_callback *cb);
+-extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
++ uint8_t type, struct nfnl_callback *cb);
++extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type);
+ extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
+
+ /* parsing */
+@@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh);
+
+ /* nfnl attribute handling functions */
+ extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int);
+-extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t);
+-extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t);
+-extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t);
++extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t);
++extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t);
++extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t);
+ extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int);
+-extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t);
+-extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t);
++extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t);
++extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t);
+ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ #define nfnl_parse_nested(tb, max, nfa) \
+ nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
+@@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ ({ (tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })
+
+ extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa,
+- u_int16_t type, u_int32_t len,
++ uint16_t type, uint32_t len,
+ unsigned char *val);
+ extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h,
+ unsigned int size);
+diff --git a/src/iftable.c b/src/iftable.c
+index 5976ed8..157f97b 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -27,10 +27,10 @@
+ struct ifindex_node {
+ struct list_head head;
+
+- u_int32_t index;
+- u_int32_t type;
+- u_int32_t alen;
+- u_int32_t flags;
++ uint32_t index;
++ uint32_t type;
++ uint32_t alen;
++ uint32_t flags;
+ char addr[8];
+ char name[16];
+ };
+diff --git a/src/iftable.h b/src/iftable.h
+index 8df7f24..655df6b 100644
+--- a/src/iftable.h
++++ b/src/iftable.h
+@@ -1,8 +1,8 @@
+ #ifndef _IFTABLE_H
+ #define _IFTABLE_H
+
+-int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+-int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
++int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
++int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+
+ int iftable_init(void);
+ void iftable_fini(void);
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 398b7d7..df57533 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -72,9 +72,9 @@
+
+ struct nfnl_subsys_handle {
+ struct nfnl_handle *nfnlh;
+- u_int32_t subscriptions;
+- u_int8_t subsys_id;
+- u_int8_t cb_count;
++ uint32_t subscriptions;
++ uint8_t subsys_id;
++ uint8_t cb_count;
+ struct nfnl_callback *cb; /* array of callbacks */
+ };
+
+@@ -86,11 +86,11 @@ struct nfnl_handle {
+ int fd;
+ struct sockaddr_nl local;
+ struct sockaddr_nl peer;
+- u_int32_t subscriptions;
+- u_int32_t seq;
+- u_int32_t dump;
+- u_int32_t rcv_buffer_size; /* for nfnl_catch */
+- u_int32_t flags;
++ uint32_t subscriptions;
++ uint32_t seq;
++ uint32_t dump;
++ uint32_t rcv_buffer_size; /* for nfnl_catch */
++ uint32_t flags;
+ struct nlmsghdr *last_nlhdr;
+ struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1];
+ };
+@@ -145,7 +145,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h)
+ static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
+ {
+ int i, err;
+- u_int32_t new_subscriptions = nfnlh->subscriptions;
++ uint32_t new_subscriptions = nfnlh->subscriptions;
+
+ for (i = 0; i < NFNL_MAX_SUBSYS; i++)
+ new_subscriptions |= nfnlh->subsys[i].subscriptions;
+@@ -273,8 +273,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size)
+ * a valid address that points to a nfnl_subsys_handle structure is returned.
+ */
+ struct nfnl_subsys_handle *
+-nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id,
+- u_int8_t cb_count, u_int32_t subscriptions)
++nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id,
++ uint8_t cb_count, uint32_t subscriptions)
+ {
+ struct nfnl_subsys_handle *ssh;
+
+@@ -435,10 +435,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov,
+ */
+ void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh,
+ struct nlmsghdr *nlh, unsigned int len,
+- u_int8_t family,
+- u_int16_t res_id,
+- u_int16_t msg_type,
+- u_int16_t msg_flags)
++ uint8_t family,
++ uint16_t res_id,
++ uint16_t msg_type,
++ uint16_t msg_flags)
+ {
+ assert(ssh);
+ assert(nlh);
+@@ -815,7 +815,7 @@ int nfnl_addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
+ }
+
+ /**
+- * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr
++ * nfnl_nfa_addattr_l - Add variable length attribute to struct nfattr
+ *
+ * @nfa: struct nfattr
+ * @maxlen: maximal length of nfattr buffer
+@@ -849,14 +849,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
+ }
+
+ /**
+- * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
++ * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr
+ *
+ * @n: netlink message header to which attribute is to be added
+ * @maxlen: maximum length of netlink message header
+ * @type: type of new attribute
+ * @data: content of new attribute
+ */
+-int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
++int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data)
+ {
+ assert(n);
+ assert(maxlen > 0);
+@@ -866,7 +866,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+ }
+
+ /**
+- * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr
++ * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr
+ *
+ * @nfa: struct nfattr
+ * @maxlen: maximal length of nfattr buffer
+@@ -875,7 +875,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+ *
+ */
+ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+- u_int16_t data)
++ uint16_t data)
+ {
+ assert(nfa);
+ assert(maxlen > 0);
+@@ -885,7 +885,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+ }
+
+ /**
+- * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr
++ * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr
+ *
+ * @n: netlink message header to which attribute is to be added
+ * @maxlen: maximum length of netlink message header
+@@ -894,7 +894,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+ *
+ */
+ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+- u_int16_t data)
++ uint16_t data)
+ {
+ assert(n);
+ assert(maxlen > 0);
+@@ -904,7 +904,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+ }
+
+ /**
+- * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr
++ * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr
+ *
+ * @nfa: struct nfattr
+ * @maxlen: maximal length of nfattr buffer
+@@ -913,7 +913,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+ *
+ */
+ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+- u_int32_t data)
++ uint32_t data)
+ {
+ assert(nfa);
+ assert(maxlen > 0);
+@@ -923,7 +923,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+ }
+
+ /**
+- * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr
++ * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr
+ *
+ * @n: netlink message header to which attribute is to be added
+ * @maxlen: maximum length of netlink message header
+@@ -932,7 +932,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+ *
+ */
+ int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type,
+- u_int32_t data)
++ uint32_t data)
+ {
+ assert(n);
+ assert(maxlen > 0);
+@@ -980,7 +980,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len)
+ *
+ */
+ void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa,
+- u_int16_t type, u_int32_t len, unsigned char *val)
++ uint16_t type, uint32_t len, unsigned char *val)
+ {
+ assert(iov);
+ assert(nfa);
+@@ -1115,7 +1115,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h,
+ * appropiately.
+ */
+ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+- u_int8_t type, struct nfnl_callback *cb)
++ uint8_t type, struct nfnl_callback *cb)
+ {
+ assert(ssh);
+ assert(cb);
+@@ -1138,7 +1138,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+ * On sucess, 0 is returned. On error, -1 is returned and errno is
+ * set appropiately.
+ */
+-int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type)
++int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type)
+ {
+ assert(ssh);
+
+@@ -1161,8 +1161,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h,
+ assert(nfa);
+
+ int min_len;
+- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ const struct nfnl_subsys_handle *ssh;
+ struct nfnl_callback *cb;
+
+@@ -1212,8 +1212,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh,
+ int len)
+ {
+ struct nfnl_subsys_handle *ssh;
+- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ int err = 0;
+
+ if (subsys_id > NFNL_MAX_SUBSYS)
+@@ -1243,7 +1243,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len)
+ {
+
+ while (len >= NLMSG_SPACE(0)) {
+- u_int32_t rlen;
++ uint32_t rlen;
+ struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+
+ if (nlh->nlmsg_len < sizeof(struct nlmsghdr)
+@@ -1285,8 +1285,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ {
+ struct nfnl_subsys_handle *ssh;
+- u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+- u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++ uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++ uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+
+ /* Is this an error message? */
+ if (nfnl_is_error(h, nlh)) {
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 7b4ac7d..284eecd 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -30,7 +30,7 @@
+ #define rtnl_log(x, ...)
+
+ static inline struct rtnl_handler *
+-find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
++find_handler(struct rtnl_handle *rtnl_handle, uint16_t type)
+ {
+ struct rtnl_handler *h;
+ for (h = rtnl_handle->handlers; h; h = h->next) {
+@@ -41,7 +41,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+ }
+
+ static int call_handler(struct rtnl_handle *rtnl_handle,
+- u_int16_t type,
++ uint16_t type,
+ struct nlmsghdr *hdr)
+ {
+ struct rtnl_handler *h = find_handler(rtnl_handle, type);
+diff --git a/src/rtnl.h b/src/rtnl.h
+index 0c403dc..2cb22a8 100644
+--- a/src/rtnl.h
++++ b/src/rtnl.h
+@@ -7,7 +7,7 @@
+ struct rtnl_handler {
+ struct rtnl_handler *next;
+
+- u_int16_t nlmsg_type;
++ uint16_t nlmsg_type;
+ int (*handlefn)(struct nlmsghdr *h, void *arg);
+ void *arg;
+ };
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb
new file mode 100644
index 000000000..f7951ff8d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Low-level library for netfilter related kernel/userspace communication"
+DESCRIPTION = "libnfnetlink is the low-level library for netfilter related \
+kernel/userspace communication. It provides a generic messaging \
+infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, \
+nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or \
+management tools in userspace."
+HOMEPAGE = "http://www.netfilter.org/projects/libnfnetlink/index.html"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar \
+ file://0001-build-resolve-automake-1.12-warnings.patch \
+ file://0002-src-get-source-code-license-header-in-sync-with-curr.patch \
+ file://0003-configure-uclinux-is-also-linux.patch \
+ file://0004-libnfnetlink-initialize-attribute-padding-to-resolve.patch \
+ file://0005-include-Sync-with-kernel-headers.patch \
+ file://0006-src-Use-stdint-types-everywhere.patch \
+ "
+SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e"
+SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch
new file mode 100644
index 000000000..e82b23813
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-Declare-the-define-visivility-attribute-together.patch
@@ -0,0 +1,2949 @@
+From bd01f785da5222d0662be3182fe2650e1c12f43e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 10 Apr 2017 14:07:07 -0700
+Subject: [PATCH] Declare the define visivility attribute together
+
+clang ignores the visibility attribute if its not
+defined before the definition. As a result these
+symbols become hidden and consumers of this library
+fail to link due to these missing symbols
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ doxygen.cfg.in | 2 +-
+ include/utils.h | 5 +--
+ src/batch.c | 21 ++++-------
+ src/chain.c | 102 +++++++++++++++++---------------------------------
+ src/common.c | 21 ++++-------
+ src/expr.c | 51 +++++++++----------------
+ src/gen.c | 39 +++++++------------
+ src/object.c | 99 ++++++++++++++++--------------------------------
+ src/rule.c | 114 +++++++++++++++++++-------------------------------------
+ src/ruleset.c | 48 ++++++++----------------
+ src/set.c | 96 ++++++++++++++++-------------------------------
+ src/set_elem.c | 72 ++++++++++++-----------------------
+ src/table.c | 90 +++++++++++++++-----------------------------
+ src/trace.c | 27 +++++---------
+ src/udata.c | 48 ++++++++----------------
+ 15 files changed, 279 insertions(+), 556 deletions(-)
+
+diff --git a/doxygen.cfg.in b/doxygen.cfg.in
+index 23fcad4..e49f28d 100644
+--- a/doxygen.cfg.in
++++ b/doxygen.cfg.in
+@@ -72,7 +72,7 @@ RECURSIVE = YES
+ EXCLUDE =
+ EXCLUDE_SYMLINKS = NO
+ EXCLUDE_PATTERNS = */.git/* .*.d
+-EXCLUDE_SYMBOLS = EXPORT_SYMBOL
++EXCLUDE_SYMBOLS =
+ EXAMPLE_PATH =
+ EXAMPLE_PATTERNS =
+ EXAMPLE_RECURSIVE = NO
+diff --git a/include/utils.h b/include/utils.h
+index 2f5cf34..ff8207e 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -9,10 +9,9 @@
+
+ #include "config.h"
+ #ifdef HAVE_VISIBILITY_HIDDEN
+-# define __visible __attribute__((visibility("default")))
+-# define EXPORT_SYMBOL(x) typeof(x) (x) __visible;
++# define __EXPORTED __attribute__((visibility("default")))
+ #else
+-# define EXPORT_SYMBOL
++# define __EXPORT
+ #endif
+
+ #define __noreturn __attribute__((__noreturn__))
+diff --git a/src/batch.c b/src/batch.c
+index 5ee3fd7..3bedd26 100644
+--- a/src/batch.c
++++ b/src/batch.c
+@@ -57,7 +57,7 @@ static void nftnl_batch_add_page(struct nftnl_batch_page *page,
+ list_add_tail(&page->head, &batch->page_list);
+ }
+
+-struct nftnl_batch *nftnl_batch_alloc(uint32_t pg_size, uint32_t pg_overrun_size)
++struct nftnl_batch __EXPORTED *nftnl_batch_alloc(uint32_t pg_size, uint32_t pg_overrun_size)
+ {
+ struct nftnl_batch *batch;
+ struct nftnl_batch_page *page;
+@@ -80,9 +80,8 @@ err1:
+ free(batch);
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_batch_alloc);
+
+-void nftnl_batch_free(struct nftnl_batch *batch)
++void __EXPORTED nftnl_batch_free(struct nftnl_batch *batch)
+ {
+ struct nftnl_batch_page *page, *next;
+
+@@ -94,9 +93,8 @@ void nftnl_batch_free(struct nftnl_batch *batch)
+
+ free(batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_free);
+
+-int nftnl_batch_update(struct nftnl_batch *batch)
++int __EXPORTED nftnl_batch_update(struct nftnl_batch *batch)
+ {
+ struct nftnl_batch_page *page;
+ struct nlmsghdr *last_nlh;
+@@ -119,21 +117,18 @@ int nftnl_batch_update(struct nftnl_batch *batch)
+ err1:
+ return -1;
+ }
+-EXPORT_SYMBOL(nftnl_batch_update);
+
+-void *nftnl_batch_buffer(struct nftnl_batch *batch)
++void __EXPORTED *nftnl_batch_buffer(struct nftnl_batch *batch)
+ {
+ return mnl_nlmsg_batch_current(batch->current_page->batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_buffer);
+
+-uint32_t nftnl_batch_buffer_len(struct nftnl_batch *batch)
++uint32_t __EXPORTED nftnl_batch_buffer_len(struct nftnl_batch *batch)
+ {
+ return mnl_nlmsg_batch_size(batch->current_page->batch);
+ }
+-EXPORT_SYMBOL(nftnl_batch_buffer_len);
+
+-int nftnl_batch_iovec_len(struct nftnl_batch *batch)
++int __EXPORTED nftnl_batch_iovec_len(struct nftnl_batch *batch)
+ {
+ int num_pages = batch->num_pages;
+
+@@ -143,9 +138,8 @@ int nftnl_batch_iovec_len(struct nftnl_batch *batch)
+
+ return num_pages;
+ }
+-EXPORT_SYMBOL(nftnl_batch_iovec_len);
+
+-void nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
++void __EXPORTED nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
+ uint32_t iovlen)
+ {
+ struct nftnl_batch_page *page;
+@@ -160,4 +154,3 @@ void nftnl_batch_iovec(struct nftnl_batch *batch, struct iovec *iov,
+ i++;
+ }
+ }
+-EXPORT_SYMBOL(nftnl_batch_iovec);
+diff --git a/src/chain.c b/src/chain.c
+index 29860c5..362fa0d 100644
+--- a/src/chain.c
++++ b/src/chain.c
+@@ -87,13 +87,12 @@ static const char *nftnl_hooknum2str(int family, int hooknum)
+ return "unknown";
+ }
+
+-struct nftnl_chain *nftnl_chain_alloc(void)
++struct nftnl_chain __EXPORTED *nftnl_chain_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_chain));
+ }
+-EXPORT_SYMBOL(nftnl_chain_alloc);
+
+-void nftnl_chain_free(const struct nftnl_chain *c)
++void __EXPORTED nftnl_chain_free(const struct nftnl_chain *c)
+ {
+ if (c->flags & (1 << NFTNL_CHAIN_NAME))
+ xfree(c->name);
+@@ -105,15 +104,13 @@ void nftnl_chain_free(const struct nftnl_chain *c)
+ xfree(c->dev);
+ xfree(c);
+ }
+-EXPORT_SYMBOL(nftnl_chain_free);
+
+-bool nftnl_chain_is_set(const struct nftnl_chain *c, uint16_t attr)
++bool __EXPORTED nftnl_chain_is_set(const struct nftnl_chain *c, uint16_t attr)
+ {
+ return c->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_is_set);
+
+-void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
++void __EXPORTED nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+ {
+ if (!(c->flags & (1 << attr)))
+ return;
+@@ -147,7 +144,6 @@ void nftnl_chain_unset(struct nftnl_chain *c, uint16_t attr)
+
+ c->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_unset);
+
+ static uint32_t nftnl_chain_validate[NFTNL_CHAIN_MAX + 1] = {
+ [NFTNL_CHAIN_HOOKNUM] = sizeof(uint32_t),
+@@ -159,7 +155,7 @@ static uint32_t nftnl_chain_validate[NFTNL_CHAIN_MAX + 1] = {
+ [NFTNL_CHAIN_FAMILY] = sizeof(uint32_t),
+ };
+
+-int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
++int __EXPORTED nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ nftnl_assert_attr_exists(attr, NFTNL_CHAIN_MAX);
+@@ -226,45 +222,38 @@ int nftnl_chain_set_data(struct nftnl_chain *c, uint16_t attr,
+ c->flags |= (1 << attr);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_data);
+
+-void nftnl_chain_set(struct nftnl_chain *c, uint16_t attr, const void *data)
++void __EXPORTED nftnl_chain_set(struct nftnl_chain *c, uint16_t attr, const void *data)
+ {
+ nftnl_chain_set_data(c, attr, data, nftnl_chain_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_chain_set);
+
+-void nftnl_chain_set_u32(struct nftnl_chain *c, uint16_t attr, uint32_t data)
++void __EXPORTED nftnl_chain_set_u32(struct nftnl_chain *c, uint16_t attr, uint32_t data)
+ {
+ nftnl_chain_set_data(c, attr, &data, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u32);
+
+-void nftnl_chain_set_s32(struct nftnl_chain *c, uint16_t attr, int32_t data)
++void __EXPORTED nftnl_chain_set_s32(struct nftnl_chain *c, uint16_t attr, int32_t data)
+ {
+ nftnl_chain_set_data(c, attr, &data, sizeof(int32_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_s32);
+
+-void nftnl_chain_set_u64(struct nftnl_chain *c, uint16_t attr, uint64_t data)
++void __EXPORTED nftnl_chain_set_u64(struct nftnl_chain *c, uint16_t attr, uint64_t data)
+ {
+ nftnl_chain_set_data(c, attr, &data, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u64);
+
+-void nftnl_chain_set_u8(struct nftnl_chain *c, uint16_t attr, uint8_t data)
++void __EXPORTED nftnl_chain_set_u8(struct nftnl_chain *c, uint16_t attr, uint8_t data)
+ {
+ nftnl_chain_set_data(c, attr, &data, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_u8);
+
+-int nftnl_chain_set_str(struct nftnl_chain *c, uint16_t attr, const char *str)
++int __EXPORTED nftnl_chain_set_str(struct nftnl_chain *c, uint16_t attr, const char *str)
+ {
+ return nftnl_chain_set_data(c, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_chain_set_str);
+
+-const void *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
++const void __EXPORTED *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(c->flags & (1 << attr)))
+@@ -310,22 +299,19 @@ const void *nftnl_chain_get_data(const struct nftnl_chain *c, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_data);
+
+-const void *nftnl_chain_get(const struct nftnl_chain *c, uint16_t attr)
++const void __EXPORTED *nftnl_chain_get(const struct nftnl_chain *c, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_chain_get_data(c, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_chain_get);
+
+-const char *nftnl_chain_get_str(const struct nftnl_chain *c, uint16_t attr)
++const char __EXPORTED *nftnl_chain_get_str(const struct nftnl_chain *c, uint16_t attr)
+ {
+ return nftnl_chain_get(c, attr);
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_str);
+
+-uint32_t nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
++uint32_t __EXPORTED nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint32_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -334,9 +320,8 @@ uint32_t nftnl_chain_get_u32(const struct nftnl_chain *c, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u32);
+
+-int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
++int32_t __EXPORTED nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
+ {
+ uint32_t data_len;
+ const int32_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -345,9 +330,8 @@ int32_t nftnl_chain_get_s32(const struct nftnl_chain *c, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_s32);
+
+-uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
++uint64_t __EXPORTED nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint64_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -356,9 +340,8 @@ uint64_t nftnl_chain_get_u64(const struct nftnl_chain *c, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u64);
+
+-uint8_t nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
++uint8_t __EXPORTED nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint8_t *val = nftnl_chain_get_data(c, attr, &data_len);
+@@ -367,9 +350,8 @@ uint8_t nftnl_chain_get_u8(const struct nftnl_chain *c, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_get_u8);
+
+-void nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_chain *c)
++void __EXPORTED nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_chain *c)
+ {
+ if (c->flags & (1 << NFTNL_CHAIN_TABLE))
+ mnl_attr_put_strz(nlh, NFTA_CHAIN_TABLE, c->table);
+@@ -404,7 +386,6 @@ void nftnl_chain_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_ch
+ if (c->flags & (1 << NFTNL_CHAIN_TYPE))
+ mnl_attr_put_strz(nlh, NFTA_CHAIN_TYPE, c->type);
+ }
+-EXPORT_SYMBOL(nftnl_chain_nlmsg_build_payload);
+
+ static int nftnl_chain_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -529,7 +510,7 @@ static int nftnl_chain_parse_hook(struct nlattr *attr, struct nftnl_chain *c)
+ return 0;
+ }
+
+-int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
++int __EXPORTED nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+ {
+ struct nlattr *tb[NFTA_CHAIN_MAX+1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -590,7 +571,6 @@ int nftnl_chain_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_chain *c)
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nftnl_chain_nlmsg_parse);
+
+ static inline int nftnl_str2hooknum(int family, const char *hook)
+ {
+@@ -732,19 +712,17 @@ static int nftnl_chain_do_parse(struct nftnl_chain *c, enum nftnl_parse_type typ
+ return ret;
+ }
+
+-int nftnl_chain_parse(struct nftnl_chain *c, enum nftnl_parse_type type,
++int __EXPORTED nftnl_chain_parse(struct nftnl_chain *c, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_chain_do_parse(c, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_chain_parse);
+
+-int nftnl_chain_parse_file(struct nftnl_chain *c, enum nftnl_parse_type type,
++int __EXPORTED nftnl_chain_parse_file(struct nftnl_chain *c, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_chain_do_parse(c, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_chain_parse_file);
+
+ static int nftnl_chain_export(char *buf, size_t size,
+ const struct nftnl_chain *c, int type)
+@@ -841,13 +819,12 @@ static int nftnl_chain_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_chain_snprintf(char *buf, size_t size, const struct nftnl_chain *c,
++int __EXPORTED nftnl_chain_snprintf(char *buf, size_t size, const struct nftnl_chain *c,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_chain_cmd_snprintf(buf, size, c, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_chain_snprintf);
+
+ static int nftnl_chain_do_snprintf(char *buf, size_t size, const void *c,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -855,19 +832,18 @@ static int nftnl_chain_do_snprintf(char *buf, size_t size, const void *c,
+ return nftnl_chain_snprintf(buf, size, c, type, flags);
+ }
+
+-int nftnl_chain_fprintf(FILE *fp, const struct nftnl_chain *c, uint32_t type,
++int __EXPORTED nftnl_chain_fprintf(FILE *fp, const struct nftnl_chain *c, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, c, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_chain_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_chain_fprintf);
+
+ struct nftnl_chain_list {
+ struct list_head list;
+ };
+
+-struct nftnl_chain_list *nftnl_chain_list_alloc(void)
++struct nftnl_chain_list __EXPORTED *nftnl_chain_list_alloc(void)
+ {
+ struct nftnl_chain_list *list;
+
+@@ -879,9 +855,8 @@ struct nftnl_chain_list *nftnl_chain_list_alloc(void)
+
+ return list;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_alloc);
+
+-void nftnl_chain_list_free(struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_free(struct nftnl_chain_list *list)
+ {
+ struct nftnl_chain *r, *tmp;
+
+@@ -891,33 +866,28 @@ void nftnl_chain_list_free(struct nftnl_chain_list *list)
+ }
+ xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_free);
+
+-int nftnl_chain_list_is_empty(const struct nftnl_chain_list *list)
++int __EXPORTED nftnl_chain_list_is_empty(const struct nftnl_chain_list *list)
+ {
+ return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_is_empty);
+
+-void nftnl_chain_list_add(struct nftnl_chain *r, struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_add(struct nftnl_chain *r, struct nftnl_chain_list *list)
+ {
+ list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_add);
+
+-void nftnl_chain_list_add_tail(struct nftnl_chain *r, struct nftnl_chain_list *list)
++void __EXPORTED nftnl_chain_list_add_tail(struct nftnl_chain *r, struct nftnl_chain_list *list)
+ {
+ list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_add_tail);
+
+-void nftnl_chain_list_del(struct nftnl_chain *r)
++void __EXPORTED nftnl_chain_list_del(struct nftnl_chain *r)
+ {
+ list_del(&r->head);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_del);
+
+-int nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
++int __EXPORTED nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
+ int (*cb)(struct nftnl_chain *r, void *data),
+ void *data)
+ {
+@@ -931,14 +901,13 @@ int nftnl_chain_list_foreach(struct nftnl_chain_list *chain_list,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_foreach);
+
+ struct nftnl_chain_list_iter {
+ const struct nftnl_chain_list *list;
+ struct nftnl_chain *cur;
+ };
+
+-struct nftnl_chain_list_iter *
++struct nftnl_chain_list_iter __EXPORTED *
+ nftnl_chain_list_iter_create(const struct nftnl_chain_list *l)
+ {
+ struct nftnl_chain_list_iter *iter;
+@@ -955,9 +924,8 @@ nftnl_chain_list_iter_create(const struct nftnl_chain_list *l)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_create);
+
+-struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *iter)
++struct nftnl_chain __EXPORTED *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *iter)
+ {
+ struct nftnl_chain *r = iter->cur;
+
+@@ -971,10 +939,8 @@ struct nftnl_chain *nftnl_chain_list_iter_next(struct nftnl_chain_list_iter *ite
+
+ return r;
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_next);
+
+-void nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
++void __EXPORTED nftnl_chain_list_iter_destroy(struct nftnl_chain_list_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_chain_list_iter_destroy);
+diff --git a/src/common.c b/src/common.c
+index a95883c..68bce2e 100644
+--- a/src/common.c
++++ b/src/common.c
+@@ -43,15 +43,14 @@ static struct nlmsghdr *__nftnl_nlmsg_build_hdr(char *buf, uint16_t type,
+ return nlh;
+ }
+
+-struct nlmsghdr *nftnl_nlmsg_build_hdr(char *buf, uint16_t type, uint16_t family,
++struct nlmsghdr __EXPORTED *nftnl_nlmsg_build_hdr(char *buf, uint16_t type, uint16_t family,
+ uint16_t flags, uint32_t seq)
+ {
+ return __nftnl_nlmsg_build_hdr(buf, (NFNL_SUBSYS_NFTABLES << 8) | type,
+ family, flags, seq, 0);
+ }
+-EXPORT_SYMBOL(nftnl_nlmsg_build_hdr);
+
+-struct nftnl_parse_err *nftnl_parse_err_alloc(void)
++struct nftnl_parse_err __EXPORTED *nftnl_parse_err_alloc(void)
+ {
+ struct nftnl_parse_err *err;
+
+@@ -63,15 +62,13 @@ struct nftnl_parse_err *nftnl_parse_err_alloc(void)
+
+ return err;
+ }
+-EXPORT_SYMBOL(nftnl_parse_err_alloc);
+
+-void nftnl_parse_err_free(struct nftnl_parse_err *err)
++void __EXPORTED nftnl_parse_err_free(struct nftnl_parse_err *err)
+ {
+ xfree(err);
+ }
+-EXPORT_SYMBOL(nftnl_parse_err_free);
+
+-int nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
++int __EXPORTED nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
+ {
+ switch (err->error) {
+ case NFTNL_PARSE_EBADINPUT:
+@@ -89,7 +86,6 @@ int nftnl_parse_perror(const char *msg, struct nftnl_parse_err *err)
+ return fprintf(stderr, "%s: Undefined error\n", msg);
+ }
+ }
+-EXPORT_SYMBOL(nftnl_parse_perror);
+
+ int nftnl_cmd_header_snprintf(char *buf, size_t size, uint32_t cmd, uint32_t type,
+ uint32_t flags)
+@@ -165,21 +161,19 @@ int nftnl_cmd_footer_fprintf(FILE *fp, uint32_t cmd, uint32_t type,
+ nftnl_cmd_footer_fprintf_cb);
+ }
+
+-struct nlmsghdr *nftnl_batch_begin(char *buf, uint32_t seq)
++struct nlmsghdr __EXPORTED *nftnl_batch_begin(char *buf, uint32_t seq)
+ {
+ return __nftnl_nlmsg_build_hdr(buf, NFNL_MSG_BATCH_BEGIN, AF_UNSPEC,
+ 0, seq, NFNL_SUBSYS_NFTABLES);
+ }
+-EXPORT_SYMBOL(nftnl_batch_begin);
+
+-struct nlmsghdr *nftnl_batch_end(char *buf, uint32_t seq)
++struct nlmsghdr __EXPORTED *nftnl_batch_end(char *buf, uint32_t seq)
+ {
+ return __nftnl_nlmsg_build_hdr(buf, NFNL_MSG_BATCH_END, AF_UNSPEC,
+ 0, seq, NFNL_SUBSYS_NFTABLES);
+ }
+-EXPORT_SYMBOL(nftnl_batch_end);
+
+-int nftnl_batch_is_supported(void)
++int __EXPORTED nftnl_batch_is_supported(void)
+ {
+ struct mnl_socket *nl;
+ struct mnl_nlmsg_batch *b;
+@@ -236,4 +230,3 @@ err:
+ mnl_nlmsg_batch_stop(b);
+ return -1;
+ }
+-EXPORT_SYMBOL(nftnl_batch_is_supported);
+diff --git a/src/expr.c b/src/expr.c
+index 10ba2c4..c7eb2b4 100644
+--- a/src/expr.c
++++ b/src/expr.c
+@@ -24,7 +24,7 @@
+
+ #include <libnftnl/expr.h>
+
+-struct nftnl_expr *nftnl_expr_alloc(const char *name)
++struct nftnl_expr __EXPORTED *nftnl_expr_alloc(const char *name)
+ {
+ struct nftnl_expr *expr;
+ struct expr_ops *ops;
+@@ -43,24 +43,21 @@ struct nftnl_expr *nftnl_expr_alloc(const char *name)
+
+ return expr;
+ }
+-EXPORT_SYMBOL(nftnl_expr_alloc);
+
+-void nftnl_expr_free(const struct nftnl_expr *expr)
++void __EXPORTED nftnl_expr_free(const struct nftnl_expr *expr)
+ {
+ if (expr->ops->free)
+ expr->ops->free(expr);
+
+ xfree(expr);
+ }
+-EXPORT_SYMBOL(nftnl_expr_free);
+
+-bool nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type)
++bool __EXPORTED nftnl_expr_is_set(const struct nftnl_expr *expr, uint16_t type)
+ {
+ return expr->flags & (1 << type);
+ }
+-EXPORT_SYMBOL(nftnl_expr_is_set);
+
+-int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
++int __EXPORTED nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
+ const void *data, uint32_t data_len)
+ {
+ switch(type) {
+@@ -73,43 +70,37 @@ int nftnl_expr_set(struct nftnl_expr *expr, uint16_t type,
+ expr->flags |= (1 << type);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_expr_set);
+
+-void
++void __EXPORTED
+ nftnl_expr_set_u8(struct nftnl_expr *expr, uint16_t type, uint8_t data)
+ {
+ nftnl_expr_set(expr, type, &data, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u8);
+
+-void
++void __EXPORTED
+ nftnl_expr_set_u16(struct nftnl_expr *expr, uint16_t type, uint16_t data)
+ {
+ nftnl_expr_set(expr, type, &data, sizeof(uint16_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u16);
+
+-void
++void __EXPORTED
+ nftnl_expr_set_u32(struct nftnl_expr *expr, uint16_t type, uint32_t data)
+ {
+ nftnl_expr_set(expr, type, &data, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u32);
+
+-void
++void __EXPORTED
+ nftnl_expr_set_u64(struct nftnl_expr *expr, uint16_t type, uint64_t data)
+ {
+ nftnl_expr_set(expr, type, &data, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_u64);
+
+-int nftnl_expr_set_str(struct nftnl_expr *expr, uint16_t type, const char *str)
++int __EXPORTED nftnl_expr_set_str(struct nftnl_expr *expr, uint16_t type, const char *str)
+ {
+ return nftnl_expr_set(expr, type, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_expr_set_str);
+
+-const void *nftnl_expr_get(const struct nftnl_expr *expr,
++const void __EXPORTED *nftnl_expr_get(const struct nftnl_expr *expr,
+ uint16_t type, uint32_t *data_len)
+ {
+ const void *ret;
+@@ -129,9 +120,8 @@ const void *nftnl_expr_get(const struct nftnl_expr *expr,
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nftnl_expr_get);
+
+-uint8_t nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
++uint8_t __EXPORTED nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
+ {
+ const void *data;
+ uint32_t data_len;
+@@ -145,9 +135,8 @@ uint8_t nftnl_expr_get_u8(const struct nftnl_expr *expr, uint16_t type)
+
+ return *((uint8_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u8);
+
+-uint16_t nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
++uint16_t __EXPORTED nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
+ {
+ const void *data;
+ uint32_t data_len;
+@@ -161,9 +150,8 @@ uint16_t nftnl_expr_get_u16(const struct nftnl_expr *expr, uint16_t type)
+
+ return *((uint16_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u16);
+
+-uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
++uint32_t __EXPORTED nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
+ {
+ const void *data;
+ uint32_t data_len;
+@@ -177,9 +165,8 @@ uint32_t nftnl_expr_get_u32(const struct nftnl_expr *expr, uint16_t type)
+
+ return *((uint32_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u32);
+
+-uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
++uint64_t __EXPORTED nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
+ {
+ const void *data;
+ uint32_t data_len;
+@@ -193,17 +180,15 @@ uint64_t nftnl_expr_get_u64(const struct nftnl_expr *expr, uint16_t type)
+
+ return *((uint64_t *)data);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_u64);
+
+-const char *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type)
++const char __EXPORTED *nftnl_expr_get_str(const struct nftnl_expr *expr, uint16_t type)
+ {
+ uint32_t data_len;
+
+ return (const char *)nftnl_expr_get(expr, type, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_expr_get_str);
+
+-bool nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
++bool __EXPORTED nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
+ {
+ if (e1->flags != e2->flags ||
+ strcmp(e1->ops->name, e2->ops->name) != 0)
+@@ -211,7 +196,6 @@ bool nftnl_expr_cmp(const struct nftnl_expr *e1, const struct nftnl_expr *e2)
+
+ return e1->ops->cmp(e1, e2);
+ }
+-EXPORT_SYMBOL(nftnl_expr_cmp);
+
+ void nftnl_expr_build_payload(struct nlmsghdr *nlh, struct nftnl_expr *expr)
+ {
+@@ -275,7 +259,7 @@ err1:
+ return NULL;
+ }
+
+-int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
++int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
+ uint32_t type, uint32_t flags)
+ {
+ int ret;
+@@ -289,4 +273,3 @@ int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,
+
+ return offset;
+ }
+-EXPORT_SYMBOL(nftnl_expr_snprintf);
+diff --git a/src/gen.c b/src/gen.c
+index 213562e..8b45caa 100644
+--- a/src/gen.c
++++ b/src/gen.c
+@@ -29,25 +29,22 @@ struct nftnl_gen {
+ uint32_t flags;
+ };
+
+-struct nftnl_gen *nftnl_gen_alloc(void)
++struct nftnl_gen __EXPORTED *nftnl_gen_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_gen));
+ }
+-EXPORT_SYMBOL(nftnl_gen_alloc);
+
+-void nftnl_gen_free(const struct nftnl_gen *gen)
++void __EXPORTED nftnl_gen_free(const struct nftnl_gen *gen)
+ {
+ xfree(gen);
+ }
+-EXPORT_SYMBOL(nftnl_gen_free);
+
+-bool nftnl_gen_is_set(const struct nftnl_gen *gen, uint16_t attr)
++bool __EXPORTED nftnl_gen_is_set(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ return gen->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_gen_is_set);
+
+-void nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
++void __EXPORTED nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
+ {
+ if (!(gen->flags & (1 << attr)))
+ return;
+@@ -58,13 +55,12 @@ void nftnl_gen_unset(struct nftnl_gen *gen, uint16_t attr)
+ }
+ gen->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_gen_unset);
+
+ static uint32_t nftnl_gen_validate[NFTNL_GEN_MAX + 1] = {
+ [NFTNL_GEN_ID] = sizeof(uint32_t),
+ };
+
+-int nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
++int __EXPORTED nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ nftnl_assert_attr_exists(attr, NFTNL_GEN_MAX);
+@@ -78,21 +74,18 @@ int nftnl_gen_set_data(struct nftnl_gen *gen, uint16_t attr,
+ gen->flags |= (1 << attr);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_gen_set_data);
+
+-int nftnl_gen_set(struct nftnl_gen *gen, uint16_t attr, const void *data)
++int __EXPORTED nftnl_gen_set(struct nftnl_gen *gen, uint16_t attr, const void *data)
+ {
+ return nftnl_gen_set_data(gen, attr, data, nftnl_gen_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_gen_set);
+
+-void nftnl_gen_set_u32(struct nftnl_gen *gen, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_gen_set_u32(struct nftnl_gen *gen, uint16_t attr, uint32_t val)
+ {
+ nftnl_gen_set_data(gen, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_gen_set_u32);
+
+-const void *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
++const void __EXPORTED *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(gen->flags & (1 << attr)))
+@@ -105,21 +98,18 @@ const void *nftnl_gen_get_data(const struct nftnl_gen *gen, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_gen_get_data);
+
+-const void *nftnl_gen_get(const struct nftnl_gen *gen, uint16_t attr)
++const void __EXPORTED *nftnl_gen_get(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_gen_get_data(gen, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_gen_get);
+
+-uint32_t nftnl_gen_get_u32(const struct nftnl_gen *gen, uint16_t attr)
++uint32_t __EXPORTED nftnl_gen_get_u32(const struct nftnl_gen *gen, uint16_t attr)
+ {
+ const void *ret = nftnl_gen_get(gen, attr);
+ return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_gen_get_u32);
+
+ static int nftnl_gen_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -140,7 +130,7 @@ static int nftnl_gen_parse_attr_cb(const struct nlattr *attr, void *data)
+ return MNL_CB_OK;
+ }
+
+-int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
++int __EXPORTED nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
+ {
+ struct nlattr *tb[NFTA_GEN_MAX + 1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -154,7 +144,6 @@ int nftnl_gen_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_gen *gen)
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_gen_nlmsg_parse);
+
+ static int nftnl_gen_snprintf_default(char *buf, size_t size,
+ const struct nftnl_gen *gen)
+@@ -186,13 +175,12 @@ static int nftnl_gen_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_gen_snprintf(char *buf, size_t size, const struct nftnl_gen *gen,
++int __EXPORTED nftnl_gen_snprintf(char *buf, size_t size, const struct nftnl_gen *gen,
+ uint32_t type, uint32_t flags)
+ {;
+ return nftnl_gen_cmd_snprintf(buf, size, gen, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_gen_snprintf);
+
+ static int nftnl_gen_do_snprintf(char *buf, size_t size, const void *gen,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -200,10 +188,9 @@ static int nftnl_gen_do_snprintf(char *buf, size_t size, const void *gen,
+ return nftnl_gen_snprintf(buf, size, gen, type, flags);
+ }
+
+-int nftnl_gen_fprintf(FILE *fp, const struct nftnl_gen *gen, uint32_t type,
++int __EXPORTED nftnl_gen_fprintf(FILE *fp, const struct nftnl_gen *gen, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, gen, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_gen_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_gen_fprintf);
+diff --git a/src/object.c b/src/object.c
+index e1a5ac4..d409c6d 100644
+--- a/src/object.c
++++ b/src/object.c
+@@ -39,13 +39,12 @@ static struct obj_ops *nftnl_obj_ops_lookup(uint32_t type)
+ return obj_ops[type];
+ }
+
+-struct nftnl_obj *nftnl_obj_alloc(void)
++struct nftnl_obj __EXPORTED *nftnl_obj_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_obj));
+ }
+-EXPORT_SYMBOL(nftnl_obj_alloc);
+
+-void nftnl_obj_free(const struct nftnl_obj *obj)
++void __EXPORTED nftnl_obj_free(const struct nftnl_obj *obj)
+ {
+ if (obj->flags & (1 << NFTNL_OBJ_TABLE))
+ xfree(obj->table);
+@@ -54,20 +53,18 @@ void nftnl_obj_free(const struct nftnl_obj *obj)
+
+ xfree(obj);
+ }
+-EXPORT_SYMBOL(nftnl_obj_free);
+
+-bool nftnl_obj_is_set(const struct nftnl_obj *obj, uint16_t attr)
++bool __EXPORTED nftnl_obj_is_set(const struct nftnl_obj *obj, uint16_t attr)
+ {
+ return obj->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_is_set);
+
+ static uint32_t nftnl_obj_validate[NFTNL_OBJ_MAX + 1] = {
+ [NFTNL_OBJ_FAMILY] = sizeof(uint32_t),
+ [NFTNL_OBJ_USE] = sizeof(uint32_t),
+ };
+
+-void nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
++void __EXPORTED nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ if (attr < NFTNL_OBJ_MAX)
+@@ -100,45 +97,38 @@ void nftnl_obj_set_data(struct nftnl_obj *obj, uint16_t attr,
+ }
+ obj->flags |= (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_data);
+
+-void nftnl_obj_set(struct nftnl_obj *obj, uint16_t attr, const void *data)
++void __EXPORTED nftnl_obj_set(struct nftnl_obj *obj, uint16_t attr, const void *data)
+ {
+ nftnl_obj_set_data(obj, attr, data, nftnl_obj_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set);
+
+-void nftnl_obj_set_u8(struct nftnl_obj *obj, uint16_t attr, uint8_t val)
++void __EXPORTED nftnl_obj_set_u8(struct nftnl_obj *obj, uint16_t attr, uint8_t val)
+ {
+ nftnl_obj_set_data(obj, attr, &val, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u8);
+
+-void nftnl_obj_set_u16(struct nftnl_obj *obj, uint16_t attr, uint16_t val)
++void __EXPORTED nftnl_obj_set_u16(struct nftnl_obj *obj, uint16_t attr, uint16_t val)
+ {
+ nftnl_obj_set_data(obj, attr, &val, sizeof(uint16_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u16);
+
+-void nftnl_obj_set_u32(struct nftnl_obj *obj, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_obj_set_u32(struct nftnl_obj *obj, uint16_t attr, uint32_t val)
+ {
+ nftnl_obj_set_data(obj, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u32);
+
+-void nftnl_obj_set_u64(struct nftnl_obj *obj, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_obj_set_u64(struct nftnl_obj *obj, uint16_t attr, uint64_t val)
+ {
+ nftnl_obj_set_data(obj, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_u64);
+
+-void nftnl_obj_set_str(struct nftnl_obj *obj, uint16_t attr, const char *str)
++void __EXPORTED nftnl_obj_set_str(struct nftnl_obj *obj, uint16_t attr, const char *str)
+ {
+ nftnl_obj_set_data(obj, attr, str, 0);
+ }
+-EXPORT_SYMBOL(nftnl_obj_set_str);
+
+-const void *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
++const void __EXPORTED *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(obj->flags & (1 << attr)))
+@@ -168,50 +158,43 @@ const void *nftnl_obj_get_data(struct nftnl_obj *obj, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_data);
+
+-const void *nftnl_obj_get(struct nftnl_obj *obj, uint16_t attr)
++const void __EXPORTED *nftnl_obj_get(struct nftnl_obj *obj, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_obj_get_data(obj, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get);
+
+-uint8_t nftnl_obj_get_u8(struct nftnl_obj *obj, uint16_t attr)
++uint8_t __EXPORTED nftnl_obj_get_u8(struct nftnl_obj *obj, uint16_t attr)
+ {
+ const void *ret = nftnl_obj_get(obj, attr);
+ return ret == NULL ? 0 : *((uint8_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u8);
+
+-uint16_t nftnl_obj_get_u16(struct nftnl_obj *obj, uint16_t attr)
++uint16_t __EXPORTED nftnl_obj_get_u16(struct nftnl_obj *obj, uint16_t attr)
+ {
+ const void *ret = nftnl_obj_get(obj, attr);
+ return ret == NULL ? 0 : *((uint16_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u16);
+
+-uint32_t nftnl_obj_get_u32(struct nftnl_obj *obj, uint16_t attr)
++uint32_t __EXPORTED nftnl_obj_get_u32(struct nftnl_obj *obj, uint16_t attr)
+ {
+ const void *ret = nftnl_obj_get(obj, attr);
+ return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u32);
+
+-uint64_t nftnl_obj_get_u64(struct nftnl_obj *obj, uint16_t attr)
++uint64_t __EXPORTED nftnl_obj_get_u64(struct nftnl_obj *obj, uint16_t attr)
+ {
+ const void *ret = nftnl_obj_get(obj, attr);
+ return ret == NULL ? 0 : *((uint64_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_u64);
+
+-const char *nftnl_obj_get_str(struct nftnl_obj *obj, uint16_t attr)
++const char __EXPORTED *nftnl_obj_get_str(struct nftnl_obj *obj, uint16_t attr)
+ {
+ return nftnl_obj_get(obj, attr);
+ }
+-EXPORT_SYMBOL(nftnl_obj_get_str);
+
+-void nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
++void __EXPORTED nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
+ const struct nftnl_obj *obj)
+ {
+ if (obj->flags & (1 << NFTNL_OBJ_TABLE))
+@@ -228,7 +211,6 @@ void nftnl_obj_nlmsg_build_payload(struct nlmsghdr *nlh,
+ mnl_attr_nest_end(nlh, nest);
+ }
+ }
+-EXPORT_SYMBOL(nftnl_obj_nlmsg_build_payload);
+
+ static int nftnl_obj_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -258,7 +240,7 @@ static int nftnl_obj_parse_attr_cb(const struct nlattr *attr, void *data)
+ return MNL_CB_OK;
+ }
+
+-int nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
++int __EXPORTED nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
+ {
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+ struct nlattr *tb[NFTA_OBJ_MAX + 1] = {};
+@@ -299,7 +281,6 @@ int nftnl_obj_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_obj *obj)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_obj_nlmsg_parse);
+
+ #ifdef JSON_PARSING
+ static int nftnl_jansson_parse_obj(struct nftnl_obj *t, json_t *tree,
+@@ -377,19 +358,17 @@ static int nftnl_obj_do_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ return ret;
+ }
+
+-int nftnl_obj_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
++int __EXPORTED nftnl_obj_parse(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_obj_do_parse(obj, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_obj_parse);
+
+-int nftnl_obj_parse_file(struct nftnl_obj *obj, enum nftnl_parse_type type,
++int __EXPORTED nftnl_obj_parse_file(struct nftnl_obj *obj, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_obj_do_parse(obj, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_obj_parse_file);
+
+ static int nftnl_obj_export(char *buf, size_t size,
+ const struct nftnl_obj *obj,
+@@ -469,13 +448,12 @@ static int nftnl_obj_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_obj_snprintf(char *buf, size_t size, const struct nftnl_obj *obj,
++int __EXPORTED nftnl_obj_snprintf(char *buf, size_t size, const struct nftnl_obj *obj,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_obj_cmd_snprintf(buf, size, obj, nftnl_flag2cmd(flags),
+ type, flags);
+ }
+-EXPORT_SYMBOL(nftnl_obj_snprintf);
+
+ static int nftnl_obj_do_snprintf(char *buf, size_t size, const void *obj,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -483,19 +461,18 @@ static int nftnl_obj_do_snprintf(char *buf, size_t size, const void *obj,
+ return nftnl_obj_snprintf(buf, size, obj, type, flags);
+ }
+
+-int nftnl_obj_fprintf(FILE *fp, const struct nftnl_obj *obj, uint32_t type,
++int __EXPORTED nftnl_obj_fprintf(FILE *fp, const struct nftnl_obj *obj, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, obj, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_obj_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_obj_fprintf);
+
+ struct nftnl_obj_list {
+ struct list_head list;
+ };
+
+-struct nftnl_obj_list *nftnl_obj_list_alloc(void)
++struct nftnl_obj_list __EXPORTED *nftnl_obj_list_alloc(void)
+ {
+ struct nftnl_obj_list *list;
+
+@@ -507,9 +484,8 @@ struct nftnl_obj_list *nftnl_obj_list_alloc(void)
+
+ return list;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_alloc);
+
+-void nftnl_obj_list_free(struct nftnl_obj_list *list)
++void __EXPORTED nftnl_obj_list_free(struct nftnl_obj_list *list)
+ {
+ struct nftnl_obj *r, *tmp;
+
+@@ -519,34 +495,29 @@ void nftnl_obj_list_free(struct nftnl_obj_list *list)
+ }
+ xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_free);
+
+-int nftnl_obj_list_is_empty(struct nftnl_obj_list *list)
++int __EXPORTED nftnl_obj_list_is_empty(struct nftnl_obj_list *list)
+ {
+ return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_is_empty);
+
+-void nftnl_obj_list_add(struct nftnl_obj *r, struct nftnl_obj_list *list)
++void __EXPORTED nftnl_obj_list_add(struct nftnl_obj *r, struct nftnl_obj_list *list)
+ {
+ list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_add);
+
+-void nftnl_obj_list_add_tail(struct nftnl_obj *r,
++void __EXPORTED nftnl_obj_list_add_tail(struct nftnl_obj *r,
+ struct nftnl_obj_list *list)
+ {
+ list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_add_tail);
+
+-void nftnl_obj_list_del(struct nftnl_obj *t)
++void __EXPORTED nftnl_obj_list_del(struct nftnl_obj *t)
+ {
+ list_del(&t->head);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_del);
+
+-int nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
++int __EXPORTED nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
+ int (*cb)(struct nftnl_obj *t, void *data),
+ void *data)
+ {
+@@ -560,14 +531,13 @@ int nftnl_obj_list_foreach(struct nftnl_obj_list *table_list,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_foreach);
+
+ struct nftnl_obj_list_iter {
+ struct nftnl_obj_list *list;
+ struct nftnl_obj *cur;
+ };
+
+-struct nftnl_obj_list_iter *
++struct nftnl_obj_list_iter __EXPORTED *
+ nftnl_obj_list_iter_create(struct nftnl_obj_list *l)
+ {
+ struct nftnl_obj_list_iter *iter;
+@@ -584,9 +554,8 @@ nftnl_obj_list_iter_create(struct nftnl_obj_list *l)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_create);
+
+-struct nftnl_obj *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
++struct nftnl_obj __EXPORTED *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
+ {
+ struct nftnl_obj *r = iter->cur;
+
+@@ -600,10 +569,8 @@ struct nftnl_obj *nftnl_obj_list_iter_next(struct nftnl_obj_list_iter *iter)
+
+ return r;
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_next);
+
+-void nftnl_obj_list_iter_destroy(struct nftnl_obj_list_iter *iter)
++void __EXPORTED nftnl_obj_list_iter_destroy(struct nftnl_obj_list_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_obj_list_iter_destroy);
+diff --git a/src/rule.c b/src/rule.c
+index 6c22141..ad8609f 100644
+--- a/src/rule.c
++++ b/src/rule.c
+@@ -52,7 +52,7 @@ struct nftnl_rule {
+ struct list_head expr_list;
+ };
+
+-struct nftnl_rule *nftnl_rule_alloc(void)
++struct nftnl_rule __EXPORTED *nftnl_rule_alloc(void)
+ {
+ struct nftnl_rule *r;
+
+@@ -64,9 +64,8 @@ struct nftnl_rule *nftnl_rule_alloc(void)
+
+ return r;
+ }
+-EXPORT_SYMBOL(nftnl_rule_alloc);
+
+-void nftnl_rule_free(const struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_free(const struct nftnl_rule *r)
+ {
+ struct nftnl_expr *e, *tmp;
+
+@@ -82,15 +81,13 @@ void nftnl_rule_free(const struct nftnl_rule *r)
+
+ xfree(r);
+ }
+-EXPORT_SYMBOL(nftnl_rule_free);
+
+-bool nftnl_rule_is_set(const struct nftnl_rule *r, uint16_t attr)
++bool __EXPORTED nftnl_rule_is_set(const struct nftnl_rule *r, uint16_t attr)
+ {
+ return r->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_is_set);
+
+-void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
++void __EXPORTED nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+ {
+ if (!(r->flags & (1 << attr)))
+ return;
+@@ -116,7 +113,6 @@ void nftnl_rule_unset(struct nftnl_rule *r, uint16_t attr)
+
+ r->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_unset);
+
+ static uint32_t nftnl_rule_validate[NFTNL_RULE_MAX + 1] = {
+ [NFTNL_RULE_HANDLE] = sizeof(uint64_t),
+@@ -127,7 +123,7 @@ static uint32_t nftnl_rule_validate[NFTNL_RULE_MAX + 1] = {
+ [NFTNL_RULE_ID] = sizeof(uint32_t),
+ };
+
+-int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
++int __EXPORTED nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ nftnl_assert_attr_exists(attr, NFTNL_RULE_MAX);
+@@ -183,33 +179,28 @@ int nftnl_rule_set_data(struct nftnl_rule *r, uint16_t attr,
+ r->flags |= (1 << attr);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_data);
+
+-int nftnl_rule_set(struct nftnl_rule *r, uint16_t attr, const void *data)
++int __EXPORTED nftnl_rule_set(struct nftnl_rule *r, uint16_t attr, const void *data)
+ {
+ return nftnl_rule_set_data(r, attr, data, nftnl_rule_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_rule_set);
+
+-void nftnl_rule_set_u32(struct nftnl_rule *r, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_rule_set_u32(struct nftnl_rule *r, uint16_t attr, uint32_t val)
+ {
+ nftnl_rule_set_data(r, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_u32);
+
+-void nftnl_rule_set_u64(struct nftnl_rule *r, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_rule_set_u64(struct nftnl_rule *r, uint16_t attr, uint64_t val)
+ {
+ nftnl_rule_set_data(r, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_u64);
+
+-int nftnl_rule_set_str(struct nftnl_rule *r, uint16_t attr, const char *str)
++int __EXPORTED nftnl_rule_set_str(struct nftnl_rule *r, uint16_t attr, const char *str)
+ {
+ return nftnl_rule_set_data(r, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_rule_set_str);
+
+-const void *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
++const void __EXPORTED *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(r->flags & (1 << attr)))
+@@ -246,22 +237,19 @@ const void *nftnl_rule_get_data(const struct nftnl_rule *r, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_data);
+
+-const void *nftnl_rule_get(const struct nftnl_rule *r, uint16_t attr)
++const void __EXPORTED *nftnl_rule_get(const struct nftnl_rule *r, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_rule_get_data(r, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_rule_get);
+
+-const char *nftnl_rule_get_str(const struct nftnl_rule *r, uint16_t attr)
++const char __EXPORTED *nftnl_rule_get_str(const struct nftnl_rule *r, uint16_t attr)
+ {
+ return nftnl_rule_get(r, attr);
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_str);
+
+-uint32_t nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
++uint32_t __EXPORTED nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint32_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -270,9 +258,8 @@ uint32_t nftnl_rule_get_u32(const struct nftnl_rule *r, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u32);
+
+-uint64_t nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
++uint64_t __EXPORTED nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint64_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -281,9 +268,8 @@ uint64_t nftnl_rule_get_u64(const struct nftnl_rule *r, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u64);
+
+-uint8_t nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
++uint8_t __EXPORTED nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint8_t *val = nftnl_rule_get_data(r, attr, &data_len);
+@@ -292,9 +278,8 @@ uint8_t nftnl_rule_get_u8(const struct nftnl_rule *r, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_get_u8);
+
+-void nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
+ {
+ struct nftnl_expr *expr;
+ struct nlattr *nest, *nest2;
+@@ -335,13 +320,11 @@ void nftnl_rule_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_rule *r)
+ if (r->flags & (1 << NFTNL_RULE_ID))
+ mnl_attr_put_u32(nlh, NFTA_RULE_ID, htonl(r->id));
+ }
+-EXPORT_SYMBOL(nftnl_rule_nlmsg_build_payload);
+
+-void nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr)
++void __EXPORTED nftnl_rule_add_expr(struct nftnl_rule *r, struct nftnl_expr *expr)
+ {
+ list_add_tail(&expr->head, &r->expr_list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_add_expr);
+
+ static int nftnl_rule_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -441,7 +424,7 @@ static int nftnl_rule_parse_compat(struct nlattr *nest, struct nftnl_rule *r)
+ return 0;
+ }
+
+-int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
++int __EXPORTED nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+ {
+ struct nlattr *tb[NFTA_RULE_MAX+1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -510,7 +493,6 @@ int nftnl_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_rule *r)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_nlmsg_parse);
+
+ #ifdef JSON_PARSING
+ int nftnl_jansson_parse_rule(struct nftnl_rule *r, json_t *tree,
+@@ -658,19 +640,17 @@ static int nftnl_rule_do_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
+
+ return ret;
+ }
+-int nftnl_rule_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_rule_parse(struct nftnl_rule *r, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_rule_do_parse(r, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_rule_parse);
+
+-int nftnl_rule_parse_file(struct nftnl_rule *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_rule_parse_file(struct nftnl_rule *r, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_rule_do_parse(r, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_rule_parse_file);
+
+ static int nftnl_rule_export(char *buf, size_t size,
+ const struct nftnl_rule *r,
+@@ -819,13 +799,12 @@ static int nftnl_rule_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_rule_snprintf(char *buf, size_t size, const struct nftnl_rule *r,
++int __EXPORTED nftnl_rule_snprintf(char *buf, size_t size, const struct nftnl_rule *r,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_rule_cmd_snprintf(buf, size, r, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_rule_snprintf);
+
+ static int nftnl_rule_do_snprintf(char *buf, size_t size, const void *r,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -833,15 +812,14 @@ static int nftnl_rule_do_snprintf(char *buf, size_t size, const void *r,
+ return nftnl_rule_snprintf(buf, size, r, type, flags);
+ }
+
+-int nftnl_rule_fprintf(FILE *fp, const struct nftnl_rule *r, uint32_t type,
++int __EXPORTED nftnl_rule_fprintf(FILE *fp, const struct nftnl_rule *r, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, r, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_rule_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_rule_fprintf);
+
+-int nftnl_expr_foreach(struct nftnl_rule *r,
++int __EXPORTED nftnl_expr_foreach(struct nftnl_rule *r,
+ int (*cb)(struct nftnl_expr *e, void *data),
+ void *data)
+ {
+@@ -855,7 +833,6 @@ int nftnl_expr_foreach(struct nftnl_rule *r,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_expr_foreach);
+
+ struct nftnl_expr_iter {
+ const struct nftnl_rule *r;
+@@ -873,7 +850,7 @@ static void nftnl_expr_iter_init(const struct nftnl_rule *r,
+ head);
+ }
+
+-struct nftnl_expr_iter *nftnl_expr_iter_create(const struct nftnl_rule *r)
++struct nftnl_expr_iter __EXPORTED *nftnl_expr_iter_create(const struct nftnl_rule *r)
+ {
+ struct nftnl_expr_iter *iter;
+
+@@ -885,9 +862,8 @@ struct nftnl_expr_iter *nftnl_expr_iter_create(const struct nftnl_rule *r)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_create);
+
+-struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
++struct nftnl_expr __EXPORTED *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
+ {
+ struct nftnl_expr *expr = iter->cur;
+
+@@ -901,15 +877,13 @@ struct nftnl_expr *nftnl_expr_iter_next(struct nftnl_expr_iter *iter)
+
+ return expr;
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_next);
+
+-void nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
++void __EXPORTED nftnl_expr_iter_destroy(struct nftnl_expr_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_expr_iter_destroy);
+
+-bool nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
++bool __EXPORTED nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
+ {
+ struct nftnl_expr_iter it1, it2;
+ struct nftnl_expr *e1, *e2;
+@@ -938,13 +912,12 @@ bool nftnl_rule_cmp(const struct nftnl_rule *r1, const struct nftnl_rule *r2)
+
+ return eq;
+ }
+-EXPORT_SYMBOL(nftnl_rule_cmp);
+
+ struct nftnl_rule_list {
+ struct list_head list;
+ };
+
+-struct nftnl_rule_list *nftnl_rule_list_alloc(void)
++struct nftnl_rule_list __EXPORTED *nftnl_rule_list_alloc(void)
+ {
+ struct nftnl_rule_list *list;
+
+@@ -956,9 +929,8 @@ struct nftnl_rule_list *nftnl_rule_list_alloc(void)
+
+ return list;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_alloc);
+
+-void nftnl_rule_list_free(struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_free(struct nftnl_rule_list *list)
+ {
+ struct nftnl_rule *r, *tmp;
+
+@@ -968,33 +940,28 @@ void nftnl_rule_list_free(struct nftnl_rule_list *list)
+ }
+ xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_free);
+
+-int nftnl_rule_list_is_empty(const struct nftnl_rule_list *list)
++int __EXPORTED nftnl_rule_list_is_empty(const struct nftnl_rule_list *list)
+ {
+ return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_is_empty);
+
+-void nftnl_rule_list_add(struct nftnl_rule *r, struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_add(struct nftnl_rule *r, struct nftnl_rule_list *list)
+ {
+ list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_add);
+
+-void nftnl_rule_list_add_tail(struct nftnl_rule *r, struct nftnl_rule_list *list)
++void __EXPORTED nftnl_rule_list_add_tail(struct nftnl_rule *r, struct nftnl_rule_list *list)
+ {
+ list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_add_tail);
+
+-void nftnl_rule_list_del(struct nftnl_rule *r)
++void __EXPORTED nftnl_rule_list_del(struct nftnl_rule *r)
+ {
+ list_del(&r->head);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_del);
+
+-int nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
++int __EXPORTED nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
+ int (*cb)(struct nftnl_rule *r, void *data),
+ void *data)
+ {
+@@ -1008,14 +975,13 @@ int nftnl_rule_list_foreach(struct nftnl_rule_list *rule_list,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_foreach);
+
+ struct nftnl_rule_list_iter {
+ const struct nftnl_rule_list *list;
+ struct nftnl_rule *cur;
+ };
+
+-struct nftnl_rule_list_iter *
++struct nftnl_rule_list_iter __EXPORTED *
+ nftnl_rule_list_iter_create(const struct nftnl_rule_list *l)
+ {
+ struct nftnl_rule_list_iter *iter;
+@@ -1032,15 +998,13 @@ nftnl_rule_list_iter_create(const struct nftnl_rule_list *l)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_create);
+
+-struct nftnl_rule *nftnl_rule_list_iter_cur(struct nftnl_rule_list_iter *iter)
++struct nftnl_rule __EXPORTED *nftnl_rule_list_iter_cur(struct nftnl_rule_list_iter *iter)
+ {
+ return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_cur);
+
+-struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
++struct nftnl_rule __EXPORTED *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
+ {
+ struct nftnl_rule *r = iter->cur;
+
+@@ -1054,10 +1018,8 @@ struct nftnl_rule *nftnl_rule_list_iter_next(struct nftnl_rule_list_iter *iter)
+
+ return r;
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_next);
+
+-void nftnl_rule_list_iter_destroy(const struct nftnl_rule_list_iter *iter)
++void __EXPORTED nftnl_rule_list_iter_destroy(const struct nftnl_rule_list_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_rule_list_iter_destroy);
+diff --git a/src/ruleset.c b/src/ruleset.c
+index 6ef2956..10d48f6 100644
+--- a/src/ruleset.c
++++ b/src/ruleset.c
+@@ -55,13 +55,12 @@ struct nftnl_parse_ctx {
+ uint16_t flags;
+ };
+
+-struct nftnl_ruleset *nftnl_ruleset_alloc(void)
++struct nftnl_ruleset __EXPORTED *nftnl_ruleset_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_ruleset));
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_alloc);
+
+-void nftnl_ruleset_free(const struct nftnl_ruleset *r)
++void __EXPORTED nftnl_ruleset_free(const struct nftnl_ruleset *r)
+ {
+ if (r->flags & (1 << NFTNL_RULESET_TABLELIST))
+ nftnl_table_list_free(r->table_list);
+@@ -73,15 +72,13 @@ void nftnl_ruleset_free(const struct nftnl_ruleset *r)
+ nftnl_rule_list_free(r->rule_list);
+ xfree(r);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_free);
+
+-bool nftnl_ruleset_is_set(const struct nftnl_ruleset *r, uint16_t attr)
++bool __EXPORTED nftnl_ruleset_is_set(const struct nftnl_ruleset *r, uint16_t attr)
+ {
+ return r->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_is_set);
+
+-void nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
++void __EXPORTED nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
+ {
+ if (!(r->flags & (1 << attr)))
+ return;
+@@ -102,9 +99,8 @@ void nftnl_ruleset_unset(struct nftnl_ruleset *r, uint16_t attr)
+ }
+ r->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_unset);
+
+-void nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
++void __EXPORTED nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
+ {
+ switch (attr) {
+ case NFTNL_RULESET_TABLELIST:
+@@ -128,9 +124,8 @@ void nftnl_ruleset_set(struct nftnl_ruleset *r, uint16_t attr, void *data)
+ }
+ r->flags |= (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_set);
+
+-void *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
++void __EXPORTED *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
+ {
+ if (!(r->flags & (1 << attr)))
+ return NULL;
+@@ -148,9 +143,8 @@ void *nftnl_ruleset_get(const struct nftnl_ruleset *r, uint16_t attr)
+ return NULL;
+ }
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_get);
+
+-void nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
++void __EXPORTED nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
+ {
+ switch (ctx->type) {
+ case NFTNL_RULESET_TABLE:
+@@ -171,15 +165,13 @@ void nftnl_ruleset_ctx_free(const struct nftnl_parse_ctx *ctx)
+ break;
+ }
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_free);
+
+-bool nftnl_ruleset_ctx_is_set(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++bool __EXPORTED nftnl_ruleset_ctx_is_set(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ return ctx->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_is_set);
+
+-void *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++void __EXPORTED *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ if (!(ctx->flags & (1 << attr)))
+ return NULL;
+@@ -203,14 +195,12 @@ void *nftnl_ruleset_ctx_get(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ return NULL;
+ }
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_get);
+
+-uint32_t nftnl_ruleset_ctx_get_u32(const struct nftnl_parse_ctx *ctx, uint16_t attr)
++uint32_t __EXPORTED nftnl_ruleset_ctx_get_u32(const struct nftnl_parse_ctx *ctx, uint16_t attr)
+ {
+ const void *ret = nftnl_ruleset_ctx_get(ctx, attr);
+ return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_ctx_get_u32);
+
+ #if defined(JSON_PARSING)
+ static void nftnl_ruleset_ctx_set(struct nftnl_parse_ctx *ctx, uint16_t attr,
+@@ -593,22 +583,20 @@ nftnl_ruleset_do_parse(enum nftnl_parse_type type, const void *data,
+ return ret;
+ }
+
+-int nftnl_ruleset_parse_file_cb(enum nftnl_parse_type type, FILE *fp,
++int __EXPORTED nftnl_ruleset_parse_file_cb(enum nftnl_parse_type type, FILE *fp,
+ struct nftnl_parse_err *err, void *data,
+ int (*cb)(const struct nftnl_parse_ctx *ctx))
+ {
+ return nftnl_ruleset_do_parse(type, fp, err, NFTNL_PARSE_FILE, data, cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_file_cb);
+
+-int nftnl_ruleset_parse_buffer_cb(enum nftnl_parse_type type, const char *buffer,
++int __EXPORTED nftnl_ruleset_parse_buffer_cb(enum nftnl_parse_type type, const char *buffer,
+ struct nftnl_parse_err *err, void *data,
+ int (*cb)(const struct nftnl_parse_ctx *ctx))
+ {
+ return nftnl_ruleset_do_parse(type, buffer, err, NFTNL_PARSE_BUFFER, data,
+ cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_buffer_cb);
+
+ static int nftnl_ruleset_cb(const struct nftnl_parse_ctx *ctx)
+ {
+@@ -671,19 +659,17 @@ static int nftnl_ruleset_cb(const struct nftnl_parse_ctx *ctx)
+ return 0;
+ }
+
+-int nftnl_ruleset_parse(struct nftnl_ruleset *r, enum nftnl_parse_type type,
++int __EXPORTED nftnl_ruleset_parse(struct nftnl_ruleset *r, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_ruleset_parse_buffer_cb(type, data, err, r, nftnl_ruleset_cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse);
+
+-int nftnl_ruleset_parse_file(struct nftnl_ruleset *rs, enum nftnl_parse_type type,
++int __EXPORTED nftnl_ruleset_parse_file(struct nftnl_ruleset *rs, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_ruleset_parse_file_cb(type, fp, err, rs, nftnl_ruleset_cb);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_parse_file);
+
+ static const char *nftnl_ruleset_o_opentag(uint32_t type)
+ {
+@@ -928,7 +914,7 @@ static int nftnl_ruleset_cmd_snprintf(char *buf, size_t size,
+ }
+ }
+
+-int nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r,
++int __EXPORTED nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r,
+ uint32_t type, uint32_t flags)
+ {
+ switch (type) {
+@@ -943,7 +929,6 @@ int nftnl_ruleset_snprintf(char *buf, size_t size, const struct nftnl_ruleset *r
+ return -1;
+ }
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_snprintf);
+
+ static int nftnl_ruleset_fprintf_tables(FILE *fp, const struct nftnl_ruleset *rs,
+ uint32_t type, uint32_t flags)
+@@ -1157,10 +1142,9 @@ static int nftnl_ruleset_cmd_fprintf(FILE *fp, const struct nftnl_ruleset *rs,
+ return len;
+ }
+
+-int nftnl_ruleset_fprintf(FILE *fp, const struct nftnl_ruleset *rs, uint32_t type,
++int __EXPORTED nftnl_ruleset_fprintf(FILE *fp, const struct nftnl_ruleset *rs, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_ruleset_cmd_fprintf(fp, rs, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_ruleset_fprintf);
+diff --git a/src/set.c b/src/set.c
+index cce5e63..33a6794 100644
+--- a/src/set.c
++++ b/src/set.c
+@@ -27,7 +27,7 @@
+ #include <libnftnl/set.h>
+ #include <libnftnl/expr.h>
+
+-struct nftnl_set *nftnl_set_alloc(void)
++struct nftnl_set __EXPORTED *nftnl_set_alloc(void)
+ {
+ struct nftnl_set *s;
+
+@@ -38,9 +38,8 @@ struct nftnl_set *nftnl_set_alloc(void)
+ INIT_LIST_HEAD(&s->element_list);
+ return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_alloc);
+
+-void nftnl_set_free(const struct nftnl_set *s)
++void __EXPORTED nftnl_set_free(const struct nftnl_set *s)
+ {
+ struct nftnl_set_elem *elem, *tmp;
+
+@@ -55,15 +54,13 @@ void nftnl_set_free(const struct nftnl_set *s)
+ }
+ xfree(s);
+ }
+-EXPORT_SYMBOL(nftnl_set_free);
+
+-bool nftnl_set_is_set(const struct nftnl_set *s, uint16_t attr)
++bool __EXPORTED nftnl_set_is_set(const struct nftnl_set *s, uint16_t attr)
+ {
+ return s->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_is_set);
+
+-void nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
++void __EXPORTED nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
+ {
+ if (!(s->flags & (1 << attr)))
+ return;
+@@ -97,7 +94,6 @@ void nftnl_set_unset(struct nftnl_set *s, uint16_t attr)
+
+ s->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_unset);
+
+ static uint32_t nftnl_set_validate[NFTNL_SET_MAX + 1] = {
+ [NFTNL_SET_FLAGS] = sizeof(uint32_t),
+@@ -113,7 +109,7 @@ static uint32_t nftnl_set_validate[NFTNL_SET_MAX + 1] = {
+ [NFTNL_SET_GC_INTERVAL] = sizeof(uint32_t),
+ };
+
+-int nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
++int __EXPORTED nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
+ uint32_t data_len)
+ {
+ nftnl_assert_attr_exists(attr, NFTNL_SET_MAX);
+@@ -186,33 +182,28 @@ int nftnl_set_set_data(struct nftnl_set *s, uint16_t attr, const void *data,
+ s->flags |= (1 << attr);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_set_data);
+
+-int nftnl_set_set(struct nftnl_set *s, uint16_t attr, const void *data)
++int __EXPORTED nftnl_set_set(struct nftnl_set *s, uint16_t attr, const void *data)
+ {
+ return nftnl_set_set_data(s, attr, data, nftnl_set_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_set_set);
+
+-void nftnl_set_set_u32(struct nftnl_set *s, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_set_set_u32(struct nftnl_set *s, uint16_t attr, uint32_t val)
+ {
+ nftnl_set_set(s, attr, &val);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_u32);
+
+-void nftnl_set_set_u64(struct nftnl_set *s, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_set_set_u64(struct nftnl_set *s, uint16_t attr, uint64_t val)
+ {
+ nftnl_set_set(s, attr, &val);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_u64);
+
+-int nftnl_set_set_str(struct nftnl_set *s, uint16_t attr, const char *str)
++int __EXPORTED nftnl_set_set_str(struct nftnl_set *s, uint16_t attr, const char *str)
+ {
+ return nftnl_set_set_data(s, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_set_set_str);
+
+-const void *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
++const void __EXPORTED *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(s->flags & (1 << attr)))
+@@ -267,22 +258,19 @@ const void *nftnl_set_get_data(const struct nftnl_set *s, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_data);
+
+-const void *nftnl_set_get(const struct nftnl_set *s, uint16_t attr)
++const void __EXPORTED *nftnl_set_get(const struct nftnl_set *s, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_set_get_data(s, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_set_get);
+
+-const char *nftnl_set_get_str(const struct nftnl_set *s, uint16_t attr)
++const char __EXPORTED *nftnl_set_get_str(const struct nftnl_set *s, uint16_t attr)
+ {
+ return nftnl_set_get(s, attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_get_str);
+
+-uint32_t nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
++uint32_t __EXPORTED nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint32_t *val = nftnl_set_get_data(s, attr, &data_len);
+@@ -291,9 +279,8 @@ uint32_t nftnl_set_get_u32(const struct nftnl_set *s, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_u32);
+
+-uint64_t nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
++uint64_t __EXPORTED nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
+ {
+ uint32_t data_len;
+ const uint64_t *val = nftnl_set_get_data(s, attr, &data_len);
+@@ -302,7 +289,6 @@ uint64_t nftnl_set_get_u64(const struct nftnl_set *s, uint16_t attr)
+
+ return val ? *val : 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_get_u64);
+
+ struct nftnl_set *nftnl_set_clone(const struct nftnl_set *set)
+ {
+@@ -351,7 +337,7 @@ nftnl_set_nlmsg_build_desc_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ mnl_attr_nest_end(nlh, nest);
+ }
+
+-void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
++void __EXPORTED nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ if (s->flags & (1 << NFTNL_SET_TABLE))
+ mnl_attr_put_strz(nlh, NFTA_SET_TABLE, s->table);
+@@ -383,7 +369,6 @@ void nftnl_set_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ if (s->flags & (1 << NFTNL_SET_USERDATA))
+ mnl_attr_put(nlh, NFTA_SET_USERDATA, s->user.len, s->user.data);
+ }
+-EXPORT_SYMBOL(nftnl_set_nlmsg_build_payload);
+
+ static int nftnl_set_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -463,7 +448,7 @@ static int nftnl_set_desc_parse(struct nftnl_set *s,
+ return 0;
+ }
+
+-int nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
++int __EXPORTED nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ struct nlattr *tb[NFTA_SET_MAX+1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -546,7 +531,6 @@ int nftnl_set_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_nlmsg_parse);
+
+ #ifdef JSON_PARSING
+ static int nftnl_jansson_parse_set_info(struct nftnl_set *s, json_t *tree,
+@@ -718,19 +702,17 @@ static int nftnl_set_do_parse(struct nftnl_set *s, enum nftnl_parse_type type,
+
+ return ret;
+ }
+-int nftnl_set_parse(struct nftnl_set *s, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_parse(struct nftnl_set *s, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_set_do_parse(s, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_set_parse);
+
+-int nftnl_set_parse_file(struct nftnl_set *s, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_parse_file(struct nftnl_set *s, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_set_do_parse(s, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_set_parse_file);
+
+ static int nftnl_set_snprintf_json(char *buf, size_t size,
+ const struct nftnl_set *s,
+@@ -918,13 +900,12 @@ static int nftnl_set_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_set_snprintf(char *buf, size_t size, const struct nftnl_set *s,
++int __EXPORTED nftnl_set_snprintf(char *buf, size_t size, const struct nftnl_set *s,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_set_cmd_snprintf(buf, size, s, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_set_snprintf);
+
+ static int nftnl_set_do_snprintf(char *buf, size_t size, const void *s,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -932,25 +913,23 @@ static int nftnl_set_do_snprintf(char *buf, size_t size, const void *s,
+ return nftnl_set_snprintf(buf, size, s, type, flags);
+ }
+
+-int nftnl_set_fprintf(FILE *fp, const struct nftnl_set *s, uint32_t type,
++int __EXPORTED nftnl_set_fprintf(FILE *fp, const struct nftnl_set *s, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, s, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_set_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_set_fprintf);
+
+-void nftnl_set_elem_add(struct nftnl_set *s, struct nftnl_set_elem *elem)
++void __EXPORTED nftnl_set_elem_add(struct nftnl_set *s, struct nftnl_set_elem *elem)
+ {
+ list_add_tail(&elem->head, &s->element_list);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_add);
+
+ struct nftnl_set_list {
+ struct list_head list;
+ };
+
+-struct nftnl_set_list *nftnl_set_list_alloc(void)
++struct nftnl_set_list __EXPORTED *nftnl_set_list_alloc(void)
+ {
+ struct nftnl_set_list *list;
+
+@@ -962,9 +941,8 @@ struct nftnl_set_list *nftnl_set_list_alloc(void)
+
+ return list;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_alloc);
+
+-void nftnl_set_list_free(struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_free(struct nftnl_set_list *list)
+ {
+ struct nftnl_set *s, *tmp;
+
+@@ -974,33 +952,28 @@ void nftnl_set_list_free(struct nftnl_set_list *list)
+ }
+ xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_free);
+
+-int nftnl_set_list_is_empty(const struct nftnl_set_list *list)
++int __EXPORTED nftnl_set_list_is_empty(const struct nftnl_set_list *list)
+ {
+ return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_is_empty);
+
+-void nftnl_set_list_add(struct nftnl_set *s, struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_add(struct nftnl_set *s, struct nftnl_set_list *list)
+ {
+ list_add(&s->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_add);
+
+-void nftnl_set_list_add_tail(struct nftnl_set *s, struct nftnl_set_list *list)
++void __EXPORTED nftnl_set_list_add_tail(struct nftnl_set *s, struct nftnl_set_list *list)
+ {
+ list_add_tail(&s->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_add_tail);
+
+-void nftnl_set_list_del(struct nftnl_set *s)
++void __EXPORTED nftnl_set_list_del(struct nftnl_set *s)
+ {
+ list_del(&s->head);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_del);
+
+-int nftnl_set_list_foreach(struct nftnl_set_list *set_list,
++int __EXPORTED nftnl_set_list_foreach(struct nftnl_set_list *set_list,
+ int (*cb)(struct nftnl_set *t, void *data), void *data)
+ {
+ struct nftnl_set *cur, *tmp;
+@@ -1013,14 +986,13 @@ int nftnl_set_list_foreach(struct nftnl_set_list *set_list,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_foreach);
+
+ struct nftnl_set_list_iter {
+ const struct nftnl_set_list *list;
+ struct nftnl_set *cur;
+ };
+
+-struct nftnl_set_list_iter *
++struct nftnl_set_list_iter __EXPORTED *
+ nftnl_set_list_iter_create(const struct nftnl_set_list *l)
+ {
+ struct nftnl_set_list_iter *iter;
+@@ -1037,16 +1009,14 @@ nftnl_set_list_iter_create(const struct nftnl_set_list *l)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_create);
+
+-struct nftnl_set *
++struct nftnl_set __EXPORTED *
+ nftnl_set_list_iter_cur(const struct nftnl_set_list_iter *iter)
+ {
+ return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_cur);
+
+-struct nftnl_set *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
++struct nftnl_set __EXPORTED *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
+ {
+ struct nftnl_set *s = iter->cur;
+
+@@ -1060,13 +1030,11 @@ struct nftnl_set *nftnl_set_list_iter_next(struct nftnl_set_list_iter *iter)
+
+ return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_next);
+
+-void nftnl_set_list_iter_destroy(const struct nftnl_set_list_iter *iter)
++void __EXPORTED nftnl_set_list_iter_destroy(const struct nftnl_set_list_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_set_list_iter_destroy);
+
+ static struct nftnl_set *nftnl_set_lookup(const char *this_set_name,
+ struct nftnl_set_list *set_list)
+diff --git a/src/set_elem.c b/src/set_elem.c
+index 433b896..bd1e895 100644
+--- a/src/set_elem.c
++++ b/src/set_elem.c
+@@ -27,7 +27,7 @@
+ #include <libnftnl/rule.h>
+ #include <libnftnl/expr.h>
+
+-struct nftnl_set_elem *nftnl_set_elem_alloc(void)
++struct nftnl_set_elem __EXPORTED *nftnl_set_elem_alloc(void)
+ {
+ struct nftnl_set_elem *s;
+
+@@ -37,9 +37,8 @@ struct nftnl_set_elem *nftnl_set_elem_alloc(void)
+
+ return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_alloc);
+
+-void nftnl_set_elem_free(struct nftnl_set_elem *s)
++void __EXPORTED nftnl_set_elem_free(struct nftnl_set_elem *s)
+ {
+ if (s->flags & (1 << NFTNL_SET_ELEM_CHAIN))
+ xfree(s->data.chain);
+@@ -55,15 +54,13 @@ void nftnl_set_elem_free(struct nftnl_set_elem *s)
+
+ xfree(s);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_free);
+
+-bool nftnl_set_elem_is_set(const struct nftnl_set_elem *s, uint16_t attr)
++bool __EXPORTED nftnl_set_elem_is_set(const struct nftnl_set_elem *s, uint16_t attr)
+ {
+ return s->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_is_set);
+
+-void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
++void __EXPORTED nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ if (!(s->flags & (1 << attr)))
+ return;
+@@ -94,9 +91,8 @@ void nftnl_set_elem_unset(struct nftnl_set_elem *s, uint16_t attr)
+
+ s->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_unset);
+
+-int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
++int __EXPORTED nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ switch(attr) {
+@@ -147,27 +143,23 @@ int nftnl_set_elem_set(struct nftnl_set_elem *s, uint16_t attr,
+ s->flags |= (1 << attr);
+ return -1;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set);
+
+-void nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_set_elem_set_u32(struct nftnl_set_elem *s, uint16_t attr, uint32_t val)
+ {
+ nftnl_set_elem_set(s, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_u32);
+
+-void nftnl_set_elem_set_u64(struct nftnl_set_elem *s, uint16_t attr, uint64_t val)
++void __EXPORTED nftnl_set_elem_set_u64(struct nftnl_set_elem *s, uint16_t attr, uint64_t val)
+ {
+ nftnl_set_elem_set(s, attr, &val, sizeof(uint64_t));
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_u64);
+
+-int nftnl_set_elem_set_str(struct nftnl_set_elem *s, uint16_t attr, const char *str)
++int __EXPORTED nftnl_set_elem_set_str(struct nftnl_set_elem *s, uint16_t attr, const char *str)
+ {
+ return nftnl_set_elem_set(s, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_set_str);
+
+-const void *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t *data_len)
++const void __EXPORTED *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t *data_len)
+ {
+ if (!(s->flags & (1 << attr)))
+ return NULL;
+@@ -205,31 +197,27 @@ const void *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get);
+
+-const char *nftnl_set_elem_get_str(struct nftnl_set_elem *s, uint16_t attr)
++const char __EXPORTED *nftnl_set_elem_get_str(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ uint32_t size;
+
+ return nftnl_set_elem_get(s, attr, &size);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_str);
+
+-uint32_t nftnl_set_elem_get_u32(struct nftnl_set_elem *s, uint16_t attr)
++uint32_t __EXPORTED nftnl_set_elem_get_u32(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ uint32_t size;
+ uint32_t val = *((uint32_t *)nftnl_set_elem_get(s, attr, &size));
+ return val;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_u32);
+
+-uint64_t nftnl_set_elem_get_u64(struct nftnl_set_elem *s, uint16_t attr)
++uint64_t __EXPORTED nftnl_set_elem_get_u64(struct nftnl_set_elem *s, uint16_t attr)
+ {
+ uint32_t size;
+ uint64_t val = *((uint64_t *)nftnl_set_elem_get(s, attr, &size));
+ return val;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_get_u64);
+
+ struct nftnl_set_elem *nftnl_set_elem_clone(struct nftnl_set_elem *elem)
+ {
+@@ -315,7 +303,7 @@ static struct nlattr *nftnl_set_elem_build(struct nlmsghdr *nlh,
+ return nest2;
+ }
+
+-void nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
++void __EXPORTED nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ struct nftnl_set_elem *elem;
+ struct nlattr *nest1;
+@@ -332,7 +320,6 @@ void nftnl_set_elems_nlmsg_build_payload(struct nlmsghdr *nlh, struct nftnl_set
+
+ mnl_attr_nest_end(nlh, nest1);
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_build_payload);
+
+ static int nftnl_set_elem_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -503,7 +490,7 @@ static int nftnl_set_elems_parse(struct nftnl_set *s, const struct nlattr *nest)
+ return ret;
+ }
+
+-int nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
++int __EXPORTED nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+ {
+ struct nlattr *tb[NFTA_SET_ELEM_LIST_MAX+1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -546,7 +533,6 @@ int nftnl_set_elems_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_set *s)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_parse);
+
+ static int nftnl_set_elem_json_parse(struct nftnl_set_elem *e, const void *json,
+ struct nftnl_parse_err *err,
+@@ -587,19 +573,17 @@ nftnl_set_elem_do_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+
+ return ret;
+ }
+-int nftnl_set_elem_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_elem_parse(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_set_elem_do_parse(e, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_parse);
+
+-int nftnl_set_elem_parse_file(struct nftnl_set_elem *e, enum nftnl_parse_type type,
++int __EXPORTED nftnl_set_elem_parse_file(struct nftnl_set_elem *e, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_set_elem_do_parse(e, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_parse_file);
+
+ static int nftnl_set_elem_snprintf_json(char *buf, size_t size,
+ const struct nftnl_set_elem *e,
+@@ -719,14 +703,13 @@ static int nftnl_set_elem_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_set_elem_snprintf(char *buf, size_t size,
++int __EXPORTED nftnl_set_elem_snprintf(char *buf, size_t size,
+ const struct nftnl_set_elem *e,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_set_elem_cmd_snprintf(buf, size, e, nftnl_flag2cmd(flags),
+ type, flags);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_snprintf);
+
+ static int nftnl_set_elem_do_snprintf(char *buf, size_t size, const void *e,
+ uint32_t cmd, uint32_t type,
+@@ -735,15 +718,14 @@ static int nftnl_set_elem_do_snprintf(char *buf, size_t size, const void *e,
+ return nftnl_set_elem_snprintf(buf, size, e, type, flags);
+ }
+
+-int nftnl_set_elem_fprintf(FILE *fp, struct nftnl_set_elem *se, uint32_t type,
++int __EXPORTED nftnl_set_elem_fprintf(FILE *fp, struct nftnl_set_elem *se, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, se, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_set_elem_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_fprintf);
+
+-int nftnl_set_elem_foreach(struct nftnl_set *s,
++int __EXPORTED nftnl_set_elem_foreach(struct nftnl_set *s,
+ int (*cb)(struct nftnl_set_elem *e, void *data),
+ void *data)
+ {
+@@ -757,7 +739,6 @@ int nftnl_set_elem_foreach(struct nftnl_set *s,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_set_elem_foreach);
+
+ struct nftnl_set_elems_iter {
+ const struct nftnl_set *set;
+@@ -765,7 +746,7 @@ struct nftnl_set_elems_iter {
+ struct nftnl_set_elem *cur;
+ };
+
+-struct nftnl_set_elems_iter *
++struct nftnl_set_elems_iter __EXPORTED *
+ nftnl_set_elems_iter_create(const struct nftnl_set *s)
+ {
+ struct nftnl_set_elems_iter *iter;
+@@ -784,16 +765,14 @@ nftnl_set_elems_iter_create(const struct nftnl_set *s)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_create);
+
+-struct nftnl_set_elem *
++struct nftnl_set_elem __EXPORTED *
+ nftnl_set_elems_iter_cur(const struct nftnl_set_elems_iter *iter)
+ {
+ return iter->cur;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_cur);
+
+-struct nftnl_set_elem *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *iter)
++struct nftnl_set_elem __EXPORTED *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *iter)
+ {
+ struct nftnl_set_elem *s = iter->cur;
+
+@@ -806,13 +785,11 @@ struct nftnl_set_elem *nftnl_set_elems_iter_next(struct nftnl_set_elems_iter *it
+
+ return s;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_next);
+
+-void nftnl_set_elems_iter_destroy(struct nftnl_set_elems_iter *iter)
++void __EXPORTED nftnl_set_elems_iter_destroy(struct nftnl_set_elems_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_iter_destroy);
+
+ static bool nftnl_attr_nest_overflow(struct nlmsghdr *nlh,
+ const struct nlattr *from,
+@@ -831,7 +808,7 @@ static bool nftnl_attr_nest_overflow(struct nlmsghdr *nlh,
+ return false;
+ }
+
+-int nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
++int __EXPORTED nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
+ struct nftnl_set_elems_iter *iter)
+ {
+ struct nftnl_set_elem *elem;
+@@ -861,4 +838,3 @@ int nftnl_set_elems_nlmsg_build_payload_iter(struct nlmsghdr *nlh,
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nftnl_set_elems_nlmsg_build_payload_iter);
+diff --git a/src/table.c b/src/table.c
+index a7d5a8f..0e99f3c 100644
+--- a/src/table.c
++++ b/src/table.c
+@@ -36,28 +36,25 @@ struct nftnl_table {
+ uint32_t flags;
+ };
+
+-struct nftnl_table *nftnl_table_alloc(void)
++struct nftnl_table __EXPORTED *nftnl_table_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_table));
+ }
+-EXPORT_SYMBOL(nftnl_table_alloc);
+
+-void nftnl_table_free(const struct nftnl_table *t)
++void __EXPORTED nftnl_table_free(const struct nftnl_table *t)
+ {
+ if (t->flags & (1 << NFTNL_TABLE_NAME))
+ xfree(t->name);
+
+ xfree(t);
+ }
+-EXPORT_SYMBOL(nftnl_table_free);
+
+-bool nftnl_table_is_set(const struct nftnl_table *t, uint16_t attr)
++bool __EXPORTED nftnl_table_is_set(const struct nftnl_table *t, uint16_t attr)
+ {
+ return t->flags & (1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_is_set);
+
+-void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
++void __EXPORTED nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
+ {
+ if (!(t->flags & (1 << attr)))
+ return;
+@@ -74,14 +71,13 @@ void nftnl_table_unset(struct nftnl_table *t, uint16_t attr)
+ }
+ t->flags &= ~(1 << attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_unset);
+
+ static uint32_t nftnl_table_validate[NFTNL_TABLE_MAX + 1] = {
+ [NFTNL_TABLE_FLAGS] = sizeof(uint32_t),
+ [NFTNL_TABLE_FAMILY] = sizeof(uint32_t),
+ };
+
+-int nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
++int __EXPORTED nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
+ const void *data, uint32_t data_len)
+ {
+ nftnl_assert_attr_exists(attr, NFTNL_TABLE_MAX);
+@@ -109,33 +105,28 @@ int nftnl_table_set_data(struct nftnl_table *t, uint16_t attr,
+ t->flags |= (1 << attr);
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_set_data);
+
+-void nftnl_table_set(struct nftnl_table *t, uint16_t attr, const void *data)
++void __EXPORTED nftnl_table_set(struct nftnl_table *t, uint16_t attr, const void *data)
+ {
+ nftnl_table_set_data(t, attr, data, nftnl_table_validate[attr]);
+ }
+-EXPORT_SYMBOL(nftnl_table_set);
+
+-void nftnl_table_set_u32(struct nftnl_table *t, uint16_t attr, uint32_t val)
++void __EXPORTED nftnl_table_set_u32(struct nftnl_table *t, uint16_t attr, uint32_t val)
+ {
+ nftnl_table_set_data(t, attr, &val, sizeof(uint32_t));
+ }
+-EXPORT_SYMBOL(nftnl_table_set_u32);
+
+-void nftnl_table_set_u8(struct nftnl_table *t, uint16_t attr, uint8_t val)
++void __EXPORTED nftnl_table_set_u8(struct nftnl_table *t, uint16_t attr, uint8_t val)
+ {
+ nftnl_table_set_data(t, attr, &val, sizeof(uint8_t));
+ }
+-EXPORT_SYMBOL(nftnl_table_set_u8);
+
+-int nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str)
++int __EXPORTED nftnl_table_set_str(struct nftnl_table *t, uint16_t attr, const char *str)
+ {
+ return nftnl_table_set_data(t, attr, str, strlen(str) + 1);
+ }
+-EXPORT_SYMBOL(nftnl_table_set_str);
+
+-const void *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
++const void __EXPORTED *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
+ uint32_t *data_len)
+ {
+ if (!(t->flags & (1 << attr)))
+@@ -157,43 +148,37 @@ const void *nftnl_table_get_data(const struct nftnl_table *t, uint16_t attr,
+ }
+ return NULL;
+ }
+-EXPORT_SYMBOL(nftnl_table_get_data);
+
+-const void *nftnl_table_get(const struct nftnl_table *t, uint16_t attr)
++const void __EXPORTED *nftnl_table_get(const struct nftnl_table *t, uint16_t attr)
+ {
+ uint32_t data_len;
+ return nftnl_table_get_data(t, attr, &data_len);
+ }
+-EXPORT_SYMBOL(nftnl_table_get);
+
+-uint32_t nftnl_table_get_u32(const struct nftnl_table *t, uint16_t attr)
++uint32_t __EXPORTED nftnl_table_get_u32(const struct nftnl_table *t, uint16_t attr)
+ {
+ const void *ret = nftnl_table_get(t, attr);
+ return ret == NULL ? 0 : *((uint32_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_u32);
+
+-uint8_t nftnl_table_get_u8(const struct nftnl_table *t, uint16_t attr)
++uint8_t __EXPORTED nftnl_table_get_u8(const struct nftnl_table *t, uint16_t attr)
+ {
+ const void *ret = nftnl_table_get(t, attr);
+ return ret == NULL ? 0 : *((uint8_t *)ret);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_u8);
+
+-const char *nftnl_table_get_str(const struct nftnl_table *t, uint16_t attr)
++const char __EXPORTED *nftnl_table_get_str(const struct nftnl_table *t, uint16_t attr)
+ {
+ return nftnl_table_get(t, attr);
+ }
+-EXPORT_SYMBOL(nftnl_table_get_str);
+
+-void nftnl_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_table *t)
++void __EXPORTED nftnl_table_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_table *t)
+ {
+ if (t->flags & (1 << NFTNL_TABLE_NAME))
+ mnl_attr_put_strz(nlh, NFTA_TABLE_NAME, t->name);
+ if (t->flags & (1 << NFTNL_TABLE_FLAGS))
+ mnl_attr_put_u32(nlh, NFTA_TABLE_FLAGS, htonl(t->table_flags));
+ }
+-EXPORT_SYMBOL(nftnl_table_nlmsg_build_payload);
+
+ static int nftnl_table_parse_attr_cb(const struct nlattr *attr, void *data)
+ {
+@@ -219,7 +204,7 @@ static int nftnl_table_parse_attr_cb(const struct nlattr *attr, void *data)
+ return MNL_CB_OK;
+ }
+
+-int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
++int __EXPORTED nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
+ {
+ struct nlattr *tb[NFTA_TABLE_MAX+1] = {};
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+@@ -249,7 +234,6 @@ int nftnl_table_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_table *t)
+
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_nlmsg_parse);
+
+ #ifdef JSON_PARSING
+ int nftnl_jansson_parse_table(struct nftnl_table *t, json_t *tree,
+@@ -330,19 +314,17 @@ static int nftnl_table_do_parse(struct nftnl_table *t, enum nftnl_parse_type typ
+ return ret;
+ }
+
+-int nftnl_table_parse(struct nftnl_table *t, enum nftnl_parse_type type,
++int __EXPORTED nftnl_table_parse(struct nftnl_table *t, enum nftnl_parse_type type,
+ const char *data, struct nftnl_parse_err *err)
+ {
+ return nftnl_table_do_parse(t, type, data, err, NFTNL_PARSE_BUFFER);
+ }
+-EXPORT_SYMBOL(nftnl_table_parse);
+
+-int nftnl_table_parse_file(struct nftnl_table *t, enum nftnl_parse_type type,
++int __EXPORTED nftnl_table_parse_file(struct nftnl_table *t, enum nftnl_parse_type type,
+ FILE *fp, struct nftnl_parse_err *err)
+ {
+ return nftnl_table_do_parse(t, type, fp, err, NFTNL_PARSE_FILE);
+ }
+-EXPORT_SYMBOL(nftnl_table_parse_file);
+
+ static int nftnl_table_export(char *buf, size_t size,
+ const struct nftnl_table *t, int type)
+@@ -400,13 +382,12 @@ static int nftnl_table_cmd_snprintf(char *buf, size_t size,
+ return offset;
+ }
+
+-int nftnl_table_snprintf(char *buf, size_t size, const struct nftnl_table *t,
++int __EXPORTED nftnl_table_snprintf(char *buf, size_t size, const struct nftnl_table *t,
+ uint32_t type, uint32_t flags)
+ {
+ return nftnl_table_cmd_snprintf(buf, size, t, nftnl_flag2cmd(flags), type,
+ flags);
+ }
+-EXPORT_SYMBOL(nftnl_table_snprintf);
+
+ static int nftnl_table_do_snprintf(char *buf, size_t size, const void *t,
+ uint32_t cmd, uint32_t type, uint32_t flags)
+@@ -414,19 +395,18 @@ static int nftnl_table_do_snprintf(char *buf, size_t size, const void *t,
+ return nftnl_table_snprintf(buf, size, t, type, flags);
+ }
+
+-int nftnl_table_fprintf(FILE *fp, const struct nftnl_table *t, uint32_t type,
++int __EXPORTED nftnl_table_fprintf(FILE *fp, const struct nftnl_table *t, uint32_t type,
+ uint32_t flags)
+ {
+ return nftnl_fprintf(fp, t, NFTNL_CMD_UNSPEC, type, flags,
+ nftnl_table_do_snprintf);
+ }
+-EXPORT_SYMBOL(nftnl_table_fprintf);
+
+ struct nftnl_table_list {
+ struct list_head list;
+ };
+
+-struct nftnl_table_list *nftnl_table_list_alloc(void)
++struct nftnl_table_list __EXPORTED *nftnl_table_list_alloc(void)
+ {
+ struct nftnl_table_list *list;
+
+@@ -438,9 +418,8 @@ struct nftnl_table_list *nftnl_table_list_alloc(void)
+
+ return list;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_alloc);
+
+-void nftnl_table_list_free(struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_free(struct nftnl_table_list *list)
+ {
+ struct nftnl_table *r, *tmp;
+
+@@ -450,33 +429,28 @@ void nftnl_table_list_free(struct nftnl_table_list *list)
+ }
+ xfree(list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_free);
+
+-int nftnl_table_list_is_empty(const struct nftnl_table_list *list)
++int __EXPORTED nftnl_table_list_is_empty(const struct nftnl_table_list *list)
+ {
+ return list_empty(&list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_is_empty);
+
+-void nftnl_table_list_add(struct nftnl_table *r, struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_add(struct nftnl_table *r, struct nftnl_table_list *list)
+ {
+ list_add(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_add);
+
+-void nftnl_table_list_add_tail(struct nftnl_table *r, struct nftnl_table_list *list)
++void __EXPORTED nftnl_table_list_add_tail(struct nftnl_table *r, struct nftnl_table_list *list)
+ {
+ list_add_tail(&r->head, &list->list);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_add_tail);
+
+-void nftnl_table_list_del(struct nftnl_table *t)
++void __EXPORTED nftnl_table_list_del(struct nftnl_table *t)
+ {
+ list_del(&t->head);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_del);
+
+-int nftnl_table_list_foreach(struct nftnl_table_list *table_list,
++int __EXPORTED nftnl_table_list_foreach(struct nftnl_table_list *table_list,
+ int (*cb)(struct nftnl_table *t, void *data),
+ void *data)
+ {
+@@ -490,14 +464,13 @@ int nftnl_table_list_foreach(struct nftnl_table_list *table_list,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_foreach);
+
+ struct nftnl_table_list_iter {
+ const struct nftnl_table_list *list;
+ struct nftnl_table *cur;
+ };
+
+-struct nftnl_table_list_iter *
++struct nftnl_table_list_iter __EXPORTED *
+ nftnl_table_list_iter_create(const struct nftnl_table_list *l)
+ {
+ struct nftnl_table_list_iter *iter;
+@@ -514,9 +487,8 @@ nftnl_table_list_iter_create(const struct nftnl_table_list *l)
+
+ return iter;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_create);
+
+-struct nftnl_table *nftnl_table_list_iter_next(struct nftnl_table_list_iter *iter)
++struct nftnl_table __EXPORTED *nftnl_table_list_iter_next(struct nftnl_table_list_iter *iter)
+ {
+ struct nftnl_table *r = iter->cur;
+
+@@ -530,10 +502,8 @@ struct nftnl_table *nftnl_table_list_iter_next(struct nftnl_table_list_iter *ite
+
+ return r;
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_next);
+
+-void nftnl_table_list_iter_destroy(const struct nftnl_table_list_iter *iter)
++void __EXPORTED nftnl_table_list_iter_destroy(const struct nftnl_table_list_iter *iter)
+ {
+ xfree(iter);
+ }
+-EXPORT_SYMBOL(nftnl_table_list_iter_destroy);
+diff --git a/src/trace.c b/src/trace.c
+index bd05d3c..4739ef9 100644
+--- a/src/trace.c
++++ b/src/trace.c
+@@ -52,14 +52,12 @@ struct nftnl_trace {
+ uint32_t flags;
+ };
+
+-EXPORT_SYMBOL(nftnl_trace_alloc);
+-struct nftnl_trace *nftnl_trace_alloc(void)
++struct nftnl_trace __EXPORTED *nftnl_trace_alloc(void)
+ {
+ return calloc(1, sizeof(struct nftnl_trace));
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_free);
+-void nftnl_trace_free(const struct nftnl_trace *t)
++void __EXPORTED nftnl_trace_free(const struct nftnl_trace *t)
+ {
+ xfree(t->chain);
+ xfree(t->table);
+@@ -70,8 +68,7 @@ void nftnl_trace_free(const struct nftnl_trace *t)
+ xfree(t);
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_is_set);
+-bool nftnl_trace_is_set(const struct nftnl_trace *t, uint16_t attr)
++bool __EXPORTED nftnl_trace_is_set(const struct nftnl_trace *t, uint16_t attr)
+ {
+ return t->flags & (1 << attr);
+ }
+@@ -130,8 +127,7 @@ static int nftnl_trace_parse_attr_cb(const struct nlattr *attr, void *data)
+ return MNL_CB_OK;
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_get_data);
+-const void *nftnl_trace_get_data(const struct nftnl_trace *trace,
++const void __EXPORTED *nftnl_trace_get_data(const struct nftnl_trace *trace,
+ uint16_t type, uint32_t *data_len)
+ {
+ enum nftnl_trace_attr attr = type;
+@@ -201,8 +197,7 @@ const void *nftnl_trace_get_data(const struct nftnl_trace *trace,
+ return NULL;
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_get_str);
+-const char *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
++const char __EXPORTED *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
+ {
+ if (!nftnl_trace_is_set(trace, type))
+ return NULL;
+@@ -216,8 +211,7 @@ const char *nftnl_trace_get_str(const struct nftnl_trace *trace, uint16_t type)
+ return NULL;
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_get_u16);
+-uint16_t nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
++uint16_t __EXPORTED nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
+ {
+ const uint16_t *d;
+ uint32_t dlen;
+@@ -229,8 +223,7 @@ uint16_t nftnl_trace_get_u16(const struct nftnl_trace *trace, uint16_t type)
+ return 0;
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_get_u32);
+-uint32_t nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
++uint32_t __EXPORTED nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
+ {
+ const uint32_t *d;
+ uint32_t dlen;
+@@ -242,8 +235,7 @@ uint32_t nftnl_trace_get_u32(const struct nftnl_trace *trace, uint16_t type)
+ return 0;
+ }
+
+-EXPORT_SYMBOL(nftnl_trace_get_u64);
+-uint64_t nftnl_trace_get_u64(const struct nftnl_trace *trace, uint16_t type)
++uint64_t __EXPORTED nftnl_trace_get_u64(const struct nftnl_trace *trace, uint16_t type)
+ {
+ const uint64_t *d;
+ uint32_t dlen;
+@@ -323,9 +315,8 @@ static int nftnl_trace_parse_verdict(const struct nlattr *attr,
+ }
+ return 0;
+ }
+-EXPORT_SYMBOL(nftnl_trace_nlmsg_parse);
+
+-int nftnl_trace_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_trace *t)
++int __EXPORTED nftnl_trace_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_trace *t)
+ {
+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh);
+ struct nlattr *tb[NFTA_TRACE_MAX+1] = {};
+diff --git a/src/udata.c b/src/udata.c
+index d679dd0..7e2de0f 100644
+--- a/src/udata.c
++++ b/src/udata.c
+@@ -16,7 +16,7 @@
+ #include <stdint.h>
+ #include <string.h>
+
+-struct nftnl_udata_buf *nftnl_udata_buf_alloc(uint32_t data_size)
++struct nftnl_udata_buf __EXPORTED *nftnl_udata_buf_alloc(uint32_t data_size)
+ {
+ struct nftnl_udata_buf *buf;
+
+@@ -28,47 +28,40 @@ struct nftnl_udata_buf *nftnl_udata_buf_alloc(uint32_t data_size)
+
+ return buf;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_alloc);
+
+-void nftnl_udata_buf_free(const struct nftnl_udata_buf *buf)
++void __EXPORTED nftnl_udata_buf_free(const struct nftnl_udata_buf *buf)
+ {
+ xfree(buf);
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_free);
+
+-uint32_t nftnl_udata_buf_len(const struct nftnl_udata_buf *buf)
++uint32_t __EXPORTED nftnl_udata_buf_len(const struct nftnl_udata_buf *buf)
+ {
+ return (uint32_t)(buf->end - buf->data);
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_len);
+
+-void *nftnl_udata_buf_data(const struct nftnl_udata_buf *buf)
++void __EXPORTED *nftnl_udata_buf_data(const struct nftnl_udata_buf *buf)
+ {
+ return (void *)buf->data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_data);
+
+-void nftnl_udata_buf_put(struct nftnl_udata_buf *buf, const void *data,
++void __EXPORTED nftnl_udata_buf_put(struct nftnl_udata_buf *buf, const void *data,
+ uint32_t len)
+ {
+ memcpy(buf->data, data, len <= buf->size ? len : buf->size);
+ buf->end = buf->data + len;
+ }
+-EXPORT_SYMBOL(nftnl_udata_buf_put);
+
+-struct nftnl_udata *nftnl_udata_start(const struct nftnl_udata_buf *buf)
++struct nftnl_udata __EXPORTED *nftnl_udata_start(const struct nftnl_udata_buf *buf)
+ {
+ return (struct nftnl_udata *)buf->data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_start);
+
+-struct nftnl_udata *nftnl_udata_end(const struct nftnl_udata_buf *buf)
++struct nftnl_udata __EXPORTED *nftnl_udata_end(const struct nftnl_udata_buf *buf)
+ {
+ return (struct nftnl_udata *)buf->end;
+ }
+-EXPORT_SYMBOL(nftnl_udata_end);
+
+-bool nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
++bool __EXPORTED nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
+ const void *value)
+ {
+ struct nftnl_udata *attr;
+@@ -85,55 +78,47 @@ bool nftnl_udata_put(struct nftnl_udata_buf *buf, uint8_t type, uint32_t len,
+
+ return true;
+ }
+-EXPORT_SYMBOL(nftnl_udata_put);
+
+-bool nftnl_udata_put_strz(struct nftnl_udata_buf *buf, uint8_t type,
++bool __EXPORTED nftnl_udata_put_strz(struct nftnl_udata_buf *buf, uint8_t type,
+ const char *strz)
+ {
+ return nftnl_udata_put(buf, type, strlen(strz) + 1, strz);
+ }
+-EXPORT_SYMBOL(nftnl_udata_put_strz);
+
+-bool nftnl_udata_put_u32(struct nftnl_udata_buf *buf, uint8_t type,
++bool __EXPORTED nftnl_udata_put_u32(struct nftnl_udata_buf *buf, uint8_t type,
+ uint32_t data)
+ {
+ return nftnl_udata_put(buf, type, sizeof(data), &data);
+ }
+-EXPORT_SYMBOL(nftnl_udata_put_u32);
+
+-uint8_t nftnl_udata_type(const struct nftnl_udata *attr)
++uint8_t __EXPORTED nftnl_udata_type(const struct nftnl_udata *attr)
+ {
+ return attr->type;
+ }
+-EXPORT_SYMBOL(nftnl_udata_type);
+
+-uint8_t nftnl_udata_len(const struct nftnl_udata *attr)
++uint8_t __EXPORTED nftnl_udata_len(const struct nftnl_udata *attr)
+ {
+ return attr->len;
+ }
+-EXPORT_SYMBOL(nftnl_udata_len);
+
+-void *nftnl_udata_get(const struct nftnl_udata *attr)
++void __EXPORTED *nftnl_udata_get(const struct nftnl_udata *attr)
+ {
+ return (void *)attr->value;
+ }
+-EXPORT_SYMBOL(nftnl_udata_get);
+
+-uint32_t nftnl_udata_get_u32(const struct nftnl_udata *attr)
++uint32_t __EXPORTED nftnl_udata_get_u32(const struct nftnl_udata *attr)
+ {
+ uint32_t *data = (uint32_t *)attr->value;
+
+ return *data;
+ }
+-EXPORT_SYMBOL(nftnl_udata_get_u32);
+
+-struct nftnl_udata *nftnl_udata_next(const struct nftnl_udata *attr)
++struct nftnl_udata __EXPORTED *nftnl_udata_next(const struct nftnl_udata *attr)
+ {
+ return (struct nftnl_udata *)&attr->value[attr->len];
+ }
+-EXPORT_SYMBOL(nftnl_udata_next);
+
+-int nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
++int __EXPORTED nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
+ void *cb_data)
+ {
+ int ret = 0;
+@@ -147,4 +132,3 @@ int nftnl_udata_parse(const void *data, uint32_t data_len, nftnl_udata_cb_t cb,
+
+ return ret;
+ }
+-EXPORT_SYMBOL(nftnl_udata_parse);
+--
+2.11.0 (Apple Git-81)
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch
new file mode 100644
index 000000000..06e68177c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl/0001-avoid-naming-local-function-as-one-of-printf-family.patch
@@ -0,0 +1,514 @@
+From f840cc0da571d98beb17855c177e9986bd096b72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 13 Apr 2017 11:46:09 -0700
+Subject: [PATCH] avoid naming local function as one of printf family
+
+Fixes build issues with clang
+error: no member named '__builtin___snprintf_chk' in 'struct expr_ops'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ include/expr_ops.h | 2 +-
+ include/obj.h | 2 +-
+ src/buffer.c | 2 +-
+ src/expr.c | 4 ++--
+ src/expr/bitwise.c | 2 +-
+ src/expr/byteorder.c | 2 +-
+ src/expr/cmp.c | 2 +-
+ src/expr/counter.c | 2 +-
+ src/expr/ct.c | 2 +-
+ src/expr/dup.c | 2 +-
+ src/expr/dynset.c | 2 +-
+ src/expr/exthdr.c | 2 +-
+ src/expr/fib.c | 2 +-
+ src/expr/fwd.c | 2 +-
+ src/expr/hash.c | 2 +-
+ src/expr/immediate.c | 2 +-
+ src/expr/limit.c | 2 +-
+ src/expr/log.c | 2 +-
+ src/expr/lookup.c | 2 +-
+ src/expr/masq.c | 2 +-
+ src/expr/match.c | 2 +-
+ src/expr/meta.c | 2 +-
+ src/expr/nat.c | 2 +-
+ src/expr/numgen.c | 2 +-
+ src/expr/objref.c | 2 +-
+ src/expr/payload.c | 2 +-
+ src/expr/queue.c | 2 +-
+ src/expr/quota.c | 2 +-
+ src/expr/range.c | 2 +-
+ src/expr/redir.c | 2 +-
+ src/expr/reject.c | 2 +-
+ src/expr/rt.c | 2 +-
+ src/expr/target.c | 2 +-
+ src/obj/counter.c | 2 +-
+ src/obj/ct_helper.c | 2 +-
+ src/obj/quota.c | 2 +-
+ src/object.c | 4 ++--
+ 37 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/include/expr_ops.h b/include/expr_ops.h
+index e639390..c4fe050 100644
+--- a/include/expr_ops.h
++++ b/include/expr_ops.h
+@@ -18,7 +18,7 @@ struct expr_ops {
+ const void *(*get)(const struct nftnl_expr *e, uint16_t type, uint32_t *data_len);
+ int (*parse)(struct nftnl_expr *e, struct nlattr *attr);
+ void (*build)(struct nlmsghdr *nlh, const struct nftnl_expr *e);
+- int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
++ int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_expr *e);
+ int (*json_parse)(struct nftnl_expr *e, json_t *data,
+ struct nftnl_parse_err *err);
+ };
+diff --git a/include/obj.h b/include/obj.h
+index d90919f..772caff 100644
+--- a/include/obj.h
++++ b/include/obj.h
+@@ -47,7 +47,7 @@ struct obj_ops {
+ const void *(*get)(const struct nftnl_obj *e, uint16_t type, uint32_t *data_len);
+ int (*parse)(struct nftnl_obj *e, struct nlattr *attr);
+ void (*build)(struct nlmsghdr *nlh, const struct nftnl_obj *e);
+- int (*snprintf)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
++ int (*snprintf_)(char *buf, size_t len, uint32_t type, uint32_t flags, const struct nftnl_obj *e);
+ int (*json_parse)(struct nftnl_obj *e, json_t *data,
+ struct nftnl_parse_err *err);
+ };
+diff --git a/src/buffer.c b/src/buffer.c
+index f9d5a83..db656e2 100644
+--- a/src/buffer.c
++++ b/src/buffer.c
+@@ -206,7 +206,7 @@ int nftnl_buf_expr(struct nftnl_buf *b, int type, uint32_t flags,
+ case NFTNL_OUTPUT_JSON:
+ nftnl_buf_put(b, "{");
+ nftnl_buf_str(b, type, expr->ops->name, TYPE);
+- ret = expr->ops->snprintf(b->buf + b->off, b->len, type, flags,
++ ret = expr->ops->snprintf_(b->buf + b->off, b->len, type, flags,
+ expr);
+ if (ret > 0)
+ nftnl_buf_update(b, ret);
+diff --git a/src/expr.c b/src/expr.c
+index c7eb2b4..24f8f8c 100644
+--- a/src/expr.c
++++ b/src/expr.c
+@@ -265,10 +265,10 @@ int __EXPORTED nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_ex
+ int ret;
+ unsigned int offset = 0, len = size;
+
+- if (!expr->ops->snprintf)
++ if (!expr->ops->snprintf_)
+ return 0;
+
+- ret = expr->ops->snprintf(buf+offset, len, type, flags, expr);
++ ret = expr->ops->snprintf_(buf+offset, len, type, flags, expr);
+ SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+
+ return offset;
+diff --git a/src/expr/bitwise.c b/src/expr/bitwise.c
+index 0febc9d..9b48e79 100644
+--- a/src/expr/bitwise.c
++++ b/src/expr/bitwise.c
+@@ -299,6 +299,6 @@ struct expr_ops expr_ops_bitwise = {
+ .get = nftnl_expr_bitwise_get,
+ .parse = nftnl_expr_bitwise_parse,
+ .build = nftnl_expr_bitwise_build,
+- .snprintf = nftnl_expr_bitwise_snprintf,
++ .snprintf_ = nftnl_expr_bitwise_snprintf,
+ .json_parse = nftnl_expr_bitwise_json_parse,
+ };
+diff --git a/src/expr/byteorder.c b/src/expr/byteorder.c
+index 3805307..079582f 100644
+--- a/src/expr/byteorder.c
++++ b/src/expr/byteorder.c
+@@ -314,6 +314,6 @@ struct expr_ops expr_ops_byteorder = {
+ .get = nftnl_expr_byteorder_get,
+ .parse = nftnl_expr_byteorder_parse,
+ .build = nftnl_expr_byteorder_build,
+- .snprintf = nftnl_expr_byteorder_snprintf,
++ .snprintf_ = nftnl_expr_byteorder_snprintf,
+ .json_parse = nftnl_expr_byteorder_json_parse,
+ };
+diff --git a/src/expr/cmp.c b/src/expr/cmp.c
+index 353e907..99b497c 100644
+--- a/src/expr/cmp.c
++++ b/src/expr/cmp.c
+@@ -284,6 +284,6 @@ struct expr_ops expr_ops_cmp = {
+ .get = nftnl_expr_cmp_get,
+ .parse = nftnl_expr_cmp_parse,
+ .build = nftnl_expr_cmp_build,
+- .snprintf = nftnl_expr_cmp_snprintf,
++ .snprintf_ = nftnl_expr_cmp_snprintf,
+ .json_parse = nftnl_expr_cmp_json_parse,
+ };
+diff --git a/src/expr/counter.c b/src/expr/counter.c
+index 21901e8..9fd7655 100644
+--- a/src/expr/counter.c
++++ b/src/expr/counter.c
+@@ -200,6 +200,6 @@ struct expr_ops expr_ops_counter = {
+ .get = nftnl_expr_counter_get,
+ .parse = nftnl_expr_counter_parse,
+ .build = nftnl_expr_counter_build,
+- .snprintf = nftnl_expr_counter_snprintf,
++ .snprintf_ = nftnl_expr_counter_snprintf,
+ .json_parse = nftnl_expr_counter_json_parse,
+ };
+diff --git a/src/expr/ct.c b/src/expr/ct.c
+index cdd08e9..6ce5478 100644
+--- a/src/expr/ct.c
++++ b/src/expr/ct.c
+@@ -356,6 +356,6 @@ struct expr_ops expr_ops_ct = {
+ .get = nftnl_expr_ct_get,
+ .parse = nftnl_expr_ct_parse,
+ .build = nftnl_expr_ct_build,
+- .snprintf = nftnl_expr_ct_snprintf,
++ .snprintf_ = nftnl_expr_ct_snprintf,
+ .json_parse = nftnl_expr_ct_json_parse,
+ };
+diff --git a/src/expr/dup.c b/src/expr/dup.c
+index 9aa332b..2f491d8 100644
+--- a/src/expr/dup.c
++++ b/src/expr/dup.c
+@@ -206,6 +206,6 @@ struct expr_ops expr_ops_dup = {
+ .get = nftnl_expr_dup_get,
+ .parse = nftnl_expr_dup_parse,
+ .build = nftnl_expr_dup_build,
+- .snprintf = nftnl_expr_dup_snprintf,
++ .snprintf_ = nftnl_expr_dup_snprintf,
+ .json_parse = nftnl_expr_dup_json_parse,
+ };
+diff --git a/src/expr/dynset.c b/src/expr/dynset.c
+index f7b99ea..758f07c 100644
+--- a/src/expr/dynset.c
++++ b/src/expr/dynset.c
+@@ -368,6 +368,6 @@ struct expr_ops expr_ops_dynset = {
+ .get = nftnl_expr_dynset_get,
+ .parse = nftnl_expr_dynset_parse,
+ .build = nftnl_expr_dynset_build,
+- .snprintf = nftnl_expr_dynset_snprintf,
++ .snprintf_ = nftnl_expr_dynset_snprintf,
+ .json_parse = nftnl_expr_dynset_json_parse,
+ };
+diff --git a/src/expr/exthdr.c b/src/expr/exthdr.c
+index d4f1665..a834782 100644
+--- a/src/expr/exthdr.c
++++ b/src/expr/exthdr.c
+@@ -356,6 +356,6 @@ struct expr_ops expr_ops_exthdr = {
+ .get = nftnl_expr_exthdr_get,
+ .parse = nftnl_expr_exthdr_parse,
+ .build = nftnl_expr_exthdr_build,
+- .snprintf = nftnl_expr_exthdr_snprintf,
++ .snprintf_ = nftnl_expr_exthdr_snprintf,
+ .json_parse = nftnl_expr_exthdr_json_parse,
+ };
+diff --git a/src/expr/fib.c b/src/expr/fib.c
+index f3be081..3c353b2 100644
+--- a/src/expr/fib.c
++++ b/src/expr/fib.c
+@@ -272,6 +272,6 @@ struct expr_ops expr_ops_fib = {
+ .get = nftnl_expr_fib_get,
+ .parse = nftnl_expr_fib_parse,
+ .build = nftnl_expr_fib_build,
+- .snprintf = nftnl_expr_fib_snprintf,
++ .snprintf_ = nftnl_expr_fib_snprintf,
+ .json_parse = nftnl_expr_fib_json_parse,
+ };
+diff --git a/src/expr/fwd.c b/src/expr/fwd.c
+index c30d494..f6e41f1 100644
+--- a/src/expr/fwd.c
++++ b/src/expr/fwd.c
+@@ -180,6 +180,6 @@ struct expr_ops expr_ops_fwd = {
+ .get = nftnl_expr_fwd_get,
+ .parse = nftnl_expr_fwd_parse,
+ .build = nftnl_expr_fwd_build,
+- .snprintf = nftnl_expr_fwd_snprintf,
++ .snprintf_ = nftnl_expr_fwd_snprintf,
+ .json_parse = nftnl_expr_fwd_json_parse,
+ };
+diff --git a/src/expr/hash.c b/src/expr/hash.c
+index d870510..5acb66a 100644
+--- a/src/expr/hash.c
++++ b/src/expr/hash.c
+@@ -332,6 +332,6 @@ struct expr_ops expr_ops_hash = {
+ .get = nftnl_expr_hash_get,
+ .parse = nftnl_expr_hash_parse,
+ .build = nftnl_expr_hash_build,
+- .snprintf = nftnl_expr_hash_snprintf,
++ .snprintf_ = nftnl_expr_hash_snprintf,
+ .json_parse = nftnl_expr_hash_json_parse,
+ };
+diff --git a/src/expr/immediate.c b/src/expr/immediate.c
+index 0b188cc..94bd6da 100644
+--- a/src/expr/immediate.c
++++ b/src/expr/immediate.c
+@@ -316,6 +316,6 @@ struct expr_ops expr_ops_immediate = {
+ .get = nftnl_expr_immediate_get,
+ .parse = nftnl_expr_immediate_parse,
+ .build = nftnl_expr_immediate_build,
+- .snprintf = nftnl_expr_immediate_snprintf,
++ .snprintf_ = nftnl_expr_immediate_snprintf,
+ .json_parse = nftnl_expr_immediate_json_parse,
+ };
+diff --git a/src/expr/limit.c b/src/expr/limit.c
+index 856ab18..e71fc2f 100644
+--- a/src/expr/limit.c
++++ b/src/expr/limit.c
+@@ -285,6 +285,6 @@ struct expr_ops expr_ops_limit = {
+ .get = nftnl_expr_limit_get,
+ .parse = nftnl_expr_limit_parse,
+ .build = nftnl_expr_limit_build,
+- .snprintf = nftnl_expr_limit_snprintf,
++ .snprintf_ = nftnl_expr_limit_snprintf,
+ .json_parse = nftnl_expr_limit_json_parse,
+ };
+diff --git a/src/expr/log.c b/src/expr/log.c
+index b642255..71dd83a 100644
+--- a/src/expr/log.c
++++ b/src/expr/log.c
+@@ -352,6 +352,6 @@ struct expr_ops expr_ops_log = {
+ .get = nftnl_expr_log_get,
+ .parse = nftnl_expr_log_parse,
+ .build = nftnl_expr_log_build,
+- .snprintf = nftnl_expr_log_snprintf,
++ .snprintf_ = nftnl_expr_log_snprintf,
+ .json_parse = nftnl_expr_log_json_parse,
+ };
+diff --git a/src/expr/lookup.c b/src/expr/lookup.c
+index 861815f..6049913 100644
+--- a/src/expr/lookup.c
++++ b/src/expr/lookup.c
+@@ -293,6 +293,6 @@ struct expr_ops expr_ops_lookup = {
+ .get = nftnl_expr_lookup_get,
+ .parse = nftnl_expr_lookup_parse,
+ .build = nftnl_expr_lookup_build,
+- .snprintf = nftnl_expr_lookup_snprintf,
++ .snprintf_ = nftnl_expr_lookup_snprintf,
+ .json_parse = nftnl_expr_lookup_json_parse,
+ };
+diff --git a/src/expr/masq.c b/src/expr/masq.c
+index 7c235d3..adec325 100644
+--- a/src/expr/masq.c
++++ b/src/expr/masq.c
+@@ -228,6 +228,6 @@ struct expr_ops expr_ops_masq = {
+ .get = nftnl_expr_masq_get,
+ .parse = nftnl_expr_masq_parse,
+ .build = nftnl_expr_masq_build,
+- .snprintf = nftnl_expr_masq_snprintf,
++ .snprintf_ = nftnl_expr_masq_snprintf,
+ .json_parse = nftnl_expr_masq_json_parse,
+ };
+diff --git a/src/expr/match.c b/src/expr/match.c
+index dd09e1e..f0d8868 100644
+--- a/src/expr/match.c
++++ b/src/expr/match.c
+@@ -249,6 +249,6 @@ struct expr_ops expr_ops_match = {
+ .get = nftnl_expr_match_get,
+ .parse = nftnl_expr_match_parse,
+ .build = nftnl_expr_match_build,
+- .snprintf = nftnl_expr_match_snprintf,
++ .snprintf_ = nftnl_expr_match_snprintf,
+ .json_parse = nftnl_expr_match_json_parse,
+ };
+diff --git a/src/expr/meta.c b/src/expr/meta.c
+index 2c75841..907a677 100644
+--- a/src/expr/meta.c
++++ b/src/expr/meta.c
+@@ -290,6 +290,6 @@ struct expr_ops expr_ops_meta = {
+ .get = nftnl_expr_meta_get,
+ .parse = nftnl_expr_meta_parse,
+ .build = nftnl_expr_meta_build,
+- .snprintf = nftnl_expr_meta_snprintf,
++ .snprintf_ = nftnl_expr_meta_snprintf,
+ .json_parse = nftnl_expr_meta_json_parse,
+ };
+diff --git a/src/expr/nat.c b/src/expr/nat.c
+index 29bc3a2..d476283 100644
+--- a/src/expr/nat.c
++++ b/src/expr/nat.c
+@@ -383,6 +383,6 @@ struct expr_ops expr_ops_nat = {
+ .get = nftnl_expr_nat_get,
+ .parse = nftnl_expr_nat_parse,
+ .build = nftnl_expr_nat_build,
+- .snprintf = nftnl_expr_nat_snprintf,
++ .snprintf_ = nftnl_expr_nat_snprintf,
+ .json_parse = nftnl_expr_nat_json_parse,
+ };
+diff --git a/src/expr/numgen.c b/src/expr/numgen.c
+index a15f03a..28ef741 100644
+--- a/src/expr/numgen.c
++++ b/src/expr/numgen.c
+@@ -264,6 +264,6 @@ struct expr_ops expr_ops_ng = {
+ .get = nftnl_expr_ng_get,
+ .parse = nftnl_expr_ng_parse,
+ .build = nftnl_expr_ng_build,
+- .snprintf = nftnl_expr_ng_snprintf,
++ .snprintf_ = nftnl_expr_ng_snprintf,
+ .json_parse = nftnl_expr_ng_json_parse,
+ };
+diff --git a/src/expr/objref.c b/src/expr/objref.c
+index 4cfa3cb..c394290 100644
+--- a/src/expr/objref.c
++++ b/src/expr/objref.c
+@@ -278,6 +278,6 @@ struct expr_ops expr_ops_objref = {
+ .get = nftnl_expr_objref_get,
+ .parse = nftnl_expr_objref_parse,
+ .build = nftnl_expr_objref_build,
+- .snprintf = nftnl_expr_objref_snprintf,
++ .snprintf_ = nftnl_expr_objref_snprintf,
+ .json_parse = nftnl_expr_objref_json_parse,
+ };
+diff --git a/src/expr/payload.c b/src/expr/payload.c
+index 91e1587..894ac08 100644
+--- a/src/expr/payload.c
++++ b/src/expr/payload.c
+@@ -348,6 +348,6 @@ struct expr_ops expr_ops_payload = {
+ .get = nftnl_expr_payload_get,
+ .parse = nftnl_expr_payload_parse,
+ .build = nftnl_expr_payload_build,
+- .snprintf = nftnl_expr_payload_snprintf,
++ .snprintf_ = nftnl_expr_payload_snprintf,
+ .json_parse = nftnl_expr_payload_json_parse,
+ };
+diff --git a/src/expr/queue.c b/src/expr/queue.c
+index 8a9deda..389af83 100644
+--- a/src/expr/queue.c
++++ b/src/expr/queue.c
+@@ -276,6 +276,6 @@ struct expr_ops expr_ops_queue = {
+ .get = nftnl_expr_queue_get,
+ .parse = nftnl_expr_queue_parse,
+ .build = nftnl_expr_queue_build,
+- .snprintf = nftnl_expr_queue_snprintf,
++ .snprintf_ = nftnl_expr_queue_snprintf,
+ .json_parse = nftnl_expr_queue_json_parse,
+ };
+diff --git a/src/expr/quota.c b/src/expr/quota.c
+index 667e6e1..ff5d182 100644
+--- a/src/expr/quota.c
++++ b/src/expr/quota.c
+@@ -203,6 +203,6 @@ struct expr_ops expr_ops_quota = {
+ .get = nftnl_expr_quota_get,
+ .parse = nftnl_expr_quota_parse,
+ .build = nftnl_expr_quota_build,
+- .snprintf = nftnl_expr_quota_snprintf,
++ .snprintf_ = nftnl_expr_quota_snprintf,
+ .json_parse = nftnl_expr_quota_json_parse,
+ };
+diff --git a/src/expr/range.c b/src/expr/range.c
+index 8c8ce12..34d422b 100644
+--- a/src/expr/range.c
++++ b/src/expr/range.c
+@@ -283,6 +283,6 @@ struct expr_ops expr_ops_range = {
+ .get = nftnl_expr_range_get,
+ .parse = nftnl_expr_range_parse,
+ .build = nftnl_expr_range_build,
+- .snprintf = nftnl_expr_range_snprintf,
++ .snprintf_ = nftnl_expr_range_snprintf,
+ .json_parse = nftnl_expr_range_json_parse,
+ };
+diff --git a/src/expr/redir.c b/src/expr/redir.c
+index 43538d5..8a21f93 100644
+--- a/src/expr/redir.c
++++ b/src/expr/redir.c
+@@ -242,6 +242,6 @@ struct expr_ops expr_ops_redir = {
+ .get = nftnl_expr_redir_get,
+ .parse = nftnl_expr_redir_parse,
+ .build = nftnl_expr_redir_build,
+- .snprintf = nftnl_expr_redir_snprintf,
++ .snprintf_ = nftnl_expr_redir_snprintf,
+ .json_parse = nftnl_expr_redir_json_parse,
+ };
+diff --git a/src/expr/reject.c b/src/expr/reject.c
+index 11d8b20..b10e729 100644
+--- a/src/expr/reject.c
++++ b/src/expr/reject.c
+@@ -200,6 +200,6 @@ struct expr_ops expr_ops_reject = {
+ .get = nftnl_expr_reject_get,
+ .parse = nftnl_expr_reject_parse,
+ .build = nftnl_expr_reject_build,
+- .snprintf = nftnl_expr_reject_snprintf,
++ .snprintf_ = nftnl_expr_reject_snprintf,
+ .json_parse = nftnl_expr_reject_json_parse,
+ };
+diff --git a/src/expr/rt.c b/src/expr/rt.c
+index 5088e66..9f44b29 100644
+--- a/src/expr/rt.c
++++ b/src/expr/rt.c
+@@ -238,6 +238,6 @@ struct expr_ops expr_ops_rt = {
+ .get = nftnl_expr_rt_get,
+ .parse = nftnl_expr_rt_parse,
+ .build = nftnl_expr_rt_build,
+- .snprintf = nftnl_expr_rt_snprintf,
++ .snprintf_ = nftnl_expr_rt_snprintf,
+ .json_parse = nftnl_expr_rt_json_parse,
+ };
+diff --git a/src/expr/target.c b/src/expr/target.c
+index ed4bf7d..2ef4078 100644
+--- a/src/expr/target.c
++++ b/src/expr/target.c
+@@ -249,6 +249,6 @@ struct expr_ops expr_ops_target = {
+ .get = nftnl_expr_target_get,
+ .parse = nftnl_expr_target_parse,
+ .build = nftnl_expr_target_build,
+- .snprintf = nftnl_expr_target_snprintf,
++ .snprintf_ = nftnl_expr_target_snprintf,
+ .json_parse = nftnl_expr_target_json_parse,
+ };
+diff --git a/src/obj/counter.c b/src/obj/counter.c
+index beadc93..8c4cc25 100644
+--- a/src/obj/counter.c
++++ b/src/obj/counter.c
+@@ -179,6 +179,6 @@ struct obj_ops obj_ops_counter = {
+ .get = nftnl_obj_counter_get,
+ .parse = nftnl_obj_counter_parse,
+ .build = nftnl_obj_counter_build,
+- .snprintf = nftnl_obj_counter_snprintf,
++ .snprintf_ = nftnl_obj_counter_snprintf,
+ .json_parse = nftnl_obj_counter_json_parse,
+ };
+diff --git a/src/obj/ct_helper.c b/src/obj/ct_helper.c
+index d6d3111..4c7c88b 100644
+--- a/src/obj/ct_helper.c
++++ b/src/obj/ct_helper.c
+@@ -205,6 +205,6 @@ struct obj_ops obj_ops_ct_helper = {
+ .get = nftnl_obj_ct_helper_get,
+ .parse = nftnl_obj_ct_helper_parse,
+ .build = nftnl_obj_ct_helper_build,
+- .snprintf = nftnl_obj_ct_helper_snprintf,
++ .snprintf_ = nftnl_obj_ct_helper_snprintf,
+ .json_parse = nftnl_obj_quota_json_parse,
+ };
+diff --git a/src/obj/quota.c b/src/obj/quota.c
+index d5757b2..e959ff8 100644
+--- a/src/obj/quota.c
++++ b/src/obj/quota.c
+@@ -200,6 +200,6 @@ struct obj_ops obj_ops_quota = {
+ .get = nftnl_obj_quota_get,
+ .parse = nftnl_obj_quota_parse,
+ .build = nftnl_obj_quota_build,
+- .snprintf = nftnl_obj_quota_snprintf,
++ .snprintf_ = nftnl_obj_quota_snprintf,
+ .json_parse = nftnl_obj_quota_json_parse,
+ };
+diff --git a/src/object.c b/src/object.c
+index d409c6d..b938c97 100644
+--- a/src/object.c
++++ b/src/object.c
+@@ -389,7 +389,7 @@ static int nftnl_obj_export(char *buf, size_t size,
+ nftnl_buf_u32(&b, type, obj->use, USE);
+
+ if (obj->ops)
+- ret = obj->ops->snprintf(buf + b.len, size - b.len, type,
++ ret = obj->ops->snprintf_(buf + b.len, size - b.len, type,
+ flags, obj);
+
+ b.len += ret;
+@@ -410,7 +410,7 @@ static int nftnl_obj_snprintf_dflt(char *buf, size_t size,
+ SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+
+ if (obj->ops) {
+- ret = obj->ops->snprintf(buf + offset, offset, type, flags, obj);
++ ret = obj->ops->snprintf_(buf + offset, offset, type, flags, obj);
+ SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
+ }
+ ret = snprintf(buf + offset, offset, "]");
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb
new file mode 100644
index 000000000..ca01c0a61
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/libnftnl/libnftnl_1.0.7.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Library for low-level interaction with nftables Netlink's API over libmnl"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=79808397c3355f163c012616125c9e26"
+SECTION = "libs"
+DEPENDS = "libmnl"
+PV .= "+git${SRCPV}"
+SRCREV = "4b89c0cb0883f638ff1abbc2ff47c43cdc26aac5"
+SRC_URI = "git://git.netfilter.org/libnftnl \
+ file://0001-Declare-the-define-visivility-attribute-together.patch \
+ file://0001-avoid-naming-local-function-as-one-of-printf-family.patch \
+ "
+SRC_URI[md5sum] = "82183867168eb6644926c48b991b8aac"
+SRC_URI[sha256sum] = "9bb66ecbc64b8508249402f0093829f44177770ad99f6042b86b3a467d963982"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb b/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb
new file mode 100644
index 000000000..8177ebcc2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nfacct/nfacct_1.0.2.bb
@@ -0,0 +1,15 @@
+SUMMARY = "nfacct is the command line tool to create/retrieve/delete accounting objects"
+HOMEPAGE = "http://netfilter.org/projects/nfacct/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI = "ftp://ftp.netfilter.org/pub/${BPN}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "94faafdaaed85ca9220c5692be8a408e"
+SRC_URI[sha256sum] = "ecff2218754be318bce3c3a5d1775bab93bf4168b2c4aac465785de5655fbd69"
+DEPENDS = "libnfnetlink libmnl libnetfilter-acct"
+
+EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+
+inherit autotools pkgconfig
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch
new file mode 100644
index 000000000..86a3d53df
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch
@@ -0,0 +1,323 @@
+From 0011985554e269e1cc8f8e5b41eb9dcd795ebe8c Mon Sep 17 00:00:00 2001
+From: Arturo Borrero Gonzalez <arturo@debian.org>
+Date: Wed, 25 Jan 2017 12:51:08 +0100
+Subject: [PATCH] payload: explicit network ctx assignment for icmp/icmp6 in
+ special families
+
+In the inet, bridge and netdev families, we can add rules like these:
+
+% nft add rule inet t c ip protocol icmp icmp type echo-request
+% nft add rule inet t c ip6 nexthdr icmpv6 icmpv6 type echo-request
+
+However, when we print the ruleset:
+
+% nft list ruleset
+table inet t {
+ chain c {
+ icmpv6 type echo-request
+ icmp type echo-request
+ }
+}
+
+These rules we obtain can't be added again:
+
+% nft add rule inet t c icmp type echo-request
+<cmdline>:1:19-27: Error: conflicting protocols specified: inet-service vs. icmp
+add rule inet t c icmp type echo-request
+ ^^^^^^^^^
+
+% nft add rule inet t c icmpv6 type echo-request
+<cmdline>:1:19-29: Error: conflicting protocols specified: inet-service vs. icmpv6
+add rule inet t c icmpv6 type echo-request
+ ^^^^^^^^^^^
+
+Since I wouldn't expect an IP packet carrying ICMPv6, or IPv6 packet
+carrying ICMP, if the link layer is inet, the network layer protocol context
+can be safely update to 'ip' or 'ip6'.
+
+Moreover, nft currently generates a 'meta nfproto ipvX' depedency when
+using icmp or icmp6 in the inet family, and similar in netdev and bridge
+families.
+
+While at it, a bit of code factorization is introduced.
+
+Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1073
+Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 70 ++++++++++++++++---------------------
+ tests/py/any/icmpX.t.netdev | 8 +++++
+ tests/py/any/icmpX.t.netdev.payload | 36 +++++++++++++++++++
+ tests/py/bridge/icmpX.t | 8 +++++
+ tests/py/bridge/icmpX.t.payload | 36 +++++++++++++++++++
+ tests/py/inet/icmpX.t | 8 +++++
+ tests/py/inet/icmpX.t.payload | 36 +++++++++++++++++++
+ 7 files changed, 162 insertions(+), 40 deletions(-)
+ create mode 100644 tests/py/any/icmpX.t.netdev
+ create mode 100644 tests/py/any/icmpX.t.netdev.payload
+ create mode 100644 tests/py/bridge/icmpX.t
+ create mode 100644 tests/py/bridge/icmpX.t.payload
+ create mode 100644 tests/py/inet/icmpX.t
+ create mode 100644 tests/py/inet/icmpX.t.payload
+
+diff --git a/src/payload.c b/src/payload.c
+index af533b2..74f8254 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -223,6 +223,34 @@ static int payload_add_dependency(struct eval_ctx *ctx,
+ return 0;
+ }
+
++static const struct proto_desc *
++payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
++{
++ switch (expr->payload.base) {
++ case PROTO_BASE_LL_HDR:
++ switch (ctx->pctx.family) {
++ case NFPROTO_INET:
++ return &proto_inet;
++ case NFPROTO_BRIDGE:
++ return &proto_eth;
++ case NFPROTO_NETDEV:
++ return &proto_netdev;
++ default:
++ break;
++ }
++ break;
++ case PROTO_BASE_TRANSPORT_HDR:
++ if (expr->payload.desc == &proto_icmp)
++ return &proto_ip;
++ if (expr->payload.desc == &proto_icmp6)
++ return &proto_ip6;
++ return &proto_inet_service;
++ default:
++ break;
++ }
++ return NULL;
++}
++
+ /**
+ * payload_gen_dependency - generate match expression on payload dependency
+ *
+@@ -276,46 +304,8 @@ int payload_gen_dependency(struct eval_ctx *ctx, const struct expr *expr,
+
+ desc = ctx->pctx.protocol[expr->payload.base - 1].desc;
+ /* Special case for mixed IPv4/IPv6 and bridge tables */
+- if (desc == NULL) {
+- switch (ctx->pctx.family) {
+- case NFPROTO_INET:
+- switch (expr->payload.base) {
+- case PROTO_BASE_LL_HDR:
+- desc = &proto_inet;
+- break;
+- case PROTO_BASE_TRANSPORT_HDR:
+- desc = &proto_inet_service;
+- break;
+- default:
+- break;
+- }
+- break;
+- case NFPROTO_BRIDGE:
+- switch (expr->payload.base) {
+- case PROTO_BASE_LL_HDR:
+- desc = &proto_eth;
+- break;
+- case PROTO_BASE_TRANSPORT_HDR:
+- desc = &proto_inet_service;
+- break;
+- default:
+- break;
+- }
+- break;
+- case NFPROTO_NETDEV:
+- switch (expr->payload.base) {
+- case PROTO_BASE_LL_HDR:
+- desc = &proto_netdev;
+- break;
+- case PROTO_BASE_TRANSPORT_HDR:
+- desc = &proto_inet_service;
+- break;
+- default:
+- break;
+- }
+- break;
+- }
+- }
++ if (desc == NULL)
++ desc = payload_gen_special_dependency(ctx, expr);
+
+ if (desc == NULL)
+ return expr_error(ctx->msgs, expr,
+diff --git a/tests/py/any/icmpX.t.netdev b/tests/py/any/icmpX.t.netdev
+new file mode 100644
+index 0000000..a327ce6
+--- /dev/null
++++ b/tests/py/any/icmpX.t.netdev
+@@ -0,0 +1,8 @@
++:ingress;type filter hook ingress device lo priority 0
++
++*netdev;test-netdev;ingress
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/any/icmpX.t.netdev.payload b/tests/py/any/icmpX.t.netdev.payload
+new file mode 100644
+index 0000000..8b8107c
+--- /dev/null
++++ b/tests/py/any/icmpX.t.netdev.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++netdev test-netdev ingress
++ [ meta load protocol => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++netdev test-netdev ingress
++ [ meta load protocol => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++netdev test-netdev ingress
++ [ meta load protocol => reg 1 ]
++ [ cmp eq reg 1 0x0000dd86 ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++netdev test-netdev ingress
++ [ meta load protocol => reg 1 ]
++ [ cmp eq reg 1 0x0000dd86 ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
+diff --git a/tests/py/bridge/icmpX.t b/tests/py/bridge/icmpX.t
+new file mode 100644
+index 0000000..8c0a597
+--- /dev/null
++++ b/tests/py/bridge/icmpX.t
+@@ -0,0 +1,8 @@
++:input;type filter hook input priority 0
++
++*bridge;test-bridge;input
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/bridge/icmpX.t.payload b/tests/py/bridge/icmpX.t.payload
+new file mode 100644
+index 0000000..19efdd8
+--- /dev/null
++++ b/tests/py/bridge/icmpX.t.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++bridge test-bridge input
++ [ payload load 2b @ link header + 12 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++bridge test-bridge input
++ [ payload load 2b @ link header + 12 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++bridge test-bridge input
++ [ payload load 2b @ link header + 12 => reg 1 ]
++ [ cmp eq reg 1 0x0000dd86 ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++bridge test-bridge input
++ [ payload load 2b @ link header + 12 => reg 1 ]
++ [ cmp eq reg 1 0x0000dd86 ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
+diff --git a/tests/py/inet/icmpX.t b/tests/py/inet/icmpX.t
+new file mode 100644
+index 0000000..1b467a1
+--- /dev/null
++++ b/tests/py/inet/icmpX.t
+@@ -0,0 +1,8 @@
++:input;type filter hook input priority 0
++
++*inet;test-inet;input
++
++ip protocol icmp icmp type echo-request;ok;icmp type echo-request
++icmp type echo-request;ok
++ip6 nexthdr icmpv6 icmpv6 type echo-request;ok;icmpv6 type echo-request
++icmpv6 type echo-request;ok
+diff --git a/tests/py/inet/icmpX.t.payload b/tests/py/inet/icmpX.t.payload
+new file mode 100644
+index 0000000..81ca774
+--- /dev/null
++++ b/tests/py/inet/icmpX.t.payload
+@@ -0,0 +1,36 @@
++# ip protocol icmp icmp type echo-request
++inet test-inet input
++ [ meta load nfproto => reg 1 ]
++ [ cmp eq reg 1 0x00000002 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# icmp type echo-request
++inet test-inet input
++ [ meta load nfproto => reg 1 ]
++ [ cmp eq reg 1 0x00000002 ]
++ [ payload load 1b @ network header + 9 => reg 1 ]
++ [ cmp eq reg 1 0x00000001 ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000008 ]
++
++# ip6 nexthdr icmpv6 icmpv6 type echo-request
++inet test-inet input
++ [ meta load nfproto => reg 1 ]
++ [ cmp eq reg 1 0x0000000a ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
++# icmpv6 type echo-request
++inet test-inet input
++ [ meta load nfproto => reg 1 ]
++ [ cmp eq reg 1 0x0000000a ]
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000080 ]
++
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch
new file mode 100644
index 000000000..4d9e9d11a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0002-proto-Add-some-exotic-ICMPv6-types.patch
@@ -0,0 +1,147 @@
+From 9ade8fb75f8963375b45b3f2973b8bb7aa66ad76 Mon Sep 17 00:00:00 2001
+From: Phil Sutter <phil@nwl.cc>
+Date: Thu, 16 Mar 2017 13:43:20 +0100
+Subject: [PATCH] proto: Add some exotic ICMPv6 types
+
+This adds support for matching on inverse ND messages as defined by
+RFC3122 (not implemented in Linux) and MLDv2 as defined by RFC3810.
+
+Note that ICMPV6_MLD2_REPORT macro is defined in linux/icmpv6.h but
+including that header leads to conflicts with symbols defined in
+netinet/icmp6.h.
+
+In addition to the above, "mld-listener-done" is introduced as an alias
+for "mld-listener-reduction".
+
+Signed-off-by: Phil Sutter <phil@nwl.cc>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/proto.c | 8 ++++++++
+ tests/py/ip6/icmpv6.t | 8 ++++++--
+ tests/py/ip6/icmpv6.t.payload.ip6 | 34 +++++++++++++++++++++++++++++++++-
+ 3 files changed, 47 insertions(+), 3 deletions(-)
+
+diff --git a/src/proto.c b/src/proto.c
+index fb96530..79e9dbf 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -632,6 +632,10 @@ const struct proto_desc proto_ip = {
+
+ #include <netinet/icmp6.h>
+
++#define IND_NEIGHBOR_SOLICIT 141
++#define IND_NEIGHBOR_ADVERT 142
++#define ICMPV6_MLD2_REPORT 143
++
+ static const struct symbol_table icmp6_type_tbl = {
+ .base = BASE_DECIMAL,
+ .symbols = {
+@@ -643,6 +647,7 @@ static const struct symbol_table icmp6_type_tbl = {
+ SYMBOL("echo-reply", ICMP6_ECHO_REPLY),
+ SYMBOL("mld-listener-query", MLD_LISTENER_QUERY),
+ SYMBOL("mld-listener-report", MLD_LISTENER_REPORT),
++ SYMBOL("mld-listener-done", MLD_LISTENER_REDUCTION),
+ SYMBOL("mld-listener-reduction", MLD_LISTENER_REDUCTION),
+ SYMBOL("nd-router-solicit", ND_ROUTER_SOLICIT),
+ SYMBOL("nd-router-advert", ND_ROUTER_ADVERT),
+@@ -650,6 +655,9 @@ static const struct symbol_table icmp6_type_tbl = {
+ SYMBOL("nd-neighbor-advert", ND_NEIGHBOR_ADVERT),
+ SYMBOL("nd-redirect", ND_REDIRECT),
+ SYMBOL("router-renumbering", ICMP6_ROUTER_RENUMBERING),
++ SYMBOL("ind-neighbor-solicit", IND_NEIGHBOR_SOLICIT),
++ SYMBOL("ind-neighbor-advert", IND_NEIGHBOR_ADVERT),
++ SYMBOL("mld2-listener-report", ICMPV6_MLD2_REPORT),
+ SYMBOL_LIST_END
+ },
+ };
+diff --git a/tests/py/ip6/icmpv6.t b/tests/py/ip6/icmpv6.t
+index afbd451..a898fe3 100644
+--- a/tests/py/ip6/icmpv6.t
++++ b/tests/py/ip6/icmpv6.t
+@@ -11,7 +11,8 @@ icmpv6 type echo-request accept;ok
+ icmpv6 type echo-reply accept;ok
+ icmpv6 type mld-listener-query accept;ok
+ icmpv6 type mld-listener-report accept;ok
+-icmpv6 type mld-listener-reduction accept;ok
++icmpv6 type mld-listener-done accept;ok
++icmpv6 type mld-listener-reduction accept;ok;icmpv6 type mld-listener-done accept
+ icmpv6 type nd-router-solicit accept;ok
+ icmpv6 type nd-router-advert accept;ok
+ icmpv6 type nd-neighbor-solicit accept;ok
+@@ -19,8 +20,11 @@ icmpv6 type nd-neighbor-advert accept;ok
+ icmpv6 type nd-redirect accept;ok
+ icmpv6 type parameter-problem accept;ok
+ icmpv6 type router-renumbering accept;ok
++icmpv6 type ind-neighbor-solicit accept;ok
++icmpv6 type ind-neighbor-advert accept;ok
++icmpv6 type mld2-listener-report accept;ok
+ icmpv6 type {destination-unreachable, time-exceeded, nd-router-solicit} accept;ok
+-icmpv6 type {router-renumbering, mld-listener-reduction, time-exceeded, nd-router-solicit} accept;ok
++icmpv6 type {router-renumbering, mld-listener-done, time-exceeded, nd-router-solicit} accept;ok
+ icmpv6 type {mld-listener-query, time-exceeded, nd-router-advert} accept;ok
+ icmpv6 type != {mld-listener-query, time-exceeded, nd-router-advert} accept;ok
+
+diff --git a/tests/py/ip6/icmpv6.t.payload.ip6 b/tests/py/ip6/icmpv6.t.payload.ip6
+index 9fe2496..30f58ca 100644
+--- a/tests/py/ip6/icmpv6.t.payload.ip6
++++ b/tests/py/ip6/icmpv6.t.payload.ip6
+@@ -54,6 +54,14 @@ ip6 test-ip6 input
+ [ cmp eq reg 1 0x00000083 ]
+ [ immediate reg 0 accept ]
+
++# icmpv6 type mld-listener-done accept
++ip6 test-ip6 input
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000084 ]
++ [ immediate reg 0 accept ]
++
+ # icmpv6 type mld-listener-reduction accept
+ ip6 test-ip6 input
+ [ payload load 1b @ network header + 6 => reg 1 ]
+@@ -118,6 +126,30 @@ ip6 test-ip6 input
+ [ cmp eq reg 1 0x0000008a ]
+ [ immediate reg 0 accept ]
+
++# icmpv6 type ind-neighbor-solicit accept
++ip6 test-ip6 input
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x0000008d ]
++ [ immediate reg 0 accept ]
++
++# icmpv6 type ind-neighbor-advert accept
++ip6 test-ip6 input
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x0000008e ]
++ [ immediate reg 0 accept ]
++
++# icmpv6 type mld2-listener-report accept
++ip6 test-ip6 input
++ [ payload load 1b @ network header + 6 => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x0000008f ]
++ [ immediate reg 0 accept ]
++
+ # icmpv6 type {destination-unreachable, time-exceeded, nd-router-solicit} accept
+ __set%d test-ip6 3
+ __set%d test-ip6 0
+@@ -129,7 +161,7 @@ ip6 test-ip6 input
+ [ lookup reg 1 set __set%d ]
+ [ immediate reg 0 accept ]
+
+-# icmpv6 type {router-renumbering, mld-listener-reduction, time-exceeded, nd-router-solicit} accept
++# icmpv6 type {router-renumbering, mld-listener-done, time-exceeded, nd-router-solicit} accept
+ __set%d test-ip6 3
+ __set%d test-ip6 0
+ element 0000008a : 0 [end] element 00000084 : 0 [end] element 00000003 : 0 [end] element 00000085 : 0 [end]
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
new file mode 100644
index 000000000..50cac300e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0003-payload-split-ll-proto-dependency-into-helper.patch
@@ -0,0 +1,62 @@
+From 8d8cfe5ad6ca460a5262fb15fdbef3601058c784 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Thu, 18 May 2017 13:30:54 +0200
+Subject: [PATCH 1/4] payload: split ll proto dependency into helper
+
+will be re-used in folloup patch for icmp/icmpv6 depenency
+handling.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 29 ++++++++++++++++++-----------
+ 1 file changed, 18 insertions(+), 11 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 55128fe..31e5a02 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -224,21 +224,28 @@ static int payload_add_dependency(struct eval_ctx *ctx,
+ }
+
+ static const struct proto_desc *
++payload_get_get_ll_hdr(const struct eval_ctx *ctx)
++{
++ switch (ctx->pctx.family) {
++ case NFPROTO_INET:
++ return &proto_inet;
++ case NFPROTO_BRIDGE:
++ return &proto_eth;
++ case NFPROTO_NETDEV:
++ return &proto_netdev;
++ default:
++ break;
++ }
++
++ return NULL;
++}
++
++static const struct proto_desc *
+ payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
+ {
+ switch (expr->payload.base) {
+ case PROTO_BASE_LL_HDR:
+- switch (ctx->pctx.family) {
+- case NFPROTO_INET:
+- return &proto_inet;
+- case NFPROTO_BRIDGE:
+- return &proto_eth;
+- case NFPROTO_NETDEV:
+- return &proto_netdev;
+- default:
+- break;
+- }
+- break;
++ return payload_get_get_ll_hdr(ctx);
+ case PROTO_BASE_TRANSPORT_HDR:
+ if (expr->payload.desc == &proto_icmp)
+ return &proto_ip;
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch
new file mode 100644
index 000000000..180edb350
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch
@@ -0,0 +1,65 @@
+From 9a1f2bbf3cd2417e0c10d18578e224abe2071d68 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Tue, 21 Mar 2017 19:47:22 +0100
+Subject: [PATCH 2/4] src: allow update of net base w. meta l4proto icmpv6
+
+nft add rule ip6 f i meta l4proto ipv6-icmp icmpv6 type nd-router-advert
+<cmdline>:1:50-60: Error: conflicting protocols specified: unknown vs. icmpv6
+
+add icmpv6 to nexthdr list so base gets updated correctly.
+
+Reported-by: Thomas Woerner <twoerner@redhat.com>
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/proto.c | 1 +
+ tests/py/any/meta.t | 1 +
+ tests/py/any/meta.t.payload | 7 +++++++
+ 3 files changed, 9 insertions(+)
+
+diff --git a/src/proto.c b/src/proto.c
+index 79e9dbf..fcdfbe7 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -779,6 +779,7 @@ const struct proto_desc proto_inet_service = {
+ PROTO_LINK(IPPROTO_TCP, &proto_tcp),
+ PROTO_LINK(IPPROTO_DCCP, &proto_dccp),
+ PROTO_LINK(IPPROTO_SCTP, &proto_sctp),
++ PROTO_LINK(IPPROTO_ICMPV6, &proto_icmp6),
+ },
+ .templates = {
+ [0] = PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+diff --git a/tests/py/any/meta.t b/tests/py/any/meta.t
+index c3ac0a4..2ff942f 100644
+--- a/tests/py/any/meta.t
++++ b/tests/py/any/meta.t
+@@ -38,6 +38,7 @@ meta l4proto { 33, 55, 67, 88};ok;meta l4proto { 33, 55, 67, 88}
+ meta l4proto != { 33, 55, 67, 88};ok
+ meta l4proto { 33-55};ok
+ meta l4proto != { 33-55};ok
++meta l4proto ipv6-icmp icmpv6 type nd-router-advert;ok;icmpv6 type nd-router-advert
+
+ meta priority root;ok
+ meta priority none;ok
+diff --git a/tests/py/any/meta.t.payload b/tests/py/any/meta.t.payload
+index e432656..871f1ad 100644
+--- a/tests/py/any/meta.t.payload
++++ b/tests/py/any/meta.t.payload
+@@ -187,6 +187,13 @@ ip test-ip4 input
+ [ byteorder reg 1 = hton(reg 1, 2, 1) ]
+ [ lookup reg 1 set __set%d 0x1 ]
+
++# meta l4proto ipv6-icmp icmpv6 type nd-router-advert
++ip test-ip4 input
++ [ meta load l4proto => reg 1 ]
++ [ cmp eq reg 1 0x0000003a ]
++ [ payload load 1b @ transport header + 0 => reg 1 ]
++ [ cmp eq reg 1 0x00000086 ]
++
+ # meta mark 0x4
+ ip test-ip4 input
+ [ meta load mark => reg 1 ]
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch
new file mode 100644
index 000000000..f600ae05c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch
@@ -0,0 +1,98 @@
+From 2366ed9ffcb4f5f5341f10f0a1d1a4688d37ad87 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Wed, 22 Mar 2017 15:08:48 +0100
+Subject: [PATCH 3/4] src: ipv6: switch implicit dependencies to meta l4proto
+
+when using rule like
+
+ip6 filter input tcp dport 22
+nft generates:
+ [ payload load 1b @ network header + 6 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ payload load 2b @ transport header + 2 => reg 1 ]
+ [ cmp eq reg 1 0x00001600 ]
+
+which is: ip6 filter input ip6 nexthdr tcp dport 22
+IOW, such a rule won't match if e.g. a fragment header is in place.
+
+This changes ip6_proto to use 'meta l4proto' which is the protocol header
+found by exthdr walk.
+
+A side effect is that for bridge we get a shorter dependency chain as it
+no longer needs to prepend 'ether proto ipv6' for old 'ip6 nexthdr' dep.
+
+Only problem:
+
+ip6 nexthdr tcp tcp dport 22
+will now inject a (useless) meta l4 dependency as ip6 nexthdr is no
+longer flagged as EXPR_F_PROTOCOL, to avoid this add a small helper
+that skips the unneded meta dependency in that case.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 19 ++++++++++++++++++-
+ src/proto.c | 2 +-
+ 2 files changed, 19 insertions(+), 2 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 31e5a02..38db15e 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -117,6 +117,23 @@ static const struct expr_ops payload_expr_ops = {
+ .pctx_update = payload_expr_pctx_update,
+ };
+
++/*
++ * ipv6 is special case, we normally use 'meta l4proto' to fetch the last
++ * l4 header of the ipv6 extension header chain so we will also match
++ * tcp after a fragmentation header, for instance.
++ *
++ * If user specifically asks for nexthdr x, treat is as a full
++ * dependency rather than injecting another (useless) meta l4 one.
++ */
++static bool proto_key_is_protocol(const struct proto_desc *desc, unsigned int type)
++{
++ if (type == desc->protocol_key ||
++ (desc == &proto_ip6 && type == IP6HDR_NEXTHDR))
++ return true;
++
++ return false;
++}
++
+ struct expr *payload_expr_alloc(const struct location *loc,
+ const struct proto_desc *desc,
+ unsigned int type)
+@@ -129,7 +146,7 @@ struct expr *payload_expr_alloc(const struct location *loc,
+ if (desc != NULL) {
+ tmpl = &desc->templates[type];
+ base = desc->base;
+- if (type == desc->protocol_key)
++ if (proto_key_is_protocol(desc, type))
+ flags = EXPR_F_PROTOCOL;
+ } else {
+ tmpl = &proto_unknown_template;
+diff --git a/src/proto.c b/src/proto.c
+index fcdfbe7..3b20a5f 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -707,7 +707,6 @@ const struct proto_desc proto_icmp6 = {
+ const struct proto_desc proto_ip6 = {
+ .name = "ip6",
+ .base = PROTO_BASE_NETWORK_HDR,
+- .protocol_key = IP6HDR_NEXTHDR,
+ .protocols = {
+ PROTO_LINK(IPPROTO_ESP, &proto_esp),
+ PROTO_LINK(IPPROTO_AH, &proto_ah),
+@@ -720,6 +719,7 @@ const struct proto_desc proto_ip6 = {
+ PROTO_LINK(IPPROTO_ICMPV6, &proto_icmp6),
+ },
+ .templates = {
++ [0] = PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+ [IP6HDR_VERSION] = HDR_BITFIELD("version", &integer_type, 0, 4),
+ [IP6HDR_DSCP] = HDR_BITFIELD("dscp", &dscp_type, 4, 6),
+ [IP6HDR_ECN] = HDR_BITFIELD("ecn", &ecn_type, 10, 2),
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch
new file mode 100644
index 000000000..00076d7ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch
@@ -0,0 +1,84 @@
+From f21a7a4849b50c30341ec571813bd7fe37040ad3 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Thu, 18 May 2017 13:30:54 +0200
+Subject: [PATCH 4/4] payload: enforce ip/ip6 protocol depending on icmp or
+ icmpv6
+
+After some discussion with Pablo we agreed to treat icmp/icmpv6 specially.
+
+in the case of a rule like 'tcp dport 22' the inet, bridge and netdev
+families only care about the lower layer protocol.
+
+In the icmpv6 case however we'd like to also enforce an ipv6 protocol check
+(and ipv4 check in icmp case).
+
+This extends payload_gen_special_dependency() to consider this.
+With this patch:
+
+add rule $pf filter input meta l4proto icmpv6
+add rule $pf filter input meta l4proto icmpv6 icmpv6 type echo-request
+add rule $pf filter input icmpv6 type echo-request
+
+will work in all tables and all families.
+For inet/bridge/netdev, an ipv6 protocol dependency is added; this will
+not match ipv4 packets with ip->protocol == icmpv6, EXCEPT in the case
+of the ip family.
+
+Its still possible to match icmpv6-in-ipv4 in inet/bridge/netdev with an
+explicit dependency:
+
+add rule inet f i ip protocol ipv6-icmp meta l4proto ipv6-icmp icmpv6 type ...
+
+Implicit dependencies won't get removed at the moment, so
+ bridge ... icmp type echo-request
+will be shown as
+ ether type ip meta l4proto 1 icmp type echo-request
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 27 +++++++++++++++++++++++----
+ 1 file changed, 23 insertions(+), 4 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 38db15e..8796ee5 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -264,10 +264,29 @@ payload_gen_special_dependency(struct eval_ctx *ctx, const struct expr *expr)
+ case PROTO_BASE_LL_HDR:
+ return payload_get_get_ll_hdr(ctx);
+ case PROTO_BASE_TRANSPORT_HDR:
+- if (expr->payload.desc == &proto_icmp)
+- return &proto_ip;
+- if (expr->payload.desc == &proto_icmp6)
+- return &proto_ip6;
++ if (expr->payload.desc == &proto_icmp ||
++ expr->payload.desc == &proto_icmp6) {
++ const struct proto_desc *desc, *desc_upper;
++ struct stmt *nstmt;
++
++ desc = ctx->pctx.protocol[PROTO_BASE_LL_HDR].desc;
++ if (!desc) {
++ desc = payload_get_get_ll_hdr(ctx);
++ if (!desc)
++ break;
++ }
++
++ desc_upper = &proto_ip6;
++ if (expr->payload.desc == &proto_icmp)
++ desc_upper = &proto_ip;
++
++ if (payload_add_dependency(ctx, desc, desc_upper,
++ expr, &nstmt) < 0)
++ return NULL;
++
++ list_add_tail(&nstmt->list, &ctx->stmt->list);
++ return desc_upper;
++ }
+ return &proto_inet_service;
+ default:
+ break;
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch
new file mode 100644
index 000000000..5b72437d2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch
@@ -0,0 +1,86 @@
+From 0825c57d571bb7121e7048e198b9b023f7e7f358 Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Sun, 7 May 2017 03:53:30 +0200
+Subject: [PATCH] src: ip: switch implicit dependencies to meta l4proto too
+
+after ip6 nexthdr also switch ip to meta l4proto instead of ip protocol.
+
+While its needed for ipv6 (due to extension headers) this isn't needed
+for ip but it has the advantage that
+
+tcp dport 22
+
+produces same expressions for ip/ip6/inet families.
+
+Signed-off-by: Florian Westphal <fw@strlen.de>
+---
+Upstream-Status: Backport
+Signed-off-by: André Draszik <adraszik@tycoint.com>
+ src/payload.c | 17 +++++++++++------
+ src/proto.c | 3 ++-
+ 2 files changed, 13 insertions(+), 7 deletions(-)
+
+diff --git a/src/payload.c b/src/payload.c
+index 8796ee5..11b6df3 100644
+--- a/src/payload.c
++++ b/src/payload.c
+@@ -118,17 +118,22 @@ static const struct expr_ops payload_expr_ops = {
+ };
+
+ /*
+- * ipv6 is special case, we normally use 'meta l4proto' to fetch the last
+- * l4 header of the ipv6 extension header chain so we will also match
++ * We normally use 'meta l4proto' to fetch the last l4 header of the
++ * ipv6 extension header chain so we will also match
+ * tcp after a fragmentation header, for instance.
++ * For consistency we also use meta l4proto for ipv4.
+ *
+- * If user specifically asks for nexthdr x, treat is as a full
+- * dependency rather than injecting another (useless) meta l4 one.
++ * If user specifically asks for nexthdr x, don't add another (useless)
++ * meta dependency.
+ */
+ static bool proto_key_is_protocol(const struct proto_desc *desc, unsigned int type)
+ {
+- if (type == desc->protocol_key ||
+- (desc == &proto_ip6 && type == IP6HDR_NEXTHDR))
++ if (type == desc->protocol_key)
++ return true;
++
++ if (desc == &proto_ip6 && type == IP6HDR_NEXTHDR)
++ return true;
++ if (desc == &proto_ip && type == IPHDR_PROTOCOL)
+ return true;
+
+ return false;
+diff --git a/src/proto.c b/src/proto.c
+index 3b20a5f..2afedf7 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -587,7 +587,6 @@ const struct proto_desc proto_ip = {
+ .name = "ip",
+ .base = PROTO_BASE_NETWORK_HDR,
+ .checksum_key = IPHDR_CHECKSUM,
+- .protocol_key = IPHDR_PROTOCOL,
+ .protocols = {
+ PROTO_LINK(IPPROTO_ICMP, &proto_icmp),
+ PROTO_LINK(IPPROTO_ESP, &proto_esp),
+@@ -600,6 +599,7 @@ const struct proto_desc proto_ip = {
+ PROTO_LINK(IPPROTO_SCTP, &proto_sctp),
+ },
+ .templates = {
++ [0] = PROTO_META_TEMPLATE("l4proto", &inet_protocol_type, NFT_META_L4PROTO, 8),
+ [IPHDR_VERSION] = HDR_BITFIELD("version", &integer_type, 0, 4),
+ [IPHDR_HDRLENGTH] = HDR_BITFIELD("hdrlength", &integer_type, 4, 4),
+ [IPHDR_DSCP] = HDR_BITFIELD("dscp", &dscp_type, 8, 6),
+@@ -779,6 +779,7 @@ const struct proto_desc proto_inet_service = {
+ PROTO_LINK(IPPROTO_TCP, &proto_tcp),
+ PROTO_LINK(IPPROTO_DCCP, &proto_dccp),
+ PROTO_LINK(IPPROTO_SCTP, &proto_sctp),
++ PROTO_LINK(IPPROTO_ICMP, &proto_icmp),
+ PROTO_LINK(IPPROTO_ICMPV6, &proto_icmp6),
+ },
+ .templates = {
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/files/fix-to-generate-ntf.8.patch b/meta-openembedded/meta-networking/recipes-filter/nftables/files/fix-to-generate-ntf.8.patch
new file mode 100644
index 000000000..8dce90a75
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/files/fix-to-generate-ntf.8.patch
@@ -0,0 +1,26 @@
+[PATCH] disable to make ntf.8 man
+
+Upstream-Status: Pending
+
+$DB2MAN do not support the xinclude parameter whether it is
+docbook2x-man or other, so disable to make ntf.8 man
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ doc/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index a92de7f..537c36b 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -1,5 +1,5 @@
+ if BUILD_MAN
+-man_MANS = nft.8
++#man_MANS = nft.8
+ endif
+
+ if BUILD_PDF
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb b/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb
new file mode 100644
index 000000000..0ea79953b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-filter/nftables/nftables_0.7.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Netfilter Tables userspace utillites"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79"
+SECTION = "net"
+
+DEPENDS = "libmnl libnftnl readline gmp"
+RRECOMMENDS_${PN} += "kernel-module-nf-tables \
+ "
+
+SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \
+ file://fix-to-generate-ntf.8.patch \
+ \
+ file://0001-payload-explicit-network-ctx-assignment-for-icmp-icm.patch \
+ file://0002-proto-Add-some-exotic-ICMPv6-types.patch \
+ \
+ file://0003-payload-split-ll-proto-dependency-into-helper.patch \
+ file://0004-src-allow-update-of-net-base-w.-meta-l4proto-icmpv6.patch \
+ file://0005-src-ipv6-switch-implicit-dependencies-to-meta-l4prot.patch \
+ file://0006-payload-enforce-ip-ip6-protocol-depending-on-icmp-or.patch \
+ file://0007-src-ip-switch-implicit-dependencies-to-meta-l4proto-.patch \
+ "
+SRC_URI[md5sum] = "4c005e76a15a029afaba71d7db21d065"
+SRC_URI[sha256sum] = "fe639239d801ce5890397f6f4391c58a934bfc27d8b7d5ef922692de5ec4ed43"
+
+ASNEEDED = ""
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb b/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb
new file mode 100644
index 000000000..c2d71563a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-irc/znc/znc_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "ZNC, an advanced IRC bouncer"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+DEPENDS = "openssl zlib icu"
+
+PV = "1.6.0"
+
+SRC_URI = "git://github.com/znc/znc.git;name=znc \
+ git://github.com/jimloco/Csocket.git;destsuffix=git/third_party/Csocket;name=Csocket \
+ "
+SRCREV_znc = "f47e8465efa4e1cd948b9caae93ac401b4355df8"
+SRCREV_Csocket = "07b4437396122650e5b8fb3d014e820a5decf4ee"
+
+# This constructs a composite revision based on multiple SRCREV's.
+#
+SRCREV_FORMAT = "znc_Csocket"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# ZNC has a custom autogen.sh that states that this command is needed *and* expected to fail
+do_configure_prepend() {
+ automake --add-missing || true
+}
+
+do_install_append() {
+ sed -i 's/-fdebug-prefix-map[^ ]*//g; s#${STAGING_DIR_TARGET}##g' ${D}${libdir}/pkgconfig/*.pc
+}
diff --git a/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20171221.bb b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20171221.bb
new file mode 100644
index 000000000..2c69c58f8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-module_0.0.20171221.bb
@@ -0,0 +1,31 @@
+require wireguard.inc
+
+inherit module kernel-module-split
+
+DEPENDS = "virtual/kernel libmnl"
+
+# This module requires Linux 3.10 higher and several networking related
+# configuration options. For exact kernel requirements visit:
+# https://www.wireguard.io/install/#kernel-requirements
+
+EXTRA_OEMAKE_append = " \
+ KERNELDIR=${STAGING_KERNEL_DIR} \
+ "
+
+MAKE_TARGETS = "module"
+
+RRECOMMENDS_${PN} = "kernel-module-xt-hashlimit"
+MODULE_NAME = "wireguard"
+
+# Kernel module packages MUST begin with 'kernel-module-', otherwise
+# multilib image generation can fail.
+#
+# The following line is only necessary if the recipe name does not begin
+# with kernel-module-.
+PKG_${PN} = "kernel-module-${MODULE_NAME}"
+
+module_do_install() {
+ install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
+ install -m 0644 ${MODULE_NAME}.ko \
+ ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
+}
diff --git a/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20171221.bb b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20171221.bb
new file mode 100644
index 000000000..c4ddbcb0e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard-tools_0.0.20171221.bb
@@ -0,0 +1,27 @@
+require wireguard.inc
+
+inherit bash-completion systemd pkgconfig
+
+DEPENDS = "wireguard-module libmnl"
+
+do_compile_prepend () {
+ cd ${S}/tools
+}
+
+do_install () {
+ cd ${S}/tools
+ oe_runmake DESTDIR="${D}" PREFIX="${prefix}" SYSCONFDIR="${sysconfdir}" \
+ SYSTEMDUNITDIR="${systemd_unitdir}" \
+ WITH_SYSTEMDUNITS=${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'yes', '', d)} \
+ WITH_BASHCOMPLETION=yes \
+ WITH_WGQUICK=yes \
+ install
+}
+
+FILES_${PN} = " \
+ ${sysconfdir} \
+ ${systemd_unitdir} \
+ ${bindir} \
+"
+
+RDEPENDS_${PN} = "wireguard-module bash"
diff --git a/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc
new file mode 100644
index 000000000..6bd581a68
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-kernel/wireguard/wireguard.inc
@@ -0,0 +1,17 @@
+SUMMARY = "WireGuard is an extremely simple yet fast and modern VPN"
+DESCRIPTION="WireGuard is a secure network tunnel, operating at layer 3, \
+implemented as a kernel virtual network interface for Linux, which aims to \
+replace both IPsec for most use cases, as well as popular user space and/or \
+TLS-based solutions like OpenVPN, while being more secure, more performant, \
+and easier to use."
+SECTION = "networking"
+HOMEPAGE = "https://www.wireguard.io/"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${PV}.tar.xz"
+SRC_URI[md5sum] = "39bb99fe11356423fb1ab45ae2d938bb"
+SRC_URI[sha256sum] = "2b97697e9b271ba8836a04120a287b824648124f21d5309170ec51c1f86ac5ed"
+
+S = "${WORKDIR}/WireGuard-${PV}/src/"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch
new file mode 100644
index 000000000..8376603ea
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/0001-ftp-include-sys-types.h-for-u_long.patch
@@ -0,0 +1,30 @@
+From 2ee0c51d81a0a08d64b64ab624074e5f7cd9615a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Jul 2017 00:07:32 -0700
+Subject: [PATCH] ftp: include sys/types.h for u_long
+
+fixes
+ftp.c:1091:2: error: unknown type name 'u_long'; did you mean 'long'?
+ u_long a1,a2,a3,a4,p1,p2;
+ ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ftp/ftp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ftp/ftp.c b/ftp/ftp.c
+index 7a56af6..5dcb513 100644
+--- a/ftp/ftp.c
++++ b/ftp/ftp.c
+@@ -43,6 +43,7 @@ char ftp_rcsid[] =
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <sys/file.h>
++#include <sys/types.h>
+
+ #include <netinet/in.h>
+ #include <netinet/ip.h>
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/Add_ARG_MAX_define.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/Add_ARG_MAX_define.patch
new file mode 100644
index 000000000..5a47fd917
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp/Add_ARG_MAX_define.patch
@@ -0,0 +1,28 @@
+This adds ARG_MAX define to be _SC_ARG_MAX
+
+Upstream-Status: Inappropriate.
+Most distros have their own verion for this fix.
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: netkit-ftp-0.17/ftp/glob.c
+===================================================================
+--- netkit-ftp-0.17.orig/ftp/glob.c
++++ netkit-ftp-0.17/ftp/glob.c
+@@ -50,6 +50,7 @@ char glob_rcsid[] =
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #include "ftp_var.h" /* for protos only */
+ #include "glob.h"
+@@ -57,6 +58,9 @@ char glob_rcsid[] =
+ #define QUOTE 0200
+ #define TRIM 0177
+ #define eq(a,b) (strcmp(a, b)==0)
++#ifndef ARG_MAX
++#define ARG_MAX (sysconf(_SC_ARG_MAX))
++#endif
+ #define GAVSIZ (ARG_MAX/6)
+ #define isdir(d) ((d.st_mode & S_IFMT) == S_IFDIR)
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb
new file mode 100644
index 000000000..394a69e62
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-ftp/netkit-ftp_0.17.bb
@@ -0,0 +1,47 @@
+DESCRIPTION = "netkit-ft includes the ftp client."
+SECTION = "net"
+HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
+LICENSE = "BSD"
+
+LIC_FILES_CHKSUM = "file://ftp/ftp.c;beginline=2;endline=3;md5=2d40a75a50d83b8f6317b3f53db72bfa"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-ftp/netkit-ftp_${PV}.orig.tar.gz;name=archive \
+ ${DEBIAN_MIRROR}/main/n/netkit-ftp/netkit-ftp_${PV}-31.debian.tar.xz;name=patch31 \
+ file://Add_ARG_MAX_define.patch \
+ file://0001-ftp-include-sys-types.h-for-u_long.patch \
+ "
+
+SRC_URI[archive.md5sum] = "94441610c9b86ef45c4c6ec609444060"
+SRC_URI[archive.sha256sum] = "61c913299b81a4671ff089aac821329f7db9bc111aa812993dd585798b700349"
+SRC_URI[patch31.md5sum] = "93d71e28ce70df69e080c7f90da63cac"
+SRC_URI[patch31.sha256sum] = "4edd46a32d70daa7ba00f0ebf0118dc5d17dff23d6e46aa21a2722be2e22d1c1"
+
+inherit autotools-brokensep
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
+}
+
+BINMODE = "0755"
+MANMODE = "0644"
+
+do_install () {
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man5
+
+ install -m${BINMODE} ${S}/ftp/ftp ${D}${bindir}
+ ln -sf ftp ${D}${bindir}/pftp
+ install -m${MANMODE} ${S}/ftp/ftp.1 ${D}${mandir}/man1
+ ln -sf ftp.1 ${D}${mandir}/man1/pftp.1
+ install -m${MANMODE} ${S}/ftp/netrc.5 ${D}${mandir}/man5
+}
+
+PACKAGES = "${PN} ${PN}-doc ${BPN}-dbg"
+FILES_${PN} = "${bindir}/*"
+FILES_${PN}-doc = "${mandir}"
+FILES_${PN}-dbg = "${prefix}/src/debug \
+ ${bindir}/.debug"
+
+RDEPENDS_${PN} = "readline"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch
new file mode 100644
index 000000000..8bd77d2e4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/0001-rpcgen-Fix-printf-formats.patch
@@ -0,0 +1,51 @@
+From 439e3e35f7fcbff1abb782de4b19b31e43ae3449 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 09:59:19 -0700
+Subject: [PATCH] rpcgen: Fix printf formats
+
+Fixes build with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ rpcgen/rpc_hout.c | 2 +-
+ rpcgen/rpc_tblout.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/rpcgen/rpc_hout.c b/rpcgen/rpc_hout.c
+index 0ef52df..09a7b57 100644
+--- a/rpcgen/rpc_hout.c
++++ b/rpcgen/rpc_hout.c
+@@ -474,7 +474,7 @@ pdeclaration(const char *name, declaration *dec, int tab,
+ break;
+ }
+ }
+- f_print(fout, separator );
++ f_print(fout, "%s", separator );
+ }
+
+ static int
+diff --git a/rpcgen/rpc_tblout.c b/rpcgen/rpc_tblout.c
+index d64bfde..fd62a52 100644
+--- a/rpcgen/rpc_tblout.c
++++ b/rpcgen/rpc_tblout.c
+@@ -99,7 +99,7 @@ write_table(const definition *def)
+ }
+ else {
+ expected = 1;
+- f_print(fout, null_entry);
++ f_print(fout, "%s", null_entry);
+ }
+ for (proc = vp->procs; proc != NULL; proc = proc->next) {
+ current = atoi(proc->proc_num);
+@@ -139,7 +139,7 @@ write_table(const definition *def)
+ }
+
+ /* print the table trailer */
+- f_print(fout, tbl_end);
++ f_print(fout, "%s", tbl_end);
+ f_print(fout, tbl_nproc, progvers, progvers, progvers);
+ }
+ }
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/gcc4.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/gcc4.patch
new file mode 100644
index 000000000..d54cea9fd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc/gcc4.patch
@@ -0,0 +1,39 @@
+This fixes an issue when building with gcc 4.x
+
+https://github.com/openembedded/openembedded/tree/master/recipes/netkit-rpc/netkit-rpc
+
+Upstream-status: Backported
+
+Signed-off-By: Armin Kuster <akuster808@gmail.com>
+
+--- netkit-rpc-0.17/rpcgen/rpc_cout.c~gcc4
++++ netkit-rpc-0.17/rpcgen/rpc_cout.c
+@@ -101,8 +101,6 @@
+ case DEF_TYPEDEF:
+ emit_typedef(def);
+ break;
+- default:
+- /* can't happen */
+ }
+ print_trailer();
+ }
+@@ -664,9 +662,6 @@
+ decl->name,decl->array_max);
+ emit_single_in_line(decl,flag,REL_VECTOR);
+ f_print(fout,"\t\t }\n\t\t };\n");
+-
+- default:
+- /* ?... do nothing I guess */
+ }
+ }
+
+--- netkit-rpc-0.17/rpcgen/rpc_hout.c~gcc4
++++ netkit-rpc-0.17/rpcgen/rpc_hout.c
+@@ -106,8 +106,6 @@
+ f_print(fout, "\n");
+ pprogramdef(def);
+ break;
+- default:
+- /* ?... shouldn't happen I guess */
+ }
+ }
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb
new file mode 100644
index 000000000..9487fdc2c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rpc/netkit-rpc_0.17.bb
@@ -0,0 +1,44 @@
+DESCRIPTION = "netkit-rpc includes rpcinfo and rpcgen."
+HOMEPAGE = "http://ftp.linux.org.uk/pub/linux/Networking/netkit"
+SECTION = "net"
+LICENSE = "SPL-1.0"
+LIC_FILES_CHKSUM = "file://rpcinfo/rpcinfo.c;beginline=2;endline=3;md5=3e6339e3ce266e1122c5ba293e04bc89"
+
+DEPENDS_append_libc-musl = " libtirpc"
+SRC_URI = "http://sources.openembedded.org/${BPN}-${PV}.tar.gz \
+ file://gcc4.patch \
+ file://0001-rpcgen-Fix-printf-formats.patch \
+ "
+SRC_URI[md5sum] = "67212720482ea1aea9182a98653a9642"
+SRC_URI[sha256sum] = "421d63b414162237a72867061f1bd3e3752a0d962cd5d30b5e933ddad8a14d3b"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LIBS_append_libc-musl = " -ltirpc"
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ echo "LDFLAGS=${LDFLAGS}" > MCONFIG
+ echo "CC=${CC}" >> MCONFIG
+ echo "LD=${LD}" >> MCONFIG
+ echo "CFLAGS=${CFLAGS}" >> MCONFIG
+ echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
+ echo "LIBS=${LIBS}" >> MCONFIG
+}
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}'
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man8
+
+ # remove strip flag
+ sed -i 's/install -s/install/' rpcinfo/Makefile
+ sed -i 's/install -s/install/' rpcgen/Makefile
+
+ oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
+ 'DAEMONMODE=0755' 'MANMODE=0644' \
+ 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' install
+}
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fix-host-variable.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fix-host-variable.patch
new file mode 100644
index 000000000..1d3631d47
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fix-host-variable.patch
@@ -0,0 +1,27 @@
+fix host variable when rsh is renamed to other.
+
+Upstream-Status: Pending
+
+If rsh is renamed to other, like rsh.netkit, host variable is assigned to
+rsh.netkit, which is wrong.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ rsh/rsh.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/rsh/rsh.c b/rsh/rsh.c
+index ac594f9..11f533e 100644
+--- a/rsh/rsh.c
++++ b/rsh/rsh.c
+@@ -100,7 +100,6 @@ main(int argc, char *argv[])
+ #else
+ if (!strcmp(p, "rsh")) asrsh = 1;
+ #endif
+- else host = p;
+
+ /* handle "rsh host flags" */
+ if (!host && argc > 2 && argv[1][0] != '-') {
+--
+1.7.5.4
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fixup_wait3_api_change.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fixup_wait3_api_change.patch
new file mode 100644
index 000000000..cd6df62fb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/fixup_wait3_api_change.patch
@@ -0,0 +1,34 @@
+Fix build issue do to Deprecate union wait and remove support from wait functions [BZ #19613]
+
+| rlogin.c: In function 'catch_child':
+| rlogin.c:463:13: error: storage size of 'status' isn't known
+| union wait status;
+
+https://sourceware.org/ml/libc-alpha/2016-02/msg00342.html
+
+Upstream-Status: Inappropriate [ no upstream maintaner ]
+
+Signed-off-by Armin Kuster <akuster@mvista.com>
+
+Index: netkit-rsh-0.17/rlogin/rlogin.c
+===================================================================
+--- netkit-rsh-0.17.orig/rlogin/rlogin.c
++++ netkit-rsh-0.17/rlogin/rlogin.c
+@@ -460,7 +460,7 @@ writeroob(int ignore)
+ void
+ catch_child(int ignore)
+ {
+- union wait status;
++ int status;
+ int pid;
+
+ (void)ignore;
+@@ -471,7 +471,7 @@ catch_child(int ignore)
+ return;
+ /* if the child (reader) dies, just quit */
+ if (pid < 0 || (pid == childpid && !WIFSTOPPED(status)))
+- done((int)(status.w_termsig | status.w_retcode));
++ done((int)(WTERMSIG(status) | WEXITSTATUS(status)));
+ }
+ /* NOTREACHED */
+ }
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/netkit-rsh-0.17-rexec-ipv6.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/netkit-rsh-0.17-rexec-ipv6.patch
new file mode 100644
index 000000000..efd060f36
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/netkit-rsh-0.17-rexec-ipv6.patch
@@ -0,0 +1,30 @@
+make rexec support ipv6
+
+Upstream-status: Pending
+
+rexec equals rexec_af(... ,AF_INET) which only support ipv4,
+use rexec_af(..., AF_UNSPEC) to support both ipv6 and ipv4.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ rexec/rexec.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/rexec/rexec.c b/rexec/rexec.c
+index 0913c02..9c8f769 100644
+--- a/rexec/rexec.c
++++ b/rexec/rexec.c
+@@ -214,8 +214,8 @@ int main(int argc, char *argv[])
+ passwd = getpass("Password: ");
+ }
+
+- if ( (sock = rexec(&host, port_exec, user_name, passwd, command,
+- p_to_aux_sock)) < 0 )
++ if ( (sock = rexec_af(&host, port_exec, user_name, passwd, command,
++ p_to_aux_sock, AF_UNSPEC)) < 0 )
+ {
+ fprintf(stderr,"%s: Error in rexec system call: ",argv[0]);
+ perror(NULL);
+--
+1.7.4.1
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/no_pam_build_fix.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/no_pam_build_fix.patch
new file mode 100644
index 000000000..fdd535be1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/no_pam_build_fix.patch
@@ -0,0 +1,39 @@
+netkit-rsh:
+Allow to build with no PAM enabled.
+
+Upstream-Status: Inappropriate [ no upstream maintaner ]
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: netkit-rsh-0.17/rshd/rshd.c
+===================================================================
+--- netkit-rsh-0.17.orig/rshd/rshd.c
++++ netkit-rsh-0.17/rshd/rshd.c
+@@ -110,9 +110,11 @@ extern char **environ;
+ static void error(const char *fmt, ...);
+ static void doit(struct sockaddr *fromp, socklen_t fromlen);
+ static char *getstr(char *, size_t, const char *);
++#ifdef USE_PAM
+ static int err_conv(
+ int, const struct pam_message **, struct pam_response **, void *
+ );
++#endif /* USE_PAM */
+
+ extern int _check_rhosts_file;
+
+@@ -256,6 +258,7 @@ static void stderr_parent(int sock, int
+ }
+
+
++#ifdef USE_PAM
+ static int err_conv(
+ int num_msg, const struct pam_message **msg,
+ struct pam_response **resp, void *appdata_ptr
+@@ -266,6 +269,7 @@ static int err_conv(
+ (void) appdata_ptr;
+ return PAM_CONV_ERR;
+ }
++#endif
+
+ static struct passwd *doauth(const char *remuser,
+ const char *hostname,
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.pam b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.pam
new file mode 100644
index 000000000..94e5dda50
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.pam
@@ -0,0 +1,10 @@
+#%PAM-1.0
+# For root login to succeed here with pam_securetty, "rexec" must be
+# listed in /etc/securetty.
+auth required pam_nologin.so
+auth required pam_env.so
+auth include common-auth
+account include common-account
+session optional pam_keyinit.so force revoke
+session include common-session
+session required pam_loginuid.so
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.xinetd.netkit b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.xinetd.netkit
new file mode 100644
index 000000000..7354360ae
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rexec.xinetd.netkit
@@ -0,0 +1,20 @@
+# default: off
+# description:
+# Rexecd is the server for the rexec program. The server provides remote
+# execution facilities with authentication based on user names and
+# passwords.
+#
+service exec
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = /usr/sbin/tcpd
+ server_args = /usr/sbin/in.rexecd
+ disable = yes
+}
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.pam b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.pam
new file mode 100644
index 000000000..b30f139cb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.pam
@@ -0,0 +1,12 @@
+#%PAM-1.0
+# For root login to succeed here with pam_securetty, "rlogin" must be
+# listed in /etc/securetty.
+auth required pam_nologin.so
+auth required pam_securetty.so
+auth required pam_env.so
+auth include common-auth
+account include common-account
+password include common-password
+session optional pam_keyinit.so force revoke
+session include common-session
+session required pam_loginuid.so
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.xinetd.netkit b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.xinetd.netkit
new file mode 100644
index 000000000..70493e603
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rlogin.xinetd.netkit
@@ -0,0 +1,23 @@
+# default: off
+# description:
+# Rlogind is a server for the rlogin program. The server provides remote
+# execution with authentication based on privileged port numbers from trusted
+# host
+#
+service login
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = /usr/sbin/tcpd
+ server_args = /usr/sbin/in.rlogind -a
+ disable = yes
+}
+
+
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh-redone_link_order_file.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh-redone_link_order_file.patch
new file mode 100644
index 000000000..c12ee9b46
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh-redone_link_order_file.patch
@@ -0,0 +1,77 @@
+This fixes a build issue caused by linking order.
+
+Upstream-Status: Inappropriate
+Most distos have there own verison of this fix. This was derived by
+* Fix link order to list libraries after the objects that require them
+(LP: #771080).
+
+-- Colin Watson <cjwatson@ubuntu.com> Tue, 13 Sep 2011 10:07:08 +0100
+
+
+signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: netkit-rsh-0.17/rsh/Makefile
+===================================================================
+--- netkit-rsh-0.17.orig/rsh/Makefile
++++ netkit-rsh-0.17/rsh/Makefile
+@@ -6,7 +6,7 @@ include ../MRULES
+ OBJS = rsh.o
+
+ rsh: $(OBJS)
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
++ $(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
+
+ install: rsh
+ install -o root -m$(SUIDMODE) rsh $(INSTALLROOT)$(BINDIR)
+Index: netkit-rsh-0.17/rshd/Makefile
+===================================================================
+--- netkit-rsh-0.17.orig/rshd/Makefile
++++ netkit-rsh-0.17/rshd/Makefile
+@@ -11,7 +11,7 @@ LIBS += -ldl -lpam
+ endif
+
+ rshd: $(OBJS)
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
++ $(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
+
+ install: rshd
+ install -m$(DAEMONMODE) rshd $(INSTALLROOT)$(SBINDIR)/in.rshd
+Index: netkit-rsh-0.17/rlogin/Makefile
+===================================================================
+--- netkit-rsh-0.17.orig/rlogin/Makefile
++++ netkit-rsh-0.17/rlogin/Makefile
+@@ -7,7 +7,7 @@ PROG=rlogin
+ OBJS=rlogin.o
+
+ $(PROG): $(OBJS)
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
++ $(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
+
+ install: $(PROG)
+ install -o root -m$(SUIDMODE) $(PROG) $(INSTALLROOT)$(BINDIR)
+Index: netkit-rsh-0.17/rlogind/Makefile
+===================================================================
+--- netkit-rsh-0.17.orig/rlogind/Makefile
++++ netkit-rsh-0.17/rlogind/Makefile
+@@ -13,7 +13,7 @@ LIBS += -ldl -lpam -lpam_misc
+ endif
+
+ rlogind: $(OBJS)
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
++ $(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
+
+ rlogind.o: pathnames.h logwtmp.h rlogind.h ../version.h
+ logwtmp.o: logwtmp.h
+Index: netkit-rsh-0.17/rexecd/Makefile
+===================================================================
+--- netkit-rsh-0.17.orig/rexecd/Makefile
++++ netkit-rsh-0.17/rexecd/Makefile
+@@ -24,7 +24,7 @@ endif
+ CFLAGS += -DRESTRICT_FTP=1
+
+ rexecd: rexecd.o
+- $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
++ $(CC) $^ -o $@ $(LDFLAGS) $(LIBS)
+
+ install: rexecd
+ install -m$(DAEMONMODE) rexecd $(INSTALLROOT)$(SBINDIR)/in.rexecd
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.pam b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.pam
new file mode 100644
index 000000000..072327a76
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.pam
@@ -0,0 +1,10 @@
+#%PAM-1.0
+# For root login to succeed here with pam_securetty, "rsh" must be
+# listed in /etc/securetty.
+auth required pam_nologin.so
+auth required pam_securetty.so
+auth required pam_env.so
+account include common-account
+session optional pam_keyinit.so force revoke
+session include common-session
+session required pam_loginuid.so
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.xinetd.netkit b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.xinetd.netkit
new file mode 100644
index 000000000..a842eb974
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh/rsh.xinetd.netkit
@@ -0,0 +1,21 @@
+# default: off
+# description:
+# The rshd server is a server for the rcmd(3) routine and,
+# consequently, for the rsh(1) program. The server provides
+# remote execution facilities with authentication based on
+# privileged port numbers from trusted hosts.
+#
+service shell
+{
+ socket_type = stream
+ protocol = tcp
+ flags = NAMEINARGS
+ wait = no
+ user = root
+ group = root
+ log_on_success += USERID
+ log_on_failure += USERID
+ server = /usr/sbin/tcpd
+ server_args = /usr/sbin/in.rshd -aL
+ disable = yes
+}
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb
new file mode 100644
index 000000000..3990f7b52
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rsh/netkit-rsh_0.17.bb
@@ -0,0 +1,102 @@
+DESCRIPTION = "netkit-rsh includes the rsh daemon and client."
+SECTION = "net"
+HOMEPAGE="ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
+LICENSE = "BSD-4-Clause"
+DEPENDS = "xinetd libgcrypt"
+
+LIC_FILES_CHKSUM = "file://rsh/rsh.c;endline=32;md5=487b3c637bdc181d32b2a8543d41b606"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-rsh/netkit-rsh_${PV}.orig.tar.gz;name=archive \
+ ${DEBIAN_MIRROR}/main/n/netkit-rsh/netkit-rsh_${PV}-15.diff.gz;name=patch15 \
+ file://rsh-redone_link_order_file.patch \
+ file://no_pam_build_fix.patch \
+ file://rexec.xinetd.netkit \
+ file://rlogin.xinetd.netkit \
+ file://rsh.xinetd.netkit \
+ file://netkit-rsh-0.17-rexec-ipv6.patch \
+ file://fix-host-variable.patch \
+ file://fixup_wait3_api_change.patch \
+"
+
+SRC_URI[archive.md5sum] = "65f5f28e2fe22d9ad8b17bb9a10df096"
+SRC_URI[archive.sha256sum] = "edcac7fa18015f0bc04e573f3f54ae3b638d71335df1ad7dae692779914ad669"
+SRC_URI[patch15.md5sum] = "655efc0d541b03ca5de0ae506c805ea3"
+SRC_URI[patch15.sha256sum] = "2bc071c438e8b0ed42a0bd2db2d8b681b27a1e9b1798694d9874733293bc2aa9"
+
+# Other support files
+PAM_SRC_URI = "file://rexec.pam \
+ file://rlogin.pam \
+ file://rsh.pam \
+"
+SRC_URI += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
+
+inherit pkgconfig
+
+CFLAGS += " -D_GNU_SOURCE -Wno-deprecated-declarations"
+LDFLAGS += " -L${STAGING_LIBDIR} -lutil -lcrypt"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[pam] = " , --without-pam, libpam, libpam"
+
+do_configure () {
+ ./configure --prefix=${prefix} --exec-prefix=${exec_prefix}
+ echo "INSTALLROOT=${D}" > MCONFIG
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
+ echo "USE_PAM=1" >> MCONFIG
+ fi
+
+ # didn't want to patch these next changes
+ sed -i 's/netkit-//' ${S}/rsh/pathnames.h
+ sed -i 's/netkit-//' ${S}/rcp/pathnames.h
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man8
+ install -d ${D}${sysconfdir}/xinetd.d
+
+ oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
+ 'DAEMONMODE=0755' 'MANMODE=0644' \
+ 'SUIDMODE=4755' \
+ 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' install
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
+ install -d ${D}${sysconfdir}/pam.d
+ install -m 0644 debian/hosts.equiv ${D}/${sysconfdir}
+ install -m 0644 ${WORKDIR}/rexec.pam ${D}/${sysconfdir}/pam.d/rexec
+ install -m 0644 ${WORKDIR}/rlogin.pam ${D}/${sysconfdir}/pam.d/rlogin
+ install -m 0644 ${WORKDIR}/rsh.pam ${D}/${sysconfdir}/pam.d/rsh
+ fi
+ cp ${WORKDIR}/rexec.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rexec
+ cp ${WORKDIR}/rlogin.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rlogin
+ cp ${WORKDIR}/rsh.xinetd.netkit ${D}/${sysconfdir}/xinetd.d/rsh
+}
+
+PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
+
+FILES_${PN}-client = "${bindir}/*"
+FILES_${PN}-server = "${sbindir}/* ${sysconfdir}"
+FILES_${PN}-doc = "${mandir}"
+FILES_${PN}-dbg = "${prefix}/src/debug \
+ ${sbindir}/.debug ${bindir}/.debug"
+
+ALTERNATIVE_PRIORITY = "80"
+ALTERNATIVE_${PN}-client = "rcp rexec rlogin rsh"
+ALTERNATIVE_${PN}-server = "rshd rexecd rlogind"
+ALTERNATIVE_LINK_NAME[server] = "${bindir}/rshd"
+ALTERNATIVE_TARGET[rshd] = "${sbindir}/in.rshd"
+ALTERNATIVE_LINK_NAME[rexecd] = "${bindir}/rexecd"
+ALTERNATIVE_TARGET[rexecd] = "${sbindir}/in.rexecd"
+ALTERNATIVE_LINK_NAME[rlogind] = "${bindir}/rlogind"
+ALTERNATIVE_TARGET[rlogind] = "${sbindir}/in.rlogind"
+
+RCONFLICTS_${PN}-server += "inetutils-rshd"
+RPROVIDES_${PN}-server = "rshd"
+
+RDEPENDS_${PN}-server = "xinetd"
+RDEPENDS_${PN}-server += "tcp-wrappers"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers/rpc.rusersd-Makefile-fix-parallel-build-issue.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers/rpc.rusersd-Makefile-fix-parallel-build-issue.patch
new file mode 100644
index 000000000..d85178d71
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers/rpc.rusersd-Makefile-fix-parallel-build-issue.patch
@@ -0,0 +1,30 @@
+From c23cc112a480f90950de5cf1de09b1a7e732bf21 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 15 Dec 2014 18:31:13 -0800
+Subject: [PATCH] rpc.rusersd/Makefile: fix parallel build issue
+
+Fixed:
+rusers.x: No such file or directory
+Makefile:44: recipe for target 'rusers_xdr.c' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ rpc.rusersd/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpc.rusersd/Makefile b/rpc.rusersd/Makefile
+index 792f528..65a424a 100644
+--- a/rpc.rusersd/Makefile
++++ b/rpc.rusersd/Makefile
+@@ -40,5 +40,5 @@ rusers.x:
+ rusers.h: $(RUSERSX) rusers.x
+ $(RPCGEN) -h -o rusers.h rusers.x
+
+-rusers_xdr.c: $(RUSERSX)
++rusers_xdr.c: $(RUSERSX) rusers.x
+ $(RPCGEN) -c -C -o rusers_xdr.c rusers.x
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers_0.17.bb
new file mode 100644
index 000000000..459e39e59
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rusers/netkit-rusers_0.17.bb
@@ -0,0 +1,70 @@
+DESCRIPTION = "netkit-rusers includes rusers - Displays who is logged in to machines on local network \
+ rusersd - Logged in users server"
+HOMEPAGE = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://rusers/rusers.c;beginline=2;endline=3;md5=f4fc634a4ce8c569911196b72b10770e"
+DEPENDS = " tcp-wrappers libtirpc rpcbind"
+
+SRC_URI = "http://http.debian.net/debian/pool/main/n/${BPN}/${BPN}_${PV}.orig.tar.gz;name=archive \
+ http://http.debian.net/debian/pool/main/n/${BPN}/${BPN}_${PV}-8.diff.gz;name=patch8 \
+ file://rpc.rusersd-Makefile-fix-parallel-build-issue.patch \
+"
+
+SRC_URI[archive.md5sum] = "dc99a80b9fde2ab427c874f88f1c1602"
+SRC_URI[archive.sha256sum] = "f00138651865ad2dcfec5dedda0cda403cb80c4ab68efcc3bbccafe198c24b6d"
+SRC_URI[patch8.md5sum] = "1ff498113e0f920d92088092e5570bdc"
+SRC_URI[patch8.sha256sum] = "14882dbdda4e37baa84d55b54b46c7e063a20fc9e04d1be1a2807643cd0f3067"
+
+inherit autotools-brokensep
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
+ echo "USE_GLIBC=1" >> MCONFIG
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man8
+ install -d ${D}${sysconfdir}/xinetd.d
+
+ sed -i 's/install -s/install/' rusers/Makefile
+ sed -i 's/install -s/install/' rup/Makefile
+ sed -i 's/install -s/install/' rpc.rusersd/Makefile
+
+ oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
+ 'DAEMONMODE=0755' 'MANMODE=0644' \
+ 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' install
+
+ # create the xinetd config file
+ cat >rusersd.conf <<EOF
+ service rusersd
+ {
+ disable = yes
+ type = RPC
+ rpc_version = 1-2
+ socket_type = dgram
+ protocol = udp
+ wait = yes
+ user = root
+ server = ${sbindir}/rpc.rusersd
+ }
+EOF
+ install rusersd.conf ${D}/${sysconfdir}/xinetd.d/rusersd
+}
+
+
+INSANE_SKIP_${PN} = "already-stripped"
+
+PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
+FILES_${PN}-client = "${bindir}/*"
+FILES_${PN}-server = "${sbindir}/* ${sysconfdir}"
+FILES_${PN}-doc = "${mandir}"
+FILES_${PN}-dbg = "${prefix}/src/debug \
+ ${bindir}/.debug ${sbindir}/.debug"
+
+RDEPENDS_${PN}-server = "tcp-wrappers xinetd rpcbind"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch
new file mode 100644
index 000000000..b1325b317
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0001-Add-missing-include-path-to-I-options.patch
@@ -0,0 +1,46 @@
+From 55ab6f1389261edff5f4c942bc3b0d8e695856d7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:11:33 -0700
+Subject: [PATCH 1/2] Add missing include path to -I options
+
+Fixes errors like
+| rwho.c:52:10: fatal error: 'protocols/rwhod.h' file not found
+| #include <protocols/rwhod.h>
+| ^~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ rwho/Makefile | 1 +
+ rwhod/Makefile | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/rwho/Makefile b/rwho/Makefile
+index 6f86388..67b28d4 100644
+--- a/rwho/Makefile
++++ b/rwho/Makefile
+@@ -6,6 +6,7 @@ include ../MRULES
+ rwho: rwho.o
+ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@
+
++CFLAGS += -I../include
+ rwho.o: ../version.h
+
+ install: rwho
+diff --git a/rwhod/Makefile b/rwhod/Makefile
+index 772b641..9034218 100644
+--- a/rwhod/Makefile
++++ b/rwhod/Makefile
+@@ -7,6 +7,8 @@ ifneq ($(USE_GLIBC),1)
+ CFLAGS += -D_GNU_SOURCE
+ endif
+
++CFLAGS += -I../include
++
+ OBJS = rwhod.o
+
+ rwhod: $(OBJS)
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch
new file mode 100644
index 000000000..717b4d73f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/0002-Fix-build-issues-found-with-musl.patch
@@ -0,0 +1,71 @@
+From 2108213242638fa355f662382f55495d91301858 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:13:17 -0700
+Subject: [PATCH 2/2] Fix build issues found with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ruptime/ruptime.c | 1 +
+ rwho/rwho.c | 1 +
+ rwhod/rwhod.c | 5 +++--
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ruptime/ruptime.c b/ruptime/ruptime.c
+index 1d4f7b6..f1f043c 100644
+--- a/ruptime/ruptime.c
++++ b/ruptime/ruptime.c
+@@ -53,6 +53,7 @@ char ruptime_rcsid[] =
+ #include <string.h>
+ #include <errno.h>
+ #include <time.h>
++#include <fcntl.h>
+
+ struct hs {
+ char hs_hostname[MAXHOSTNAMELEN];
+diff --git a/rwho/rwho.c b/rwho/rwho.c
+index 63919ac..71aec9e 100644
+--- a/rwho/rwho.c
++++ b/rwho/rwho.c
+@@ -49,6 +49,7 @@ char rcsid[] = "$Id: rwho.c,v 1.7 1999/08/01 20:44:18 dholland Exp $";
+ #include <assert.h>
+ #include <stdio.h>
+ #include <time.h>
++#include <fcntl.h>
+ #include <protocols/rwhod.h>
+
+ #include "../version.h"
+diff --git a/rwhod/rwhod.c b/rwhod/rwhod.c
+index 54498d0..40cabcf 100644
+--- a/rwhod/rwhod.c
++++ b/rwhod/rwhod.c
+@@ -76,6 +76,7 @@ char rcsid[] =
+ #include <grp.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <fcntl.h>
+
+ #include "../version.h"
+
+@@ -102,7 +103,7 @@ struct nlist nl[] = {
+ static void broadcaster(void);
+ static int configure(int s);
+ static int verify(const char *name);
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
++#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
+ static int getloadavg(double ptr[3], int n);
+ #endif
+
+@@ -549,7 +550,7 @@ sendpacket(struct whod *wd)
+ }
+ }
+
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
++#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
+ /*
+ * Taken from:
+ *
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod
new file mode 100755
index 000000000..f6419032e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides: rwhod
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Server for rwho and ruptime services
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+DAEMON=/usr/sbin/rwhod
+PIDFILE=/var/run/rwhod.pid
+CONF_FILE="/etc/default/rwhod"
+DESC="Who daemon "
+# default options. Change them in /etc/default/rwhod
+RWHOD_OPTIONS="-b"
+
+# rwhod init.d script for ntpdc from ntp.isc.org
+test -f $DAEMON || exit 0
+
+# Source function library.
+. /etc/init.d/functions
+
+[ -r $CONF_FILE ] && . $CONF_FILE
+
+startdaemon(){
+ echo -n "Starting $DESC" " rwhod "
+ start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON -- $RWHOD_OPTIONS
+ echo "done"
+}
+stopdaemon(){
+ echo -n "Stopping $DESC" " rwhod "
+ start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
+ echo "done"
+}
+
+case "$1" in
+ start)
+ startdaemon
+ ;;
+ stop)
+ stopdaemon
+ ;;
+ force-reload)
+ stopdaemon
+ startdaemon
+ ;;
+ restart)
+ stopdaemon
+ sleep 1
+ startdaemon
+ ;;
+ reload)
+ stopdaemon
+ sleep 1
+ startdaemon
+ ;;
+ status)
+ status /usr/sbin/rwhod;
+ exit $?
+ ;;
+ *)
+ echo "Usage: rwhod { start | stop | status | restart | reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod.default b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod.default
new file mode 100644
index 000000000..62d3a942d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho/rwhod.default
@@ -0,0 +1,2 @@
+#Options for the rwhod daemon.
+RWHOD_OPTIONS="-b"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb
new file mode 100644
index 000000000..5685f03d6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-rwho/netkit-rwho_0.17.bb
@@ -0,0 +1,85 @@
+DESCRIPTION = "netkit-rwho includes, ruptime rwho and rwhod (Daemon to maintain data for rwho/ruptime)"
+HOMEPAGE = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://rwho/rwho.c;beginline=2;endline=3;md5=5a85f13c0142d72fc378e00f15da5b9e"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}.orig.tar.gz;name=archive \
+ ${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}-13.debian.tar.gz;name=patch13 \
+ file://rwhod \
+ file://rwhod.default \
+ file://0001-Add-missing-include-path-to-I-options.patch \
+ file://0002-Fix-build-issues-found-with-musl.patch \
+ "
+SRC_URI[archive.md5sum] = "0f71620d45d472f89134ba0d74242e75"
+SRC_URI[archive.sha256sum] = "0409e2ce4bfdb2dacb2c193d0fedfc49bb975cb057c5c6b0ffcca603a1188da7"
+SRC_URI[patch13.md5sum] = "82ed5a3c6b0bbf00b36508b9787963b9"
+SRC_URI[patch13.sha256sum] = "53aefa27d98b565bf756db57120c03bd224a238e45699d92076420272a6eba8e"
+
+inherit autotools-brokensep useradd update-rc.d update-alternatives
+
+CFLAGS += " -D_GNU_SOURCE"
+
+debian_do_patch() {
+ cd ${S}
+ while read line; do patch -p1 < ${WORKDIR}/debian/patches/$line; done < ${WORKDIR}/debian/patches/series
+}
+
+python do_patch() {
+ bb.build.exec_func('debian_do_patch', d)
+ bb.build.exec_func('patch_do_patch', d)
+}
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
+}
+
+do_install () {
+ # rwho & ruptime
+ install -d ${D}${bindir}
+ install -d ${D}${mandir}/man1
+ #rwhod
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man8
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
+ sed -i 's/install -s/install/' rwho/Makefile
+ sed -i 's/install -s/install/' ruptime/Makefile
+ sed -i 's/install -s/install/' rwhod/Makefile
+ oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
+ 'DAEMONMODE=0755' 'MANMODE=0644' \
+ 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' install
+
+ install -m 0644 ${WORKDIR}/rwhod.default ${D}${sysconfdir}/default/rwhod
+ install -m 755 ${WORKDIR}/rwhod ${D}${sysconfdir}/init.d
+
+ mkdir -p -m 755 ${D}${localstatedir}/spool/rwho
+ chown -R rwhod ${D}${localstatedir}/spool/rwho
+}
+
+pkg_postinst_${PN}-server() {
+ ${sysconfdir}/init.d/rwhod start
+}
+
+pkg_postrm_${PN}-server() {
+ ${sysconfdir}/init.d/rwhod stop
+}
+
+INITSCRIPT_NAME = "rwhod"
+INITSCRIPT_PARAM = "defaults 85 15"
+
+USERADD_PACKAGES = "${PN}-server"
+GROUPADD_PARAM_${PN}-server = "--system rwhod"
+USERADD_PARAM_${PN}-server = "--system -g rwhod --home-dir ${localstatedir}/spool/rwho \
+ --no-create-home --shell /bin/false rwhod"
+
+INSANE_SKIP_${PN} = "already-stripped"
+
+PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
+FILES_${PN}-client = "${bindir}/*"
+FILES_${PN}-server = "${sbindir}/* ${localstatedir} ${sysconfdir}/default/* ${sysconfdir}/init.d/*"
+FILES_${PN}-doc = "${mandir}"
+FILES_${PN}-dbg = "${prefix}/src/debug \
+ ${bindir}/.debug ${sbindir}/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
new file mode 100644
index 000000000..f2f1b12e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/0001-telnet-telnetd-Fix-print-format-strings.patch
@@ -0,0 +1,66 @@
+From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 10:15:34 -0700
+Subject: [PATCH] telnet/telnetd: Fix print format strings
+
+Fixes build with hardening flags
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ telnet/utilities.cc | 6 +++---
+ telnetd/utility.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/telnet/utilities.cc b/telnet/utilities.cc
+index 66839ab..36f0731 100644
+--- a/telnet/utilities.cc
++++ b/telnet/utilities.cc
+@@ -583,17 +583,17 @@ void printsub(int direction, unsigned char *pointer, int length) {
+ case ENV_VAR:
+ if (pointer[1] == TELQUAL_SEND)
+ goto def_case;
+- fprintf(NetTrace, "\" VAR " + noquote);
++ fprintf(NetTrace, "%s", "\" VAR " + noquote);
+ noquote = 2;
+ break;
+
+ case ENV_VALUE:
+- fprintf(NetTrace, "\" VALUE " + noquote);
++ fprintf(NetTrace, "%s", "\" VALUE " + noquote);
+ noquote = 2;
+ break;
+
+ case ENV_ESC:
+- fprintf(NetTrace, "\" ESC " + noquote);
++ fprintf(NetTrace, "%s", "\" ESC " + noquote);
+ noquote = 2;
+ break;
+
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index 29b7da1..75314cb 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -909,17 +909,17 @@ printsub(char direction, unsigned char *pointer, int length)
+ case ENV_VAR:
+ if (pointer[1] == TELQUAL_SEND)
+ goto def_case;
+- netoprintf("\" VAR " + noquote);
++ netoprintf("%s", "\" VAR " + noquote);
+ noquote = 2;
+ break;
+
+ case ENV_VALUE:
+- netoprintf("\" VALUE " + noquote);
++ netoprintf("%s", "\" VALUE " + noquote);
+ noquote = 2;
+ break;
+
+ case ENV_ESC:
+- netoprintf("\" ESC " + noquote);
++ netoprintf("%s", "\" ESC " + noquote);
+ noquote = 2;
+ break;
+
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/To-aviod-buffer-overflow-in-telnet.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/To-aviod-buffer-overflow-in-telnet.patch
new file mode 100644
index 000000000..7fff8cffc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/To-aviod-buffer-overflow-in-telnet.patch
@@ -0,0 +1,1217 @@
+From f09a6460a62aacb87bb8683d16aa3ce55848bf7e Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 28 Nov 2014 07:06:24 +0900
+Subject: [PATCH 1/2] To aviod buffer overflow in telnet
+
+This patch is from Fedora.
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ telnet/Makefile | 4 +-
+ telnet/commands.cc | 270 +++++++++++++++++++++++++++++++++++-----------------
+ telnet/defines.h | 2 +
+ telnet/externs.h | 7 +-
+ telnet/main.cc | 65 ++++++++++---
+ telnet/netlink.cc | 78 +++++++++------
+ telnet/netlink.h | 7 +-
+ telnet/network.cc | 1 +
+ telnet/proto.h | 2 +-
+ telnet/ring.cc | 2 +-
+ telnet/ring.h | 2 +-
+ telnet/sys_bsd.cc | 11 +++
+ telnet/telnet.1 | 37 +++++--
+ telnet/telnet.cc | 45 +++++----
+ telnet/terminal.cc | 17 +++-
+ telnet/utilities.cc | 2 +
+ 16 files changed, 380 insertions(+), 172 deletions(-)
+
+diff --git a/telnet/Makefile b/telnet/Makefile
+index cef866f..39249e1 100644
+--- a/telnet/Makefile
++++ b/telnet/Makefile
+@@ -7,7 +7,7 @@ include ../MRULES
+
+ # -DAUTHENTICATE
+ CXXFLAGS += -DUSE_TERMIO -DKLUDGELINEMODE
+-LIBS += $(LIBTERMCAP)
++LIBS = $(LIBTERMCAP)
+
+ SRCS = commands.cc main.cc network.cc ring.cc sys_bsd.cc telnet.cc \
+ terminal.cc tn3270.cc utilities.cc genget.cc environ.cc netlink.cc
+@@ -22,7 +22,7 @@ depend:
+ $(CXX) $(CXXFLAGS) -MM $(SRCS) >depend.mk
+
+ install: telnet
+- install -s -m$(BINMODE) telnet $(INSTALLROOT)$(BINDIR)
++ install -m$(BINMODE) telnet $(INSTALLROOT)$(BINDIR)
+ install -m$(MANMODE) telnet.1 $(INSTALLROOT)$(MANDIR)/man1
+
+ clean:
+diff --git a/telnet/commands.cc b/telnet/commands.cc
+index d92bccd..02c593e 100644
+--- a/telnet/commands.cc
++++ b/telnet/commands.cc
+@@ -86,10 +86,6 @@ char cmd_rcsid[] =
+
+ #define HELPINDENT ((int) sizeof ("connect"))
+
+-#ifndef MAXHOSTNAMELEN
+-#define MAXHOSTNAMELEN 64
+-#endif MAXHOSTNAMELEN
+-
+ #if defined(HAS_IPPROTO_IP) && defined(IP_TOS)
+ int tos = -1;
+ #endif /* defined(HAS_IPPROTO_IP) && defined(IP_TOS) */
+@@ -98,7 +94,7 @@ static unsigned long sourceroute(char *arg, char **cpp, int *lenp);
+
+
+ char *hostname;
+-static char _hostname[MAXHOSTNAMELEN];
++static char *_hostname;
+
+ //typedef int (*intrtn_t)(int argc, const char *argv[]);
+
+@@ -161,7 +157,7 @@ class command_entry {
+ assert(argc>=1);
+ if (nargs>=0 && argc!=nargs+1) {
+ fprintf(stderr, "Wrong number of arguments for command.\n");
+- fprintf(stderr, "Try %s ? for help\n", argv[0]);
++ fprintf(stderr, "Try ? %s for help\n", argv[0]);
+ return 0; /* is this right? */
+ }
+ if (nargs==-2) {
+@@ -480,6 +476,7 @@ static int send_wontcmd(const char *name, const char *) {
+ int send_tncmd(int (*func)(int, int), const char *cmd, const char *name) {
+ char **cpp;
+ extern char *telopts[];
++ long opt;
+
+ if (isprefix(name, "help") || isprefix(name, "?")) {
+ register int col, len;
+@@ -506,16 +503,23 @@ int send_tncmd(int (*func)(int, int), const char *cmd, const char *name) {
+ name, cmd);
+ return 0;
+ }
++
++ opt = cpp - telopts;
+ if (cpp == 0) {
+- fprintf(stderr, "'%s': unknown argument ('send %s ?' for help).\n",
++ char *end;
++
++ opt = strtol(name, &end, 10);
++ if (*end || opt < 0 || opt > 255) {
++ fprintf(stderr, "'%s': unknown argument ('send %s ?' for help).\n",
+ name, cmd);
+- return 0;
++ return 0;
++ }
+ }
+ if (!connected) {
+ printf("?Need to be connected first.\n");
+ return 0;
+ }
+- (*func)(cpp - telopts, 1);
++ (*func)(opt, 1);
+ return 1;
+ }
+
+@@ -689,9 +693,9 @@ static struct togglelist Togglelist[] = {
+ "print encryption debugging information" },
+ #endif
+
+- { "skiprc", "don't read ~/.telnetrc file",
++ { "skiprc", "don't read the telnetrc files",
+ NULL, &skiprc,
+- "read ~/.telnetrc file" },
++ "read the telnetrc files" },
+ { "binary",
+ "sending and receiving of binary data",
+ togbinary, NULL,
+@@ -1615,15 +1619,20 @@ void ayt_status(int) {
+ #endif
+
+ int tn(int argc, const char *argv[]) {
+- register struct hostent *host = 0;
+ struct sockaddr_in sn;
+- struct servent *sp = 0;
+ char *srp = NULL;
+ int srlen;
+-
+- const char *cmd, *volatile user = 0;
++ int family = 0;
++ const char *cmd, *volatile user = 0, *srchostp = 0;
+ const char *portp = NULL;
+ char *hostp = NULL;
++ char *resolv_hostp;
++ struct addrinfo hints;
++ struct addrinfo *hostaddr = 0;
++ int res;
++ char name[NI_MAXHOST];
++ char service[NI_MAXSERV];
++ struct addrinfo *tmpaddr;
+
+ /* clear the socket address prior to use */
+ memset(&sn, 0, sizeof(sn));
+@@ -1632,6 +1641,10 @@ int tn(int argc, const char *argv[]) {
+ printf("?Already connected to %s\n", hostname);
+ return 0;
+ }
++ if (_hostname) {
++ delete[] _hostname;
++ _hostname = 0;
++ }
+ if (argc < 2) {
+ (void) strcpy(line, "open ");
+ printf("(to) ");
+@@ -1657,11 +1670,33 @@ int tn(int argc, const char *argv[]) {
+ --argc;
+ continue;
+ }
++ if (strcmp(*argv, "-b") == 0) {
++ --argc; ++argv;
++ if (argc == 0)
++ goto usage;
++ srchostp = *argv++;
++ --argc;
++ continue;
++ }
+ if (strcmp(*argv, "-a") == 0) {
+ --argc; ++argv;
+ autologin = 1;
+ continue;
+ }
++ if (strcmp(*argv, "-6") == 0) {
++ --argc; ++argv;
++#ifdef AF_INET6
++ family = AF_INET6;
++#else
++ puts("IPv6 unsupported");
++#endif
++ continue;
++ }
++ if (strcmp(*argv, "-4") == 0) {
++ --argc; ++argv;
++ family = AF_INET;
++ continue;
++ }
+ if (hostp == 0) {
+ /* this leaks memory - FIXME */
+ hostp = strdup(*argv++);
+@@ -1680,6 +1715,8 @@ int tn(int argc, const char *argv[]) {
+ if (hostp == 0)
+ goto usage;
+
++ resolv_hostp = hostp;
++
+ #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
+ if (hostp[0] == '@' || hostp[0] == '!') {
+ if ((hostname = strrchr(hostp, ':')) == NULL)
+@@ -1696,78 +1733,122 @@ int tn(int argc, const char *argv[]) {
+ } else {
+ sn.sin_addr.s_addr = temp;
+ sn.sin_family = AF_INET;
++ /*
++ * For source route we just make sure to get the IP given
++ * on the command line when looking up the port.
++ */
++ resolv_hostp = inet_ntoa(sn.sin_addr);
+ }
+ }
+- else {
+-#endif
+- if (inet_aton(hostp, &sn.sin_addr)) {
+- sn.sin_family = AF_INET;
+- strcpy(_hostname, hostp);
+- hostname = _hostname;
+- }
+- else {
+- host = gethostbyname(hostp);
+- if (host) {
+- sn.sin_family = host->h_addrtype;
+- if (host->h_length > (int)sizeof(sn.sin_addr)) {
+- host->h_length = sizeof(sn.sin_addr);
+- }
+-#if defined(h_addr) /* In 4.3, this is a #define */
+- memcpy((caddr_t)&sn.sin_addr,
+- host->h_addr_list[0], host->h_length);
+-#else /* defined(h_addr) */
+- memcpy((caddr_t)&sn.sin_addr, host->h_addr, host->h_length);
+-#endif /* defined(h_addr) */
+- strncpy(_hostname, host->h_name, sizeof(_hostname));
+- _hostname[sizeof(_hostname)-1] = '\0';
+- hostname = _hostname;
+- } else {
+- herror(hostp);
+- return 0;
+- }
+- }
+-#if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
+- }
+ #endif
++
++ /* User port or the default name of telnet. */
+ if (portp) {
+ if (*portp == '-') {
+ portp++;
+ telnetport = 1;
+- } else
++ } else {
+ telnetport = 0;
+- sn.sin_port = atoi(portp);
+- if (sn.sin_port == 0) {
+- sp = getservbyname(portp, "tcp");
+- if (sp)
+- sn.sin_port = sp->s_port;
+- else {
+- printf("%s: bad port number\n", portp);
+- return 0;
++ if (*portp >='0' && *portp<='9') {
++ char *end;
++ long int p;
++
++ p=strtol(portp, &end, 10);
++ if (ERANGE==errno && (LONG_MIN==p || LONG_MAX==p)) {
++ fprintf(stderr, "telnet: port %s overflows\n", portp);
++ return 0;
++ } else if (p<=0 || p>=65536) {
++ fprintf(stderr, "telnet: port %s out of range\n", portp);
++ return 0;
++ }
+ }
+- }
+- else {
+- sn.sin_port = htons(sn.sin_port);
+ }
+- }
++ }
+ else {
+- if (sp == 0) {
+- sp = getservbyname("telnet", "tcp");
+- if (sp == 0) {
+- fprintf(stderr, "telnet: tcp/telnet: unknown service\n");
+- return 0;
+- }
+- sn.sin_port = sp->s_port;
+- }
++ portp = "telnet";
+ telnetport = 1;
+ }
+- printf("Trying %s...\n", inet_ntoa(sn.sin_addr));
++
++ /* We only understand SOCK_STREAM sockets. */
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_flags = AI_NUMERICHOST;
++ hints.ai_family = family;
++
++ if (srchostp) {
++ res = getaddrinfo(srchostp, "0", &hints, &hostaddr);
++ if (res) {
++ fprintf(stderr, "telnet: could not resolve %s: %s\n", srchostp,
++ gai_strerror(res));
++ return 0;
++ }
++ hints.ai_family = hostaddr->ai_family;
++ res = nlink.bind(hostaddr);
++ freeaddrinfo(hostaddr);
++ if (res < 0)
++ return 0;
++ }
++
++ /* Resolve both the host and service simultaneously. */
++ res = getaddrinfo(resolv_hostp, portp, &hints, &hostaddr);
++ if (res == EAI_NONAME) {
++ hints.ai_flags = AI_CANONNAME;
++ res = getaddrinfo(resolv_hostp, portp, &hints, &hostaddr);
++ } else if (hostaddr) {
++ hostaddr->ai_canonname = 0;
++ }
++ if (res || !hostaddr) {
++ fprintf(stderr, "telnet: could not resolve %s/%s: %s\n", resolv_hostp, portp, gai_strerror(res));
++ return 0;
++ }
++
++ /* Try to connect to every listed round robin IP. */
++ tmpaddr = hostaddr;
++ errno = 0;
+ do {
+- int x = nlink.connect(debug, host, &sn, srp, srlen, tos);
+- if (!x) return 0;
+- else if (x==1) continue;
++ int x;
++
++ if (!tmpaddr) {
++ if (errno)
++ perror("telnet: Unable to connect to remote host");
++ else
++ fputs("telnet: Unable to connect to remote host: "
++ "Bad port number\n", stderr);
++err:
++ freeaddrinfo(hostaddr);
++ return 0;
++ }
++
++ if (tmpaddr->ai_family == AF_UNIX) {
++nextaddr:
++ tmpaddr = tmpaddr->ai_next;
++ continue;
++ }
++
++ getnameinfo(tmpaddr->ai_addr, tmpaddr->ai_addrlen,
++ name, sizeof(name), service, sizeof(service),
++ NI_NUMERICHOST | NI_NUMERICSERV);
++
++ printf("Trying %s...\n", name);
++ x = nlink.connect(debug, tmpaddr, srp, srlen, tos);
++ if (!x)
++ goto err;
++ else if (x==1)
++ goto nextaddr;
++
+ connected++;
+ } while (connected == 0);
+- cmdrc(hostp, hostname);
++ if (tmpaddr->ai_canonname == 0) {
++ hostname = new char[strlen(hostp)+1];
++ strcpy(hostname, hostp);
++ }
++ else {
++ hostname = new char[strlen(tmpaddr->ai_canonname)+1];
++ strcpy(hostname, tmpaddr->ai_canonname);
++ }
++
++ cmdrc(hostp, hostname, portp);
++ freeaddrinfo(hostaddr);
+ if (autologin && user == NULL) {
+ struct passwd *pw;
+
+@@ -2013,30 +2094,21 @@ static int help(command_table *tab, int argc, const char *argv[]) {
+ return 0;
+ }
+
+-static char *rcname = 0;
+-static char rcbuf[128];
+-
+-void cmdrc(const char *m1, const char *m2) {
++static void readrc(const char *m1, const char *m2, const char *port,
++ const char *rcname)
++{
+ FILE *rcfile;
+ int gotmachine = 0;
+ int l1 = strlen(m1);
+ int l2 = strlen(m2);
+- char m1save[64];
+-
+- if (skiprc) return;
++ int lport = strlen(port);
++ char m1save[l1 + 1];
++ char portsave[lport + 1];
+
+ strcpy(m1save, m1);
+ m1 = m1save;
+-
+- if (rcname == 0) {
+- rcname = getenv("HOME");
+- if (rcname)
+- strcpy(rcbuf, rcname);
+- else
+- rcbuf[0] = '\0';
+- strcat(rcbuf, "/.telnetrc");
+- rcname = rcbuf;
+- }
++ strcpy(portsave, port);
++ port = portsave;
+
+ rcfile = fopen(rcname, "r");
+ if (!rcfile) return;
+@@ -2061,6 +2133,13 @@ void cmdrc(const char *m1, const char *m2) {
+ strncpy(line, &line[7], sizeof(line) - 7);
+ else
+ continue;
++
++ if (line[0] == ':') {
++ if (!strncasecmp(&line[1], port, lport))
++ continue;
++ strncpy(line, &line[lport + 1], sizeof(line) - lport - 1);
++ }
++
+ if (line[0] != ' ' && line[0] != '\t' && line[0] != '\n')
+ continue;
+ gotmachine = 1;
+@@ -2073,6 +2152,21 @@ void cmdrc(const char *m1, const char *m2) {
+ fclose(rcfile);
+ }
+
++void cmdrc(const char *m1, const char *m2, const char *port) {
++ char *rcname = NULL;
++
++ if (skiprc) return;
++
++ readrc(m1, m2, port, "/etc/telnetrc");
++ if (asprintf (&rcname, "%s/.telnetrc", getenv ("HOME")) == -1)
++ {
++ perror ("asprintf");
++ return;
++ }
++ readrc(m1, m2, port, rcname);
++ free (rcname);
++}
++
+ #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
+
+ /*
+diff --git a/telnet/defines.h b/telnet/defines.h
+index 2784400..d5edc46 100644
+--- a/telnet/defines.h
++++ b/telnet/defines.h
+@@ -50,3 +50,5 @@
+ #define MODE_COMMAND_LINE(m) ((m)==-1)
+
+ #define CONTROL(x) ((x)&0x1f) /* CTRL(x) is not portable */
++
++#define MODE_OUT8 0x8000 /* binary mode sans -opost */
+diff --git a/telnet/externs.h b/telnet/externs.h
+index 955df79..0730e8a 100644
+--- a/telnet/externs.h
++++ b/telnet/externs.h
+@@ -48,9 +48,7 @@
+ typedef unsigned char cc_t;
+ #endif
+
+-#ifdef __linux__
+ #include <unistd.h> /* get _POSIX_VDISABLE */
+-#endif
+
+ #ifndef _POSIX_VDISABLE
+ #error "Please fix externs.h to define _POSIX_VDISABLE"
+@@ -60,7 +58,8 @@ typedef unsigned char cc_t;
+
+ extern int autologin; /* Autologin enabled */
+ extern int skiprc; /* Don't process the ~/.telnetrc file */
+-extern int eight; /* use eight bit mode (binary in and/or out */
++extern int eight; /* use eight bit mode (binary in and/or out) */
++extern int binary; /* use binary option (in and/or out) */
+ extern int flushout; /* flush output */
+ extern int connected; /* Are we connected to the other side? */
+ extern int globalmode; /* Mode tty should be in */
+@@ -225,6 +224,8 @@ cc_t *tcval(int);
+
+ //#if 0
+ extern struct termios new_tc;
++extern struct termios old_tc;
++
+
+ #define termEofChar new_tc.c_cc[VEOF]
+ #define termEraseChar new_tc.c_cc[VERASE]
+diff --git a/telnet/main.cc b/telnet/main.cc
+index b67f2ce..b626e54 100644
+--- a/telnet/main.cc
++++ b/telnet/main.cc
+@@ -45,7 +45,10 @@ char main_rcsid[] =
+
+ #include <sys/types.h>
+ #include <getopt.h>
++#include <stdlib.h>
+ #include <string.h>
++#include <netdb.h>
++#include <errno.h>
+
+ #include "ring.h"
+ #include "externs.h"
+@@ -80,12 +83,13 @@ tninit(void)
+ void usage(void) {
+ fprintf(stderr, "Usage: %s %s%s%s%s\n",
+ prompt,
+- " [-8] [-E] [-L] [-a] [-d] [-e char] [-l user] [-n tracefile]",
+- "\n\t",
++ "[-4] [-6] [-8] [-E] [-L] [-a] [-d] [-e char] [-l user]",
++ "\n\t[-n tracefile] [ -b addr ]",
+ #ifdef TN3270
++ "\n\t"
+ "[-noasynch] [-noasynctty] [-noasyncnet] [-r] [-t transcom]\n\t",
+ #else
+- "[-r] ",
++ " [-r] ",
+ #endif
+ "[host-name [port]]"
+ );
+@@ -102,7 +106,8 @@ main(int argc, char *argv[])
+ extern char *optarg;
+ extern int optind;
+ int ch;
+- char *user;
++ char *user, *srcaddr;
++ int family;
+
+ tninit(); /* Clear out things */
+ #if defined(CRAY) && !defined(__STDC__)
+@@ -110,21 +115,38 @@ main(int argc, char *argv[])
+ #endif
+
+ TerminalSaveState();
++ if ((old_tc.c_cflag & (CSIZE|PARENB)) != CS8)
++ eight = 0;
+
+ if ((prompt = strrchr(argv[0], '/'))!=NULL)
+ ++prompt;
+ else
+ prompt = argv[0];
+
+- user = NULL;
++ user = srcaddr = NULL;
++ family = 0;
+
+ rlogin = (strncmp(prompt, "rlog", 4) == 0) ? '~' : _POSIX_VDISABLE;
+ autologin = -1;
+
+- while ((ch = getopt(argc, argv, "8EKLS:X:ade:k:l:n:rt:x")) != EOF) {
++ while ((ch = getopt(argc, argv,
++ "4678EKLS:X:ab:de:k:l:n:rt:x")) != EOF) {
+ switch(ch) {
++ case '4':
++ family = AF_INET;
++ break;
++ case '6':
++#ifdef AF_INET6
++ family = AF_INET6;
++#else
++ fputs("IPv6 unsupported\n", stderr);
++#endif
++ break;
++ case '7':
++ eight = 0; /* 7-bit ouput and input */
++ break;
+ case '8':
+- eight = 3; /* binary output and input */
++ binary = 3; /* binary output and input */
+ break;
+ case 'E':
+ rlogin = escapechar = _POSIX_VDISABLE;
+@@ -133,23 +155,26 @@ main(int argc, char *argv[])
+ //autologin = 0;
+ break;
+ case 'L':
+- eight |= 2; /* binary output only */
++ binary |= 2; /* binary output only */
+ break;
+ case 'S':
+ {
+-#ifdef HAS_GETTOS
+ extern int tos;
++ int num;
+
+- if ((tos = parsetos(optarg, "tcp")) < 0)
++#ifdef HAS_GETTOS
++ if ((num = parsetos(optarg, "tcp")) < 0) {
++#else
++ errno = 0;
++ num = strtol(optarg, 0, 0);
++ if (errno) {
++#endif
+ fprintf(stderr, "%s%s%s%s\n",
+ prompt, ": Bad TOS argument '",
+ optarg,
+ "; will try to use default TOS");
+-#else
+- fprintf(stderr,
+- "%s: Warning: -S ignored, no parsetos() support.\n",
+- prompt);
+-#endif
++ } else
++ tos = num;
+ }
+ break;
+ case 'X':
+@@ -210,6 +235,9 @@ main(int argc, char *argv[])
+ "%s: -x ignored, no encryption support.\n",
+ prompt);
+ break;
++ case 'b':
++ srcaddr = optarg;
++ break;
+ case '?':
+ default:
+ usage();
+@@ -233,6 +261,13 @@ main(int argc, char *argv[])
+ *argp++ = "-l";
+ *argp++ = user;
+ }
++ if (srcaddr) {
++ *argp++ = "-b";
++ *argp++ = srcaddr;
++ }
++ if (family) {
++ *argp++ = family == AF_INET ? "-4" : "-6";
++ }
+ *argp++ = argv[0]; /* host */
+ if (argc > 1)
+ *argp++ = argv[1]; /* port */
+diff --git a/telnet/netlink.cc b/telnet/netlink.cc
+index f439cff..f839747 100644
+--- a/telnet/netlink.cc
++++ b/telnet/netlink.cc
+@@ -79,22 +79,61 @@ void netlink::close(int doshutdown) {
+ shutdown(net, 2);
+ }
+ ::close(net);
++ net = -1;
+ }
+
+-int netlink::connect(int debug, struct hostent *host,
+- struct sockaddr_in *sn,
+- char *srcroute, int srlen, int tos)
++int netlink::bind(struct addrinfo *addr)
+ {
+- int on=1;
++ int res;
++
++ res = socket(addr->ai_family);
++ if (res < 2) {
++ if (res == 1)
++ perror("telnet: socket");
++ return -1;
++ }
++
++ if (::bind(net, addr->ai_addr, addr->ai_addrlen) < 0) {
++ perror("telnet: bind");
++ return -1;
++ }
++
++ return 0;
++}
++
++int netlink::socket(int family)
++{
++ if (this->family != family)
++ close(0);
+
+- net = socket(AF_INET, SOCK_STREAM, 0);
+ if (net < 0) {
+- perror("telnet: socket");
+- return 0;
++ this->family = family;
++ net = ::socket(family, SOCK_STREAM, 0);
++ if (net < 0) {
++ if (errno == EAFNOSUPPORT)
++ return 1;
++ perror("telnet: socket");
++ return 0;
++ }
+ }
+
++ return 2;
++}
++
++int netlink::connect(int debug, struct addrinfo *addr,
++ char *srcroute, int srlen, int tos)
++{
++ int on=1;
++ int res;
++
++ res = socket(addr->ai_family);
++ if (res < 2)
++ return res;
++
+ #if defined(IP_OPTIONS) && defined(HAS_IPPROTO_IP)
+ if (srcroute) {
++ if (addr->ai_family != AF_INET)
++ fputs("Source route is only supported for IPv4\n", stderr);
+ if (setsockopt(net, IPPROTO_IP, IP_OPTIONS, srcroute, srlen) < 0)
+ perror("setsockopt (IP_OPTIONS)");
+ }
+@@ -108,7 +147,7 @@ int netlink::connect(int debug, struct hostent *host,
+ #endif
+ if (tos < 0) tos = 020; /* Low Delay bit */
+ if (tos && (setsockopt(net, IPPROTO_IP, IP_TOS, &tos, sizeof(int)) < 0)
+- && (errno != ENOPROTOOPT))
++ && (errno != ENOPROTOOPT) && (errno != EOPNOTSUPP))
+ perror("telnet: setsockopt (IP_TOS) (ignored)");
+ #endif /* defined(IPPROTO_IP) && defined(IP_TOS) */
+
+@@ -116,27 +155,8 @@ int netlink::connect(int debug, struct hostent *host,
+ perror("setsockopt (SO_DEBUG)");
+ }
+
+- if (::connect(net, (struct sockaddr *)sn, sizeof(*sn)) < 0) {
+-#if defined(h_addr) /* In 4.3, this is a #define */
+- if (host && host->h_addr_list[1]) {
+- int oerrno = errno;
+-
+- fprintf(stderr, "telnet: connect to address %s: ",
+- inet_ntoa(sn->sin_addr));
+- errno = oerrno;
+- perror(NULL);
+- host->h_addr_list++;
+- if (host->h_length > (int)sizeof(sn->sin_addr)) {
+- host->h_length = sizeof(sn->sin_addr);
+- }
+- memcpy(&sn->sin_addr, host->h_addr_list[0], host->h_length);
+- close(net);
+- return 1;
+- }
+-#endif /* defined(h_addr) */
+-
+- perror("telnet: Unable to connect to remote host");
+- return 0;
++ if (::connect(net, addr->ai_addr, addr->ai_addrlen) < 0) {
++ return 1;
+ }
+ return 2;
+ }
+diff --git a/telnet/netlink.h b/telnet/netlink.h
+index 9852b30..0ac8a08 100644
+--- a/telnet/netlink.h
++++ b/telnet/netlink.h
+@@ -1,13 +1,16 @@
+
+ class netlink {
++ private:
++ int family;
+ protected:
+ int net;
+ public:
+ netlink();
+ ~netlink();
+
+- int connect(int debug, struct hostent *host,
+- struct sockaddr_in *sin,
++ int bind(struct addrinfo *hostaddr);
++ int socket(int family);
++ int connect(int debug, struct addrinfo *hostaddr,
+ char *srcroute, int srlen,
+ int tos);
+ void close(int doshutdown);
+diff --git a/telnet/network.cc b/telnet/network.cc
+index 6a2c374..0dcf3e2 100644
+--- a/telnet/network.cc
++++ b/telnet/network.cc
+@@ -40,6 +40,7 @@ char net_rcsid[] =
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
++#include <stdlib.h>
+ #include <errno.h>
+ #include <arpa/telnet.h>
+
+diff --git a/telnet/proto.h b/telnet/proto.h
+index 8be4a39..92f2419 100644
+--- a/telnet/proto.h
++++ b/telnet/proto.h
+@@ -13,7 +13,7 @@ int TerminalWindowSize(long *rows, long *cols);
+ void auth_encrypt_user(char *);
+ void auth_name(unsigned char *, int);
+ void auth_printsub(unsigned char *, int, unsigned char *, int);
+-void cmdrc(const char *m1, const char *m2);
++void cmdrc(const char *, const char *, const char *);
+ void env_init(void);
+ int getconnmode(void);
+ void init_network(void);
+diff --git a/telnet/ring.cc b/telnet/ring.cc
+index be57396..772c6c5 100644
+--- a/telnet/ring.cc
++++ b/telnet/ring.cc
+@@ -165,7 +165,7 @@ int ringbuf::flush() {
+
+ /////////////////////////////////////////////////// supply //////////////
+
+-void ringbuf::printf(const char *format, ...) {
++void ringbuf::xprintf(const char *format, ...) {
+ char xbuf[256];
+ va_list ap;
+ va_start(ap, format);
+diff --git a/telnet/ring.h b/telnet/ring.h
+index 15d3f3f..049377e 100644
+--- a/telnet/ring.h
++++ b/telnet/ring.h
+@@ -83,7 +83,7 @@ class ringbuf {
+ // manual supply
+ void putch(char c) { write(&c, 1); }
+ void write(const char *buffer, int ct);
+- void printf(const char *format, ...);
++ void xprintf(const char *format, ...);
+ int empty_count() { return size - count; }
+
+ // automatic supply
+diff --git a/telnet/sys_bsd.cc b/telnet/sys_bsd.cc
+index 93fba7e..a8c9aab 100644
+--- a/telnet/sys_bsd.cc
++++ b/telnet/sys_bsd.cc
+@@ -189,18 +189,25 @@ void NetSetPgrp(int fd) {
+ * Various signal handling routines.
+ */
+
++#if 0
+ static void deadpeer(int /*sig*/) {
+ setcommandmode();
+ siglongjmp(peerdied, -1);
+ }
++#endif
+
+ static void intr(int /*sig*/) {
+ if (localchars) {
+ intp();
+ }
+ else {
++#if 0
+ setcommandmode();
+ siglongjmp(toplevel, -1);
++#else
++ signal(SIGINT, SIG_DFL);
++ raise(SIGINT);
++#endif
+ }
+ }
+
+@@ -214,6 +221,8 @@ static void intr2(int /*sig*/) {
+ sendabort();
+ return;
+ }
++ signal(SIGQUIT, SIG_DFL);
++ raise(SIGQUIT);
+ }
+
+ #ifdef SIGWINCH
+@@ -238,7 +247,9 @@ void ayt(int sig) {
+ void sys_telnet_init(void) {
+ signal(SIGINT, intr);
+ signal(SIGQUIT, intr2);
++#if 0
+ signal(SIGPIPE, deadpeer);
++#endif
+ #ifdef SIGWINCH
+ signal(SIGWINCH, sendwin);
+ #endif
+diff --git a/telnet/telnet.1 b/telnet/telnet.1
+index 54a47fb..8365e42 100644
+--- a/telnet/telnet.1
++++ b/telnet/telnet.1
+@@ -42,8 +42,9 @@
+ protocol
+ .Sh SYNOPSIS
+ .Nm telnet
+-.Op Fl 8ELadr
++.Op Fl 468ELadr
+ .Op Fl S Ar tos
++.Op Fl b Ar address
+ .Op Fl e Ar escapechar
+ .Op Fl l Ar user
+ .Op Fl n Ar tracefile
+@@ -68,6 +69,10 @@ command implicitly; see the description below.
+ .Pp
+ Options:
+ .Bl -tag -width indent
++.It Fl 4
++Force IPv4 address resolution.
++.It Fl 6
++Force IPv6 address resolution.
+ .It Fl 8
+ Request 8-bit operation. This causes an attempt to negotiate the
+ .Dv TELNET BINARY
+@@ -89,6 +94,8 @@ of the
+ option if supported by the remote system. The username is retrieved
+ via
+ .Xr getlogin 3 .
++.It Fl b Ar address
++Use bind(2) on the local socket to bind it to a specific local address.
+ .It Fl d
+ Sets the initial value of the
+ .Ic debug
+@@ -474,17 +481,29 @@ protocol without making a mess. Protocol negotiation can be forced by
+ placing a dash before the port number.
+ .Pp
+ After establishing a connection, any commands associated with the
+-remote host in the user's
++remote host in
++.Pa /etc/telnetrc
++and the user's
+ .Pa .telnetrc
+-file are executed.
++file are executed, in that order.
+ .Pp
+-The format of the .telnetrc file is as follows: Lines beginning with a
++The format of the telnetrc files is as follows: Lines beginning with a
+ #, and blank lines, are ignored. The rest of the file should consist
+ of hostnames and sequences of
+ .Nm telnet
+ commands to use with that host. Commands should be one per line,
+ indented by whitespace; lines beginning without whitespace are
+-interpreted as hostnames. Upon connecting to a particular host, the
++interpreted as hostnames. Lines beginning with the special hostname
++.Ql DEFAULT
++will apply to all hosts. Hostnames including
++.Ql DEFAULT
++may be followed immediately by a colon and a port number or string.
++If a port is specified it must match exactly with what is specified
++on the command line. If no port was specified on the command line,
++then the value
++.Ql telnet
++is used.
++Upon connecting to a particular host, the
+ commands associated with that host are executed.
+ .It Ic quit
+ Close any open session and exit
+@@ -1184,9 +1203,7 @@ escape sequences are preceded by a '*' to aid in locating them.
+ When the skiprc toggle is
+ .Dv TRUE ,
+ .Tn telnet
+-does not read the
+-.Pa \&.telnetrc
+-file. The initial value for this toggle is
++does not read the telnetrc files. The initial value for this toggle is
+ .Dv FALSE.
+ .It Ic termdata
+ Toggles the display of all terminal data (in hexadecimal format).
+@@ -1239,7 +1256,9 @@ to the other side via the
+ .Dv TELNET ENVIRON
+ option.
+ .Sh FILES
+-.Bl -tag -width ~/.telnetrc -compact
++.Bl -tag -width /etc/telnetrc -compact
++.It Pa /etc/telnetrc
++global telnet startup values
+ .It Pa ~/.telnetrc
+ user customized telnet startup values
+ .El
+diff --git a/telnet/telnet.cc b/telnet/telnet.cc
+index 4fc3b1f..7eca811 100644
+--- a/telnet/telnet.cc
++++ b/telnet/telnet.cc
+@@ -88,7 +88,8 @@ char do_dont_resp[256];
+ char will_wont_resp[256];
+
+ int
+-eight = 0,
++ eight = 3,
++ binary = 0,
+ autologin = 0, /* Autologin anyone? */
+ skiprc = 0,
+ connected,
+@@ -639,14 +640,14 @@ static const char *gettermname(void) {
+ if (resettermname) {
+ resettermname = 0;
+ tname = env_getvalue("TERM", 0);
+- if (!tname || my_setupterm(tname, 1, &err)) {
++ if (!tname /* || my_setupterm(tname, 1, &err) */) {
+ termbuf[0] = 0;
+ tname = "UNKNOWN";
+ }
+ mklist(termbuf, tname, termtypes);
+ next = 0;
+ }
+- if (next==termtypes.num()) next = 0;
++ if (next==termtypes.num()-1) next = 0;
+ return termtypes[next++];
+ }
+ /*
+@@ -681,7 +682,7 @@ static void suboption(void) {
+ }
+ #endif /* TN3270 */
+ name = gettermname();
+- netoring.printf("%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE,
++ netoring.xprintf("%c%c%c%c%s%c%c", IAC, SB, TELOPT_TTYPE,
+ TELQUAL_IS, name, IAC, SE);
+ }
+ break;
+@@ -693,7 +694,7 @@ static void suboption(void) {
+ if (SB_GET() == TELQUAL_SEND) {
+ long oospeed, iispeed;
+ TerminalSpeeds(&iispeed, &oospeed);
+- netoring.printf("%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED,
++ netoring.xprintf("%c%c%c%c%ld,%ld%c%c", IAC, SB, TELOPT_TSPEED,
+ TELQUAL_IS, oospeed, iispeed, IAC, SE);
+ }
+ break;
+@@ -780,7 +781,7 @@ static void suboption(void) {
+ send_wont(TELOPT_XDISPLOC, 1);
+ break;
+ }
+- netoring.printf("%c%c%c%c%s%c%c", IAC, SB, TELOPT_XDISPLOC,
++ netoring.xprintf("%c%c%c%c%s%c%c", IAC, SB, TELOPT_XDISPLOC,
+ TELQUAL_IS, dp, IAC, SE);
+ }
+ break;
+@@ -798,7 +799,7 @@ void lm_will(unsigned char *cmd, int len) {
+ return;
+ }
+
+- netoring.printf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
++ netoring.xprintf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
+ DONT, cmd[0], IAC, SE);
+ }
+
+@@ -815,7 +816,7 @@ void lm_do(unsigned char *cmd, int len) {
+ /*@*/ printf("lm_do: no command!!!\n"); /* Should not happen... */
+ return;
+ }
+- netoring.printf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
++ netoring.xprintf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
+ WONT, cmd[0], IAC, SE);
+ }
+
+@@ -838,7 +839,7 @@ void lm_mode(unsigned char *cmd, int len, int init) {
+ k |= MODE_ACK;
+ }
+
+- netoring.printf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE,
++ netoring.xprintf("%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE, LM_MODE,
+ k, IAC, SE);
+
+ setconnmode(0); /* set changed mode */
+@@ -933,11 +934,11 @@ void slc_mode_import(int def) {
+
+ void slc_import(int def) {
+ if (def) {
+- netoring.printf("%c%c%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
++ netoring.xprintf("%c%c%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
+ LM_SLC, 0, SLC_DEFAULT, 0, IAC, SE);
+ }
+ else {
+- netoring.printf("%c%c%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
++ netoring.xprintf("%c%c%c%c%c%c%c%c%c", IAC, SB, TELOPT_LINEMODE,
+ LM_SLC, 0, SLC_VARIABLE, 0, IAC, SE);
+ }
+ }
+@@ -1050,6 +1051,7 @@ void slc_check(void) {
+
+
+ unsigned char slc_reply[128];
++unsigned char const * const slc_reply_eom = &slc_reply[sizeof(slc_reply)];
+ unsigned char *slc_replyp;
+
+ void slc_start_reply(void) {
+@@ -1061,6 +1063,14 @@ void slc_start_reply(void) {
+ }
+
+ void slc_add_reply(int func, int flags, int value) {
++ /* A sequence of up to 6 bytes my be written for this member of the SLC
++ * suboption list by this function. The end of negotiation command,
++ * which is written by slc_end_reply(), will require 2 additional
++ * bytes. Do not proceed unless there is sufficient space for these
++ * items.
++ */
++ if (&slc_replyp[6+2] > slc_reply_eom)
++ return;
+ if ((*slc_replyp++ = func) == IAC)
+ *slc_replyp++ = IAC;
+ if ((*slc_replyp++ = flags) == IAC)
+@@ -1142,6 +1152,7 @@ void env_opt(unsigned char *buf, int len) {
+ }
+ }
+
++/* OPT_REPLY_SIZE must be a multiple of 2. */
+ #define OPT_REPLY_SIZE 256
+ unsigned char *opt_reply;
+ unsigned char *opt_replyp;
+@@ -1173,6 +1184,7 @@ void env_opt_start_info(void) {
+
+ void env_opt_add(const char *ep) {
+ const char *vp;
++ const unsigned char *tp;
+ unsigned char c;
+
+ if (opt_reply == NULL) /*XXX*/
+@@ -1185,11 +1197,12 @@ void env_opt_add(const char *ep) {
+ return;
+ }
+ vp = env_getvalue(ep, 1);
+- if (opt_replyp + (vp ? strlen(vp) : 0) + strlen(ep) + 6 > opt_replyend)
++ tp = opt_replyp + (vp ? strlen(vp) * 2 : 0) + strlen(ep) * 2 + 6;
++ if (tp > opt_replyend)
+ {
+ register int len;
+- opt_replyend += OPT_REPLY_SIZE;
+- len = opt_replyend - opt_reply;
++ len = ((tp - opt_reply) + OPT_REPLY_SIZE - 1) & ~(OPT_REPLY_SIZE - 1);
++ opt_replyend = opt_reply + len;
+ opt_reply = (unsigned char *)realloc(opt_reply, len);
+ if (opt_reply == NULL) {
+ /*@*/ printf("env_opt_add: realloc() failed!!!\n");
+@@ -1740,8 +1753,8 @@ void telnet(const char * /*user*/) {
+ send_do(TELOPT_STATUS, 1);
+ if (env_getvalue("DISPLAY", 0))
+ send_will(TELOPT_XDISPLOC, 1);
+- if (eight)
+- tel_enter_binary(eight);
++ if (binary)
++ tel_enter_binary(binary);
+ }
+ #endif /* !defined(TN3270) */
+
+diff --git a/telnet/terminal.cc b/telnet/terminal.cc
+index 9eb47ae..764f18f 100644
+--- a/telnet/terminal.cc
++++ b/telnet/terminal.cc
+@@ -45,6 +45,8 @@ char terminal_rcsid[] =
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
+
+ #include "ring.h"
+ #include "defines.h"
+@@ -155,9 +157,11 @@ int getconnmode(void) {
+ if (localflow)
+ mode |= MODE_FLOW;
+
+- if (my_want_state_is_will(TELOPT_BINARY))
++ if ((eight & 1) || my_want_state_is_will(TELOPT_BINARY))
+ mode |= MODE_INBIN;
+
++ if (eight & 2)
++ mode |= MODE_OUT8;
+ if (his_want_state_is_will(TELOPT_BINARY))
+ mode |= MODE_OUTBIN;
+
+@@ -449,10 +453,13 @@ void TerminalNewMode(int f)
+ // breaks SunOS.
+ tmp_tc.c_iflag |= ISTRIP;
+ }
+- if (f & MODE_OUTBIN) {
++ if (f & (MODE_OUTBIN|MODE_OUT8)) {
+ tmp_tc.c_cflag &= ~(CSIZE|PARENB);
+ tmp_tc.c_cflag |= CS8;
+- tmp_tc.c_oflag &= ~OPOST;
++ if (f & MODE_OUTBIN)
++ tmp_tc.c_oflag &= ~OPOST;
++ else
++ tmp_tc.c_oflag |= OPOST;
+ } else {
+ tmp_tc.c_cflag &= ~(CSIZE|PARENB);
+ tmp_tc.c_cflag |= old_tc.c_cflag & (CSIZE|PARENB);
+@@ -468,7 +475,7 @@ void TerminalNewMode(int f)
+
+ #ifdef SIGINFO
+ signal(SIGINFO, ayt);
+-#endif SIGINFO
++#endif /* SIGINFO */
+
+ #if defined(NOKERNINFO)
+ tmp_tc.c_lflag |= NOKERNINFO;
+@@ -504,7 +511,7 @@ void TerminalNewMode(int f)
+
+ #ifdef SIGINFO
+ signal(SIGINFO, ayt_status);
+-#endif SIGINFO
++#endif /* SIGINFO */
+
+ #ifdef SIGTSTP
+ signal(SIGTSTP, SIG_DFL);
+diff --git a/telnet/utilities.cc b/telnet/utilities.cc
+index 0448f0a..66839ab 100644
+--- a/telnet/utilities.cc
++++ b/telnet/utilities.cc
+@@ -47,6 +47,8 @@ char util_rcsid[] =
+ #include <sys/socket.h>
+ #include <unistd.h>
+ #include <ctype.h>
++#include <string.h>
++#include <stdlib.h>
+
+ #include "ring.h"
+ #include "defines.h"
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/Warning-fix-in-the-step-of-install.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/Warning-fix-in-the-step-of-install.patch
new file mode 100644
index 000000000..b9a98f1d6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/Warning-fix-in-the-step-of-install.patch
@@ -0,0 +1,41 @@
+From 31362e4c0d02b4a2b952ad0dd32acfb573c442f3 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 28 Nov 2014 07:17:40 +0900
+Subject: [PATCH 2/2] WARNING Fix and modify "CFLAGS"
+
+WARNING: QA Issue: File '/usr/sbin/in.telnetd' from netkit-telnet was
+already stripped, this will prevent future debugging! [already-stripped]
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ telnetd/Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/telnetd/Makefile b/telnetd/Makefile
+index 72650b4..a4cf9fa 100644
+--- a/telnetd/Makefile
++++ b/telnetd/Makefile
+@@ -9,7 +9,8 @@ include ../MRULES
+ # take out -DPARANOID_TTYS.
+
+ CFLAGS += '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS \
+- -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS
++ -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS \
++ -DLOGIN_WRAPPER=\"/${libdir}/telnetlogin\"
+ # LIBS += $(LIBTERMCAP)
+
+ OBJS = telnetd.o state.o termstat.o slc.o sys_term.o utility.o \
+@@ -27,7 +28,7 @@ $(OBJS): defs.h ext.h pathnames.h telnetd.h logwtmp.h logout.h setproctitle.h
+ telnetd.o: ../version.h
+
+ install: telnetd
+- install -s -m$(DAEMONMODE) telnetd $(INSTALLROOT)$(SBINDIR)/in.telnetd
++ install -m$(DAEMONMODE) telnetd $(INSTALLROOT)$(SBINDIR)/in.telnetd
+ install -m$(MANMODE) issue.net.5 $(INSTALLROOT)$(MANDIR)/man5/
+ install -m$(MANMODE) telnetd.8 $(INSTALLROOT)$(MANDIR)/man8/in.telnetd.8
+ ln -sf in.telnetd.8 $(INSTALLROOT)$(MANDIR)/man8/telnetd.8
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/cross-compile.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/cross-compile.patch
new file mode 100644
index 000000000..b3fe36b7b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/cross-compile.patch
@@ -0,0 +1,48 @@
+To support the cross-compile
+
+Upstream-Status: Pending
+
+make the configure to support the cross-compile, by only to compile the
+target, and not to run it
+
+Roy Li <rongqing.li@windriver.com>
+Index: netkit-telnet-0.17/configure
+===================================================================
+--- netkit-telnet-0.17.orig/configure 2008-11-23 22:01:26.000000000 +0100
++++ netkit-telnet-0.17/configure 2008-11-23 22:05:00.000000000 +0100
+@@ -94,7 +94,7 @@
+ echo -n 'Checking if C compiler works... '
+ if (
+ $CC __conftest.c -o __conftest || exit 1
+- ./__conftest || exit 1
++ # Idiots belong shot! ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ else
+@@ -141,7 +141,7 @@
+ echo -n 'Checking if C++ compiler works... '
+ if (
+ $CXX __conftest.cc -o __conftest || exit 1
+- ./__conftest || exit 1
++ # Iditios belong shot! ./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'yes'
+ else
+@@ -284,7 +284,7 @@
+ else
+ if (
+ $CXX $CXXFLAGS -D__USE_BSD_SIGNAL __conftest.cc -o __conftest || exit 1
+- ./__conftest || exit 1
++ # running still does not work./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo '-D__USE_BSD_SIGNAL'
+ CFLAGS="$CFLAGS -D__USE_BSD_SIGNAL"
+@@ -501,7 +501,7 @@
+ EOF
+ if (
+ $CXX $CXXFLAGS __conftest.cc $LIBBSD -o __conftest || exit 1
+- ./__conftest || exit 1
++ # argh! morons!./__conftest || exit 1
+ ) >/dev/null 2>&1; then
+ echo 'ok'
+ else
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/telnet-xinetd b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/telnet-xinetd
new file mode 100644
index 000000000..12204c71b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/files/telnet-xinetd
@@ -0,0 +1,14 @@
+# default: on
+# description: The telnet server serves telnet sessions; it uses \
+# unencrypted username/password pairs for authentication.
+service telnet
+{
+ flags = REUSE
+ socket_type = stream
+ wait = no
+ user = root
+ server = /usr/sbin/in.telnetd
+ log_on_failure += USERID
+ disable = yes
+}
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
new file mode 100644
index 000000000..807b56644
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-telnet/netkit-telnet_0.17.bb
@@ -0,0 +1,61 @@
+DESCRIPTION = "netkit-telnet includes the telnet daemon and client."
+HOMEPAGE = "http://www.hcs.harvard.edu/~dholland/computers/netkit.html"
+SECTION = "net"
+DEPENDS = "ncurses"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://telnet/telnet.cc;beginline=2;endline=3;md5=780868e7b566313e70cb701560ca95ef"
+
+SRC_URI = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit/${BP}.tar.gz \
+ file://To-aviod-buffer-overflow-in-telnet.patch \
+ file://Warning-fix-in-the-step-of-install.patch \
+ file://telnet-xinetd \
+ file://cross-compile.patch \
+ file://0001-telnet-telnetd-Fix-print-format-strings.patch \
+ "
+
+EXTRA_OEMAKE = "INSTALLROOT=${D} SBINDIR=${sbindir} DAEMONMODE=755 \
+ MANMODE=644 MANDIR=${mandir}"
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ sed -e 's#^CFLAGS=\(.*\)$#CFLAGS= -D_GNU_SOURCE \1#' \
+ -e 's#^CXXFLAGS=\(.*\)$#CXXFLAGS= -D_GNU_SOURCE \1#' \
+ -e 's#^LDFLAGS=.*$#LDFLAGS= ${LDFLAGS}#' \
+ -i MCONFIG
+}
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnet
+ oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' LIBS=-lutil SUB=telnetd
+ oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' SUB=telnetlogin
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 telnet/telnet ${D}${bindir}/telnet.${PN}
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man5
+ install -d ${D}${mandir}/man8
+ oe_runmake SUB=telnetd install
+ rm -rf ${D}${mandir}/man1
+ install -D -m 4750 ${B}/telnetlogin/telnetlogin ${D}/${libdir}/telnetlogin
+ # fix up hardcoded paths
+ sed -i -e 's,/usr/sbin/,${sbindir}/,' ${WORKDIR}/telnet-xinetd
+ install -d ${D}/etc/xinetd.d/
+ install -p -m644 ${WORKDIR}/telnet-xinetd ${D}/etc/xinetd.d/telnet
+}
+
+pkg_postinst_${PN} () {
+#!/bin/sh
+ update-alternatives --install ${bindir}/telnet telnet telnet.${PN} 100
+}
+
+pkg_prerm_${PN} () {
+#!/bin/sh
+ update-alternatives --remove telnet telnet.${PN} 100
+}
+
+SRC_URI[md5sum] = "d6beabaaf53fe6e382c42ce3faa05a36"
+SRC_URI[sha256sum] = "9c80d5c7838361a328fb6b60016d503def9ce53ad3c589f3b08ff71a2bb88e00"
+FILES_${PN} += "${sbindir}/in.* ${libdir}/* ${sysconfdir}/xinetd.d/*"
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch
new file mode 100644
index 000000000..78936907f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/0001-tftp-Include-missing-fcntl.h.patch
@@ -0,0 +1,27 @@
+From fa57e161fc953264a75d50a787cb83983e60acc7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 18:30:02 -0700
+Subject: [PATCH] tftp: Include missing fcntl.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ tftp/main.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tftp/main.c b/tftp/main.c
+index 8c54843..5c9b698 100644
+--- a/tftp/main.c
++++ b/tftp/main.c
+@@ -63,6 +63,7 @@ char main_rcsid[] =
+ #include <ctype.h>
+ #include <netdb.h>
+ #include <unistd.h>
++#include <fcntl.h>
+
+ #include "tftpsubs.h" /* for mysignal() */
+
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/tftp.conf b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/tftp.conf
new file mode 100644
index 000000000..7bc6ca96b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp/tftp.conf
@@ -0,0 +1,11 @@
+service tftp
+{
+ disable = no
+ socket_type = dgram
+ port = 69
+ protocol = udp
+ wait = yes
+ user = nobody
+ server = /usr/sbin/in.tftpd
+ server_args = /tftpboot
+}
diff --git a/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb
new file mode 100644
index 000000000..92c13e850
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-netkit/netkit-tftp/netkit-tftp_0.17.bb
@@ -0,0 +1,55 @@
+SUMMARY = "tftp - Trivial file transfer protocol client"
+SECTION = "net"
+LICENSE = "BSD-4-Clause"
+DEPENDS = "tcp-wrappers"
+
+LIC_FILES_CHKSUM = "file://tftp/tftp.c;beginline=2;endline=3;md5=84d2cfe1e60863a7d82648734ba4d30c"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/${BPN}/${BPN}_${PV}.orig.tar.gz;name=archive \
+ ${DEBIAN_MIRROR}/main/n/${BPN}/${BPN}_${PV}-18.diff.gz;name=patch18 \
+ file://tftp.conf \
+ file://0001-tftp-Include-missing-fcntl.h.patch \
+ "
+
+SRC_URI[archive.md5sum] = "b7262c798e2ff50e29c2ff50dfd8d6a8"
+SRC_URI[archive.sha256sum] = "3a43c0010d4e61f412563fd83769d4667d8b8e82903526d21cb9205fe55ad14d"
+SRC_URI[patch18.md5sum] = "cb29e7a33dd85105ba6e6ec4f971e42c"
+SRC_URI[patch18.sha256sum] = "092437d27b4fa88c044ef6290372fee5ce06d223607f0e22a6e527065c8930e7"
+
+inherit autotools-brokensep
+
+do_configure () {
+ ./configure --prefix=${prefix}
+ echo "CFLAGS=${CFLAGS}" > MCONFIG
+}
+
+do_compile () {
+ oe_runmake 'CC=${CC}' 'LD=${LD}' 'LDFLAGS=${LDFLAGS}' 'CFLAGS=${CFLAGS}'
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -d ${D}${sbindir}
+ install -d ${D}${mandir}/man1
+ install -d ${D}${mandir}/man8
+ install -d ${D}${sysconfdir}/xinetd.d
+
+ sed -i 's/install -s/install/' tftp/Makefile
+ sed -i 's/install -s/install/' tftpd/Makefile
+
+ oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
+ 'DAEMONMODE=0755' 'MANMODE=0644' \
+ 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
+ 'MANDIR=${mandir}' install
+
+ install ${WORKDIR}/tftp.conf ${D}/${sysconfdir}/xinetd.d/tftp
+}
+
+PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
+FILES_${PN}-client = "${bindir}/*"
+FILES_${PN}-server = "${sbindir}/* ${sysconfdir}/xinetd.d/*"
+FILES_${PN}-doc = "${mandir}"
+FILES_${PN}-dbg = "${prefix}/src/debug \
+ ${bindir}/.debug ${sbindir}/.debug"
+
+RDEPENDS_${PN}-server = "tcp-wrappers xinetd"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb b/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb
new file mode 100644
index 000000000..ffdab22cf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/dante/dante_1.4.1.bb
@@ -0,0 +1,49 @@
+SECTION = "console/utils"
+SUMMARY = "A free SOCKS server"
+DESCRIPTION = "Dante consists of a SOCKS server and a SOCKS client,\
+implementing RFC 1928 and related standards. It is a flexible product\
+that can be used to provide convenient and secure network\
+connectivity. Once installed, Dante can in most cases be made\
+transparent to clients, providing functionality somewhat similar to\
+what could be described as a non-transparent Layer 4 router."
+HOMEPAGE = "http://www.inet.no/dante/"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=221118dda731fe93a85d0ed973467249"
+
+SRC_URI = "https://www.inet.no/dante/files/dante-${PV}.tar.gz \
+ "
+SRC_URI[md5sum] = "68c2ce12119e12cea11a90c7a80efa8f"
+SRC_URI[sha256sum] = "b6d232bd6fefc87d14bf97e447e4fcdeef4b28b16b048d804b50b48f261c4f53"
+
+# without --without-gssapi, config.log will contain reference to /usr/lib
+# as a consequence of GSSAPI path being set to /usr by default.
+# --with-gssapi-path=PATH specify gssapi path
+# --without-gssapi disable gssapi support
+# --enable-release build prerelease as full release
+EXTRA_OECONF += "--without-gssapi --sbindir=${bindir}"
+
+DEPENDS += "flex-native bison-native libpam"
+
+inherit autotools-brokensep distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "pam"
+
+EXTRA_AUTORECONF = "-I ${S}"
+
+PACKAGECONFIG[libwrap] = ",--disable-libwrap,tcp-wrappers,libwrap"
+PACKAGECONFIG[krb5] = ",--without-krb5,krb5"
+
+PACKAGECONFIG ??= ""
+
+do_install_append() {
+ install -d ${D}${sysconfdir}
+ cp ${S}/example/sock[sd].conf ${D}${sysconfdir}
+}
+
+PACKAGES =+ "${PN}-sockd ${PN}-libdsocks "
+
+FILES_${PN}-libdsocks = "${libdir}/libdsocks.so"
+FILES_${PN}-sockd = "${bindir}/sockd ${sysconfdir}/sockd.conf"
+
+INSANE_SKIP_${PN}-libdsocks = "dev-elf"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
new file mode 100644
index 000000000..71a5a1ae4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch
@@ -0,0 +1,223 @@
+Replace murmurhash algorithm with Robert Jenkin's hash algorithm
+
+Upstream-Status: Pending
+
+From test result, murmurhash algorithm does not work in big endian
+processor, so replace it with Robert Jenkin's hash which has worked
+in linux kernel for many years and has more adaptability.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ libfdproto/ostr.c | 192 +++++++++++++++++++++--------------------------------
+ 1 file changed, 74 insertions(+), 118 deletions(-)
+
+diff --git a/libfdproto/ostr.c b/libfdproto/ostr.c
+index 8f29b48..ce1f4dd 100644
+--- a/libfdproto/ostr.c
++++ b/libfdproto/ostr.c
+@@ -430,128 +430,84 @@ after_proto:
+
+
+ /********************************************************************************************************/
+-/* Hash function -- credits to Austin Appleby, thank you ^^ */
+-/* See http://murmurhash.googlepages.com for more information on this function */
+-
+-/* the strings are NOT always aligned properly (ex: received in RADIUS message), so we use the aligned MurmurHash2 function as needed */
+-#define _HASH_MIX(h,k,m) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+-uint32_t fd_os_hash ( uint8_t * string, size_t len )
++/*
++ * Robert Jenkin's hash function.
++ * http://burtleburtle.net/bob/hash/evahash.html
++ * This is in the public domain.
++ */
++#define mix(a, b, c) \
++ do { \
++ a = a - b; a = a - c; a = a ^ (c >> 13); \
++ b = b - c; b = b - a; b = b ^ (a << 8); \
++ c = c - a; c = c - b; c = c ^ (b >> 13); \
++ a = a - b; a = a - c; a = a ^ (c >> 12); \
++ b = b - c; b = b - a; b = b ^ (a << 16); \
++ c = c - a; c = c - b; c = c ^ (b >> 5); \
++ a = a - b; a = a - c; a = a ^ (c >> 3); \
++ b = b - c; b = b - a; b = b ^ (a << 10); \
++ c = c - a; c = c - b; c = c ^ (b >> 15); \
++ } while (0)
++
++unsigned hash_rjenkins(const char *str, unsigned length)
+ {
+- uint32_t hash = len;
+- uint8_t * data = string;
+-
+- const unsigned int m = 0x5bd1e995;
+- const int r = 24;
+- int align = (long)string & 3;
+-
+- if (!align || (len < 4)) {
+- /* In case data is aligned, MurmurHash2 function */
+- while(len >= 4)
+- {
+- /* Mix 4 bytes at a time into the hash */
+- uint32_t k = *(uint32_t *)data; /* We don't care about the byte order */
+-
+- _HASH_MIX(hash, k, m);
+-
+- data += 4;
+- len -= 4;
+- }
+-
+- /* Handle the last few bytes of the input */
+- switch(len) {
+- case 3: hash ^= data[2] << 16;
+- case 2: hash ^= data[1] << 8;
+- case 1: hash ^= data[0];
+- hash *= m;
+- }
+-
+- } else {
+- /* Unaligned data, use alignment-safe slower version */
+-
+- /* Pre-load the temp registers */
+- uint32_t t = 0, d = 0;
+- switch(align)
+- {
+- case 1: t |= data[2] << 16;
+- case 2: t |= data[1] << 8;
+- case 3: t |= data[0];
+- }
+- t <<= (8 * align);
+-
+- data += 4-align;
+- len -= 4-align;
+-
+- /* From this point, "data" can be read by chunks of 4 bytes */
+-
+- int sl = 8 * (4-align);
+- int sr = 8 * align;
+-
+- /* Mix */
+- while(len >= 4)
+- {
+- uint32_t k;
+-
+- d = *(unsigned int *)data;
+- k = (t >> sr) | (d << sl);
+-
+- _HASH_MIX(hash, k, m);
+-
+- t = d;
+-
+- data += 4;
+- len -= 4;
+- }
+-
+- /* Handle leftover data in temp registers */
+- d = 0;
+- if(len >= align)
+- {
+- uint32_t k;
+-
+- switch(align)
+- {
+- case 3: d |= data[2] << 16;
+- case 2: d |= data[1] << 8;
+- case 1: d |= data[0];
+- }
+-
+- k = (t >> sr) | (d << sl);
+- _HASH_MIX(hash, k, m);
+-
+- data += align;
+- len -= align;
+-
+- /* Handle tail bytes */
+-
+- switch(len)
+- {
+- case 3: hash ^= data[2] << 16;
+- case 2: hash ^= data[1] << 8;
+- case 1: hash ^= data[0];
+- hash *= m;
+- };
+- }
+- else
+- {
+- switch(len)
+- {
+- case 3: d |= data[2] << 16;
+- case 2: d |= data[1] << 8;
+- case 1: d |= data[0];
+- case 0: hash ^= (t >> sr) | (d << sl);
+- hash *= m;
+- }
+- }
+-
++ const unsigned char *k = (const unsigned char *)str;
++ uint32_t a, b, c; /* the internal state */
++ uint32_t len; /* how many key bytes still need mixing */
++
++ /* Set up the internal state */
++ len = length;
++ a = 0x9e3779b9; /* the golden ratio; an arbitrary value */
++ b = a;
++ c = 0; /* variable initialization of internal state */
++
++ /* handle most of the key */
++ while (len >= 12) {
++ a = a + (k[0] + ((uint32_t)k[1] << 8) + ((uint32_t)k[2] << 16) +
++ ((uint32_t)k[3] << 24));
++ b = b + (k[4] + ((uint32_t)k[5] << 8) + ((uint32_t)k[6] << 16) +
++ ((uint32_t)k[7] << 24));
++ c = c + (k[8] + ((uint32_t)k[9] << 8) + ((uint32_t)k[10] << 16) +
++ ((uint32_t)k[11] << 24));
++ mix(a, b, c);
++ k = k + 12;
++ len = len - 12;
++ }
+
++ /* handle the last 11 bytes */
++ c = c + length;
++ switch (len) { /* all the case statements fall through */
++ case 11:
++ c = c + ((uint32_t)k[10] << 24);
++ case 10:
++ c = c + ((uint32_t)k[9] << 16);
++ case 9:
++ c = c + ((uint32_t)k[8] << 8);
++ /* the first byte of c is reserved for the length */
++ case 8:
++ b = b + ((uint32_t)k[7] << 24);
++ case 7:
++ b = b + ((uint32_t)k[6] << 16);
++ case 6:
++ b = b + ((uint32_t)k[5] << 8);
++ case 5:
++ b = b + k[4];
++ case 4:
++ a = a + ((uint32_t)k[3] << 24);
++ case 3:
++ a = a + ((uint32_t)k[2] << 16);
++ case 2:
++ a = a + ((uint32_t)k[1] << 8);
++ case 1:
++ a = a + k[0];
++ /* case 0: nothing left to add */
+ }
++ mix(a, b, c);
+
+- /* Do a few final mixes of the hash to ensure the last few
+- bytes are well-incorporated. */
+- hash ^= hash >> 13;
+- hash *= m;
+- hash ^= hash >> 15;
++ return c;
++}
+
+- return hash;
++uint32_t fd_os_hash ( uint8_t * string, size_t len )
++{
++ return hash_rjenkins(string, len);
+ }
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freeDiameter.conf b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freeDiameter.conf
new file mode 100644
index 000000000..7b56d748a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freeDiameter.conf
@@ -0,0 +1,250 @@
+# This is a sample configuration file for freeDiameter daemon.
+
+# Most of the options can be omitted, as they default to reasonable values.
+# Only TLS-related options must be configured properly in usual setups.
+
+# It is possible to use "include" keyword to import additional files
+# e.g.: include "/etc/freeDiameter.d/*.conf"
+# This is exactly equivalent as copy & paste the content of the included file(s)
+# where the "include" keyword is found.
+
+
+##############################################################
+## Peer identity and realm
+
+# The Diameter Identity of this daemon.
+# This must be a valid FQDN that resolves to the local host.
+# Default: hostname's FQDN
+#Identity = "aaa.koganei.freediameter.net";
+
+# The Diameter Realm of this daemon.
+# Default: the domain part of Identity (after the first dot).
+#Realm = "koganei.freediameter.net";
+
+##############################################################
+## Transport protocol configuration
+
+# The port this peer is listening on for incoming connections (TCP and SCTP).
+# Default: 3868. Use 0 to disable.
+#Port = 3868;
+
+# The port this peer is listening on for incoming TLS-protected connections (TCP and SCTP).
+# See TLS_old_method for more information about TLS flavours.
+# Note: we use TLS/SCTP instead of DTLS/SCTP at the moment. This will change in future version of freeDiameter.
+# Default: 5868. Use 0 to disable.
+#SecPort = 5868;
+
+# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed
+# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the
+# CER/CEA exchange on a dedicated secure port.
+# This parameter only affects outgoing connections.
+# The setting can be also defined per-peer (see Peers configuration section).
+# Default: use RFC6733 method with separate port for TLS.
+#TLS_old_method;
+
+# Disable use of TCP protocol (only listen and connect over SCTP)
+# Default : TCP enabled
+#No_TCP;
+
+# Disable use of SCTP protocol (only listen and connect over TCP)
+# Default : SCTP enabled
+#No_SCTP;
+# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option.
+
+# Prefer TCP instead of SCTP for establishing new connections.
+# This setting may be overwritten per peer in peer configuration blocs.
+# Default : SCTP is attempted first.
+#Prefer_TCP;
+
+# Default number of streams per SCTP associations.
+# This setting may be overwritten per peer basis.
+# Default : 30 streams
+#SCTP_streams = 30;
+
+##############################################################
+## Endpoint configuration
+
+# Disable use of IP addresses (only IPv6)
+# Default : IP enabled
+#No_IP;
+
+# Disable use of IPv6 addresses (only IP)
+# Default : IPv6 enabled
+#No_IPv6;
+
+# Specify local addresses the server must bind to
+# Default : listen on all addresses available.
+#ListenOn = "202.249.37.5";
+#ListenOn = "2001:200:903:2::202:1";
+#ListenOn = "fe80::21c:5ff:fe98:7d62%eth0";
+
+
+##############################################################
+## Server configuration
+
+# How many Diameter peers are allowed to be connecting at the same time ?
+# This parameter limits the number of incoming connections from the time
+# the connection is accepted until the first CER is received.
+# Default: 5 unidentified clients in paralel.
+#ThreadsPerServer = 5;
+
+##############################################################
+## TLS Configuration
+
+# TLS is managed by the GNUTLS library in the freeDiameter daemon.
+# You may find more information about parameters and special behaviors
+# in the relevant documentation.
+# http://www.gnu.org/software/gnutls/manual/
+
+# Credentials of the local peer
+# The X509 certificate and private key file to use for the local peer.
+# The files must contain PKCS-1 encoded RSA key, in PEM format.
+# (These parameters are passed to gnutls_certificate_set_x509_key_file function)
+# Default : NO DEFAULT
+#TLS_Cred = "<x509 certif file.PEM>" , "<x509 private key file.PEM>";
+#TLS_Cred = "/etc/ssl/certs/freeDiameter.pem", "/etc/ssl/private/freeDiameter.key";
+
+# Certificate authority / trust anchors
+# The file containing the list of trusted Certificate Authorities (PEM list)
+# (This parameter is passed to gnutls_certificate_set_x509_trust_file function)
+# The directive can appear several times to specify several files.
+# Default : GNUTLS default behavior
+#TLS_CA = "<file.PEM>";
+
+# Certificate Revocation List file
+# The information about revoked certificates.
+# The file contains a list of trusted CRLs in PEM format. They should have been verified before.
+# (This parameter is passed to gnutls_certificate_set_x509_crl_file function)
+# Note: openssl CRL format might have interoperability issue with GNUTLS format.
+# Default : GNUTLS default behavior
+#TLS_CRL = "<file.PEM>";
+
+# GNU TLS Priority string
+# This string allows to configure the behavior of GNUTLS key exchanges
+# algorithms. See gnutls_priority_init function documentation for information.
+# You should also refer to the Diameter required TLS support here:
+# http://tools.ietf.org/html/rfc6733#section-13.1
+# Default : "NORMAL"
+# Example: TLS_Prio = "NONE:+VERS-TLS1.1:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL";
+#TLS_Prio = "NORMAL";
+
+# Diffie-Hellman parameters size
+# Set the number of bits for generated DH parameters
+# Valid value should be 768, 1024, 2048, 3072 or 4096.
+# (This parameter is passed to gnutls_dh_params_generate2 function,
+# it usually should match RSA key size)
+# Default : 1024
+#TLS_DH_Bits = 1024;
+
+# Alternatively, you can specify a file to load the PKCS#3 encoded
+# DH parameters directly from. This accelerates the daemon start
+# but is slightly less secure. If this file is provided, the
+# TLS_DH_Bits parameters has no effect.
+# Default : no default.
+#TLS_DH_File = "<file.PEM>";
+
+
+##############################################################
+## Timers configuration
+
+# The Tc timer of this peer.
+# It is the delay before a new attempt is made to reconnect a disconnected peer.
+# The value is expressed in seconds. The recommended value is 30 seconds.
+# Default: 30
+#TcTimer = 30;
+
+# The Tw timer of this peer.
+# It is the delay before a watchdog message is sent, as described in RFC 3539.
+# The value is expressed in seconds. The default value is 30 seconds. Value must
+# be greater or equal to 6 seconds. See details in the RFC.
+# Default: 30
+#TwTimer = 30;
+
+##############################################################
+## Applications configuration
+
+# Disable the relaying of Diameter messages?
+# For messages not handled locally, the default behavior is to forward the
+# message to another peer if any is available, according to the routing
+# algorithms. In addition the "0xffffff" application is advertised in CER/CEA
+# exchanges.
+# Default: Relaying is enabled.
+#NoRelay;
+
+# Number of server threads that can handle incoming messages at the same time.
+# Default: 4
+#AppServThreads = 4;
+
+# Other applications are configured by loaded extensions.
+
+##############################################################
+## Extensions configuration
+
+# The freeDiameter framework merely provides support for
+# Diameter Base Protocol. The specific application behaviors,
+# as well as advanced functions, are provided
+# by loadable extensions (plug-ins).
+# These extensions may in addition receive the name of a
+# configuration file, the format of which is extension-specific.
+#
+# Format:
+#LoadExtension = "/path/to/extension" [ : "/optional/configuration/file" ] ;
+#
+# Examples:
+#LoadExtension = "extensions/sample.fdx";
+#LoadExtension = "extensions/sample.fdx":"conf/sample.conf";
+
+# Extensions are named as follow:
+# dict_* for extensions that add content to the dictionary definitions.
+# dbg_* for extensions useful only to retrieve more information on the framework execution.
+# acl_* : Access control list, to control which peers are allowed to connect.
+# rt_* : routing extensions that impact how messages are forwarded to other peers.
+# app_* : applications, these extensions usually register callbacks to handle specific messages.
+# test_* : dummy extensions that are useful only in testing environments.
+
+
+# The dbg_msg_dump.fdx extension allows you to tweak the way freeDiameter displays some
+# information about some events. This extension does not actually use a configuration file
+# but receives directly a parameter in the string passed to the extension. Here are some examples:
+## LoadExtension = "dbg_msg_dumps.fdx" : "0x1111"; # Removes all default hooks, very quiet even in case of errors.
+## LoadExtension = "dbg_msg_dumps.fdx" : "0x2222"; # Display all events with few details.
+## LoadExtension = "dbg_msg_dumps.fdx" : "0x0080"; # Dump complete information about sent and received messages.
+# The four digits respectively control: connections, routing decisions, sent/received messages, errors.
+# The values for each digit are:
+# 0 - default - keep the default behavior
+# 1 - quiet - remove any specific log
+# 2 - compact - display only a summary of the information
+# 4 - full - display the complete information on a single long line
+# 8 - tree - display the complete information in an easier to read format spanning several lines.
+
+
+##############################################################
+## Peers configuration
+
+# The local server listens for incoming connections. By default,
+# all unknown connecting peers are rejected. Extensions can override this behavior (e.g., acl_wl).
+#
+# In addition to incoming connections, the local peer can
+# be configured to establish and maintain connections to some
+# Diameter nodes and allow connections from these nodes.
+# This is achieved with the ConnectPeer directive described below.
+#
+# Note that the configured Diameter Identity MUST match
+# the information received inside CEA, or the connection will be aborted.
+#
+# Format:
+#ConnectPeer = "diameterid" [ { parameter1; parameter2; ...} ] ;
+# Parameters that can be specified in the peer's parameter list:
+# No_TCP; No_SCTP; No_IP; No_IPv6; Prefer_TCP; TLS_old_method;
+# No_TLS; # assume transparent security instead of TLS. DTLS is not supported yet (will change in future versions).
+# Port = 5868; # The port to connect to
+# TcTimer = 30;
+# TwTimer = 30;
+# ConnectTo = "202.249.37.5";
+# ConnectTo = "2001:200:903:2::202:1";
+# TLS_Prio = "NORMAL";
+# Realm = "realm.net"; # Reject the peer if it does not advertise this realm.
+# Examples:
+#ConnectPeer = "aaa.wide.ad.jp";
+#ConnectPeer = "old.diameter.serv" { TcTimer = 60; TLS_old_method; No_SCTP; Port=3868; } ;
+##############################################################
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.init b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.init
new file mode 100755
index 000000000..e63a42a7c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.init
@@ -0,0 +1,72 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: freediameter
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Short-Description: Start freeDiameter daemon at boot time
+# Description: Start the freeDiameter daemon at boot time.
+# freeDiameter is an extensible implementation of the Diameter protocol,
+# designed for Authentication, Authorization and Accounting. Diameter is
+# an evolution of the RADIUS protocol.
+### END INIT INFO#
+DAEMON=/usr/bin/freeDiameterd
+CONF=/etc/freeDiameter/freeDiameter.conf
+NAME=freediameter
+DESC="freeDiameter daemon"
+
+. /etc/init.d/functions
+start() {
+ [ -x $DAEMON ] || exit 5
+ echo -n $"Starting $DAEMON: "
+ start-stop-daemon -S -b -x ${DAEMON} && success || failure
+ retval=$?
+ echo ""
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog: "
+ start-stop-daemon -K -x $DAEMON
+ retval=$?
+ echo ""
+ return $retval
+}
+
+restart() {
+ stop
+ sleep 3
+ start
+}
+
+rh_status() {
+ status $DAEMON
+}
+
+rh_status_q() {
+ rh_status > /dev/null 2>&1
+}
+
+case "$1" in
+ start)
+ rh_status_q && exit 0
+ start
+ ;;
+ stop)
+ rh_status_q || exit 0
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ rh_status
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|status|restart}"
+ exit 2
+esac
+
+exit $?
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service
new file mode 100644
index 000000000..514481b43
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/freediameter.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=freediameter daemon
+After=network.target
+
+[Service]
+Type=simple
+PIDFile=/var/run/freediameter.pid
+ExecStart=@BINDIR@/freeDiameterd
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/install_test.patch b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/install_test.patch
new file mode 100644
index 000000000..151037d69
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/install_test.patch
@@ -0,0 +1,22 @@
+CMakeLists: add an option to install tests
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Original author: Yao Zhao <yao.zhao@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index da8da1b..de04059 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -113,4 +113,9 @@ ENDFOREACH( TEST )
+ ####
+ ## INSTALL section ##
+
+-# we do not install the tests
++# install the tests
++SET(INSTALL_TEST_SUFFIX /opt/${FD_PROJECT_NAME}-tests CACHE PATH "Directory where the test binary is installed.")
++
++INSTALL(TARGETS ${TEST_LIST}
++ RUNTIME DESTINATION ${INSTALL_TEST_SUFFIX}
++ COMPONENT freeDiameter-common)
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
new file mode 100644
index 000000000..ea857af7d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/pass-ptest-env.patch
@@ -0,0 +1,72 @@
+freediameter ptest cases testmesg_stress.c and testloadext.c need load
+extensions both build time and runtime. Then they search extensions with
+build directory that causes runtime failures.
+
+Pass an environment variable to define runtime extension path.
+
+Upstream-Status: Inappropriate [OE ptest specific]
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff -Nur freeDiameter-1.2.0.orig/tests/testloadext.c freeDiameter-1.2.0/tests/testloadext.c
+--- freeDiameter-1.2.0.orig/tests/testloadext.c 2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testloadext.c 2014-02-19 20:08:03.871403924 +0800
+@@ -49,7 +49,7 @@
+ {
+ DIR *dir;
+ struct dirent *dp;
+- char fullname[512];
++ char fullname[1024];
+ int pathlen;
+
+ /* First, initialize the daemon modules */
+@@ -57,11 +57,16 @@
+ CHECK( 0, fd_queues_init() );
+ CHECK( 0, fd_msg_init() );
+ CHECK( 0, fd_rtdisp_init() );
+-
++
++ char *ext_dir = getenv("EXTENSIONS_DIR");
++ if (ext_dir)
++ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++ else
++ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ /* Find all extensions which have been compiled along the test */
+- TRACE_DEBUG(INFO, "Loading from: '%s'", BUILD_DIR "/extensions");
+- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+
+ while ((dp = readdir (dir)) != NULL) {
+ char * dot = strrchr(dp->d_name, '.');
+diff -Nur freeDiameter-1.2.0.orig/tests/testmesg_stress.c freeDiameter-1.2.0/tests/testmesg_stress.c
+--- freeDiameter-1.2.0.orig/tests/testmesg_stress.c 2014-02-19 17:33:24.785405032 +0800
++++ freeDiameter-1.2.0/tests/testmesg_stress.c 2014-02-19 20:08:03.928403924 +0800
+@@ -67,15 +67,20 @@
+ {
+ DIR *dir;
+ struct dirent *dp;
+- char fullname[512];
++ char fullname[1024];
+ int pathlen;
+ struct fd_list all_extensions = FD_LIST_INITIALIZER(all_extensions);
+ struct fd_list ext_with_depends = FD_LIST_INITIALIZER(ext_with_depends);
+
++ char *ext_dir = getenv("EXTENSIONS_DIR");
++ if (ext_dir)
++ pathlen = snprintf(fullname, sizeof(fullname), "%s", ext_dir);
++ else
++ pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++
+ /* Find all extensions which have been compiled along the test */
+- LOG_D("Loading %s*.fdx from: '%s'", BUILD_DIR "/extensions", prefix ?: "");
+- CHECK( 0, (dir = opendir (BUILD_DIR "/extensions")) == NULL ? 1 : 0 );
+- pathlen = snprintf(fullname, sizeof(fullname), BUILD_DIR "/extensions/");
++ TRACE_DEBUG(INFO, "Loading from: '%s'", fullname);
++ CHECK( 0, (dir = opendir (fullname)) == NULL ? 1 : 0 );
+
+ while ((dp = readdir (dir)) != NULL) {
+ char * dot = strrchr(dp->d_name, '.');
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/run-ptest b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/run-ptest
new file mode 100644
index 000000000..d0ca8d962
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/files/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if ! lsmod | grep -q sctp && ! modprobe sctp 2>/dev/null; then
+ echo "Couldn't load kernel module sctp."
+ echo "Test cases testsctp and testcnx will fail."
+ echo
+fi
+
+export EXTENSIONS_DIR=$EXTENSIONS_DIR
+cmake -E cmake_echo_color --cyan "Running tests..."
+ctest --force-new-ctest-process
diff --git a/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb b/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
new file mode 100644
index 000000000..c556eb48e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/freediameter/freediameter_1.2.1.bb
@@ -0,0 +1,138 @@
+SUMMARY = "An open source implementation of the diameter protocol"
+DESCRIPTION = "\
+freeDiameter is an open source Diameter protocol implementation \
+(RFC3588). It provides an extensible platform for deploying a \
+Diameter network for your Authentication, Authorization and \
+Accounting needs."
+
+HOMEPAGE = "http://www.freediameter.net"
+
+DEPENDS = "flex bison cmake-native libgcrypt gnutls libidn lksctp-tools virtual/kernel"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+fd_pkgname = "freeDiameter"
+
+SRC_URI = "\
+ http://www.freediameter.net/hg/${fd_pkgname}/archive/${PV}.tar.gz;downloadfilename=${fd_pkgname}-${PV}.tar.gz \
+ file://Replace-murmurhash-algorithm-with-Robert-Jenkin-s-ha.patch \
+ file://freediameter.service \
+ file://freediameter.init \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'file://install_test.patch file://run-ptest file://pass-ptest-env.patch', '', d)} \
+ file://freeDiameter.conf \
+ "
+
+SRC_URI[md5sum] = "61b1062aa144b5f12eed514611e6d697"
+SRC_URI[sha256sum] = "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097"
+
+S = "${WORKDIR}/${fd_pkgname}-${PV}"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=892b2ed6ae815488a08416ff7ee74a35"
+
+PTEST_PATH = "${libdir}/${fd_pkgname}/ptest"
+
+inherit cmake pkgconfig update-rc.d ptest systemd
+
+EXTRA_OECMAKE = " \
+ -DDEFAULT_CONF_PATH:PATH=${sysconfdir}/${fd_pkgname} \
+ -DBUILD_DBG_MONITOR:BOOL=ON \
+ -DBUILD_TEST_APP:BOOL=ON \
+ -DBUILD_TESTING:BOOL=ON \
+ -DBUILD_APP_RADGW:BOOL=ON \
+ -DBUILD_APP_REDIRECT:BOOL=ON \
+ -DBUILD_TEST_ACCT:BOOL=ON \
+ -DBUILD_TEST_NETEMUL:BOOL=ON \
+ -DBUILD_TEST_RT_ANY:BOOL=ON \
+ -DINSTALL_LIBRARY_SUFFIX:PATH=${baselib} \
+ -DINSTALL_EXTENSIONS_SUFFIX:PATH=${baselib}/${fd_pkgname} \
+ -DINSTALL_TEST_SUFFIX:PATH=${PTEST_PATH}-tests \
+ -DCMAKE_SKIP_RPATH:BOOL=ON \
+"
+# INSTALL_LIBRARY_SUFFIX is relative to CMAKE_INSTALL_PREFIX
+# specify it on cmd line will fix the SET bug in CMakeList.txt
+
+# -DBUILD_APP_ACCT:BOOL=ON This needs POSTGRESQL support
+
+# -DBUILD_APP_DIAMEAP:BOOL=ON -DBUILD_APP_SIP:BOOL=ON -DBUILD_TEST_SIP:BOOL=ON
+# These need MySQL support
+
+# -DBUILD_DBG_INTERACTIVE:BOOL=ON This needs SWIG support
+
+# -DALL_EXTENSIONS=ON will enable all
+
+FD_KEY ?="${BPN}.key"
+FD_PEM ?= "${BPN}.pem"
+FD_CA ?= "${BPN}.pem"
+FD_DH_PEM ?= "${BPN}-dh.pem"
+FD_HOSTNAME ?= "${MACHINE}"
+FD_REALM ?= "openembedded.org"
+
+do_install_append() {
+ # install the sample configuration files
+ install -d -m 0755 ${D}${sysconfdir}/${fd_pkgname}
+ for i in ${S}/doc/*.conf.sample; do
+ install -m 0644 $i ${D}${sysconfdir}/${fd_pkgname}/
+ done
+ mv ${D}${sysconfdir}/${fd_pkgname}/freediameter.conf.sample \
+ ${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf.sample
+ install -d ${D}${sysconfdir}/freeDiameter
+ install ${WORKDIR}/freeDiameter.conf ${D}${sysconfdir}/${fd_pkgname}/freeDiameter.conf
+
+ # install daemon init related files
+ install -d -m 0755 ${D}${sysconfdir}/default
+ install -d -m 0755 ${D}${sysconfdir}/init.d
+ install -m 0644 ${S}/contrib/debian/freediameter-daemon.default \
+ ${D}${sysconfdir}/default/${BPN}
+ install -m 0755 ${WORKDIR}/freediameter.init ${D}${sysconfdir}/init.d/${BPN}
+
+ # install for systemd
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/freediameter.service ${D}${systemd_system_unitdir}
+ sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/*.service
+
+ cat >> ${D}${sysconfdir}/freeDiameter/freeDiameter.conf <<EOF
+## OE specific ##
+#Identity="${FD_HOSTNAME}";
+Identity = "${FD_HOSTNAME}.${FD_REALM}";
+Realm = "${FD_REALM}";
+Port = 30868;
+SecPort = 30869;
+TLS_Cred = "/etc/freeDiameter/${FD_PEM}" , "/etc/freeDiameter/${FD_KEY}";
+TLS_CA = "/etc/freeDiameter/${FD_CA}";
+TLS_DH_File = "/etc/freeDiameter/${FD_DH_PEM}";
+EOF
+
+ # create self cert
+ openssl req -x509 -config ${STAGING_DIR_NATIVE}/etc/ssl/openssl.cnf -newkey rsa:4096 -sha256 -nodes -out ${D}${sysconfdir}/freeDiameter/${FD_PEM} -keyout ${D}${sysconfdir}/freeDiameter/${FD_KEY} -days 3650 -subj '/CN=${FD_HOSTNAME}.${FD_REALM}'
+ openssl dhparam -out ${D}${sysconfdir}/freeDiameter/${FD_DH_PEM} 1024
+
+}
+
+do_install_ptest() {
+ sed -i "s#\(EXTENSIONS_DIR=\).*\$#\1${libdir}/${fd_pkgname}/#" ${D}${PTEST_PATH}/run-ptest
+ mv ${D}${PTEST_PATH}-tests/* ${D}${PTEST_PATH}/
+ rmdir ${D}${PTEST_PATH}-tests
+ install -m 0644 ${B}/tests/CTestTestfile.cmake ${D}${PTEST_PATH}/
+}
+
+FILES_${PN}-dbg += "${libdir}/${fd_pkgname}/.debug/*"
+
+# include the extensions in main package
+FILES_${PN} += "${libdir}/${fd_pkgname}/*"
+
+RDEPENDS_${PN} = "glib-2.0 gnutls libidn"
+RDEPENDS_${PN} += "openssl openssl-conf openssl-engines"
+RRECOMMENDS_${PN} += "kernel-module-tipc kernel-module-sctp"
+RRECOMMENDS_${PN} += "kernel-module-udp-tunnel kernel-module-ipip"
+RDEPENDS_${PN}-ptest = "cmake"
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "${BPN}"
+INITSCRIPT_PARAMS$_${PN} = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "freediameter.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+CONFFILES_${PN} = "${sysconfdir}/freediameter.conf"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch
new file mode 100644
index 000000000..863866d18
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch
@@ -0,0 +1,42 @@
+From d3082d2c606c810aa0a39378bf1e02575af3a301 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 2 Feb 2018 21:54:11 -0800
+Subject: [PATCH] nss_mdns: Do not include nss.h when libc != glibc
+
+Provide nss_status macro instead for non-glibc case
+where nss.h is absent
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ mDNSPosix/nss_mdns.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/mDNSPosix/nss_mdns.c b/mDNSPosix/nss_mdns.c
+index afadb3c..c469584 100755
+--- a/mDNSPosix/nss_mdns.c
++++ b/mDNSPosix/nss_mdns.c
+@@ -378,8 +378,19 @@ init_config ();
+
+ #define ENTNAME hostent
+ #define DATABASE "hosts"
+-
++#ifdef __GLIBC__
+ #include <nss.h>
++#else
++enum nss_status
++{
++ NSS_STATUS_TRYAGAIN = -2,
++ NSS_STATUS_UNAVAIL,
++ NSS_STATUS_NOTFOUND,
++ NSS_STATUS_SUCCESS,
++ NSS_STATUS_RETURN
++};
++#define NETDB_INTERNAL NULL
++#endif
+ // For nss_status
+ #include <netdb.h>
+ // For hostent
+--
+2.16.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch
new file mode 100644
index 000000000..4ab9d23bf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/build.patch
@@ -0,0 +1,167 @@
+From 43b6e98c9c37afd0d914949dcff4eab81f5a995f Mon Sep 17 00:00:00 2001
+From: Brendan Le Foll <brendan.le.foll@intel.com>
+Date: Tue, 3 Mar 2015 11:42:57 +0000
+
+Upstream-Status: Inappropriate [OE-specific]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ mDNSPosix/Makefile | 54 +++++++++++++++++++++++++-----------------------------
+ 1 file changed, 25 insertions(+), 29 deletions(-)
+
+diff --git a/mDNSPosix/Makefile b/mDNSPosix/Makefile
+index 4f98e90..8ac97ad 100755
+--- a/mDNSPosix/Makefile
++++ b/mDNSPosix/Makefile
+@@ -50,6 +50,7 @@
+
+ LIBVERS = 1
+
++POSIXDIR = ../mDNSPosix
+ COREDIR = ../mDNSCore
+ SHAREDDIR ?= ../mDNSShared
+ JDK = /usr/jdk
+@@ -58,11 +59,11 @@ CC = @cc
+ BISON = @bison
+ FLEX = @flex
+ ST = @strip
+-LD = ld -shared
++LD =@LD
+ CP = cp
+ RM = rm
+ LN = ln -s -f
+-CFLAGS_COMMON = -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
++CFLAGS_COMMON = -I$(POSIXDIR) -I$(COREDIR) -I$(SHAREDDIR) -I$(OBJDIR) -fwrapv -W -Wall -DPID_FILE=\"/var/run/mdnsd.pid\" -DMDNS_UDS_SERVERPATH=\"/var/run/mdnsd\"
+ CFLAGS_PTHREAD =
+ LINKOPTS =
+ LINKOPTS_PTHREAD = -lpthread
+@@ -70,7 +71,7 @@ LDSUFFIX = so
+ JAVACFLAGS_OS = -fPIC -shared -ldns_sd
+
+ # Set up diverging paths for debug vs. prod builds
+-DEBUG=0
++DEBUG?=1
+ ifeq ($(DEBUG),1)
+ CFLAGS_DEBUG = -g -DMDNS_DEBUGMSGS=2
+ OBJDIR = objects/debug
+@@ -213,7 +214,7 @@ endif
+ endif
+ endif
+
+-CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
++CFLAGS_BUILD = $(CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_OS) $(CFLAGS_DEBUG)
+
+ #############################################################################
+
+@@ -249,8 +250,7 @@ Daemon: setup $(BUILDDIR)/mdnsd
+ @echo "Responder daemon done"
+
+ $(BUILDDIR)/mdnsd: $(DAEMONOBJS)
+- $(CC) -o $@ $+ $(LINKOPTS)
+- @$(STRIP) $@
++ $(CC) -o $@ $+
+
+ # libdns_sd target builds the client library
+ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
+@@ -259,22 +259,18 @@ libdns_sd: setup $(BUILDDIR)/libdns_sd.$(LDSUFFIX)
+ CLIENTLIBOBJS = $(OBJDIR)/dnssd_clientlib.c.so.o $(OBJDIR)/dnssd_clientstub.c.so.o $(OBJDIR)/dnssd_ipc.c.so.o
+
+ $(BUILDDIR)/libdns_sd.$(LDSUFFIX): $(CLIENTLIBOBJS)
+- @$(LD) $(LINKOPTS) -o $@ $+
+- @$(STRIP) $@
++ $(LD) -shared $(LINKOPTS) -Wl,-soname,libdns_sd.$(LDSUFFIX).1 -o $@ $+
+
+-Clients: setup libdns_sd ../Clients/build/dns-sd
++Clients: setup libdns_sd
++ @$(MAKE) -C ../Clients DEBUG=${DEBUG}
+ @echo "Clients done"
+
+-../Clients/build/dns-sd:
+- @$(MAKE) -C ../Clients
+-
+ # nss_mdns target builds the Name Service Switch module
+ nss_mdns: setup $(BUILDDIR)/$(NSSLIBFILE)
+ @echo "Name Service Switch module done"
+
+ $(BUILDDIR)/$(NSSLIBFILE): $(CLIENTLIBOBJS) $(OBJDIR)/nss_mdns.c.so.o
+- @$(LD) $(LINKOPTS) -o $@ $+
+- @$(STRIP) $@
++ $(LD) -shared $(LINKOPTS) -o $@ $+
+
+ #############################################################################
+
+@@ -470,55 +466,55 @@ dnsextd: setup $(BUILDDIR)/dnsextd
+ @echo "dnsextd done"
+
+ $(BUILDDIR)/mDNSClientPosix: $(APPOBJ) $(OBJDIR)/Client.c.o
+- $(CC) $+ -o $@ $(LINKOPTS)
++ $(CC) $+ -o $@
+
+ $(BUILDDIR)/mDNSResponderPosix: $(COMMONOBJ) $(OBJDIR)/Responder.c.o
+- $(CC) $+ -o $@ $(LINKOPTS)
++ $(CC) $+ -o $@
+
+ $(BUILDDIR)/mDNSProxyResponderPosix: $(COMMONOBJ) $(OBJDIR)/ProxyResponder.c.o
+- $(CC) $+ -o $@ $(LINKOPTS)
++ $(CC) $+ -o $@
+
+ $(BUILDDIR)/mDNSIdentify: $(SPECIALOBJ) $(OBJDIR)/Identify.c.o
+- $(CC) $+ -o $@ $(LINKOPTS)
++ $(CC) $+ -o $@
+
+ $(OBJDIR)/Identify.c.o: $(COREDIR)/mDNS.c # Note: Identify.c textually imports mDNS.c
+
+ $(BUILDDIR)/mDNSNetMonitor: $(SPECIALOBJ) $(OBJDIR)/NetMonitor.c.o
+- $(CC) $+ -o $@ $(LINKOPTS)
++ $(CC) $+ -o $@
+
+ $(OBJDIR)/NetMonitor.c.o: $(COREDIR)/mDNS.c # Note: NetMonitor.c textually imports mDNS.c
+
+ $(BUILDDIR)/dnsextd: $(DNSEXTDOBJ) $(OBJDIR)/dnsextd.c.threadsafe.o
+- $(CC) $+ -o $@ $(LINKOPTS) $(LINKOPTS_PTHREAD)
++ $(CC) $+ -o $@ $(LINKOPTS_PTHREAD)
+
+ #############################################################################
+
+ # Implicit rules
+ $(OBJDIR)/%.c.o: %.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
+
+ $(OBJDIR)/%.c.o: $(COREDIR)/%.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
+
+ $(OBJDIR)/%.c.o: $(SHAREDDIR)/%.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(CFLAGS_BUILD) -c -o $@ $<
+
+ $(OBJDIR)/%.c.threadsafe.o: %.c
+- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
++ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
+
+ $(OBJDIR)/%.c.threadsafe.o: $(SHAREDDIR)/%.c
+- $(CC) $(CFLAGS) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
++ $(CC) $(CFLAGS_BUILD) $(CFLAGS_PTHREAD) -D_REENTRANT -c -o $@ $<
+
+ $(OBJDIR)/%.c.so.o: %.c
+- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
++ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $<
+
+ $(OBJDIR)/%.c.so.o: $(SHAREDDIR)/%.c
+- $(CC) $(CFLAGS) -c -fPIC -o $@ $<
++ $(CC) $(CFLAGS_BUILD) -c -fPIC -o $@ $<
+
+ $(OBJDIR)/%.y.o: $(SHAREDDIR)/%.y
+ $(BISON) -o $(OBJDIR)/$*.c -d $<
+- $(CC) $(CFLAGS) -c -o $@ $(OBJDIR)/$*.c
++ $(CC) $(CFLAGS_BUILD) -c -o $@ $(OBJDIR)/$*.c
+
+ $(OBJDIR)/%.l.o: $(SHAREDDIR)/%.l
+ $(FLEX) $(FLEXFLAGS_OS) -i -o$(OBJDIR)/$*.l.c $<
+- $(CC) $(CFLAGS) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
++ $(CC) $(CFLAGS_BUILD) -Wno-error -c -o $@ $(OBJDIR)/$*.l.c
+--
+2.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/files/mdns.service b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/mdns.service
new file mode 100644
index 000000000..531d142dc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/files/mdns.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Zero-configuration networking
+After=network.target
+
+[Service]
+Type=forking
+ExecStartPre=/bin/rm -f /var/run/mdnsd.pid
+ExecStart=/usr/sbin/mdnsd
+ExecReload=/bin/kill -HUP $MAINPID
+PIDFile=/var/run/mdnsd.pid
+Restart=always
+RestartSec=10s
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb b/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb
new file mode 100644
index 000000000..9a7152fcf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/mdns/mdns_765.50.9.bb
@@ -0,0 +1,90 @@
+SUMMARY = "Publishes & browses available services on a link according to the Zeroconf / Bonjour protocol"
+DESCRIPTION = "Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks."
+HOMEPAGE = "http://developer.apple.com/networking/bonjour/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=31c50371921e0fb731003bbc665f29bf"
+
+RPROVIDES_${PN} += "libdns_sd.so"
+
+SRC_URI = "http://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-${PV}.tar.gz \
+ file://build.patch;patchdir=.. \
+ file://mdns.service \
+ file://0001-nss_mdns-Do-not-include-nss.h-when-libc-glibc.patch;patchdir=.. \
+ "
+
+SRC_URI[md5sum] = "4a6bc1628851002634ea3833a4dca317"
+SRC_URI[sha256sum] = "de61dd0034357aa50c60806726fb1f70fa8e953ff9cb62eccfb73efad10dba0a"
+
+PARALLEL_MAKE = ""
+
+S = "${WORKDIR}/mDNSResponder-${PV}/mDNSPosix"
+
+EXTRA_OEMAKE += "os=linux DEBUG=0 'CC=${CC}' 'LD=${CCLD} ${LDFLAGS}'"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install () {
+ install -d ${D}${sbindir}
+ install -m 0755 build/prod/mdnsd ${D}${sbindir}
+
+ install -d ${D}${libdir}
+ cp build/prod/libdns_sd.so ${D}${libdir}/libdns_sd.so.1
+ chmod 0644 ${D}${libdir}/libdns_sd.so.1
+ ln -s libdns_sd.so.1 ${D}${libdir}/libdns_sd.so
+
+ install -d ${D}${includedir}
+ install -m 0644 ../mDNSShared/dns_sd.h ${D}${includedir}
+
+ install -d ${D}${mandir}/man8
+ install -m 0644 ../mDNSShared/mDNSResponder.8 ${D}${mandir}/man8/mdnsd.8
+
+ install -d ${D}${bindir}
+ install -m 0755 ../Clients/build/dns-sd ${D}${bindir}
+
+ install -d ${D}${libdir}
+ oe_libinstall -C build/prod -so libnss_mdns-0.2 ${D}${libdir}
+ ln -s libnss_mdns-0.2.so ${D}${libdir}/libnss_mdns.so.2
+
+ install -d ${D}${sysconfdir}
+ install -m 0644 nss_mdns.conf ${D}${sysconfdir}
+
+ install -d ${D}${mandir}/man5
+ install -m 0644 nss_mdns.conf.5 ${D}${mandir}/man5
+
+ install -d ${D}${mandir}/man8
+ install -m 0644 libnss_mdns.8 ${D}${mandir}/man8
+
+ install -d ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/mdns.service ${D}${systemd_unitdir}/system/
+}
+
+pkg_postinst_${PN} () {
+ sed -e '/^hosts:/s/\s*\<mdns\>//' \
+ -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns\3\4\5/' \
+ -i $D/etc/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+ sed -e '/^hosts:/s/\s*\<mdns\>//' \
+ -e '/^hosts:/s/\s*mdns//' \
+ -i $D/etc/nsswitch.conf
+}
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "mdns.service"
+
+FILES_${PN} += "${systemd_unitdir}/system/mdns.service"
+FILES_${PN} += "${libdir}/libdns_sd.so.1 \
+ ${bindir}/dns-sd \
+ ${libdir}/libnss_mdns-0.2.so \
+ ${sysconfdir}/nss_mdns.conf"
+
+FILES_${PN}-dev += "${libdir}/libdns_sd.so \
+ ${includedir}/dns_sd.h "
+
+FILES_${PN}-man += "${mandir}/man8/mdnsd.8 \
+ ${mandir}/man5/nss_mdns.conf.5 \
+ ${mandir}/man8/libnss_mdns.8"
+
+PACKAGES = "${PN} ${PN}-dev ${PN}-man ${PN}-dbg"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init
new file mode 100755
index 000000000..47995466f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/init
@@ -0,0 +1,66 @@
+#! /bin/sh
+# /etc/init.d/snmpd: start snmp daemon.
+
+. /etc/init.d/functions
+
+# Defaults
+export MIBDIRS=/usr/share/snmp/mibs
+SNMPDRUN=yes
+SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid'
+TRAPDRUN=no
+TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
+PIDFILE=/var/run/snmpd.pid
+SPIDFILE=/var/run/snmptrapd.pid
+
+# Reads config file if exists (will override defaults above)
+[ -r /etc/default/snmpd ] && . /etc/default/snmpd
+
+[ "$SNMPDRUN" = "yes" ] && { test -x /usr/sbin/snmpd || exit 0; }
+[ "$TRAPDRUN" = "yes" ] && { test -x /usr/sbin/snmptrapd || exit 0; }
+
+case "$1" in
+ start)
+ echo -n "Starting network management services:"
+ if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf -a ! -f "$PIDFILE" ]; then
+ start-stop-daemon -o --start --quiet --name snmpd --pidfile "$PIDFILE" \
+ --exec /usr/sbin/snmpd -- $SNMPDOPTS
+ echo -n " snmpd"
+ fi
+ if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf -a ! -f "$SPIDFILE" ]; then
+ start-stop-daemon -o --start --quiet --name snmptrapd --pidfile "$SPIDFILE" \
+ --exec /usr/sbin/snmptrapd -- $TRAPDOPTS
+ echo -n " snmptrapd"
+ fi
+ echo "."
+
+ test ! -x /sbin/restorecon || /sbin/restorecon -FR /var/lib/net-snmp
+ ;;
+ stop)
+ echo -n "Stopping network management services:"
+ if [ -f "$PIDFILE" ] ; then
+ start-stop-daemon -o --stop --quiet --pidfile $PIDFILE --name snmpd
+ fi
+ echo -n " snmpd"
+ if [ -f "$SPIDFILE" ] ; then
+ start-stop-daemon -o --stop --quiet --pidfile $SPIDFILE --name snmptrapd
+ rm -rf $SPIDFILE
+ fi
+ echo -n " snmptrapd"
+ echo "."
+ ;;
+ status)
+ status /usr/sbin/snmpd;
+ exit $?
+ ;;
+ restart|reload|force-reload)
+ $0 stop
+ # Allow the daemons time to exit completely.
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/snmpd {start|stop|status|restart|reload|force-reload}"
+ exit 1
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf
new file mode 100644
index 000000000..728171c42
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf
@@ -0,0 +1,422 @@
+###############################################################################
+#
+# EXAMPLE.conf:
+# An example configuration file for configuring the ucd-snmp snmpd agent.
+#
+###############################################################################
+#
+# This file is intended to only be an example. If, however, you want
+# to use it, it should be placed in /etc/snmp/snmpd.conf.
+# When the snmpd agent starts up, this is where it will look for it.
+#
+# You might be interested in generating your own snmpd.conf file using
+# the "snmpconf" program (perl script) instead. It's a nice menu
+# based interface to writing well commented configuration files. Try it!
+#
+# Note: This file is automatically generated from EXAMPLE.conf.def.
+# Do NOT read the EXAMPLE.conf.def file! Instead, after you have run
+# configure & make, and then make sure you read the EXAMPLE.conf file
+# instead, as it will tailor itself to your configuration.
+
+# All lines beginning with a '#' are comments and are intended for you
+# to read. All other lines are configuration commands for the agent.
+
+#
+# PLEASE: read the snmpd.conf(5) manual page as well!
+#
+
+
+###############################################################################
+# Access Control
+###############################################################################
+
+# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY
+# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO
+# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE.
+
+# By far, the most common question I get about the agent is "why won't
+# it work?", when really it should be "how do I configure the agent to
+# allow me to access it?"
+#
+# By default, the agent responds to the "public" community for read
+# only access, if run out of the box without any configuration file in
+# place. The following examples show you other ways of configuring
+# the agent so that you can change the community names, and give
+# yourself write access as well.
+#
+# The following lines change the access permissions of the agent so
+# that the COMMUNITY string provides read-only access to your entire
+# NETWORK (EG: 10.10.10.0/24), and read/write access to only the
+# localhost (127.0.0.1, not its real ipaddress).
+#
+# For more information, read the FAQ as well as the snmpd.conf(5)
+# manual page.
+
+####
+# First, map the community name (COMMUNITY) into a security name
+# (local and mynetwork, depending on where the request is coming
+# from):
+
+# sec.name source community
+com2sec paranoid default public
+#com2sec readonly default public
+#com2sec readwrite default private
+
+####
+# Second, map the security names into group names:
+
+# sec.model sec.name
+group MyROSystem v1 paranoid
+group MyROSystem v2c paranoid
+group MyROSystem usm paranoid
+group MyROGroup v1 readonly
+group MyROGroup v2c readonly
+group MyROGroup usm readonly
+group MyRWGroup v1 readwrite
+group MyRWGroup v2c readwrite
+group MyRWGroup usm readwrite
+
+####
+# Third, create a view for us to let the groups have rights to:
+
+# incl/excl subtree mask
+view all included .1 80
+view system included .iso.org.dod.internet.mgmt.mib-2.system
+
+####
+# Finally, grant the 2 groups access to the 1 view with different
+# write permissions:
+
+# context sec.model sec.level match read write notif
+access MyROSystem "" any noauth exact system none none
+access MyROGroup "" any noauth exact all none none
+access MyRWGroup "" any noauth exact all all none
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# System contact information
+#
+
+# It is also possible to set the sysContact and sysLocation system
+# variables through the snmpd.conf file. **PLEASE NOTE** that setting
+# the value of these objects here makes these objects READ-ONLY
+# (regardless of any access control settings). Any attempt to set the
+# value of an object whose value is given here will fail with an error
+# status of notWritable.
+
+syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
+syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
+
+# Example output of snmpwalk:
+# % snmpwalk -v 1 -c public localhost system
+# system.sysDescr.0 = "SunOS name sun4c"
+# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
+# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
+# system.sysContact.0 = "Me <me@somewhere.org>"
+# system.sysName.0 = "name"
+# system.sysLocation.0 = "Right here, right now."
+# system.sysServices.0 = 72
+
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Process checks.
+#
+# The following are examples of how to use the agent to check for
+# processes running on the host. The syntax looks something like:
+#
+# proc NAME [MAX=0] [MIN=0]
+#
+# NAME: the name of the process to check for. It must match
+# exactly (ie, http will not find httpd processes).
+# MAX: the maximum number allowed to be running. Defaults to 0.
+# MIN: the minimum number to be running. Defaults to 0.
+
+#
+# Examples:
+#
+
+# Make sure mountd is running
+#proc mountd
+
+# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
+#proc ntalkd 4
+
+# Make sure at least one sendmail, but less than or equal to 10 are running.
+#proc sendmail 10 1
+
+# A snmpwalk of the prTable would look something like this:
+#
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2
+# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1
+# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2
+# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3
+# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd"
+# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd"
+# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail"
+# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1
+# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4
+# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10
+# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running."
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = ""
+# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = ""
+# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0
+# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0
+#
+# Note that the errorFlag for mountd is set to 1 because one is not
+# running (in this case an rpc.mountd is, but thats not good enough),
+# and the ErrMessage tells you what's wrong. The configuration
+# imposed in the snmpd.conf file is also shown.
+#
+# Special Case: When the min and max numbers are both 0, it assumes
+# you want a max of infinity and a min of 1.
+#
+
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Executables/scripts
+#
+
+#
+# You can also have programs run by the agent that return a single
+# line of output and an exit code. Here are two examples.
+#
+# exec NAME PROGRAM [ARGS ...]
+#
+# NAME: A generic name.
+# PROGRAM: The program to run. Include the path!
+# ARGS: optional arguments to be passed to the program
+
+# a simple hello world
+#exec echotest /bin/echo hello world
+
+# Run a shell script containing:
+#
+# #!/bin/sh
+# echo hello world
+# echo hi there
+# exit 35
+#
+# Note: this has been specifically commented out to prevent
+# accidental security holes due to someone else on your system writing
+# a /tmp/shtest before you do. Uncomment to use it.
+#
+#exec shelltest /bin/sh /tmp/shtest
+
+# Then,
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8
+# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1
+# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2
+# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"
+# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"
+# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"
+# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"
+# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0
+# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35
+# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."
+# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."
+# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0
+# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0
+
+# Note that the second line of the /tmp/shtest shell script is cut
+# off. Also note that the exit status of 35 was returned.
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# disk checks
+#
+
+# The agent can check the amount of available disk space, and make
+# sure it is above a set limit.
+
+# disk PATH [MIN=DEFDISKMINIMUMSPACE]
+#
+# PATH: mount path to the disk in question.
+# MIN: Disks with space below this value will have the Mib's errorFlag set.
+# Default value = DEFDISKMINIMUMSPACE.
+
+# Check the / partition and make sure it contains at least 10 megs.
+
+#disk / 10000
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9
+# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
+# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F
+# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"
+# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000
+# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130
+# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325
+# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092
+# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58
+# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0
+# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = ""
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# load average checks
+#
+
+# load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
+#
+# 1MAX: If the 1 minute load average is above this limit at query
+# time, the errorFlag will be set.
+# 5MAX: Similar, but for 5 min average.
+# 15MAX: Similar, but for 15 min average.
+
+# Check for loads:
+#load 12 14 14
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2
+# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"
+# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
+# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""
+# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Extensible sections.
+#
+
+# This alleviates the multiple line output problem found in the
+# previous executable mib by placing each mib in its own mib table:
+
+# Run a shell script containing:
+#
+# #!/bin/sh
+# echo hello world
+# echo hi there
+# exit 35
+#
+# Note: this has been specifically commented out to prevent
+# accidental security holes due to someone else on your system writing
+# a /tmp/shtest before you do. Uncomment to use it.
+#
+# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50
+# enterprises.ucdavis.50.1.1 = 1
+# enterprises.ucdavis.50.2.1 = "shelltest"
+# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
+# enterprises.ucdavis.50.100.1 = 35
+# enterprises.ucdavis.50.101.1 = "hello world."
+# enterprises.ucdavis.50.101.2 = "hi there."
+# enterprises.ucdavis.50.102.1 = 0
+
+# Now the Output has grown to two lines, and we can see the 'hi
+# there.' output as the second line from our shell script.
+#
+# Note that you must alter the mib.txt file to be correct if you want
+# the .50.* outputs above to change to reasonable text descriptions.
+
+# Other ideas:
+#
+# exec .1.3.6.1.4.1.2021.51 ps /bin/ps
+# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top
+# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq
+
+# -----------------------------------------------------------------------------
+
+
+###############################################################################
+# Pass through control.
+#
+
+# Usage:
+# pass MIBOID EXEC-COMMAND
+#
+# This will pass total control of the mib underneath the MIBOID
+# portion of the mib to the EXEC-COMMAND.
+#
+# Note: You'll have to change the path of the passtest script to your
+# source directory or install it in the given location.
+#
+# Example: (see the script for details)
+# (commented out here since it requires that you place the
+# script in the right location. (its not installed by default))
+
+# pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/passtest
+
+# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
+# enterprises.ucdavis.255.1 = "life the universe and everything"
+# enterprises.ucdavis.255.2.1 = 42
+# enterprises.ucdavis.255.2.2 = OID: 42.42.42
+# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42
+# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1
+# enterprises.ucdavis.255.5 = 42
+# enterprises.ucdavis.255.6 = Gauge: 42
+#
+# % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5
+# enterprises.ucdavis.255.5 = 42
+#
+# % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string"
+# enterprises.ucdavis.255.1 = "New string"
+#
+
+# For specific usage information, see the man/snmpd.conf.5 manual page
+# as well as the local/passtest script used in the above example.
+
+###############################################################################
+# Subagent control
+#
+
+# The agent can support subagents using a number of extension mechanisms.
+# From the 4.2.1 release, AgentX support is being compiled in by default.
+# However, this is still experimental code, so should not be used on
+# critical production systems.
+# Please see the file README.agentx for more details.
+#
+# If having read, marked, learnt and inwardly digested this information,
+# you decide that you do wish to make use of this mechanism, simply
+# uncomment the following directive.
+#
+# master agentx
+#
+# I repeat - this is *NOT* regarded as suitable for front-line production
+# systems, though it is probably stable enough for day-to-day use.
+# Probably.
+#
+# No refunds will be given.
+
+###############################################################################
+# Further Information
+#
+# See the snmpd.conf manual page, and the output of "snmpd -H".
+# MUCH more can be done with the snmpd.conf than is shown as an
+# example here.
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf
new file mode 100644
index 000000000..8d2e4375e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf
@@ -0,0 +1,18 @@
+###############################################################################
+#
+# EXAMPLE.conf:
+# An example configuration file for configuring the ucd-snmp snmptrapd agent.
+#
+###############################################################################
+#
+# This file is intended to only be an example. If, however, you want
+# to use it, it should be placed in /etc/snmp/snmptrapd.conf.
+# When the snmptrapd agent starts up, this is where it will look for it.
+#
+# All lines beginning with a '#' are comments and are intended for you
+# to read. All other lines are configuration commands for the agent.
+
+#
+# PLEASE: read the snmptrapd.conf(5) manual page as well!
+#
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch
new file mode 100644
index 000000000..b14b76128
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch
@@ -0,0 +1,45 @@
+From a92628a163ebf1ea62220684736300461c003875 Mon Sep 17 00:00:00 2001
+From: Niels Baggesen <nba@users.sourceforge.net>
+Date: Mon, 26 Jan 2015 20:26:06 +0100
+Subject: [PATCH] BUG#a2584: Fix snmptrap to use clientaddr from snmp.conf.
+ Thanks to rizwan
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ snmplib/transports/snmpUDPIPv6Domain.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+Index: net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c
+===================================================================
+--- net-snmp-5.7.3.orig/snmplib/transports/snmpUDPIPv6Domain.c
++++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c
+@@ -286,6 +286,27 @@ netsnmp_udp6_transport(struct sockaddr_i
+ return NULL;
+ #endif /* NETSNMP_NO_LISTEN_SUPPORT */
+ } else {
++ char *client_socket = NULL;
++ /*
++ * This is a client session. If we've been given a
++ * client address to send from, then bind to that.
++ * Otherwise the send will use "something sensible".
++ */
++
++ client_socket = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
++ NETSNMP_DS_LIB_CLIENT_ADDR);
++ if (client_socket) {
++ struct sockaddr_in6 client_addr;
++ netsnmp_sockaddr_in6_2(&client_addr, client_socket, NULL);
++ rc = bind(t->sock, (struct sockaddr *)&client_addr,
++ sizeof(struct sockaddr_in6));
++ if ( rc != 0 ) {
++ DEBUGMSGTL(("netsnmp_udp6", "failed to bind for clientaddr: %d %s\n",
++ errno, strerror(errno)));
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ }
++ }
+ /*
+ * This is a client session. Save the address in the
+ * transport-specific data pointer for later use by netsnmp_udp6_send.
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Remove-U64-typedef.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Remove-U64-typedef.patch
new file mode 100644
index 000000000..7314ab16a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Remove-U64-typedef.patch
@@ -0,0 +1,2524 @@
+net-snmp: remove U64 typedef
+
+From git://git.code.sf.net/p/net-snmp/code
+
+Upstream-Status: Backport (unmodified)
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+From 477b4307ef12ddce3b6a9205e0bdddbfb2e0e9b6 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Sat, 20 Feb 2016 18:58:18 -0800
+Subject: [PATCH 1/1] Remove U64 typedef
+
+The U64 typedef conflicts with a typedef in a Perl header file. Hence
+remove the U64 typedef from the Net-SNMP header files. This patch does
+not modify the Net-SNMP ABI.
+---
+ agent/mibgroup/if-mib/ifXTable/ifXTable.c | 16 +-
+ agent/mibgroup/if-mib/ifXTable/ifXTable.h | 48 +-
+ .../mibgroup/if-mib/ifXTable/ifXTable_interface.c | 32 +-
+ .../ip-mib/data_access/systemstats_common.c | 2 +-
+ .../ipIfStatsTable/ipIfStatsTable_data_get.c | 28 +-
+ .../ipIfStatsTable/ipIfStatsTable_data_get.h | 28 +-
+ .../ipIfStatsTable/ipIfStatsTable_interface.c | 56 +-
+ .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.c | 28 +-
+ .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.h | 921 ++-------------------
+ .../ipSystemStatsTable_interface.c | 56 +-
+ include/net-snmp/data_access/ipstats.h | 42 +-
+ include/net-snmp/library/int64.h | 34 +-
+ snmplib/int64.c | 38 +-
+ snmplib/read_config.c | 6 +-
+ testing/fulltests/unit-tests/T015int64_clib.c | 10 +-
+ 15 files changed, 274 insertions(+), 1071 deletions(-)
+
+Index: net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/if-mib/ifXTable/ifXTable.c
++++ net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable.c
+@@ -722,7 +722,7 @@ The total number of octets received on t
+ */
+ int
+ ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInOctets_val_ptr)
++ struct counter64 *ifHCInOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInOctets_val_ptr);
+@@ -779,7 +779,7 @@ The number of packets, delivered by this
+ */
+ int
+ ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInUcastPkts_val_ptr)
++ struct counter64 *ifHCInUcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr);
+@@ -838,7 +838,7 @@ The number of packets, delivered by this
+ */
+ int
+ ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInMulticastPkts_val_ptr)
++ struct counter64 *ifHCInMulticastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInMulticastPkts_val_ptr);
+@@ -897,7 +897,7 @@ The number of packets, delivered by this
+ */
+ int
+ ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInBroadcastPkts_val_ptr)
++ struct counter64 *ifHCInBroadcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInBroadcastPkts_val_ptr);
+@@ -955,7 +955,7 @@ The total number of octets transmitted o
+ */
+ int
+ ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutOctets_val_ptr)
++ struct counter64 *ifHCOutOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutOctets_val_ptr);
+@@ -1013,7 +1013,7 @@ The total number of packets that higher-
+ */
+ int
+ ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutUcastPkts_val_ptr)
++ struct counter64 *ifHCOutUcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutUcastPkts_val_ptr);
+@@ -1074,7 +1074,7 @@ The total number of packets that higher-
+ */
+ int
+ ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutMulticastPkts_val_ptr)
++ struct counter64 *ifHCOutMulticastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutMulticastPkts_val_ptr);
+@@ -1134,7 +1134,7 @@ The total number of packets that higher-
+ */
+ int
+ ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutBroadcastPkts_val_ptr)
++ struct counter64 *ifHCOutBroadcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutBroadcastPkts_val_ptr);
+Index: net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable.h
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/if-mib/ifXTable/ifXTable.h
++++ net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable.h
+@@ -143,28 +143,28 @@ config_require(if-mib/ifXTable/ifXTable_
+ u_long *
+ ifOutBroadcastPkts_val_ptr);
+ int ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInOctets_val_ptr);
++ struct counter64 *ifHCInOctets_val_ptr);
+ int ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCInUcastPkts_val_ptr);
++ struct counter64 *ifHCInUcastPkts_val_ptr);
+ int ifHCInMulticastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ifHCInMulticastPkts_val_ptr);
+ int ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ifHCInBroadcastPkts_val_ptr);
+ int ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutOctets_val_ptr);
++ struct counter64 *ifHCOutOctets_val_ptr);
+ int ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 * ifHCOutUcastPkts_val_ptr);
++ struct counter64 *ifHCOutUcastPkts_val_ptr);
+ int ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ifHCOutMulticastPkts_val_ptr);
+ int ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ifHCOutBroadcastPkts_val_ptr);
+ int ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -284,86 +284,86 @@ config_require(if-mib/ifXTable/ifXTable_
+
+ int ifHCInOctets_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCInOctets_val);
++ struct counter64 ifHCInOctets_val);
+ int ifHCInOctets_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 ifHCInOctets_val);
++ struct counter64 ifHCInOctets_val);
+ int ifHCInOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCInUcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCInUcastPkts_val);
++ struct counter64 ifHCInUcastPkts_val);
+ int ifHCInUcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 ifHCInUcastPkts_val);
++ struct counter64 ifHCInUcastPkts_val);
+ int ifHCInUcastPkts_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCInMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64
++ struct counter64
+ ifHCInMulticastPkts_val);
+ int ifHCInMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInMulticastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCInMulticastPkts_val);
++ struct counter64 ifHCInMulticastPkts_val);
+ int ifHCInMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCInBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64
++ struct counter64
+ ifHCInBroadcastPkts_val);
+ int ifHCInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInBroadcastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCInBroadcastPkts_val);
++ struct counter64 ifHCInBroadcastPkts_val);
+ int ifHCInBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutOctets_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCOutOctets_val);
++ struct counter64 ifHCOutOctets_val);
+ int ifHCOutOctets_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 ifHCOutOctets_val);
++ struct counter64 ifHCOutOctets_val);
+ int ifHCOutOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCOutUcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCOutUcastPkts_val);
++ struct counter64 ifHCOutUcastPkts_val);
+ int ifHCOutUcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+- U64 ifHCOutUcastPkts_val);
++ struct counter64 ifHCOutUcastPkts_val);
+ int ifHCOutUcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64
++ struct counter64
+ ifHCOutMulticastPkts_val);
+ int ifHCOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutMulticastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCOutMulticastPkts_val);
++ struct counter64 ifHCOutMulticastPkts_val);
+ int ifHCOutMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64
++ struct counter64
+ ifHCOutBroadcastPkts_val);
+ int ifHCOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutBroadcastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 ifHCOutBroadcastPkts_val);
++ struct counter64 ifHCOutBroadcastPkts_val);
+ int ifHCOutBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+Index: net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
++++ net-snmp-5.7.3/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
+@@ -729,72 +729,72 @@ _ifXTable_get_column(ifXTable_rowreq_ctx
+ * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCInOctets_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINUCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCInUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCInUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINMULTICASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCInMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCInMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINBROADCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCInBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCInBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTUCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCOutUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCOutUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTMULTICASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCOutMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCOutMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTBROADCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/data_access/systemstats_common.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/data_access/systemstats_common.c
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/data_access/systemstats_common.c
+@@ -264,7 +264,7 @@ _calculate_entries(netsnmp_systemstats_e
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES]
+ && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) {
+
+- U64 tmp, tmp2, tmp3;
++ struct counter64 tmp, tmp2, tmp3;
+ tmp = entry->stats.HCOutRequests;
+ u64Incr(&tmp, &entry->stats.HCOutForwDatagrams);
+ u64Incr(&tmp, &entry->stats.HCOutFragCreates);
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c
+@@ -270,7 +270,7 @@ The total number of input IP datagrams r
+ */
+ int
+ ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInReceives_val_ptr)
++ struct counter64 *ipIfStatsHCInReceives_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInReceives_val_ptr);
+@@ -395,7 +395,7 @@ The total number of octets received in i
+ */
+ int
+ ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInOctets_val_ptr)
++ struct counter64 *ipIfStatsHCInOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInOctets_val_ptr);
+@@ -862,7 +862,7 @@ The number of input datagrams for which
+ */
+ int
+ ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInForwDatagrams_val_ptr)
++ struct counter64 *ipIfStatsHCInForwDatagrams_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInForwDatagrams_val_ptr);
+@@ -1267,7 +1267,7 @@ The total number of datagrams successful
+ */
+ int
+ ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInDelivers_val_ptr)
++ struct counter64 *ipIfStatsHCInDelivers_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInDelivers_val_ptr);
+@@ -1396,7 +1396,7 @@ The total number of IP datagrams that lo
+ */
+ int
+ ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutRequests_val_ptr)
++ struct counter64 *ipIfStatsHCOutRequests_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutRequests_val_ptr);
+@@ -1532,7 +1532,7 @@ The number of datagrams for which this e
+ */
+ int
+ ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutForwDatagrams_val_ptr)
++ struct counter64 *ipIfStatsHCOutForwDatagrams_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutForwDatagrams_val_ptr);
+@@ -1999,7 +1999,7 @@ The total number of IP datagrams that th
+ */
+ int
+ ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutTransmits_val_ptr)
++ struct counter64 *ipIfStatsHCOutTransmits_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutTransmits_val_ptr);
+@@ -2123,7 +2123,7 @@ The total number of octets in IP datagra
+ */
+ int
+ ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutOctets_val_ptr)
++ struct counter64 *ipIfStatsHCOutOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutOctets_val_ptr);
+@@ -2245,7 +2245,7 @@ The number of IP multicast datagrams rec
+ */
+ int
+ ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInMcastPkts_val_ptr)
++ struct counter64 *ipIfStatsHCInMcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInMcastPkts_val_ptr);
+@@ -2372,7 +2372,7 @@ The total number of octets received in I
+ */
+ int
+ ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInMcastOctets_val_ptr)
++ struct counter64 *ipIfStatsHCInMcastOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInMcastOctets_val_ptr);
+@@ -2497,7 +2497,7 @@ The number of IP multicast datagrams tra
+ */
+ int
+ ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutMcastPkts_val_ptr)
++ struct counter64 *ipIfStatsHCOutMcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutMcastPkts_val_ptr);
+@@ -2621,7 +2621,7 @@ The total number of octets transmitted i
+ */
+ int
+ ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutMcastOctets_val_ptr)
++ struct counter64 *ipIfStatsHCOutMcastOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutMcastOctets_val_ptr);
+@@ -2743,7 +2743,7 @@ The number of IP broadcast datagrams rec
+ */
+ int
+ ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCInBcastPkts_val_ptr)
++ struct counter64 *ipIfStatsHCInBcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCInBcastPkts_val_ptr);
+@@ -2865,7 +2865,7 @@ The number of IP broadcast datagrams tra
+ */
+ int
+ ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipIfStatsHCOutBcastPkts_val_ptr)
++ struct counter64 *ipIfStatsHCOutBcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipIfStatsHCOutBcastPkts_val_ptr);
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h
+@@ -50,7 +50,7 @@ extern "C" {
+ ipIfStatsInReceives_val_ptr);
+ int ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInReceives_val_ptr);
+ int ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -58,7 +58,7 @@ extern "C" {
+ ipIfStatsInOctets_val_ptr);
+ int ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInOctets_val_ptr);
+ int ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -87,7 +87,7 @@ extern "C" {
+ int
+ ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInForwDatagrams_val_ptr);
+ int ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -111,7 +111,7 @@ extern "C" {
+ ipIfStatsInDelivers_val_ptr);
+ int ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInDelivers_val_ptr);
+ int ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -119,7 +119,7 @@ extern "C" {
+ ipIfStatsOutRequests_val_ptr);
+ int ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutRequests_val_ptr);
+ int ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+@@ -128,7 +128,7 @@ extern "C" {
+ int
+ ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutForwDatagrams_val_ptr);
+ int ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -156,7 +156,7 @@ extern "C" {
+ ipIfStatsOutTransmits_val_ptr);
+ int ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutTransmits_val_ptr);
+ int ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -164,7 +164,7 @@ extern "C" {
+ ipIfStatsOutOctets_val_ptr);
+ int ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutOctets_val_ptr);
+ int ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -172,7 +172,7 @@ extern "C" {
+ ipIfStatsInMcastPkts_val_ptr);
+ int ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInMcastPkts_val_ptr);
+ int ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -180,7 +180,7 @@ extern "C" {
+ ipIfStatsInMcastOctets_val_ptr);
+ int ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInMcastOctets_val_ptr);
+ int ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -188,7 +188,7 @@ extern "C" {
+ ipIfStatsOutMcastPkts_val_ptr);
+ int ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutMcastPkts_val_ptr);
+ int ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -196,7 +196,7 @@ extern "C" {
+ ipIfStatsOutMcastOctets_val_ptr);
+ int ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx
+ * rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutMcastOctets_val_ptr);
+ int ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -204,7 +204,7 @@ extern "C" {
+ ipIfStatsInBcastPkts_val_ptr);
+ int ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCInBcastPkts_val_ptr);
+ int ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+@@ -212,7 +212,7 @@ extern "C" {
+ ipIfStatsOutBcastPkts_val_ptr);
+ int ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipIfStatsHCOutBcastPkts_val_ptr);
+ int
+ ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx *
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c
+@@ -722,10 +722,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINRECEIVES:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInReceives_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -741,9 +741,9 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ipIfStatsHCInOctets_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ipIfStatsHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -810,10 +810,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINFORWDATAGRAMS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInForwDatagrams_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -869,10 +869,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINDELIVERS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInDelivers_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -889,10 +889,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTREQUESTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutRequests_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -909,10 +909,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutForwDatagrams_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -979,10 +979,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTTRANSMITS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutTransmits_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -999,9 +999,9 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+- rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string);
++ rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1018,10 +1018,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINMCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInMcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1038,10 +1038,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINMCASTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInMcastOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1058,10 +1058,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTMCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutMcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1078,10 +1078,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTMCASTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutMcastOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1098,10 +1098,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCINBCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCInBcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1118,10 +1118,10 @@ _ipIfStatsTable_get_column(ipIfStatsTabl
+ * ipIfStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPIFSTATSHCOUTBCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipIfStatsHCOutBcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
+@@ -452,7 +452,7 @@ The total number of input IP datagrams r
+ */
+ int
+ ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCInReceives_val_ptr)
++ struct counter64 *ipSystemStatsHCInReceives_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr);
+@@ -579,7 +579,7 @@ The total number of octets received in i
+ */
+ int
+ ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCInOctets_val_ptr)
++ struct counter64 *ipSystemStatsHCInOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr);
+@@ -1058,7 +1058,7 @@ The number of input datagrams for which
+ int
+ ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+@@ -1474,7 +1474,7 @@ The total number of datagrams successful
+ */
+ int
+ ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCInDelivers_val_ptr)
++ struct counter64 *ipSystemStatsHCInDelivers_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr);
+@@ -1602,7 +1602,7 @@ The total number of IP datagrams which l
+ */
+ int
+ ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCOutRequests_val_ptr)
++ struct counter64 *ipSystemStatsHCOutRequests_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr);
+@@ -1809,7 +1809,7 @@ The number of datagrams for which this e
+ int
+ ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+@@ -2288,7 +2288,7 @@ The total number of IP datagrams that th
+ */
+ int
+ ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCOutTransmits_val_ptr)
++ struct counter64 *ipSystemStatsHCOutTransmits_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr);
+@@ -2415,7 +2415,7 @@ The total number of octets in IP datagra
+ */
+ int
+ ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCOutOctets_val_ptr)
++ struct counter64 *ipSystemStatsHCOutOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr);
+@@ -2539,7 +2539,7 @@ The number of IP multicast datagrams rec
+ */
+ int
+ ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCInMcastPkts_val_ptr)
++ struct counter64 *ipSystemStatsHCInMcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr);
+@@ -2665,7 +2665,7 @@ The total number of octets received in I
+ int
+ ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInMcastOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+@@ -2790,7 +2790,7 @@ The number of IP multicast datagrams tra
+ */
+ int
+ ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCOutMcastPkts_val_ptr)
++ struct counter64 *ipSystemStatsHCOutMcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr);
+@@ -2921,7 +2921,7 @@ The total number of octets transmitted i
+ int
+ ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+@@ -3046,7 +3046,7 @@ The number of IP broadcast datagrams rec
+ */
+ int
+ ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCInBcastPkts_val_ptr)
++ struct counter64 *ipSystemStatsHCInBcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr);
+@@ -3170,7 +3170,7 @@ The number of IP broadcast datagrams tra
+ */
+ int
+ ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+- U64 * ipSystemStatsHCOutBcastPkts_val_ptr)
++ struct counter64 *ipSystemStatsHCOutBcastPkts_val_ptr)
+ {
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr);
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+@@ -144,93 +144,22 @@ config_require(ip-mib/ipSystemStatsTable
+ *********************************************************************
+ * function prototypes
+ */
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
++ int ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
+ user_context);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
++ int ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
+ user_context, int rc);
+
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+ ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ ipSystemStatsTable_data *ipSystemStatsTable_allocate_data(void);
+ void ipSystemStatsTable_release_data(ipSystemStatsTable_data
+ * data);
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_rowreq_ctx
++ ipSystemStatsTable_rowreq_ctx
+ * ipSystemStatsTable_row_find_by_mib_index
+ (ipSystemStatsTable_mib_index * mib_idx);
+
+@@ -265,226 +194,50 @@ config_require(ip-mib/ipSystemStatsTable
+ * indexes
+ */
+
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInReceives_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInReceives_val_ptr);
+ int ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsInOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 * ipSystemStatsHCInOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx *
++ struct counter64 *ipSystemStatsHCInOctets_val_ptr);
++ int ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInHdrErrors_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInNoRoutes_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInAddrErrors_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInUnknownProtos_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInTruncatedPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInForwDatagrams_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmReqds_val_ptr);
+@@ -492,690 +245,142 @@ config_require(ip-mib/ipSystemStatsTable
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmOKs_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmFails_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDiscards_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDelivers_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInDelivers_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutRequests_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutRequests_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutNoRoutes_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutForwDatagrams_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutDiscards_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragReqds_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragOKs_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragFails_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragCreates_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutTransmits_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutTransmits_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInMcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInMcastOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutMcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInBcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCInBcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutBcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+- U64 *
++ struct counter64 *
+ ipSystemStatsHCOutBcastPkts_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsDiscontinuityTime_val_ptr);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsRefreshRate_val_ptr);
+-
+-
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index
++ int ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index
+ * tbl_idx,
+ u_long
+ ipSystemStatsIPVersion_val);
+- int
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+-
+- ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx *
++ int ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipSystemStatsIPVersion_val);
+
+-
+-
+ /*
+ *********************************************************************
+ * SET function declarations
+Index: net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
++++ net-snmp-5.7.3/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
+@@ -674,10 +674,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINRECEIVES:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInReceives_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -694,10 +694,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -764,10 +764,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -824,10 +824,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINDELIVERS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInDelivers_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -844,10 +844,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutRequests_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -874,10 +874,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -944,10 +944,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -964,10 +964,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -984,10 +984,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1004,10 +1004,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1024,10 +1024,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1044,10 +1044,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1064,10 +1064,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+@@ -1084,10 +1084,10 @@ _ipSystemStatsTable_get_column(ipSystemS
+ * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS:
+- var->val_len = sizeof(U64);
++ var->val_len = sizeof(struct counter64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx,
+- (U64 *) var->val.string);
++ (struct counter64 *) var->val.string);
+ break;
+
+ /*
+Index: net-snmp-5.7.3/include/net-snmp/data_access/ipstats.h
+===================================================================
+--- net-snmp-5.7.3.orig/include/net-snmp/data_access/ipstats.h
++++ net-snmp-5.7.3/include/net-snmp/data_access/ipstats.h
+@@ -58,45 +58,45 @@ typedef struct netsnmp_ipstats_s {
+ * other columns, when underlying OS does not provide them.
+ * Always fill at least 32 bits, the table is periodically polled -> 32 bit
+ * overflow shall be detected and 64 bit value should be computed automatically. */
+- U64 HCInReceives;
+- U64 HCInOctets;
++ struct counter64 HCInReceives;
++ struct counter64 HCInOctets;
+ u_long InHdrErrors;
+- U64 HCInNoRoutes;
++ struct counter64 HCInNoRoutes;
+ u_long InAddrErrors;
+ u_long InUnknownProtos;
+ u_long InTruncatedPkts;
+
+ /* optional, can be computed from HCInNoRoutes and HCOutForwDatagrams */
+- U64 HCInForwDatagrams;
++ struct counter64 HCInForwDatagrams;
+
+ u_long ReasmReqds;
+ u_long ReasmOKs;
+ u_long ReasmFails;
+ u_long InDiscards;
+- U64 HCInDelivers;
+- U64 HCOutRequests;
+- U64 HCOutNoRoutes;
+- U64 HCOutForwDatagrams;
+- U64 HCOutDiscards;
++ struct counter64 HCInDelivers;
++ struct counter64 HCOutRequests;
++ struct counter64 HCOutNoRoutes;
++ struct counter64 HCOutForwDatagrams;
++ struct counter64 HCOutDiscards;
+
+ /* optional, can be computed from HCOutFragOKs + HCOutFragFails*/
+- U64 HCOutFragReqds;
+- U64 HCOutFragOKs;
+- U64 HCOutFragFails;
+- U64 HCOutFragCreates;
++ struct counter64 HCOutFragReqds;
++ struct counter64 HCOutFragOKs;
++ struct counter64 HCOutFragFails;
++ struct counter64 HCOutFragCreates;
+
+ /* optional, can be computed from
+ * HCOutRequests +HCOutForwDatagrams + HCOutFragCreates
+ * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards */
+- U64 HCOutTransmits;
++ struct counter64 HCOutTransmits;
+
+- U64 HCOutOctets;
+- U64 HCInMcastPkts;
+- U64 HCInMcastOctets;
+- U64 HCOutMcastPkts;
+- U64 HCOutMcastOctets;
+- U64 HCInBcastPkts;
+- U64 HCOutBcastPkts;
++ struct counter64 HCOutOctets;
++ struct counter64 HCInMcastPkts;
++ struct counter64 HCInMcastOctets;
++ struct counter64 HCOutMcastPkts;
++ struct counter64 HCOutMcastOctets;
++ struct counter64 HCInBcastPkts;
++ struct counter64 HCOutBcastPkts;
+
+ /* Array of available columns.*/
+ int columnAvail[IPSYSTEMSTATSTABLE_LAST+1];
+Index: net-snmp-5.7.3/include/net-snmp/library/int64.h
+===================================================================
+--- net-snmp-5.7.3.orig/include/net-snmp/library/int64.h
++++ net-snmp-5.7.3/include/net-snmp/library/int64.h
+@@ -5,31 +5,29 @@
+ extern "C" {
+ #endif
+
+- typedef struct counter64 U64;
+-
+ #define I64CHARSZ 21
+
+- void divBy10(U64, U64 *, unsigned int *);
+- void multBy10(U64, U64 *);
+- void incrByU16(U64 *, unsigned int);
+- void incrByU32(U64 *, unsigned int);
++ void divBy10(struct counter64, struct counter64 *, unsigned int *);
++ void multBy10(struct counter64, struct counter64 *);
++ void incrByU16(struct counter64 *, unsigned int);
++ void incrByU32(struct counter64 *, unsigned int);
+ NETSNMP_IMPORT
+- void zeroU64(U64 *);
+- int isZeroU64(const U64 *);
++ void zeroU64(struct counter64 *);
++ int isZeroU64(const struct counter64 *);
+ NETSNMP_IMPORT
+- void printU64(char *, const U64 *);
++ void printU64(char *, const struct counter64 *);
+ NETSNMP_IMPORT
+- void printI64(char *, const U64 *);
+- int read64(U64 *, const char *);
++ void printI64(char *, const struct counter64 *);
++ int read64(struct counter64 *, const char *);
+ NETSNMP_IMPORT
+- void u64Subtract(const U64 * pu64one, const U64 * pu64two,
+- U64 * pu64out);
+- void u64Incr(U64 * pu64out, const U64 * pu64one);
+- void u64UpdateCounter(U64 * pu64out, const U64 * pu64one,
+- const U64 * pu64two);
+- void u64Copy(U64 * pu64one, const U64 * pu64two);
++ void u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two,
++ struct counter64 *pu64out);
++ void u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one);
++ void u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one,
++ const struct counter64 *pu64two);
++ void u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two);
+
+- int netsnmp_c64_check_for_32bit_wrap(U64 *old_val, U64 *new_val,
++ int netsnmp_c64_check_for_32bit_wrap(struct counter64 *old_val, struct counter64 *new_val,
+ int adjust);
+ NETSNMP_IMPORT
+ int netsnmp_c64_check32_and_update(struct counter64 *prev_val,
+Index: net-snmp-5.7.3/snmplib/int64.c
+===================================================================
+--- net-snmp-5.7.3.orig/snmplib/int64.c
++++ net-snmp-5.7.3/snmplib/int64.c
+@@ -33,7 +33,7 @@
+ * @param[out] puR Remainder.
+ */
+ void
+-divBy10(U64 u64, U64 * pu64Q, unsigned int *puR)
++divBy10(struct counter64 u64, struct counter64 *pu64Q, unsigned int *puR)
+ {
+ unsigned long ulT;
+ unsigned long ulQ;
+@@ -83,7 +83,7 @@ divBy10(U64 u64, U64 * pu64Q, unsigned i
+ * @param[out] pu64P Product.
+ */
+ void
+-multBy10(U64 u64, U64 * pu64P)
++multBy10(struct counter64 u64, struct counter64 *pu64P)
+ {
+ unsigned long ulT;
+ unsigned long ulP;
+@@ -130,7 +130,7 @@ multBy10(U64 u64, U64 * pu64P)
+ *
+ */
+ void
+-incrByU16(U64 * pu64, unsigned int u16)
++incrByU16(struct counter64 *pu64, unsigned int u16)
+ {
+ incrByU32(pu64, u16);
+ }
+@@ -143,7 +143,7 @@ incrByU16(U64 * pu64, unsigned int u16)
+ *
+ */
+ void
+-incrByU32(U64 * pu64, unsigned int u32)
++incrByU32(struct counter64 *pu64, unsigned int u32)
+ {
+ uint32_t tmp;
+
+@@ -161,7 +161,7 @@ incrByU32(U64 * pu64, unsigned int u32)
+ * @param[out] pu64out pu64one - pu64two.
+ */
+ void
+-u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out)
++u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two, struct counter64 *pu64out)
+ {
+ int carry;
+
+@@ -177,7 +177,7 @@ u64Subtract(const U64 * pu64one, const U
+ * @param[in,out] pu64out pu64out += pu64one.
+ */
+ void
+-u64Incr(U64 * pu64out, const U64 * pu64one)
++u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one)
+ {
+ pu64out->high = (uint32_t)(pu64out->high + pu64one->high);
+ incrByU32(pu64out, pu64one->low);
+@@ -191,9 +191,9 @@ u64Incr(U64 * pu64out, const U64 * pu64o
+ * @param[out] pu64out pu64out += (pu64one - pu64two)
+ */
+ void
+-u64UpdateCounter(U64 * pu64out, const U64 * pu64one, const U64 * pu64two)
++u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one, const struct counter64 *pu64two)
+ {
+- U64 tmp;
++ struct counter64 tmp;
+
+ u64Subtract(pu64one, pu64two, &tmp);
+ u64Incr(pu64out, &tmp);
+@@ -208,7 +208,7 @@ netsnmp_feature_child_of(u64copy, netsnm
+ * @param[out] pu64one Where to store the copy - *pu64one = *pu64two.
+ */
+ void
+-u64Copy(U64 * pu64one, const U64 * pu64two)
++u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two)
+ {
+ *pu64one = *pu64two;
+ }
+@@ -220,7 +220,7 @@ u64Copy(U64 * pu64one, const U64 * pu64t
+ * @param[in] pu64 Number to be zeroed.
+ */
+ void
+-zeroU64(U64 * pu64)
++zeroU64(struct counter64 *pu64)
+ {
+ pu64->low = 0;
+ pu64->high = 0;
+@@ -232,7 +232,7 @@ zeroU64(U64 * pu64)
+ * @param[in] pu64 Number to be checked.
+ */
+ int
+-isZeroU64(const U64 * pu64)
++isZeroU64(const struct counter64 *pu64)
+ {
+ return pu64->low == 0 && pu64->high == 0;
+ }
+@@ -390,10 +390,10 @@ netsnmp_c64_check32_and_update(struct co
+ /** Convert an unsigned 64-bit number to ASCII. */
+ void
+ printU64(char *buf, /* char [I64CHARSZ+1]; */
+- const U64 * pu64)
++ const struct counter64 *pu64)
+ {
+- U64 u64a;
+- U64 u64b;
++ struct counter64 u64a;
++ struct counter64 u64b;
+
+ char aRes[I64CHARSZ + 1];
+ unsigned int u;
+@@ -414,9 +414,9 @@ printU64(char *buf, /* char [I64CHARSZ+1
+ /** Convert a signed 64-bit number to ASCII. */
+ void
+ printI64(char *buf, /* char [I64CHARSZ+1]; */
+- const U64 * pu64)
++ const struct counter64 *pu64)
+ {
+- U64 u64a;
++ struct counter64 u64a;
+
+ if (pu64->high & 0x80000000) {
+ u64a.high = (uint32_t) ~pu64->high;
+@@ -429,11 +429,11 @@ printI64(char *buf, /* char [I64CHARSZ+1
+ }
+ }
+
+-/** Convert a signed 64-bit integer from ASCII to U64. */
++/** Convert a signed 64-bit integer from ASCII to struct counter64. */
+ int
+-read64(U64 * i64, const char *str)
++read64(struct counter64 *i64, const char *str)
+ {
+- U64 i64p;
++ struct counter64 i64p;
+ unsigned int u;
+ int sign = 0;
+ int ok = 0;
+Index: net-snmp-5.7.3/snmplib/read_config.c
+===================================================================
+--- net-snmp-5.7.3.orig/snmplib/read_config.c
++++ net-snmp-5.7.3/snmplib/read_config.c
+@@ -2270,10 +2270,10 @@ read_config_read_memory(int type, char *
+ return readfrom;
+
+ case ASN_COUNTER64:
+- if (*len < sizeof(U64))
++ if (*len < sizeof(struct counter64))
+ return NULL;
+- *len = sizeof(U64);
+- read64((U64 *) dataptr, readfrom);
++ *len = sizeof(struct counter64);
++ read64((struct counter64 *) dataptr, readfrom);
+ readfrom = skip_token(readfrom);
+ return readfrom;
+ }
+Index: net-snmp-5.7.3/testing/fulltests/unit-tests/T015int64_clib.c
+===================================================================
+--- net-snmp-5.7.3.orig/testing/fulltests/unit-tests/T015int64_clib.c
++++ net-snmp-5.7.3/testing/fulltests/unit-tests/T015int64_clib.c
+@@ -1,4 +1,4 @@
+-/* HEADER Testing 64-bit integer operations (U64). */
++/* HEADER Testing 64-bit integer operations (struct counter64). */
+
+ int i, j;
+ char buf[22];
+@@ -15,7 +15,7 @@ static const int64_t intval[] = {
+ };
+
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+- U64 a, b;
++ struct counter64 a, b;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+ printI64(buf, &a);
+@@ -27,7 +27,7 @@ for (i = 0; i < sizeof(intval)/sizeof(in
+
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) {
+- U64 a, b;
++ struct counter64 a, b;
+ uint64_t d;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+@@ -43,7 +43,7 @@ for (i = 0; i < sizeof(intval)/sizeof(in
+
+ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) {
+ for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) {
+- U64 a, b, c;
++ struct counter64 a, b, c;
+ uint64_t d;
+ a.low = (uint32_t)intval[i];
+ a.high = (uint32_t)(intval[i] >> 32);
+@@ -58,7 +58,7 @@ for (i = 0; i < sizeof(intval)/sizeof(in
+ }
+
+ {
+- U64 old_val, new_val;
++ struct counter64 old_val, new_val;
+ old_val.low = 7;
+ old_val.high = 0;
+ new_val = old_val;
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch
new file mode 100644
index 000000000..44359bebe
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch
@@ -0,0 +1,34 @@
+From 261a22096c79f8e6ef7b387514a74d208e4e5945 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 21 Aug 2015 18:23:13 +0900
+Subject: [PATCH] config_os_headers: Error Fix
+
+ERROR: This autoconf log indicates errors, it looked at host include
+and/or library paths while determining system capabilities.
+cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories]
+conftest.c:168:17: fatal error: pkg.h: No such file or directory
+ #include <pkg.h>
+ ^
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ configure.d/config_os_headers | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: net-snmp-5.7.3/configure.d/config_os_headers
+===================================================================
+--- net-snmp-5.7.3.orig/configure.d/config_os_headers
++++ net-snmp-5.7.3/configure.d/config_os_headers
+@@ -484,8 +484,8 @@ then
+ unset ac_cv_header_pkg_h
+ netsnmp_save_CPPFLAGS="$CPPFLAGS"
+ netsnmp_save_LDFLAGS="$LDFLAGS"
+- CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+- LDFLAGS="$LDFLAGS -L/usr/local/lib"
++ CPPFLAGS="$CPPFLAGS"
++ LDFLAGS="$LDFLAGS"
+ AC_CHECK_HEADERS(pkg.h,
+ NETSNMP_SEARCH_LIBS(pkg_init, pkg,
+ AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng])))
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_libs2-Error-Fix.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_libs2-Error-Fix.patch
new file mode 100644
index 000000000..5866a95ed
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_libs2-Error-Fix.patch
@@ -0,0 +1,31 @@
+From e24fcd140f3f6dd18fd836b197c6d4bb773e50e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C3=ABl=20Carr=C3=A9?= <funman@videolan.org>
+Date: Wed, 4 Nov 2015 16:49:30 +0100
+Subject: [PATCH] config_os_libs2: Error Fix
+
+ERROR: This autoconf log indicates errors, it looked at host include
+and/or library paths while determining system capabilities.
+---
+ configure.d/config_os_libs2 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2
+index 47491e2..e3647f9 100644
+--- a/configure.d/config_os_libs2
++++ b/configure.d/config_os_libs2
+@@ -226,10 +226,10 @@ if test "x$with_nl" != "xno"; then
+ case $target_os in
+ linux*) # Check for libnl (linux)
+ netsnmp_save_CPPFLAGS="$CPPFLAGS"
+- CPPFLAGS="-I/usr/include/libnl3 $CPPFLAGS"
++ CPPFLAGS="$CPPFLAGS"
+ NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
+ [AC_CHECK_HEADERS(netlink/netlink.h)
+- EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES -I/usr/include/libnl3"],
++ EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES"],
+ [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
+ if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
+ NETSNMP_SEARCH_LIBS(nl_connect, nl, [
+--
+2.5.0
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch
new file mode 100644
index 000000000..b87e9eec2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-configure-fix-check-for-enable-perl-cc-checks.patch
@@ -0,0 +1,31 @@
+From c6304a3e4b8441ff0a6464c0f1f6c5229092fa32 Mon Sep 17 00:00:00 2001
+From: Niels Baggesen <nba@users.sourceforge.net>
+Date: Wed, 24 May 2017 16:40:03 +0800
+Subject: [PATCH 1/4] configure: fix check for --enable-perl-cc-checks
+
+This patch comes from git://git.code.sf.net/p/net-snmp/code,
+the commit is 8f431d410b803603dc809d82e0893509615d9a11.
+
+Upstream-Status: Backport
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ configure.d/config_project_perl_python | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python
+index 23f8c7e..475c843 100644
+--- a/configure.d/config_project_perl_python
++++ b/configure.d/config_project_perl_python
+@@ -84,7 +84,7 @@ if test "x$install_perl" != "xno" ; then
+
+ # What compiler was used to build the perl binary?
+ #
+- if test "xenable_perl_cc_checks" != "xno" ; then
++ if test "x$enable_perl_cc_checks" != "xno" ; then
+ AC_MSG_CHECKING([for Perl cc])
+ changequote(, )
+ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch
new file mode 100644
index 000000000..60ce80996
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch
@@ -0,0 +1,29 @@
+From 7136d593ba96b64537069637c328bc65e1b66b2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 22 Jul 2016 18:34:39 +0000
+Subject: [PATCH] get_pid_from_inode: Include limit.h
+
+PATH_MAX and NAME_MAX are required by this file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ agent/mibgroup/util_funcs/get_pid_from_inode.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c
+index 8e157ae..a494ec7 100644
+--- a/agent/mibgroup/util_funcs/get_pid_from_inode.c
++++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c
+@@ -5,6 +5,7 @@
+ #include <net-snmp/output_api.h>
+
+ #include <ctype.h>
++#include <limits.h>
+ #include <stdio.h>
+ #if HAVE_STDLIB_H
+ #include <stdlib.h>
+--
+1.8.3.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch
new file mode 100644
index 000000000..527aa39f2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch
@@ -0,0 +1,26 @@
+From 1ee72102fbe722d232d74abc4660a8b134cec8d6 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Sat, 23 May 2015 07:32:53 +0200
+Subject: [PATCH] snmplib, UDPIPv6 transport: Add a missing return statement
+
+Detected by Coverity.
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ snmplib/transports/snmpUDPIPv6Domain.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c
+===================================================================
+--- net-snmp-5.7.3.orig/snmplib/transports/snmpUDPIPv6Domain.c
++++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c
+@@ -305,6 +305,7 @@ netsnmp_udp6_transport(struct sockaddr_i
+ errno, strerror(errno)));
+ netsnmp_socketbase_close(t);
+ netsnmp_transport_free(t);
++ return NULL;
+ }
+ }
+ /*
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch
new file mode 100644
index 000000000..af242fafb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch
@@ -0,0 +1,33 @@
+From d3027a227bc0f603a5b650d01f97ee1dec515be5 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 18 Sep 2015 00:28:45 -0400
+Subject: [PATCH] snmplib/keytools.c: Don't check for return from
+ EVP_MD_CTX_init()
+
+EVP_MD_CTX_init() API returns void, it fixes errors with new compilers
+
+snmplib/keytools.c: In function 'generate_Ku': error: invalid use of void expression
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://sourceforge.net/p/net-snmp/patches/1317/]
+ snmplib/keytools.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/snmplib/keytools.c b/snmplib/keytools.c
+index 0ccb3a6..880fc14 100644
+--- a/snmplib/keytools.c
++++ b/snmplib/keytools.c
+@@ -153,8 +153,7 @@ generate_Ku(const oid * hashtype, u_int hashtype_len,
+ ctx = EVP_MD_CTX_create();
+ #else
+ ctx = malloc(sizeof(*ctx));
+- if (!EVP_MD_CTX_init(ctx))
+- return SNMPERR_GENERR;
++ EVP_MD_CTX_init(ctx);
+ #endif
+ #ifndef NETSNMP_DISABLE_MD5
+ if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
+--
+2.5.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch
new file mode 100644
index 000000000..999976d27
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-configure-fix-a-cc-check-issue.patch
@@ -0,0 +1,30 @@
+From 94e7e4969bc84c945dfea12d67a1e10f61973948 Mon Sep 17 00:00:00 2001
+From: Wenlin Kang <wenlin.kang@windriver.com>
+Date: Wed, 24 May 2017 16:45:34 +0800
+Subject: [PATCH 2/4] configure: fix a cc check issue.
+
+When has "." in cc value, the expression
+$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'
+can't get corretly the cc's value.
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ configure.d/config_project_perl_python | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.d/config_project_perl_python b/configure.d/config_project_perl_python
+index 475c843..22d2ad3 100644
+--- a/configure.d/config_project_perl_python
++++ b/configure.d/config_project_perl_python
+@@ -87,7 +87,7 @@ if test "x$install_perl" != "xno" ; then
+ if test "x$enable_perl_cc_checks" != "xno" ; then
+ AC_MSG_CHECKING([for Perl cc])
+ changequote(, )
+- PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'`
++ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\.\w\s\/]+).;\s*/$1/);'`
+ changequote([, ])
+ if test "x$PERLCC" != "x" ; then
+ AC_MSG_RESULT([$PERLCC])
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
new file mode 100644
index 000000000..7951234a4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch
@@ -0,0 +1,186 @@
+From e57fc809ad6ae522670f3dc157aadde20d968ca7 Mon Sep 17 00:00:00 2001
+From: Bart Van Assche <bvanassche@acm.org>
+Date: Wed, 24 May 2017 17:05:03 +0800
+Subject: [PATCH 3/4] CHANGES: BUG: 2712: Fix Perl module compilation
+
+Avoid that building the Net-SNMP Perl modules fails as follows:
+
+ERROR from evaluation of /sources/net-snmp-5.7.3/perl/ASN/Makefile.PL: Bizarre \ copy of HASH in list assignment at /usr/lib/perl5/site_perl/5.24.0/Carp.pm line\ 229.
+
+See also https://sourceforge.net/p/net-snmp/bugs/2712/.
+
+This patch comes from git://git.code.sf.net/p/net-snmp/code,
+the commit is 4e793461e96a2b4fd81142ab312d074d5c8841fa.
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ perl/ASN/Makefile.PL | 4 +---
+ perl/Makefile.PL | 4 +---
+ perl/OID/Makefile.PL | 5 +----
+ perl/SNMP/Makefile.PL | 5 +----
+ perl/TrapReceiver/Makefile.PL | 5 +----
+ perl/agent/Makefile.PL | 5 +----
+ perl/agent/Support/Makefile.PL | 5 +----
+ perl/agent/default_store/Makefile.PL | 5 +----
+ perl/default_store/Makefile.PL | 5 +----
+ 9 files changed, 9 insertions(+), 34 deletions(-)
+
+diff --git a/perl/ASN/Makefile.PL b/perl/ASN/Makefile.PL
+index 4576781..c33d8ba 100644
+--- a/perl/ASN/Makefile.PL
++++ b/perl/ASN/Makefile.PL
+@@ -7,9 +7,7 @@ my $lib_version;
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/Makefile.PL b/perl/Makefile.PL
+index 31fdc40..48aba2a 100644
+--- a/perl/Makefile.PL
++++ b/perl/Makefile.PL
+@@ -3,9 +3,7 @@ use Config;
+ use Getopt::Long;
+ require 5;
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ sub InitMakeParams {
+ $nsconfig="net-snmp-config"; # in path by default
+diff --git a/perl/OID/Makefile.PL b/perl/OID/Makefile.PL
+index 6bb1616..2589985 100644
+--- a/perl/OID/Makefile.PL
++++ b/perl/OID/Makefile.PL
+@@ -6,11 +6,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/SNMP/Makefile.PL b/perl/SNMP/Makefile.PL
+index e617cb7..8aab9a9 100644
+--- a/perl/SNMP/Makefile.PL
++++ b/perl/SNMP/Makefile.PL
+@@ -3,15 +3,12 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+ my $opts;
+
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/TrapReceiver/Makefile.PL b/perl/TrapReceiver/Makefile.PL
+index 874ee21..7e9e58e 100644
+--- a/perl/TrapReceiver/Makefile.PL
++++ b/perl/TrapReceiver/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/agent/Makefile.PL b/perl/agent/Makefile.PL
+index 4f7bee3..003c0d1 100644
+--- a/perl/agent/Makefile.PL
++++ b/perl/agent/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/agent/Support/Makefile.PL b/perl/agent/Support/Makefile.PL
+index 48815b6..2325e10 100644
+--- a/perl/agent/Support/Makefile.PL
++++ b/perl/agent/Support/Makefile.PL
+@@ -3,14 +3,11 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+ # See lib/ExtUtils/MakeMaker.pm for details of how to influence
+ # the contents of the Makefile that is written.
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/agent/default_store/Makefile.PL b/perl/agent/default_store/Makefile.PL
+index ed6483a..31cfbee 100644
+--- a/perl/agent/default_store/Makefile.PL
++++ b/perl/agent/default_store/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+ Check_Version();
+
+diff --git a/perl/default_store/Makefile.PL b/perl/default_store/Makefile.PL
+index 7c671b8..01c8dd0 100644
+--- a/perl/default_store/Makefile.PL
++++ b/perl/default_store/Makefile.PL
+@@ -3,11 +3,8 @@ require 5;
+ use Config;
+ use Getopt::Long;
+ my $lib_version;
+-my %MakeParams = ();
+
+-%MakeParams = InitMakeParams();
+-
+-WriteMakefile(%MakeParams);
++WriteMakefile(InitMakeParams());
+
+
+ sub InitMakeParams {
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch
new file mode 100644
index 000000000..2b03f9e9a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch
@@ -0,0 +1,30 @@
+From 4ad98ef125eb4e7d7a1a93146042002f78254d36 Mon Sep 17 00:00:00 2001
+From: Wenlin Kang <wenlin.kang@windriver.com>
+Date: Wed, 24 May 2017 17:10:20 +0800
+Subject: [PATCH 4/4] configure: fix incorrect variable
+
+For cross compile platform, this variable will not be correct, so fix it.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index cfcdf73..164df05 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -171,7 +171,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt
+ #
+ # override LD_RUN_PATH to avoid dependencies on the build directory
+ perlmodules: perlmakefiles subdirs
+- @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
++ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{installprivlib}/CORE);'`") ; \
+ if test $$? != 0 ; then \
+ exit 1 ; \
+ fi
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/dont-return-incompletely-parsed-varbinds.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/dont-return-incompletely-parsed-varbinds.patch
new file mode 100644
index 000000000..6bd0f93c4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/dont-return-incompletely-parsed-varbinds.patch
@@ -0,0 +1,131 @@
+From 6b93e686bdb6a908d00595608646a05527a5326b Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 21 Aug 2015 12:39:12 +0900
+Subject: [PATCH] the snmp_pdu_parse() function could leave incompletely parsed
+ varBind variables in the list of variables in case the parsing of the SNMP
+ PDU failed. If later processing tries to operate on the stale and
+ incompletely processed varBind (e.g. when printing the variables), this can
+ lead to e.g. crashes or, possibly, execution of arbitrary code
+
+Upstream-Status: Backport [net-snmp]
+
+Written-by: Robert Story
+---
+ snmplib/snmp_api.c | 53 ++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 28 insertions(+), 25 deletions(-)
+
+diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c
+index 191debf..15a2d39 100644
+--- a/snmplib/snmp_api.c
++++ b/snmplib/snmp_api.c
+@@ -4350,10 +4350,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ u_char type;
+ u_char msg_type;
+ u_char *var_val;
+- int badtype = 0;
+ size_t len;
+ size_t four;
+- netsnmp_variable_list *vp = NULL;
++ netsnmp_variable_list *vp = NULL, *vplast = NULL;
+ oid objid[MAX_OID_LEN];
+ u_char *p;
+
+@@ -4493,31 +4492,17 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ "varbinds");
+ if (data == NULL)
+- return -1;
++ goto fail;
+
+ /*
+ * get each varBind sequence
+ */
+ while ((int) *length > 0) {
+- netsnmp_variable_list *vptemp;
+- vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
+- if (NULL == vptemp) {
+- return -1;
+- }
+- if (NULL == vp) {
+- pdu->variables = vptemp;
+- } else {
+- vp->next_variable = vptemp;
+- }
+- vp = vptemp;
++ vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
++ if (NULL == vp)
++ goto fail;
+
+- vp->next_variable = NULL;
+- vp->val.string = NULL;
+ vp->name_length = MAX_OID_LEN;
+- vp->name = NULL;
+- vp->index = 0;
+- vp->data = NULL;
+- vp->dataFreeHook = NULL;
+ DEBUGDUMPSECTION("recv", "VarBind");
+ data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
+ &vp->val_len, &var_val, length);
+@@ -4604,7 +4589,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ vp->val.string = (u_char *) malloc(vp->val_len);
+ }
+ if (vp->val.string == NULL) {
+- return -1;
++ goto fail;
+ }
+ p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
+ &vp->val_len);
+@@ -4619,7 +4604,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ vp->val_len *= sizeof(oid);
+ vp->val.objid = (oid *) malloc(vp->val_len);
+ if (vp->val.objid == NULL) {
+- return -1;
++ goto fail;
+ }
+ memmove(vp->val.objid, objid, vp->val_len);
+ break;
+@@ -4631,7 +4616,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ case ASN_BIT_STR:
+ vp->val.bitstring = (u_char *) malloc(vp->val_len);
+ if (vp->val.bitstring == NULL) {
+- return -1;
++ goto fail;
+ }
+ p = asn_parse_bitstring(var_val, &len, &vp->type,
+ vp->val.bitstring, &vp->val_len);
+@@ -4640,12 +4625,30 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length)
+ break;
+ default:
+ snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
+- badtype = -1;
++ goto fail;
+ break;
+ }
+ DEBUGINDENTADD(-4);
++
++ if (NULL == vplast) {
++ pdu->variables = vp;
++ } else {
++ vplast->next_variable = vp;
++ }
++ vplast = vp;
++ vp = NULL;
++
+ }
+- return badtype;
++ return 0;
++
++ fail:
++ DEBUGMSGTL(("recv", "error while parsing VarBindList\n"));
++ /** if we were parsing a var, remove it from the pdu and free it */
++ if (vp)
++ snmp_free_var(vp);
++
++ return -1;
++
+ }
+
+ /*
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch
new file mode 100644
index 000000000..d29be3395
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch
@@ -0,0 +1,25 @@
+LIB_LDCONFIG_CMD failed since it is using a host dir $(libdir)
+which is /usr/lib64 does not exist on host when compile 64bit
+image.
+
+In fact, configuring dynamic linker run-time bindings is meaningless
+at this step, If it is needed, Poky would write ldconfig scripts to
+rpm-postinst for each recipe while do_package, in package.bbclass.
+
+Upstream-Status: Inappropriate [cross compile specific]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+Index: net-snmp-5.7.3/Makefile.top
+===================================================================
+--- net-snmp-5.7.3.orig/Makefile.top
++++ net-snmp-5.7.3/Makefile.top
+@@ -87,7 +87,7 @@ LIBREVISION = 3
+ LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
+ LIB_EXTENSION = la
+ LIB_VERSION =
+-LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir)
++LIB_LDCONFIG_CMD = echo "do not ldconfig\n"
+ LINK = $(LIBTOOL) --mode=link $(LINKCC)
+ # RANLIB = @RANLIB@
+ RANLIB = :
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch
new file mode 100644
index 000000000..fbd274bba
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch
@@ -0,0 +1,42 @@
+From e47c60dc7f649959f63e56bc62355de4bdfd73f4 Mon Sep 17 00:00:00 2001
+From: Marian Florea <marian.florea@windriver.com>
+Date: Thu, 20 Jul 2017 16:55:24 +0800
+Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP
+
+Upstream-Status: Pending
+
+Signed-off-by: Marian Florea <marian.florea@windriver.com>
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ agent/snmpd.c | 1 +
+ snmplib/snmpv3.c | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+Index: net-snmp-5.7.3/agent/snmpd.c
+===================================================================
+--- net-snmp-5.7.3.orig/agent/snmpd.c
++++ net-snmp-5.7.3/agent/snmpd.c
+@@ -1253,6 +1253,7 @@ receive(void)
+ snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n",
+ netsnmp_get_version());
+ update_config();
++ snmp_store(app_name);
+ send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3);
+ #if HAVE_SIGHOLD
+ sigrelse(SIGHUP);
+Index: net-snmp-5.7.3/snmplib/snmpv3.c
+===================================================================
+--- net-snmp-5.7.3.orig/snmplib/snmpv3.c
++++ net-snmp-5.7.3/snmplib/snmpv3.c
+@@ -984,9 +984,9 @@ init_snmpv3_post_config(int majorid, int
+ /*
+ * if our engineID has changed at all, the boots record must be set to 1
+ */
+- if (engineIDLen != oldEngineIDLength ||
++ if (oldEngineIDLength != (size_t)0 && (engineIDLen != oldEngineIDLength ||
+ oldEngineID == NULL || c_engineID == NULL ||
+- memcmp(oldEngineID, c_engineID, engineIDLen) != 0) {
++ memcmp(oldEngineID, c_engineID, engineIDLen) != 0)) {
+ engineBoots = 1;
+ }
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch
new file mode 100644
index 000000000..74b0c12e0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch
@@ -0,0 +1,35 @@
+net-snmp: add knob whether nlist.h are checked
+
+Previously, it still was checked when there was no nlish.h in sysroots directory.
+Add knob to decide whether nlist.h are checked or not.
+
+Upstream-status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.d/config_os_headers | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers
+index d903f58..a05d30e 100644
+--- a/configure.d/config_os_headers
++++ b/configure.d/config_os_headers
+@@ -31,6 +31,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl
+ [sys/un.h ])
+
+ # Library and Agent:
++if test "x$with_elf" != "xno"; then
+ AC_CHECK_HEADERS([nlist.h],,,[
+ AC_INCLUDES_DEFAULT
+ [
+@@ -38,6 +39,7 @@ AC_INCLUDES_DEFAULT
+ #define LIBBSD_DISABLE_DEPRECATED 1
+ #endif
+ ]])
++fi
+
+ # Library:
+ AC_CHECK_HEADERS([fcntl.h io.h kstat.h ] dnl
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-agentx-crash.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-agentx-crash.patch
new file mode 100644
index 000000000..5eed893e1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-agentx-crash.patch
@@ -0,0 +1,75 @@
+Description: fix snmpd crash via AgentX connection
+
+ taken from Fedora, net-snmp-5.7-agentx-crash.patch
+
+bz729738 - net-snmp dumps core in netsnmp_oid_find_prefix
+bz1038011 - net-snmp: snmpd crashes/hangs when AgentX subagent times-out
+
+commit f9304c83f76202db0e684269ca1af32e43cd9db4
+Author: Jan Safranek <jsafranek@users.sourceforge.net>
+Date: Tue Feb 7 14:53:44 2012 +0100
+
+ CHANGES: PATCH 1633670: fixed snmpd crashing when an AgentX subagent
+ disconnect in the middle of processing of a request.
+
+ I fixed also the memory leak reported in the tracker comments.
+
+Upstream-Status: Backport
+
+Signed-off-by: Zhu Yanjun <yanjun.zhu@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+---
+ agent/mibgroup/agentx/master.c | 5 +++++
+ agent/mibgroup/agentx/master_admin.c | 9 +++++++--
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/agent/mibgroup/agentx/master.c b/agent/mibgroup/agentx/master.c
+index c42a42a..baeebaf 100644
+--- a/agent/mibgroup/agentx/master.c
++++ b/agent/mibgroup/agentx/master.c
+@@ -219,6 +219,9 @@ agentx_got_response(int operation,
+ if (!cache) {
+ DEBUGMSGTL(("agentx/master", "response too late on session %8p\n",
+ session));
++ /* response is too late, free the cache */
++ if (magic)
++ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic);
+ return 0;
+ }
+ requests = cache->requests;
+@@ -606,6 +609,8 @@ agentx_master_handler(netsnmp_mib_handler *handler,
+ result = snmp_async_send(ax_session, pdu, agentx_got_response, cb_data);
+ if (result == 0) {
+ snmp_free_pdu(pdu);
++ if (cb_data)
++ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) cb_data);
+ }
+
+ return SNMP_ERR_NOERROR;
+diff --git a/agent/mibgroup/agentx/master_admin.c b/agent/mibgroup/agentx/master_admin.c
+index f16f392..b84b85e 100644
+--- a/agent/mibgroup/agentx/master_admin.c
++++ b/agent/mibgroup/agentx/master_admin.c
+@@ -133,11 +133,16 @@ close_agentx_session(netsnmp_session * session, int sessid)
+ * requests, so that the delegated request will be completed and
+ * further requests can be processed
+ */
+- netsnmp_remove_delegated_requests_for_session(session);
++ while (netsnmp_remove_delegated_requests_for_session(session)) {
++ DEBUGMSGTL(("agentx/master", "Continue removing delegated reqests\n"));
++ }
++
+ if (session->subsession != NULL) {
+ netsnmp_session *subsession = session->subsession;
+ for(; subsession; subsession = subsession->next) {
+- netsnmp_remove_delegated_requests_for_session(subsession);
++ while (netsnmp_remove_delegated_requests_for_session(subsession)) {
++ DEBUGMSGTL(("agentx/master", "Continue removing delegated subsession reqests\n"));
++ }
+ }
+ }
+
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
new file mode 100644
index 000000000..25eb9c96f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch
@@ -0,0 +1,32 @@
+From 270e952f58a7e5ddeabe5a15e3ddaaadf40017d0 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 22 Jun 2017 10:25:08 +0800
+Subject: [PATCH] net-snmp: fix for --disable-des
+
+Include des.h only if it's found in openssl so that
+the --disable-des works correctly.
+
+Upstream-Status: Submitted [net-snmp-coders@lists.sourceforge.net]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ snmplib/scapi.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/snmplib/scapi.c b/snmplib/scapi.c
+index 16ac829..271684b 100644
+--- a/snmplib/scapi.c
++++ b/snmplib/scapi.c
+@@ -79,7 +79,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support)
+ #include <openssl/hmac.h>
+ #include <openssl/evp.h>
+ #include <openssl/rand.h>
++#ifdef HAVE_OPENSSL_DES_H
+ #include <openssl/des.h>
++#endif
+ #ifdef HAVE_AES
+ #include <openssl/aes.h>
+ #endif
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch
new file mode 100644
index 000000000..8f8336a49
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch
@@ -0,0 +1,34 @@
+From 4bb4024b395f19d36ab3569e2773ea80d8cc5261 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 14 Jan 2015 15:10:06 +0800
+Subject: [PATCH] testing: add the output format for ptest
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ testing/RUNTESTS | 4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+Index: net-snmp-5.7.3/testing/RUNTESTS
+===================================================================
+--- net-snmp-5.7.3.orig/testing/RUNTESTS
++++ net-snmp-5.7.3/testing/RUNTESTS
+@@ -29,13 +29,17 @@ failed_count=0
+ rm -f failed_tests
+ for i in "${srcdir}"/testing/fulltests/default/T*$1*; do
+ echo "RUNNING $i"
++ test_name=`basename $i`
+ ${srcdir}/testing/fulltests/support/simple_run $i
+ if [ $? = 0 ]; then
++ echo "PASS: $test_name"
+ success_count=`expr $success_count + 1`
+ else
++ echo "FAIL: $test_name"
+ failed_count=`expr $failed_count + 1`
+ echo "$i" >> failed_tests
+ fi
++ echo
+ done
+
+ if [ -f failed_tests ]; then
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest
new file mode 100755
index 000000000..2334217bc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+cd testing
+./RUNTESTS
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service
new file mode 100644
index 000000000..447683f85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Simple Network Management Protocol (SNMP) Daemon.
+After=syslog.target network.target
+
+[Service]
+Type=notify
+Environment=OPTIONS="-Ls0-6d"
+EnvironmentFile=-/etc/default/snmpd
+ExecStart=/usr/sbin/snmpd $OPTIONS -a -f
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service
new file mode 100644
index 000000000..951f9f270
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Simple Network Management Protocol (SNMP) Trap Daemon.
+After=syslog.target network.target
+
+[Service]
+Type=notify
+Environment=OPTIONS="-Lsd"
+EnvironmentFile=-/etc/default/snmptrapd
+ExecStart=/usr/sbin/snmptrapd $OPTIONS -f
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch
new file mode 100644
index 000000000..c6af8c0f3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch
@@ -0,0 +1,1652 @@
+From 0cad0c6c36af2a2d589563804c9ed2b37b7085fb Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Fri, 21 Aug 2015 14:37:02 +0900
+Subject: [PATCH] ystemd support backported from the master branch as of
+ 23/04/2012 (post 5.7.1, pre 5.8).
+
+The following commits have been cherry-picked:
+
+19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11
+fef6cddfdb94da1a6b1fb768af62918b80f11fd3
+0641e43c694c485cbbffef0556efc4641bd3ff50
+76530a89f1c8bbd0b63acce63e10d5d4812a1a16 (conflict resolved)
+bf108d7f1354f6276fc43c129963f2c49b9fc242
+3692875172352f72cf3afd0d35f355e83d7e421b
+74412748067c685e1d8ab6ed3bcc3ca9c2774844
+86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0
+63557cf8986a33dba1d4429b583a901361052c4f
+
+Upstream-Status: Backport
+
+Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com>
+---
+ README.systemd | 41 +++
+ agent/snmpd.c | 33 +-
+ apps/snmptrapd.c | 32 +-
+ configure.d/config_modules_lib | 8 +
+ configure.d/config_project_with_enable | 9 +
+ dist/snmpd.servic | 18 +
+ dist/snmpd.socket | 17 +
+ dist/snmptrapd.service | 16 +
+ dist/snmptrapd.socket | 14 +
+ include/net-snmp/library/sd-daemon.h | 290 ++++++++++++++++
+ snmplib/sd-daemon.c | 532 +++++++++++++++++++++++++++++
+ snmplib/transports/snmpTCPDomain.c | 43 ++-
+ snmplib/transports/snmpTCPIPv6Domain.c | 46 ++-
+ snmplib/transports/snmpUDPIPv4BaseDomain.c | 33 +-
+ snmplib/transports/snmpUDPIPv6Domain.c | 34 +-
+ snmplib/transports/snmpUnixDomain.c | 66 ++--
+ win32/libsnmp/Makefile.in | 6 +
+ win32/net-snmp/net-snmp-config.h | 2 +
+ win32/net-snmp/net-snmp-config.h.in | 2 +
+ 19 files changed, 1176 insertions(+), 66 deletions(-)
+ create mode 100644 README.systemd
+ create mode 100644 dist/snmpd.servic
+ create mode 100644 dist/snmpd.socket
+ create mode 100644 dist/snmptrapd.service
+ create mode 100644 dist/snmptrapd.socket
+ create mode 100644 include/net-snmp/library/sd-daemon.h
+ create mode 100644 snmplib/sd-daemon.c
+
+diff --git a/README.systemd b/README.systemd
+new file mode 100644
+index 0000000..dba15d1
+--- /dev/null
++++ b/README.systemd
+@@ -0,0 +1,41 @@
++README.systemd
++--------------
++Net-SNMP provides two daemons, which support systemd system manager.
++See http://www.freedesktop.org/wiki/Software/systemd to learn how
++systemd works. Both socket activation and notification is supported by these
++daemons.
++
++To enable systemd support, the sources must be compiled with
++--with-systemd configure option.
++
++snmpd - The SNMP agent
++----------------------
++Socket activation od snmpd daemon is implemented, but it's discouraged.
++The reason is simple - snmpd not only listens and processes SNMP requests
++from network, but also gathers system statistics counters, sends traps and
++communicates with subagents. It even opens few netlink sockets.
++
++In other words, snmpd should run from system start to properly work.
++This can be done in two ways:
++1) either as snmpd service unit with 'Type=notification' and without a socket
++ unit
++2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit
++ and the snmpd service enabled. This way systemd creates the snmpd listening
++ socket early during boot and passes the sockets to snmpd slightly later
++ (but still during machine boot). This way systemd can paralelize start of
++ services, which depend on snmpd. Admins must adjust the socket file manually,
++ depending if the snmpd support AgentX, IPv6, SMUX etc.
++
++snmpd should be started with '-f' command line parameter to disable forking -
++systemd does that for us automatically.
++
++
++snmptrapd - The trap processing daemon
++--------------------------------------
++snmptrapd supports full socket activation and also notification (if needed).
++Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services
++will work. Again, '-f' parameter should be provided on snmptrapd command line.
++
++If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should
++start during boot and not after first SNMP trap arrives. Same rules as for snmpd
++applies then.
+diff --git a/agent/snmpd.c b/agent/snmpd.c
+index cfc7bce..116ee5c 100644
+--- a/agent/snmpd.c
++++ b/agent/snmpd.c
+@@ -164,6 +164,10 @@ typedef long fd_mask;
+
+ #endif
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ netsnmp_feature_want(logging_file)
+ netsnmp_feature_want(logging_stdio)
+ netsnmp_feature_want(logging_syslog)
+@@ -443,19 +447,29 @@ main(int argc, char *argv[])
+ int agent_mode = -1;
+ char *pid_file = NULL;
+ char option_compatability[] = "-Le";
++#ifndef WIN32
++ int prepared_sockets = 0;
++#endif
+ #if HAVE_GETPID
+ int fd;
+ FILE *PID;
+ #endif
+
+ #ifndef WIN32
++#ifndef NETSNMP_NO_SYSTEMD
++ /* check if systemd has sockets for us and don't close them */
++ prepared_sockets = netsnmp_sd_listen_fds(0);
++#endif /* NETSNMP_NO_SYSTEMD */
++
+ /*
+ * close all non-standard file descriptors we may have
+ * inherited from the shell.
+ */
+- for (i = getdtablesize() - 1; i > 2; --i) {
+- (void) close(i);
+- }
++ if (!prepared_sockets) {
++ for (i = getdtablesize() - 1; i > 2; --i) {
++ (void) close(i);
++ }
++}
+ #endif /* #WIN32 */
+
+ /*
+@@ -1107,6 +1121,19 @@ main(int argc, char *argv[])
+ netsnmp_addrcache_initialise();
+
+ /*
++ * Let systemd know we're up.
++ */
++#ifndef NETSNMP_NO_SYSTEMD
++ netsnmp_sd_notify(1, "READY=1\n");
++ if (prepared_sockets)
++ /*
++ * Clear the environment variable, we already processed all the sockets
++ * by now.
++ */
++ netsnmp_sd_listen_fds(1);
++#endif
++
++ /*
+ * Forever monitor the dest_port for incoming PDUs.
+ */
+ DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n"));
+diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c
+index bce0d47..c6a74ec 100644
+--- a/apps/snmptrapd.c
++++ b/apps/snmptrapd.c
+@@ -125,6 +125,10 @@ SOFTWARE.
+
+ #include <net-snmp/net-snmp-features.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ #ifndef BSD4_3
+ #define BSD4_2
+ #endif
+@@ -657,16 +661,25 @@ main(int argc, char *argv[])
+ int agentx_subagent = 1;
+ #endif
+ netsnmp_trapd_handler *traph;
++#ifndef WIN32
++ int prepared_sockets = 0;
++#endif
+
+
+ #ifndef WIN32
++#ifndef NETSNMP_NO_SYSTEMD
++ /* check if systemd has sockets for us and don't close them */
++ prepared_sockets = netsnmp_sd_listen_fds(0);
++#endif
+ /*
+ * close all non-standard file descriptors we may have
+ * inherited from the shell.
+ */
+- for (i = getdtablesize() - 1; i > 2; --i) {
+- (void) close(i);
+- }
++ if (!prepared_sockets) {
++ for (i = getdtablesize() - 1; i > 2; --i) {
++ (void) close(i);
++ }
++}
+ #endif /* #WIN32 */
+
+ #ifdef SIGTERM
+@@ -1318,6 +1331,19 @@ main(int argc, char *argv[])
+ #endif
+ #endif
+
++ /*
++ * Let systemd know we're up.
++ */
++#ifndef NETSNMP_NO_SYSTEMD
++ netsnmp_sd_notify(1, "READY=1\n");
++ if (prepared_sockets)
++ /*
++ * Clear the environment variable, we already processed all the sockets
++ * by now.
++ */
++ netsnmp_sd_listen_fds(1);
++#endif
++
+ #ifdef WIN32SERVICE
+ trapd_status = SNMPTRAPD_RUNNING;
+ #endif
+diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib
+index 362ba0a..bb69daa 100644
+--- a/configure.d/config_modules_lib
++++ b/configure.d/config_modules_lib
+@@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc"
+ other_ftobjs_list="$other_ftobjs_list winpipe.ft"
+ fi
+
++# Linux systemd
++if test "x$with_systemd" == "xyes"; then
++ other_src_list="$other_src_list sd-daemon.c"
++ other_objs_list="$other_objs_list sd-daemon.o"
++ other_lobjs_list="$other_lobjs_list sd-daemon.lo"
++ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft"
++fi
++
+ AC_SUBST(other_src_list)
+ AC_SUBST(other_objs_list)
+ AC_SUBST(other_lobjs_list)
+diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable
+index 61ba026..d782d12 100644
+--- a/configure.d/config_project_with_enable
++++ b/configure.d/config_project_with_enable
+@@ -690,6 +690,15 @@ if test "x$with_dummy_values" != "xyes"; then
+ data for])
+ fi
+
++NETSNMP_ARG_WITH(systemd,
++[ --with-systemd Provide systemd support. See README.systemd
++ for details.])
++# Define unless specifically suppressed (i.e., option defaults to false).
++if test "x$with_systemd" != "xyes"; then
++ AC_DEFINE(NETSNMP_NO_SYSTEMD, 1,
++ [If you don't want to integrate with systemd.])
++fi
++
+ NETSNMP_ARG_ENABLE(set-support,
+ [ --disable-set-support Do not allow SNMP set requests.])
+ if test "x$enable_set_support" = "xno"; then
+diff --git a/dist/snmpd.servic b/dist/snmpd.servic
+new file mode 100644
+index 0000000..31391e5
+--- /dev/null
++++ b/dist/snmpd.servic
+@@ -0,0 +1,18 @@
++#
++# SNMP agent service file for systemd
++#
++#
++# The service should be enabled, i.e. snmpd should start during machine boot.
++# Socket activation shall not be used. See README.systemd for details.
++
++[Unit]
++Description=Simple Network Management Protocol (SNMP) daemon.
++After=syslog.target network.target
++
++[Service]
++# Type=notify is also supported. It should be set when snmpd.socket is not used.
++Type=simple
++ExecStart=/usr/sbin/snmpd -f
++
++[Install]
++WantedBy=multi-user.target
+diff --git a/dist/snmpd.socket b/dist/snmpd.socket
+new file mode 100644
+index 0000000..7f3a2d9
+--- /dev/null
++++ b/dist/snmpd.socket
+@@ -0,0 +1,17 @@
++[Unit]
++Description=Socket listening for SNMP and AgentX messages
++
++[Socket]
++ListenDatagram=0.0.0.0:161
++# Uncomment other listening addresses as needed - TCP, UDP6, TCP6.
++# It must match listening addresses/ports defined in snmpd.service
++# or snmpd.conf.
++# ListenStream=0.0.0.0:161
++# ListenDatagram=[::]:161
++# ListenStream=[::]:161
++#
++# Uncomment AgentX socket if snmpd.conf enables AgentX protocol.
++# ListenStream=/var/agentx/master
++
++[Install]
++WantedBy=sockets.target
+diff --git a/dist/snmptrapd.service b/dist/snmptrapd.service
+new file mode 100644
+index 0000000..e88a5b4
+--- /dev/null
++++ b/dist/snmptrapd.service
+@@ -0,0 +1,16 @@
++#
++# SNMP trap-processing service file for systemd
++#
++
++[Unit]
++Description=Simple Network Management Protocol (SNMP) Trap daemon.
++After=syslog.target network.target
++
++[Service]
++# Type=notify is also supported. It should be set when snmptrapd.socket is not
++# used.
++Type=simple
++ExecStart=/usr/sbin/snmptrapd -f
++
++[Install]
++WantedBy=multi-user.target
+diff --git a/dist/snmptrapd.socket b/dist/snmptrapd.socket
+new file mode 100644
+index 0000000..2d24fb8
+--- /dev/null
++++ b/dist/snmptrapd.socket
+@@ -0,0 +1,14 @@
+++[Unit]
+++Description=Socket listening for SNMP trap messages
+++
+++[Socket]
+++ListenDatagram=0.0.0.0:162
+++# Uncomment other listening addresses as needed - TCP, UDP6, TCP6.
+++# It must match listening addresses/ports defined in snmptrapd.service
+++# or snmptrapd.conf.
+++# ListenStream=0.0.0.0:162
+++# ListenDatagram=[::]:162
+++# ListenStream=[::]:162
+++
+++[Install]
+++WantedBy=sockets.target
+diff --git a/include/net-snmp/library/sd-daemon.h b/include/net-snmp/library/sd-daemon.h
+new file mode 100644
+index 0000000..85274c9
+--- /dev/null
++++ b/include/net-snmp/library/sd-daemon.h
+@@ -0,0 +1,290 @@
++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
++
++#ifndef SNMPD_SD_DAEMON_H
++#define SNMPD_SD_DAEMON_H
++
++/***
++ Copyright 2010 Lennart Poettering
++
++ Permission is hereby granted, free of charge, to any person
++ obtaining a copy of this software and associated documentation files
++ (the "Software"), to deal in the Software without restriction,
++ including without limitation the rights to use, copy, modify, merge,
++ publish, distribute, sublicense, and/or sell copies of the Software,
++ and to permit persons to whom the Software is furnished to do so,
++ subject to the following conditions:
++
++ The above copyright notice and this permission notice shall be
++ included in all copies or substantial portions of the Software.
++
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ SOFTWARE.
++***/
++
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_INTTYPES_H
++#include <inttypes.h>
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/*
++ Reference implementation of a few systemd related interfaces for
++ writing daemons. These interfaces are trivial to implement. To
++ simplify porting we provide this reference implementation.
++ Applications are welcome to reimplement the algorithms described
++ here if they do not want to include these two source files.
++
++ The following functionality is provided:
++
++ - Support for logging with log levels on stderr
++ - File descriptor passing for socket-based activation
++ - Daemon startup and status notification
++ - Detection of systemd boots
++
++ You may compile this with -DDISABLE_SYSTEMD to disable systemd
++ support. This makes all those calls NOPs that are directly related to
++ systemd (i.e. only sd_is_xxx() will stay useful).
++
++ Since this is drop-in code we don't want any of our symbols to be
++ exported in any case. Hence we declare hidden visibility for all of
++ them.
++
++ You may find an up-to-date version of these source files online:
++
++ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h
++ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c
++
++ This should compile on non-Linux systems, too, but with the
++ exception of the sd_is_xxx() calls all functions will become NOPs.
++
++ See sd-daemon(7) for more information.
++*/
++
++#ifndef _sd_printf_attr_
++#if __GNUC__ >= 4
++#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
++#else
++#define _sd_printf_attr_(a,b)
++#endif
++#endif
++
++/*
++ Log levels for usage on stderr:
++
++ fprintf(stderr, SD_NOTICE "Hello World!\n");
++
++ This is similar to printk() usage in the kernel.
++*/
++#define SD_EMERG "<0>" /* system is unusable */
++#define SD_ALERT "<1>" /* action must be taken immediately */
++#define SD_CRIT "<2>" /* critical conditions */
++#define SD_ERR "<3>" /* error conditions */
++#define SD_WARNING "<4>" /* warning conditions */
++#define SD_NOTICE "<5>" /* normal but significant condition */
++#define SD_INFO "<6>" /* informational */
++#define SD_DEBUG "<7>" /* debug-level messages */
++
++/* The first passed file descriptor is fd 3 */
++#define SD_LISTEN_FDS_START 3
++
++/*
++ Returns how many file descriptors have been passed, or a negative
++ errno code on failure. Optionally, removes the $LISTEN_FDS and
++ $LISTEN_PID file descriptors from the environment (recommended, but
++ problematic in threaded environments). If r is the return value of
++ this function you'll find the file descriptors passed as fds
++ SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative
++ errno style error code on failure. This function call ensures that
++ the FD_CLOEXEC flag is set for the passed file descriptors, to make
++ sure they are not passed on to child processes. If FD_CLOEXEC shall
++ not be set, the caller needs to unset it after this call for all file
++ descriptors that are used.
++
++ See sd_listen_fds(3) for more information.
++*/
++int netsnmp_sd_listen_fds(int unset_environment);
++
++/*
++ Helper call for identifying a passed file descriptor. Returns 1 if
++ the file descriptor is a FIFO in the file system stored under the
++ specified path, 0 otherwise. If path is NULL a path name check will
++ not be done and the call only verifies if the file descriptor
++ refers to a FIFO. Returns a negative errno style error code on
++ failure.
++
++ See sd_is_fifo(3) for more information.
++*/
++int netsnmp_sd_is_fifo(int fd, const char *path);
++
++/*
++ Helper call for identifying a passed file descriptor. Returns 1 if
++ the file descriptor is a special character device on the file
++ system stored under the specified path, 0 otherwise.
++ If path is NULL a path name check will not be done and the call
++ only verifies if the file descriptor refers to a special character.
++ Returns a negative errno style error code on failure.
++
++ See sd_is_special(3) for more information.
++*/
++int netsnmp_sd_is_special(int fd, const char *path);
++
++/*
++ Helper call for identifying a passed file descriptor. Returns 1 if
++ the file descriptor is a socket of the specified family (AF_INET,
++ ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If
++ family is 0 a socket family check will not be done. If type is 0 a
++ socket type check will not be done and the call only verifies if
++ the file descriptor refers to a socket. If listening is > 0 it is
++ verified that the socket is in listening mode. (i.e. listen() has
++ been called) If listening is == 0 it is verified that the socket is
++ not in listening mode. If listening is < 0 no listening mode check
++ is done. Returns a negative errno style error code on failure.
++
++ See sd_is_socket(3) for more information.
++*/
++int netsnmp_sd_is_socket(int fd, int family, int type, int listening);
++
++/*
++ Helper call for identifying a passed file descriptor. Returns 1 if
++ the file descriptor is an Internet socket, of the specified family
++ (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM,
++ SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version
++ check is not done. If type is 0 a socket type check will not be
++ done. If port is 0 a socket port check will not be done. The
++ listening flag is used the same way as in sd_is_socket(). Returns a
++ negative errno style error code on failure.
++
++ See sd_is_socket_inet(3) for more information.
++*/
++int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port);
++
++/*
++ Helper call for identifying a passed file descriptor. Returns 1 if
++ the file descriptor is an AF_UNIX socket of the specified type
++ (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0
++ a socket type check will not be done. If path is NULL a socket path
++ check will not be done. For normal AF_UNIX sockets set length to
++ 0. For abstract namespace sockets set length to the length of the
++ socket name (including the initial 0 byte), and pass the full
++ socket path in path (including the initial 0 byte). The listening
++ flag is used the same way as in sd_is_socket(). Returns a negative
++ errno style error code on failure.
++
++ See sd_is_socket_unix(3) for more information.
++*/
++int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length);
++
++/*
++ Informs systemd about changed daemon state. This takes a number of
++ newline separated environment-style variable assignments in a
++ string. The following variables are known:
++
++ READY=1 Tells systemd that daemon startup is finished (only
++ relevant for services of Type=notify). The passed
++ argument is a boolean "1" or "0". Since there is
++ little value in signaling non-readiness the only
++ value daemons should send is "READY=1".
++
++ STATUS=... Passes a single-line status string back to systemd
++ that describes the daemon state. This is free-from
++ and can be used for various purposes: general state
++ feedback, fsck-like programs could pass completion
++ percentages and failing programs could pass a human
++ readable error message. Example: "STATUS=Completed
++ 66% of file system check..."
++
++ ERRNO=... If a daemon fails, the errno-style error code,
++ formatted as string. Example: "ERRNO=2" for ENOENT.
++
++ BUSERROR=... If a daemon fails, the D-Bus error-style error
++ code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut"
++
++ MAINPID=... The main pid of a daemon, in case systemd did not
++ fork off the process itself. Example: "MAINPID=4711"
++
++ Daemons can choose to send additional variables. However, it is
++ recommended to prefix variable names not listed above with X_.
++
++ Returns a negative errno-style error code on failure. Returns > 0
++ if systemd could be notified, 0 if it couldn't possibly because
++ systemd is not running.
++
++ Example: When a daemon finished starting up, it could issue this
++ call to notify systemd about it:
++
++ sd_notify(0, "READY=1");
++
++ See sd_notifyf() for more complete examples.
++
++ See sd_notify(3) for more information.
++*/
++int netsnmp_sd_notify(int unset_environment, const char *state);
++
++/*
++ Similar to sd_notify() but takes a format string.
++
++ Example 1: A daemon could send the following after initialization:
++
++ sd_notifyf(0, "READY=1\n"
++ "STATUS=Processing requests...\n"
++ "MAINPID=%lu",
++ (unsigned long) getpid());
++
++ Example 2: A daemon could send the following shortly before
++ exiting, on failure:
++
++ sd_notifyf(0, "STATUS=Failed to start up: %s\n"
++ "ERRNO=%i",
++ strerror(errno),
++ errno);
++
++ See sd_notifyf(3) for more information.
++*/
++int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3);
++
++/*
++ Returns > 0 if the system was booted with systemd. Returns < 0 on
++ error. Returns 0 if the system was not booted with systemd. Note
++ that all of the functions above handle non-systemd boots just
++ fine. You should NOT protect them with a call to this function. Also
++ note that this function checks whether the system, not the user
++ session is controlled by systemd. However the functions above work
++ for both user and system services.
++
++ See sd_booted(3) for more information.
++*/
++int netsnmp_sd_booted(void);
++
++/**
++ * Find an socket with given parameters. See man sd_is_socket_inet for
++ * description of the arguments.
++ *
++ * Returns the file descriptor if it is found, 0 otherwise.
++ */
++int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port);
++
++/**
++ * Find an unix socket with given parameters. See man sd_is_socket_unix for
++ * description of the arguments.
++ *
++ * Returns the file descriptor if it is found, 0 otherwise.
++ */
++int
++netsnmp_sd_find_unix_socket(int type, int listening, const char *path);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* SNMPD_SD_DAEMON_H */
+diff --git a/snmplib/sd-daemon.c b/snmplib/sd-daemon.c
+new file mode 100644
+index 0000000..42dba29
+--- /dev/null
++++ b/snmplib/sd-daemon.c
+@@ -0,0 +1,532 @@
++/*
++ * Systemd integration parts.
++ *
++ * Most of this file is directly copied from systemd sources.
++ * Changes:
++ * - all functions were renamed to have netsnmp_ prefix
++ * - includes were changed to match Net-SNMP style.
++ * - removed gcc export macros
++ * - removed POSIX message queues
++ */
++
++#include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-features.h>
++#include <net-snmp/types.h>
++#include <net-snmp/library/snmp_debug.h>
++
++#ifndef NETSNMP_NO_SYSTEMD
++
++/***
++ Copyright 2010 Lennart Poettering
++
++ Permission is hereby granted, free of charge, to any person
++ obtaining a copy of this software and associated documentation files
++ (the "Software"), to deal in the Software without restriction,
++ including without limitation the rights to use, copy, modify, merge,
++ publish, distribute, sublicense, and/or sell copies of the Software,
++ and to permit persons to whom the Software is furnished to do so,
++ subject to the following conditions:
++
++ The above copyright notice and this permission notice shall be
++ included in all copies or substantial portions of the Software.
++
++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
++ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
++ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
++ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
++ SOFTWARE.
++***/
++
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <sys/socket.h>
++#include <sys/un.h>
++#include <sys/fcntl.h>
++#include <netinet/in.h>
++#include <stdlib.h>
++#include <errno.h>
++#include <unistd.h>
++#include <string.h>
++#include <stdarg.h>
++#include <stdio.h>
++#include <stddef.h>
++#include <limits.h>
++
++#include <net-snmp/library/sd-daemon.h>
++
++int netsnmp_sd_listen_fds(int unset_environment) {
++
++ int r, fd;
++ const char *e;
++ char *p = NULL;
++ unsigned long l;
++
++ if (!(e = getenv("LISTEN_PID"))) {
++ r = 0;
++ goto finish;
++ }
++
++ errno = 0;
++ l = strtoul(e, &p, 10);
++
++ if (errno != 0) {
++ r = -errno;
++ goto finish;
++ }
++
++ if (!p || *p || l <= 0) {
++ r = -EINVAL;
++ goto finish;
++ }
++
++ /* Is this for us? */
++ if (getpid() != (pid_t) l) {
++ r = 0;
++ goto finish;
++ }
++
++ if (!(e = getenv("LISTEN_FDS"))) {
++ r = 0;
++ goto finish;
++ }
++
++ errno = 0;
++ l = strtoul(e, &p, 10);
++
++ if (errno != 0) {
++ r = -errno;
++ goto finish;
++ }
++
++ if (!p || *p) {
++ r = -EINVAL;
++ goto finish;
++ }
++
++ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) {
++ int flags;
++
++ if ((flags = fcntl(fd, F_GETFD)) < 0) {
++ r = -errno;
++ goto finish;
++ }
++
++ if (flags & FD_CLOEXEC)
++ continue;
++
++ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) {
++ r = -errno;
++ goto finish;
++ }
++ }
++
++ r = (int) l;
++
++finish:
++ if (unset_environment) {
++ unsetenv("LISTEN_PID");
++ unsetenv("LISTEN_FDS");
++ }
++
++ return r;
++}
++
++int netsnmp_sd_is_fifo(int fd, const char *path) {
++ struct stat st_fd;
++
++ if (fd < 0)
++ return -EINVAL;
++
++ memset(&st_fd, 0, sizeof(st_fd));
++ if (fstat(fd, &st_fd) < 0)
++ return -errno;
++
++ if (!S_ISFIFO(st_fd.st_mode))
++ return 0;
++
++ if (path) {
++ struct stat st_path;
++
++ memset(&st_path, 0, sizeof(st_path));
++ if (stat(path, &st_path) < 0) {
++
++ if (errno == ENOENT || errno == ENOTDIR)
++ return 0;
++
++ return -errno;
++ }
++
++ return
++ st_path.st_dev == st_fd.st_dev &&
++ st_path.st_ino == st_fd.st_ino;
++ }
++
++ return 1;
++}
++
++int netsnmp_sd_is_special(int fd, const char *path) {
++ struct stat st_fd;
++
++ if (fd < 0)
++ return -EINVAL;
++
++ if (fstat(fd, &st_fd) < 0)
++ return -errno;
++
++ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode))
++ return 0;
++
++ if (path) {
++ struct stat st_path;
++
++ if (stat(path, &st_path) < 0) {
++
++ if (errno == ENOENT || errno == ENOTDIR)
++ return 0;
++
++ return -errno;
++ }
++
++ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode))
++ return
++ st_path.st_dev == st_fd.st_dev &&
++ st_path.st_ino == st_fd.st_ino;
++ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode))
++ return st_path.st_rdev == st_fd.st_rdev;
++ else
++ return 0;
++ }
++
++ return 1;
++}
++
++static int sd_is_socket_internal(int fd, int type, int listening) {
++ struct stat st_fd;
++
++ if (fd < 0 || type < 0)
++ return -EINVAL;
++
++ if (fstat(fd, &st_fd) < 0)
++ return -errno;
++
++ if (!S_ISSOCK(st_fd.st_mode))
++ return 0;
++
++ if (type != 0) {
++ int other_type = 0;
++ socklen_t l = sizeof(other_type);
++
++ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0)
++ return -errno;
++
++ if (l != sizeof(other_type))
++ return -EINVAL;
++
++ if (other_type != type)
++ return 0;
++ }
++
++ if (listening >= 0) {
++ int accepting = 0;
++ socklen_t l = sizeof(accepting);
++
++ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0)
++ return -errno;
++
++ if (l != sizeof(accepting))
++ return -EINVAL;
++
++ if (!accepting != !listening)
++ return 0;
++ }
++
++ return 1;
++}
++
++union sockaddr_union {
++ struct sockaddr sa;
++ struct sockaddr_in in4;
++ struct sockaddr_in6 in6;
++ struct sockaddr_un un;
++ struct sockaddr_storage storage;
++};
++
++int netsnmp_sd_is_socket(int fd, int family, int type, int listening) {
++ int r;
++
++ if (family < 0)
++ return -EINVAL;
++
++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
++ return r;
++
++ if (family > 0) {
++ union sockaddr_union sockaddr;
++ socklen_t l;
++
++ memset(&sockaddr, 0, sizeof(sockaddr));
++ l = sizeof(sockaddr);
++
++ if (getsockname(fd, &sockaddr.sa, &l) < 0)
++ return -errno;
++
++ if (l < sizeof(sa_family_t))
++ return -EINVAL;
++
++ return sockaddr.sa.sa_family == family;
++ }
++
++ return 1;
++}
++
++int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
++ union sockaddr_union sockaddr;
++ socklen_t l;
++ int r;
++
++ if (family != 0 && family != AF_INET && family != AF_INET6)
++ return -EINVAL;
++
++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
++ return r;
++
++ memset(&sockaddr, 0, sizeof(sockaddr));
++ l = sizeof(sockaddr);
++
++ if (getsockname(fd, &sockaddr.sa, &l) < 0)
++ return -errno;
++
++ if (l < sizeof(sa_family_t))
++ return -EINVAL;
++
++ if (sockaddr.sa.sa_family != AF_INET &&
++ sockaddr.sa.sa_family != AF_INET6)
++ return 0;
++
++ if (family > 0)
++ if (sockaddr.sa.sa_family != family)
++ return 0;
++
++ if (port > 0) {
++ if (sockaddr.sa.sa_family == AF_INET) {
++ if (l < sizeof(struct sockaddr_in))
++ return -EINVAL;
++
++ return htons(port) == sockaddr.in4.sin_port;
++ } else {
++ if (l < sizeof(struct sockaddr_in6))
++ return -EINVAL;
++
++ return htons(port) == sockaddr.in6.sin6_port;
++ }
++ }
++
++ return 1;
++}
++
++int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) {
++ union sockaddr_union sockaddr;
++ socklen_t l;
++ int r;
++
++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0)
++ return r;
++
++ memset(&sockaddr, 0, sizeof(sockaddr));
++ l = sizeof(sockaddr);
++
++ if (getsockname(fd, &sockaddr.sa, &l) < 0)
++ return -errno;
++
++ if (l < sizeof(sa_family_t))
++ return -EINVAL;
++
++ if (sockaddr.sa.sa_family != AF_UNIX)
++ return 0;
++
++ if (path) {
++ if (length <= 0)
++ length = strlen(path);
++
++ if (length <= 0)
++ /* Unnamed socket */
++ return l == offsetof(struct sockaddr_un, sun_path);
++
++ if (path[0])
++ /* Normal path socket */
++ return
++ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) &&
++ memcmp(path, sockaddr.un.sun_path, length+1) == 0;
++ else
++ /* Abstract namespace socket */
++ return
++ (l == offsetof(struct sockaddr_un, sun_path) + length) &&
++ memcmp(path, sockaddr.un.sun_path, length) == 0;
++ }
++
++ return 1;
++}
++
++int netsnmp_sd_notify(int unset_environment, const char *state) {
++ int fd = -1, r;
++ struct msghdr msghdr;
++ struct iovec iovec;
++ union sockaddr_union sockaddr;
++ const char *e;
++
++ if (!state) {
++ r = -EINVAL;
++ goto finish;
++ }
++
++ if (!(e = getenv("NOTIFY_SOCKET")))
++ return 0;
++
++ /* Must be an abstract socket, or an absolute path */
++ if ((e[0] != '@' && e[0] != '/') || e[1] == 0) {
++ r = -EINVAL;
++ goto finish;
++ }
++
++ if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) {
++ r = -errno;
++ goto finish;
++ }
++
++ memset(&sockaddr, 0, sizeof(sockaddr));
++ sockaddr.sa.sa_family = AF_UNIX;
++ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path));
++
++ if (sockaddr.un.sun_path[0] == '@')
++ sockaddr.un.sun_path[0] = 0;
++
++ memset(&iovec, 0, sizeof(iovec));
++ iovec.iov_base = (char *)state;
++ iovec.iov_len = strlen(state);
++
++ memset(&msghdr, 0, sizeof(msghdr));
++ msghdr.msg_name = &sockaddr;
++ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e);
++
++ if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
++ msghdr.msg_namelen = sizeof(struct sockaddr_un);
++
++ msghdr.msg_iov = &iovec;
++ msghdr.msg_iovlen = 1;
++
++ if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) {
++ r = -errno;
++ goto finish;
++ }
++
++ r = 1;
++
++finish:
++ if (unset_environment)
++ unsetenv("NOTIFY_SOCKET");
++
++ if (fd >= 0)
++ close(fd);
++
++ return r;
++}
++
++int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) {
++ va_list ap;
++ char *p = NULL;
++ int r;
++
++ va_start(ap, format);
++ r = vasprintf(&p, format, ap);
++ va_end(ap);
++
++ if (r < 0 || !p)
++ return -ENOMEM;
++
++ r = netsnmp_sd_notify(unset_environment, p);
++ free(p);
++
++ return r;
++}
++
++int netsnmp_sd_booted(void) {
++ struct stat a, b;
++
++ /* We simply test whether the systemd cgroup hierarchy is
++ * mounted */
++
++ if (lstat("/sys/fs/cgroup", &a) < 0)
++ return 0;
++
++ if (lstat("/sys/fs/cgroup/systemd", &b) < 0)
++ return 0;
++
++ return a.st_dev != b.st_dev;
++}
++
++/* End of original sd-daemon.c from systemd sources */
++
++int
++netsnmp_sd_find_inet_socket(int family, int type, int listening, int port)
++{
++ int count, fd;
++
++ count = netsnmp_sd_listen_fds(0);
++ if (count <= 0) {
++ DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n"));
++ return 0;
++ }
++ DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n",
++ count));
++
++ for (fd = 3; fd < 3+count; fd++) {
++ int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port);
++ if (rc < 0)
++ DEBUGMSGTL(("systemd:find_inet_socket",
++ "sd_is_socket_inet error: %d\n", rc));
++ if (rc > 0) {
++ DEBUGMSGTL(("systemd:find_inet_socket",
++ "Found the socket in LISTEN_FDS\n"));
++ return fd;
++ }
++ }
++ DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n"));
++ return 0;
++}
++
++int
++netsnmp_sd_find_unix_socket(int type, int listening, const char *path)
++{
++ int count, fd;
++
++ count = netsnmp_sd_listen_fds(0);
++ if (count <= 0) {
++ DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n"));
++ return 0;
++ }
++ DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n",
++ count));
++
++ for (fd = 3; fd < 3+count; fd++) {
++ int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0);
++ if (rc < 0)
++ DEBUGMSGTL(("systemd:find_unix_socket",
++ "netsnmp_sd_is_socket_unix error: %d\n", rc));
++ if (rc > 0) {
++ DEBUGMSGTL(("systemd:find_unix_socket",
++ "Found the socket in LISTEN_FDS\n"));
++ return fd;
++ }
++ }
++ DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n"));
++ return 0;
++}
++
++#endif /* ! NETSNMP_NO_SYSTEMD */
+diff --git a/snmplib/transports/snmpTCPDomain.c b/snmplib/transports/snmpTCPDomain.c
+index 7feb028..a41b926 100644
+--- a/snmplib/transports/snmpTCPDomain.c
++++ b/snmplib/transports/snmpTCPDomain.c
+@@ -43,6 +43,10 @@
+ #include <net-snmp/library/snmpTCPBaseDomain.h>
+ #include <net-snmp/library/tools.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ /*
+ * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c
+ * and perl/agent/agent.xs
+@@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
+ netsnmp_transport *t = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
+ int rc = 0;
++ int socket_initialized = 0;
+
+ #ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+@@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
+ t->domain_length =
+ sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]);
+
+- t->sock = socket(PF_INET, SOCK_STREAM, 0);
++#ifndef NETSNMP_NO_SYSTEMD
++ /*
++ * Maybe the socket was already provided by systemd...
++ */
++ if (local) {
++ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1,
++ ntohs(addr->sin_port));
++ if (t->sock)
++ socket_initialized = 1;
++ }
++#endif
++ if (!socket_initialized)
++ t->sock = socket(PF_INET, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+@@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
+ setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt,
+ sizeof(opt));
+
+- rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr));
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr));
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+
+ /*
+@@ -236,11 +255,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
+ * Now sit here and wait for connections to arrive.
+ */
+
+- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+
+ /*
+diff --git a/snmplib/transports/snmpTCPIPv6Domain.c b/snmplib/transports/snmpTCPIPv6Domain.c
+index d2e0a2d..22de6d4 100644
+--- a/snmplib/transports/snmpTCPIPv6Domain.c
++++ b/snmplib/transports/snmpTCPIPv6Domain.c
+@@ -49,6 +49,10 @@
+ #include <net-snmp/library/snmpTCPBaseDomain.h>
+ #include <net-snmp/library/tools.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ #include "inet_ntop.h"
+
+ oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 };
+@@ -140,6 +144,8 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local)
+ {
+ netsnmp_transport *t = NULL;
+ int rc = 0;
++ char *str = NULL;
++ int socket_initialized = 0;
+
+ #ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+@@ -174,7 +180,19 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local)
+ t->domain = netsnmp_TCPIPv6Domain;
+ t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid);
+
+- t->sock = socket(PF_INET6, SOCK_STREAM, 0);
++#ifndef NETSNMP_NO_SYSTEMD
++ /*
++ * Maybe the socket was already provided by systemd...
++ */
++ if (local) {
++ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1,
++ ntohs(addr->sin6_port));
++ if (t->sock)
++ socket_initialized = 1;
++ }
++#endif
++ if (!socket_initialized)
++ t->sock = socket(PF_INET6, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+@@ -220,12 +238,14 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local)
+
+ setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt));
+
+- rc = bind(t->sock, (struct sockaddr *) addr,
+- sizeof(struct sockaddr_in6));
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = bind(t->sock, (struct sockaddr *) addr,
++ sizeof(struct sockaddr_in6));
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+
+ /*
+@@ -242,11 +262,13 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local)
+ * Now sit here and wait for connections to arrive.
+ */
+
+- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+
+ /*
+diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c
+index 8c0fb05..00e5bbc 100644
+--- a/snmplib/transports/snmpUDPIPv4BaseDomain.c
++++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c
+@@ -40,6 +40,10 @@
+
+ #include <net-snmp/library/snmpSocketBaseDomain.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR)
+ int netsnmp_udpipv4_recvfrom(int s, void *buf, int len, struct sockaddr *from,
+ socklen_t *fromlen, struct sockaddr *dstip,
+@@ -64,6 +68,7 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local)
+ char *client_socket = NULL;
+ netsnmp_indexed_addr_pair addr_pair;
+ socklen_t local_addr_len;
++ int socket_initialized = 0;
+
+ #ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+@@ -88,7 +93,19 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local)
+ free(str);
+ }
+
+- t->sock = socket(PF_INET, SOCK_DGRAM, 0);
++#ifndef NETSNMP_NO_SYSTEMD
++ /*
++ * Maybe the socket was already provided by systemd...
++ */
++ if (local) {
++ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1,
++ ntohs(addr->sin_port));
++ if (t->sock)
++ socket_initialized = 1;
++ }
++#endif
++ if (!socket_initialized)
++ t->sock = socket(PF_INET, SOCK_DGRAM, 0);
+ DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local));
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+@@ -151,12 +168,14 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local)
+ }
+ }
+ #endif /* !defined(WIN32) */
+- rc = bind(t->sock, (struct sockaddr *) addr,
+- sizeof(struct sockaddr));
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = bind(t->sock, (struct sockaddr *) addr,
++ sizeof(struct sockaddr));
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+ t->data = NULL;
+ t->data_length = 0;
+diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c
+index 18de876..fd2ced4 100644
+--- a/snmplib/transports/snmpUDPIPv6Domain.c
++++ b/snmplib/transports/snmpUDPIPv6Domain.c
+@@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+ #include <net-snmp/library/snmpSocketBaseDomain.h>
+ #include <net-snmp/library/tools.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ #include "inet_ntop.h"
+ #include "inet_pton.h"
+
+@@ -190,6 +194,8 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local)
+ {
+ netsnmp_transport *t = NULL;
+ int rc = 0;
++ char *str = NULL;
++ int socket_initialized = 0;
+
+ #ifdef NETSNMP_NO_LISTEN_SUPPORT
+ if (local)
+@@ -217,7 +223,19 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local)
+ t->domain_length =
+ sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]);
+
+- t->sock = socket(PF_INET6, SOCK_DGRAM, 0);
++#ifndef NETSNMP_NO_SYSTEMD
++ /*
++ * Maybe the socket was already provided by systemd...
++ */
++ if (local) {
++ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1,
++ ntohs(addr->sin6_port));
++ if (t->sock)
++ socket_initialized = 1;
++ }
++#endif
++ if (!socket_initialized)
++ t->sock = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+@@ -243,12 +261,14 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local)
+ }
+ #endif
+
+- rc = bind(t->sock, (struct sockaddr *) addr,
+- sizeof(struct sockaddr_in6));
+- if (rc != 0) {
+- netsnmp_socketbase_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = bind(t->sock, (struct sockaddr *) addr,
++ sizeof(struct sockaddr_in6));
++ if (rc != 0) {
++ netsnmp_socketbase_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+ t->local = (unsigned char*)malloc(18);
+ if (t->local == NULL) {
+diff --git a/snmplib/transports/snmpUnixDomain.c b/snmplib/transports/snmpUnixDomain.c
+index 47dffc1..8f34c37 100644
+--- a/snmplib/transports/snmpUnixDomain.c
++++ b/snmplib/transports/snmpUnixDomain.c
+@@ -37,6 +37,10 @@
+ #include <net-snmp/library/system.h> /* mkdirhier */
+ #include <net-snmp/library/tools.h>
+
++#ifndef NETSNMP_NO_SYSTEMD
++#include <net-snmp/library/sd-daemon.h>
++#endif
++
+ netsnmp_feature_child_of(transport_unix_socket_all, transport_all)
+ netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all)
+
+@@ -295,6 +299,8 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local)
+ netsnmp_transport *t = NULL;
+ sockaddr_un_pair *sup = NULL;
+ int rc = 0;
++ char *string = NULL;
++ int socket_initialized = 0;
+
+ #ifdef NETSNMP_NO_LISTEN_SUPPORT
+ /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate,
+@@ -333,7 +339,18 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local)
+ t->data_length = sizeof(sockaddr_un_pair);
+ sup = (sockaddr_un_pair *) t->data;
+
+- t->sock = socket(PF_UNIX, SOCK_STREAM, 0);
++#ifndef NETSNMP_NO_SYSTEMD
++ /*
++ * Maybe the socket was already provided by systemd...
++ */
++ if (local) {
++ t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path);
++ if (t->sock)
++ socket_initialized = 1;
++ }
++#endif
++ if (!socket_initialized)
++ t->sock = socket(PF_UNIX, SOCK_STREAM, 0);
+ if (t->sock < 0) {
+ netsnmp_transport_free(t);
+ return NULL;
+@@ -357,25 +374,26 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local)
+
+ t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN;
+
+- unlink(addr->sun_path);
+- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
+-
+- if (rc != 0 && errno == ENOENT && create_path) {
+- rc = mkdirhier(addr->sun_path, create_mode, 1);
++ if (!socket_initialized) {
++ unlink(addr->sun_path);
++ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
++ if (rc != 0 && errno == ENOENT && create_path) {
++ rc = mkdirhier(addr->sun_path, create_mode, 1);
++ if (rc != 0) {
++ netsnmp_unix_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
++ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
++ }
+ if (rc != 0) {
++ DEBUGMSGTL(("netsnmp_unix_transport",
++ "couldn't bind \"%s\", errno %d (%s)\n",
++ addr->sun_path, errno, strerror(errno)));
+ netsnmp_unix_close(t);
+ netsnmp_transport_free(t);
+ return NULL;
+ }
+- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr));
+- }
+- if (rc != 0) {
+- DEBUGMSGTL(("netsnmp_unix_transport",
+- "couldn't bind \"%s\", errno %d (%s)\n",
+- addr->sun_path, errno, strerror(errno)));
+- netsnmp_unix_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
+ }
+
+ /*
+@@ -391,14 +409,16 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local)
+ * Now sit here and listen for connections to arrive.
+ */
+
+- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
+- if (rc != 0) {
+- DEBUGMSGTL(("netsnmp_unix_transport",
+- "couldn't listen to \"%s\", errno %d (%s)\n",
+- addr->sun_path, errno, strerror(errno)));
+- netsnmp_unix_close(t);
+- netsnmp_transport_free(t);
+- return NULL;
++ if (!socket_initialized) {
++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN);
++ if (rc != 0) {
++ DEBUGMSGTL(("netsnmp_unix_transport",
++ "couldn't listen to \"%s\", errno %d (%s)\n",
++ addr->sun_path, errno, strerror(errno)));
++ netsnmp_unix_close(t);
++ netsnmp_transport_free(t);
++ return NULL;
++ }
+ }
+
+ } else {
+diff --git a/win32/libsnmp/Makefile.in b/win32/libsnmp/Makefile.in
+index 98d83c8..b228d20 100644
+--- a/win32/libsnmp/Makefile.in
++++ b/win32/libsnmp/Makefile.in
+@@ -42,6 +42,7 @@ LIB32_OBJS= \
+ "$(INTDIR)\read_config.obj" \
+ "$(INTDIR)\readdir.obj" \
+ "$(INTDIR)\scapi.obj" \
++ "$(INTDIR)\sd-daemon.obj" \
+ "$(INTDIR)\snmp-tc.obj" \
+ "$(INTDIR)\snmp.obj" \
+ "$(INTDIR)\snmpCallbackDomain.obj" \
+@@ -138,6 +139,11 @@ SOURCE=..\..\snmplib\asn1.c
+ "$(INTDIR)\asn1.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
++SOURCE=..\..\snmplib\sd-daemon.c
++
++"$(INTDIR)\sd-daemon.obj" : $(SOURCE) "$(INTDIR)"
++ $(CPP) $(CPP_PROJ) $(SOURCE)
++
+
+ SOURCE=..\..\snmplib\callback.c
+
+diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h
+index 1608563..7aec547 100644
+--- a/win32/net-snmp/net-snmp-config.h
++++ b/win32/net-snmp/net-snmp-config.h
+@@ -1717,6 +1717,8 @@ enum {
+ #define DMALLOC_FUNC_CHECK
+ #endif
+
+++#define NETSNMP_NO_SYSTEMD
+++
+ /* #undef NETSNMP_ENABLE_LOCAL_SMUX */
+
+ /* define if agentx transport is to use domain sockets only */
+diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in
+index 9693730..96ec3d9 100644
+--- a/win32/net-snmp/net-snmp-config.h.in
++++ b/win32/net-snmp/net-snmp-config.h.in
+@@ -1717,6 +1717,8 @@ enum {
+ #define DMALLOC_FUNC_CHECK
+ #endif
+
++#define NETSNMP_NO_SYSTEMD
++
+ /* #undef NETSNMP_ENABLE_LOCAL_SMUX */
+
+ /* define if agentx transport is to use domain sockets only */
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
new file mode 100644
index 000000000..faf73a563
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -0,0 +1,244 @@
+SUMMARY = "Various tools relating to the Simple Network Management Protocol"
+HOMEPAGE = "http://www.net-snmp.org/"
+SECTION = "net"
+LICENSE = "BSD"
+
+LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e"
+
+DEPENDS = "openssl libnl pciutils"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
+ file://init \
+ file://snmpd.conf \
+ file://snmptrapd.conf \
+ file://systemd-support.patch \
+ file://snmpd.service \
+ file://snmptrapd.service \
+ file://net-snmp-add-knob-whether-nlist.h-are-checked.patch \
+ file://fix-libtool-finish.patch \
+ file://net-snmp-testing-add-the-output-format-for-ptest.patch \
+ file://run-ptest \
+ file://dont-return-incompletely-parsed-varbinds.patch \
+ file://0001-config_os_headers-Error-Fix.patch \
+ file://0001-config_os_libs2-Error-Fix.patch \
+ file://0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \
+ file://net-snmp-agentx-crash.patch \
+ file://0001-get_pid_from_inode-Include-limit.h.patch \
+ file://0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch \
+ file://0001-snmplib-UDPIPv6-transport-Add-a-missing-return-state.patch \
+ file://0001-configure-fix-check-for-enable-perl-cc-checks.patch \
+ file://0002-configure-fix-a-cc-check-issue.patch \
+ file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \
+ file://0004-configure-fix-incorrect-variable.patch \
+ file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \
+ file://net-snmp-fix-for-disable-des.patch \
+ file://0001-Remove-U64-typedef.patch \
+ "
+SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
+SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"
+
+inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative
+
+EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
+
+PARALLEL_MAKE = ""
+CCACHE = ""
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils"
+PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,,"
+
+PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no,\
+ perl, perl perl-lib"
+
+EXTRA_OECONF = "--enable-shared \
+ --disable-manuals \
+ --with-defaults \
+ --with-install-prefix=${D} \
+ --with-persistent-directory=${localstatedir}/lib/net-snmp \
+ ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
+"
+
+# net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
+EXTRA_OECONF += "--with-mib-modules=smux"
+
+CACHED_CONFIGUREVARS = " \
+ ac_cv_header_valgrind_valgrind_h=no \
+ ac_cv_header_valgrind_memcheck_h=no \
+ ac_cv_ETC_MNTTAB=/etc/mtab \
+ lt_cv_shlibpath_overrides_runpath=yes \
+"
+export PERLPROG="${bindir}/env perl"
+PERLPROG_append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}"
+
+HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}"
+
+do_configure_prepend() {
+ sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \
+ "${S}"/configure \
+ "${S}"/configure.d/config_os_libs2
+
+ if [ "${HAS_PERL}" = "1" ]; then
+ # this may need to be changed when package perl has any change.
+ cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config.pm ${WORKDIR}/
+ cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl/*/Config_heavy.pl ${WORKDIR}/
+ sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \
+ -e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \
+ -e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \
+ -e "s@sitearchexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
+ -e "s@sitelibexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \
+ -e "s@vendorarchexp => '/usr@vendorarchexp => '${STAGING_DIR_TARGET}/usr@g" \
+ -e "s@vendorlibexp => '/usr@vendorlibexp => '${STAGING_DIR_TARGET}/usr@g" \
+ -i ${WORKDIR}/Config.pm
+ fi
+
+}
+
+do_configure_append() {
+ if [ "${HAS_PERL}" = "1" ]; then
+ sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \
+ -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \
+ -i ${B}/net-snmp-config
+ fi
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/snmp
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd
+ install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/
+ install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
+ sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+ -i ${D}${bindir}/net-snmp-create-v3-user
+ sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+ -e "s@\([^ ]*-fdebug-prefix-map=[^ ]*\)\1*@@g" \
+ -e "s@\([^ ]*--sysroot=[^ ]*\)\1*@@g" \
+ -e "s@\([^ ]*--with-libtool-sysroot=[^ ]*\)\1*@@g" \
+ -e "s@\([^ ]*--with-install-prefix=[^ ]*\)\1*@@g" \
+ -i ${D}${bindir}/net-snmp-config
+
+ if [ "${HAS_PERL}" = "1" ]; then
+ sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \
+ -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \
+ -i ${D}${bindir}/net-snmp-config
+ fi
+}
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}
+ for i in ${S}/dist ${S}/include ${B}/include ${S}/mibs ${S}/configure \
+ ${B}/net-snmp-config ${S}/testing; do
+ if [ -e "$i" ]; then
+ cp -R --no-dereference --preserve=mode,links -v "$i" ${D}${PTEST_PATH}
+ fi
+ done
+ echo `autoconf -V|awk '/autoconf/{print $NF}'` > ${D}${PTEST_PATH}/dist/autoconf-version
+
+ rmdlist="${D}${PTEST_PATH}/dist/net-snmp-solaris-build"
+ for i in $rmdlist; do
+ if [ -d "$i" ]; then
+ rm -rf "$i"
+ fi
+ done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess"
+SNMP_DBGDIR = "/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}"
+
+net_snmp_sysroot_preprocess () {
+ if [ -e ${D}${bindir}/net-snmp-config ]; then
+ install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ install -m 755 ${D}${bindir}/net-snmp-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+ sed -e "s@-I/usr/include@-I${STAGING_INCDIR}@g" \
+ -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}${prefix}@g" \
+ -e "s@^exec_prefix=.*@exec_prefix=${STAGING_EXECPREFIXDIR}@g" \
+ -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \
+ -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \
+ -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=${S}@g" \
+ -e "s@-fdebug-prefix-map=${SNMP_DBGDIR}@-fdebug-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \
+ -e "s@-fdebug-prefix-map= -fdebug-prefix-map=@-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
+ -fdebug-prefix-map=${STAGING_DIR_HOST}=@g" \
+ -e "s@--sysroot=@--sysroot=${STAGING_DIR_HOST}@g" \
+ -e "s@--with-libtool-sysroot=@--with-libtool-sysroot=${STAGING_DIR_HOST}@g" \
+ -e "s@--with-install-prefix=@--with-install-prefix=${D}@g" \
+ -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/net-snmp-config
+ fi
+}
+
+PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd"
+
+# perl module
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl-modules', '', d)}"
+
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-server = "1"
+
+FILES_${PN}-perl-modules = "${libdir}/perl/*"
+
+FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}"
+FILES_${PN}-mibs = "${datadir}/snmp/mibs"
+FILES_${PN}-server-snmpd = "${sbindir}/snmpd \
+ ${sysconfdir}/snmp/snmpd.conf \
+ ${sysconfdir}/init.d \
+ ${systemd_unitdir}/system/snmpd.service \
+"
+
+FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \
+ ${sysconfdir}/snmp/snmptrapd.conf \
+ ${systemd_unitdir}/system/snmptrapd.service \
+"
+
+FILES_${PN} = ""
+FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/"
+FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/"
+FILES_${PN}-dev += "${bindir}/mib2c ${bindir}/mib2c-update"
+
+CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf"
+CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf"
+
+INITSCRIPT_PACKAGES = "${PN}-server-snmpd"
+INITSCRIPT_NAME_${PN}-server-snmpd = "snmpd"
+INITSCRIPT_PARAMS_${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ."
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}"
+
+SYSTEMD_PACKAGES = "${PN}-server-snmpd \
+ ${PN}-server-snmptrapd"
+
+SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service"
+SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service"
+
+RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}"
+RDEPENDS_${PN} += "net-snmp-client"
+RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs"
+RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd"
+RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd"
+RDEPENDS_${PN}-client += "net-snmp-mibs net-snmp-libs"
+RDEPENDS_${PN}-libs += "libpci"
+RDEPENDS_${PN}-ptest += "perl \
+ perl-module-test \
+ perl-module-file-basename \
+ perl-module-getopt-long \
+ perl-module-file-temp \
+ perl-module-data-dumper \
+"
+RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})"
+RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})"
+
+RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd"
+
+RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd"
+
+LEAD_SONAME = "libnetsnmp.so"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb b/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb
new file mode 100644
index 000000000..1d77891d4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/nopoll/nopoll_0.4.2.b297.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenSource WebSocket Toolkit"
+DESCRIPTION = "noPoll is a OpenSource WebSocket implementation (RFC 6455), \
+written in ansi C, that allows building pure WebSocket solutions or to \
+provide WebSocket support to existing TCP oriented applications.\
+\
+noPoll provides support for WebSocket (ws://) and TLS (secure) WebSocket (wss://),\
+allowing message based (handler notified) programming or stream oriented access."
+
+HOMEPAGE = "http://www.aspl.es/nopoll/"
+LICENSE = "LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f0504124678c1b3158146e0630229298 \
+ "
+DEPENDS = "openssl"
+SRC_URI = "http://www.aspl.es/nopoll/downloads/nopoll-${PV}.tar.gz \
+ "
+SRC_URI[md5sum] = "8c411cd0f3c0479aed28c4cf7b114fbb"
+SRC_URI[sha256sum] = "f5fbf8aaa16a77b0f265d8c847eb06cb3e68f2b1a50737466dae81181618654c"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-nopoll-doc"
+
+LDFLAGS += "-lpthread"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc
new file mode 100644
index 000000000..cccbfa19a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow.inc
@@ -0,0 +1,37 @@
+SUMMARY = "OpenFlow communications protocol"
+DESCRIPTION = "\
+Open standard that enables researchers to run experimental protocols in \
+contained networks. OpenFlow is a communications interface between \
+control and forwarding planes of a software-defined networking architecture.\
+"
+HOMEPAGE = "http://www.openflow.org"
+
+SECTION = "net"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2"
+
+SRC_URI = "git://gitosis.stanford.edu/openflow.git;protocol=git"
+
+DEPENDS = "virtual/libc"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl openssl-native, libssl"
+
+EXTRA_OECONF += " \
+ KARCH=${TARGET_ARCH} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'openssl', 'SSL_LIBS="-lssl -lcrypto"', '', d)} \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep pkgconfig
+
+do_configure_prepend() {
+ ./boot.sh
+}
+
+do_install_append() {
+ # Remove /var/run as it is created on startup
+ rm -rf ${D}${localstatedir}/run
+}
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch
new file mode 100644
index 000000000..952274bb9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch
@@ -0,0 +1,64 @@
+From 7b62e5884353b247f542844d1e4687d0e9211999 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 04:27:32 -0700
+Subject: [PATCH 1/2] Check and use strlcpy from libc before defining own
+
+This is required especially on musl where
+function prototype conflicts and causes build
+failures.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 2 +-
+ lib/util.c | 2 ++
+ lib/util.h | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 13064f6..596c43f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -57,7 +57,7 @@ OFP_CHECK_HWTABLES
+ OFP_CHECK_HWLIBS
+ AC_SYS_LARGEFILE
+
+-AC_CHECK_FUNCS([strsignal])
++AC_CHECK_FUNCS([strlcpy strsignal])
+
+ AC_ARG_VAR(KARCH, [Kernel Architecture String])
+ AC_SUBST(KARCH)
+diff --git a/lib/util.c b/lib/util.c
+index 21cc28d..1f341b1 100644
+--- a/lib/util.c
++++ b/lib/util.c
+@@ -138,6 +138,7 @@ xasprintf(const char *format, ...)
+ return s;
+ }
+
++#ifndef HAVE_STRLCPY
+ void
+ strlcpy(char *dst, const char *src, size_t size)
+ {
+@@ -148,6 +149,7 @@ strlcpy(char *dst, const char *src, size_t size)
+ dst[n_copy] = '\0';
+ }
+ }
++#endif
+
+ void
+ ofp_fatal(int err_no, const char *format, ...)
+diff --git a/lib/util.h b/lib/util.h
+index fde681f..9e45ea9 100644
+--- a/lib/util.h
++++ b/lib/util.h
+@@ -41,6 +41,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include "compiler.h"
++#include "config.h"
+
+ #ifndef va_copy
+ #ifdef __va_copy
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch
new file mode 100644
index 000000000..75180fe32
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow/0002-lib-netdev-Adjust-header-include-sequence.patch
@@ -0,0 +1,59 @@
+From 5bba224edea38607e8732081f86679ffd8b218ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 20 Jul 2017 04:29:04 -0700
+Subject: [PATCH 2/2] lib/netdev: Adjust header include sequence
+
+Specify libc headers before kernel UAPIs
+this helps compiling with musl where otherwise
+it uses the definition from kernel and complains
+about double definition in libc headers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/netdev.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/lib/netdev.c b/lib/netdev.c
+index 3b6fbc5..c7de25e 100644
+--- a/lib/netdev.c
++++ b/lib/netdev.c
+@@ -39,7 +39,6 @@
+ #include <fcntl.h>
+ #include <arpa/inet.h>
+ #include <inttypes.h>
+-#include <linux/if_tun.h>
+
+ /* Fix for some compile issues we were experiencing when setting up openwrt
+ * with the 2.4 kernel. linux/ethtool.h seems to use kernel-style inttypes,
+@@ -57,10 +56,6 @@
+ #define s64 __s64
+ #endif
+
+-#include <linux/ethtool.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/sockios.h>
+-#include <linux/version.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+@@ -68,12 +63,16 @@
+ #include <net/ethernet.h>
+ #include <net/if.h>
+ #include <net/if_arp.h>
+-#include <net/if_packet.h>
+ #include <net/route.h>
+ #include <netinet/in.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <linux/ethtool.h>
++#include <linux/rtnetlink.h>
++#include <linux/sockios.h>
++#include <linux/version.h>
++#include <linux/if_tun.h>
+
+ #include "fatal-signal.h"
+ #include "list.h"
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_1.0.bb b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_1.0.bb
new file mode 100644
index 000000000..a7e254dd8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_1.0.bb
@@ -0,0 +1,4 @@
+include ${BPN}.inc
+
+SRCREV = "5ccca75a69f99791659bcfbcf35353ab1921320a"
+PV = "1.0"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb
new file mode 100644
index 000000000..eceb45e94
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openflow/openflow_git.bb
@@ -0,0 +1,9 @@
+include ${BPN}.inc
+
+SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a"
+PV = "1.0+git${SRCPV}"
+
+SRC_URI += "\
+ file://0001-Check-and-use-strlcpy-from-libc-before-defining-own.patch \
+ file://0002-lib-netdev-Adjust-header-include-sequence.patch \
+ "
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch
new file mode 100644
index 000000000..d1ee3c591
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-Use-1-instead-of-WAIT_ANY.patch
@@ -0,0 +1,29 @@
+From 1f8d336a5cd88b87e15596d05980f6fe77a0f226 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:28:41 -0700
+Subject: [PATCH 1/4] Use -1 instead of WAIT_ANY
+
+WAIT_ANY is not supported by POSIX and some C libraries
+e.g. musl do not define this.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ usl/usl_pid.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usl/usl_pid.c b/usl/usl_pid.c
+index 103458b..9819473 100644
+--- a/usl/usl_pid.c
++++ b/usl/usl_pid.c
+@@ -78,7 +78,7 @@ int usl_pid_reap_children(int waitfor)
+
+ /* Wait for processes in our process group. */
+
+- while (((pid = waitpid(WAIT_ANY, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
++ while (((pid = waitpid(-1, &status, (waitfor ? 0: WNOHANG))) != -1) && (pid != 0)) {
+ have_callback = 0;
+ usl_list_for_each(walk, tmp, &usl_child_list) {
+ child = usl_list_entry(walk, struct usl_pid_child, list);
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch
new file mode 100644
index 000000000..c50f68e65
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api-Included-needed-headers.patch
@@ -0,0 +1,34 @@
+From 25dce20a75bc84ae9e4ec640590cef0c12750789 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 17:48:13 -0700
+Subject: [PATCH 1/2] l2tp_api: Included needed headers
+
+These are flagged by musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ l2tp_api.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/l2tp_api.c b/l2tp_api.c
+index d16f80e..9d6f60a 100644
+--- a/l2tp_api.c
++++ b/l2tp_api.c
+@@ -22,9 +22,12 @@
+ * Each module implements the required RPC xxx_1_svc() callbacks which
+ * are called directly by the RPC library.
+ */
+-
++#define _GNU_SOURCE
++#include <sys/types.h>
++#include <rpc/types.h>
++#include <rpc/xdr.h>
+ #include <rpc/pmap_clnt.h>
+-#include <net/ethernet.h>
++//#include <netinet/in.h>
+
+ #include "usl.h"
+
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch
new file mode 100644
index 000000000..a11a97ebd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch
@@ -0,0 +1,31 @@
+From 8f299df4dd1ca857e34859c377a29b183c630961 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Sep 2017 13:05:03 -0700
+Subject: [PATCH] l2tp_api.c: include rpc/clnt.h for 'resultproc_t'
+
+Fixes
+
+| /mnt/a/oe/build/tmp/work/mips32r2-bec-linux-musl/openl2tp/1.8-r0/recipe-sysroot/usr/include/tirpc/rpc/pmap_clnt.h:81:12: error: unknown type name 'resultproc_t'; did you mean 'rpcproc_t'? | resultproc_t); | ^~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ l2tp_api.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/l2tp_api.c b/l2tp_api.c
+index f0946fd..f77881c 100644
+--- a/l2tp_api.c
++++ b/l2tp_api.c
+@@ -26,6 +26,7 @@
+ #include <sys/types.h>
+ #include <rpc/types.h>
+ #include <rpc/xdr.h>
++#include <rpc/clnt.h>
+ #include <rpc/pmap_clnt.h>
+ //#include <netinet/in.h>
+
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch
new file mode 100644
index 000000000..1f576fa71
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0001-test-pppd_dummy.c-Fix-return-value.patch
@@ -0,0 +1,38 @@
+From ce5f5563ab54db9d28dba44a0e25e8a8c7bb9876 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 19 Oct 2016 00:34:35 +0000
+Subject: [PATCH] test/pppd_dummy.c: Fix return value
+
+pause() is defined in unistd.h, clang does not
+like the fact that we are using a function without
+declaration
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/pppd_dummy.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/test/pppd_dummy.c b/test/pppd_dummy.c
+index 148e7d2..b564c36 100644
+--- a/test/pppd_dummy.c
++++ b/test/pppd_dummy.c
+@@ -26,6 +26,7 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <syslog.h>
++#include <unistd.h>
+
+ #define PPPD_DUMMY_TMP_FILE "/tmp/pppd_dummy"
+
+@@ -40,7 +41,7 @@ int main(int argc, char **argv)
+
+ if (file == NULL) {
+ syslog(LOG_ERR, "Failed to open %s\n", filename);
+- return;
++ return -1;
+ }
+
+ for (arg = 1; arg < argc; arg++) {
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch
new file mode 100644
index 000000000..9df32658a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-cli-include-fcntl.h-for-O_CREAT-define.patch
@@ -0,0 +1,25 @@
+From 2d633f4c18ff3cb52234449fd86a0a63b55d669b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:31:55 -0700
+Subject: [PATCH 2/4] cli: include fcntl.h for O_CREAT define
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 097ed6a..127136c 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -24,6 +24,7 @@
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include <sys/errno.h>
++#include <fcntl.h>
+ #include <signal.h>
+
+ #include <readline/readline.h>
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
new file mode 100644
index 000000000..3f8bcaa48
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
@@ -0,0 +1,33 @@
+From a41cbeee3cf660663a9baac80545050a8d960898 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 18:09:58 -0700
+Subject: [PATCH 2/2] user ipv6 structures
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ l2tp_api.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/l2tp_api.c b/l2tp_api.c
+index 9d6f60a..f0946fd 100644
+--- a/l2tp_api.c
++++ b/l2tp_api.c
+@@ -450,10 +450,12 @@ int l2tp_api_rpc_check_request(SVCXPRT *xprt)
+ * non-loopback interface, reject the request.
+ */
+ if ((!l2tp_opt_remote_rpc) &&
+- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
+- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
++ ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
++ (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
++ char straddr[INET6_ADDRSTRLEN];
++ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
+ if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {
+- l2tp_log(LOG_ERR, "Rejecting RPC request from %s", inet_ntoa(xprt->xp_raddr.sin_addr));
++ l2tp_log(LOG_ERR, "Rejecting RPC request from %s", straddr);
+ }
+ svcerr_auth(xprt, AUTH_TOOWEAK);
+ return -EPERM;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch
new file mode 100644
index 000000000..e05be1bbb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch
@@ -0,0 +1,35 @@
+From 74fe72583472bcc3c89a52839cac2ebbad6c8a74 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:34:52 -0700
+Subject: [PATCH 3/4] cli: Define _GNU_SOURCE for getting sighandler_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cli/cli_readline.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cli/cli_readline.c b/cli/cli_readline.c
+index 127136c..931779b 100644
+--- a/cli/cli_readline.c
++++ b/cli/cli_readline.c
+@@ -17,7 +17,7 @@
+ * Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+-
++#define _GNU_SOURCE
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <sys/types.h>
+@@ -634,7 +634,7 @@ static void cli_rl_uninstall_signal_handlers(void)
+
+ static int cli_rl_install_signal_handlers(void)
+ {
+- __sighandler_t handler;
++ sighandler_t handler;
+
+ rl_catch_signals = 0;
+ rl_clear_signals();
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch
new file mode 100644
index 000000000..0fcba6546
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch
@@ -0,0 +1,36 @@
+From ede4ae8e25f9fb746a6f4e076d0ef029938d2880 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 11:46:56 -0700
+Subject: [PATCH 4/4] Adjust for linux-kernel headers assumptions on glibc
+
+Fixes build issues e.g.
+
+In file included from /mnt/a/build/tmp-musl/work/cortexa7hf-neon-vfpv4-oe-linux-musleabi/openl2tp/1.8-r0/recipe-sysroot/usr/include/linux/if_pppox.h:24:
+/mnt/a/build/tmp-musl/work/cortexa7hf-neon-vfpv4-oe-linux-musleabi/openl2tp/1.8-r0/recipe-sysroot/usr/include/linux/if.h:97:2: error: expected identifier
+ IFF_LOWER_UP = 1<<16, /* __volatile__ */
+ ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ plugins/ppp_unix.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/plugins/ppp_unix.c b/plugins/ppp_unix.c
+index 869066f..5c1e44f 100644
+--- a/plugins/ppp_unix.c
++++ b/plugins/ppp_unix.c
+@@ -21,6 +21,11 @@
+ * Plugin to use the standard UNIX pppd
+ */
+
++/* hack to make sure kernel headers understand that libc (musl)
++ * does define IFF_LOWER_UP et al.
++ */
++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0
++
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-modify-CFLAGS-to-aviod-build-error.patch
@@ -0,0 +1,106 @@
+From 152486fa3c36c3b99d17d5b553cf87ef412fae8e Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Mon, 1 Dec 2014 01:53:41 +0900
+Subject: [PATCH] Makefile:modify CFLAGS to aviod build error.
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ Makefile | 22 +++++++++++-----------
+ plugins/Makefile | 6 +++---
+ 2 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4aaa448..baa7882 100644
+--- a/Makefile
++++ b/Makefile
+@@ -152,10 +152,10 @@ LIBS.dmalloc= -ldmalloc
+ export USE_DMALLOC
+ endif
+
+-CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y)
+-CFLAGS= -I. -Iusl -Icli -isystem include \
+- -MMD -Wall -Werror -Wno-strict-aliasing \
+- $(CPPFLAGS) $(CPPFLAGS.dmalloc) \
++ADD_CPPFLAGS= $(CPPFLAGS.l2tptest) $(CPPFLAGS-y)
++ADD_CFLAGS= -I. -Iusl -Icli -isystem include \
++ -MMD -Wall -Wno-strict-aliasing \
++ $(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \
+ -DSYS_LIBDIR=$(SYS_LIBDIR)
+ LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
+ LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
+@@ -170,10 +170,10 @@ CFLAGS.optimize= $(OPT_CFLAGS)
+ endif
+ export CFLAGS.optimize
+
+-CFLAGS+= $(CFLAGS.optimize)
++ADD_CFLAGS+= $(CFLAGS.optimize)
+
+ ifeq ($(L2TP_USE_ASYNC_RPC),y)
+-CPPFLAGS+= -DL2TP_ASYNC_RPC
++ADD_CPPFLAGS+= -DL2TP_ASYNC_RPC
+ endif
+
+ ifeq ($(L2TP_FEATURE_RPC_MANAGEMENT),y)
+@@ -220,13 +220,13 @@ endif
+
+ # Compile without -Wall because rpcgen-generated code is full of warnings.
+ %_xdr.o: %_xdr.c
+- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
+
+ %_client.o: %_client.c
+- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
+
+ %_server.o: %_server.c
+- $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(CPPFLAGS) $<
++ $(CC) -I. -MMD -w $(CFLAGS.optimize) -c $(ADD_CPPFLAGS) $<
+
+ %_xdr.c: %.x
+ -$(RM) $@
+@@ -272,7 +272,7 @@ l2tpconfig: $(L2TPCONFIG_SRCS.o)
+ $(CC) -o $@ $^ $(LDFLAGS.l2tpconfig)
+
+ %.o: %.c
+- $(CC) -c $(CFLAGS) $< -o $@
++ $(CC) -c $(CFLAGS) $(ADD_CFLAGS) $< -o $@
+
+ l2tp_options.h: FORCE
+ @rm -f $@.tmp
+@@ -325,7 +325,7 @@ install: install-all
+ install-all: all install-daemon install-app
+
+ install-daemon:
+- @for d in $(filter-out usl,$(SUBDIRS)); do $(MAKE) -C $$d $(MFLAGS) EXTRA_CFLAGS="$(CPPFLAGS)" install; if [ $$? -ne 0 ]; then exit 1; fi; done
++ @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
+ $(INSTALL) -d $(DESTDIR)/usr/sbin
+ $(INSTALL) openl2tpd $(DESTDIR)/usr/sbin
+
+diff --git a/plugins/Makefile b/plugins/Makefile
+index 5be996d..6810236 100644
+--- a/plugins/Makefile
++++ b/plugins/Makefile
+@@ -1,7 +1,7 @@
+-CFLAGS := $(CFLAGS.optimize) -MMD -Wall \
++ADD_CFLAGS := $(CFLAGS.optimize) -MMD -Wall \
+ -isystem ../include \
+ -I. -I.. -I../usl -fPIC $(EXTRA_CFLAGS)
+-LDFLAGS := -shared
++ADD_LDFLAGS := -shared
+
+ PLUGINS.c:= ppp_unix.c ppp_null.c ipsec.c event_sock.c
+
+@@ -21,7 +21,7 @@ clean:
+ $(RM) $(PLUGINS.so) $(wildcard *.o) $(wildcard *.d) $(SRC.generated)
+
+ %.so: %.c
+- $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $<
++ $(CC) -o $@ $(LDFLAGS) $(ADD_LDFLAGS) $(CFLAGS) $(ADD_CFLAGS) $<
+
+ install: all
+ $(INSTALL) -d $(DESTDIR)$(SYS_LIBDIR)/openl2tp
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-obey-LDFLAGS.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-obey-LDFLAGS.patch
new file mode 100644
index 000000000..811faddd0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/Makefile-obey-LDFLAGS.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+--- openl2tp-1.8/Makefile.orig 2016-09-16 14:54:18.554291976 +0200
++++ openl2tp-1.8/Makefile 2016-09-16 14:57:23.559090400 +0200
+@@ -157,8 +157,8 @@ ADD_CFLAGS= -I. -Iusl -Icli -isystem i
+ -MMD -Wall -Wno-strict-aliasing \
+ $(ADD_CPPFLAGS) $(CPPFLAGS.dmalloc) \
+ -DSYS_LIBDIR=$(SYS_LIBDIR)
+-LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc
+-LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc
++LDFLAGS.l2tpd= -Wl,-E -L. -Lusl -lusl -ldl $(LIBS.dmalloc) -lc $(LDFLAGS)
++LDFLAGS.l2tpconfig= -Lcli -lcli -lreadline $(LIBS.dmalloc) $(READLINE_LDFLAGS) -lc $(LDFLAGS)
+
+ OPT_CFLAGS?= -O
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/fix_linux_4.15_compile.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/fix_linux_4.15_compile.patch
new file mode 100644
index 000000000..4597df80a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/fix_linux_4.15_compile.patch
@@ -0,0 +1,44 @@
+This fixes a compile issue introduced with linux kernel 4.15
+
+include/linux/in.h:222:8: error: redefinition of 'struct in_pktinfo'
+| struct in_pktinfo {
+
+
+Upstream-Status: Pending
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: openl2tp-1.8/plugins/ppp_unix.c
+===================================================================
+--- openl2tp-1.8.orig/plugins/ppp_unix.c
++++ openl2tp-1.8/plugins/ppp_unix.c
+@@ -25,9 +25,14 @@
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <signal.h>
++#include <linux/version.h>
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ #include <net/ethernet.h>
+ #include <net/if.h>
+ #include <netinet/in.h>
++#endif
++
+ #include <arpa/inet.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+@@ -41,12 +46,12 @@
+ #define __user
+ #endif
+ #include <sys/ioctl.h>
+-#include <linux/if_ether.h>
+-#include <linux/if_pppox.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_ppp.h>
++#include <linux/if_pppox.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ #include <linux/if_pppol2tp.h>
+-
++#endif
+ #include "usl.h"
+ #include "l2tp_private.h"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch
new file mode 100644
index 000000000..c11a127b8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tp-simplify-gcc-warning-hack.patch
@@ -0,0 +1,41 @@
+From 460549a3de27f8dd8371b6d6fc1f69d8bffa102b Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 6 Jan 2015 11:23:21 -0500
+Subject: [PATCH] openl2tp: simplify gcc warning hack
+
+The hack to work around the gcc warning causes problems with some modern
+gcc configurations. Since the redef behaviour is essentially correct
+everywhere and since the hack is still required on 32-bit builders, leave
+it in place but remove the #if guard since it is only there to ensure that
+the l2tp_private.h file is updated if the rpc source file is changed and
+the two get out of sync.
+
+Upstream-status: pending
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ l2tp_private.h | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/l2tp_private.h b/l2tp_private.h
+index f3c1af7..cca6806 100644
+--- a/l2tp_private.h
++++ b/l2tp_private.h
+@@ -89,14 +89,8 @@
+ * So we redefine the constant with UL suffix to avoid the gcc warning.
+ * Is there some C preprocessor magic that could avoid having to do this?
+ */
+-#if L2TP_API_TUNNEL_FLAG_MTU != 2147483648
+-#error Constant L2TP_API_TUNNEL_FLAG_MTU changed. Update local definition here.
+-#endif
+ #undef L2TP_API_TUNNEL_FLAG_MTU
+ #define L2TP_API_TUNNEL_FLAG_MTU 2147483648UL
+-#if L2TP_API_SESSION_FLAG_NO_PPP != 2147483648
+-#error Constant L2TP_API_SESSION_FLAG_NO_PPP changed. Update local definition here.
+-#endif
+ #undef L2TP_API_SESSION_FLAG_NO_PPP
+ #define L2TP_API_SESSION_FLAG_NO_PPP 2147483648UL
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch
new file mode 100644
index 000000000..0bece2f4d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-enable-tests.patch
@@ -0,0 +1,24 @@
+commit 3e96a6c41bdd26417265a45ed685138d8eed564e
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Fri Sep 14 02:32:53 2012 -0400
+
+ openl2tp: Enable tests
+
+ Build the test direcctory as part
+ of the overall build
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 412cf4d..adf4f44 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,7 +16,7 @@ L2TP_FEATURE_LOCAL_CONF_FILE= y
+
+ # Define to include test code. This must be defined to run the
+ # regression tests
+-# L2TP_TEST= y
++L2TP_TEST=y
+
+ # Define to compile in debug code. Also makes default trace flags
+ # enable all messages
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch
new file mode 100644
index 000000000..3119425e6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-sysconfig.patch
@@ -0,0 +1,35 @@
+commit 6ea3125e2bec15004f312814022335d94cdf7e94
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Wed Sep 19 11:34:48 2012 -0400
+
+ Fix openl2tp config script location
+
+ Correct the location of the sysconfig
+ script. Use /etc/default/ instead of
+ /etc/sysconfig/
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+ Upstream-Status: Inappropriate [configuration]
+
+ Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff --git a/etc/rc.d/init.d/openl2tpd b/etc/rc.d/init.d/openl2tpd
+index 7f27bb7..4194f63 100755
+--- a/etc/rc.d/init.d/openl2tpd
++++ b/etc/rc.d/init.d/openl2tpd
+@@ -8,12 +8,12 @@
+ # can be used to implement L2TP VPNs. As a server, it can handle
+ # hundreds of tunnels and sessions.
+ # processname: openl2tpd
+-# config: /etc/sysconfig/openl2tpd
++# config: /etc/default/openl2tpd
+ # pidfile: /var/run/openl2tpd.pid
+
+ # Source function library.
+ . /etc/init.d/functions
+-. /etc/sysconfig/openl2tpd
++. /etc/default/openl2tpd
+
+ # See how we were called.
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch
new file mode 100644
index 000000000..15a8c5b08
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix-warning.patch
@@ -0,0 +1,32 @@
+openl2tp: eliminate warning from modprobe
+
+modprobe will emit alarming warnings if it cannot
+find a module, but we only care that it find one
+of two possible modules when we start openl2tpd.
+
+Suppress messages from modprobe.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/etc/rc.d/init.d/openl2tpd
++++ b/etc/rc.d/init.d/openl2tpd
+@@ -29,7 +29,7 @@ start() {
+ return 1
+ fi
+ fi
+- modprobe -s pppol2tp || modprobe -s l2tp_ppp
++ modprobe -sq pppol2tp || modprobe -sq l2tp_ppp
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ start-stop-daemon --start --exec openl2tpd $OPENL2TPDARGS
+@@ -57,7 +57,7 @@ stop() {
+ return 1;
+ fi
+ killproc openl2tpd
+- modprobe -s -r pppol2tp || modprobe -s -r l2tp_ppp
++ modprobe -srq pppol2tp || modprobe -srq l2tp_ppp
+ echo
+ rm -f /var/run/openl2tpd.pid
+ rm -f /var/lock/subsys/openl2tpd
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch
new file mode 100644
index 000000000..9ecd4b072
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd-initscript-fix.patch
@@ -0,0 +1,49 @@
+commit 7c58a1e244ea83a9e7bbd51a6d354cee25cdbd33
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Wed Sep 12 23:35:40 2012 -0400
+
+ Fix openl2tpd initscript
+
+ - Correct the location of the retval statement.
+ - use start-stop-daemon instead of daemon.
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+ Upstream-Status: Inappropriate [OE specific]
+
+ Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+diff --git a/etc/rc.d/init.d/openl2tpd b/etc/rc.d/init.d/openl2tpd
+index ce21b50..7f27bb7 100755
+--- a/etc/rc.d/init.d/openl2tpd
++++ b/etc/rc.d/init.d/openl2tpd
+@@ -24,7 +24,7 @@ start() {
+ if [ -e /var/lock/subsys/openl2tpd ]; then
+ if [ -e /var/run/openl2tpd.pid ] && [ -e /proc/`cat /var/run/openl2tpd.pid` ]; then
+ echo -n $"cannot start openl2tpd: openl2tpd is already running.";
+- failure $"cannot start openl2tpd: openl2tpd already running.";
++ #failure $"cannot start openl2tpd: openl2tpd already running.";
+ echo
+ return 1
+ fi
+@@ -32,9 +32,9 @@ start() {
+ modprobe -s pppol2tp || modprobe -s l2tp_ppp
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+- daemon openl2tpd $OPENL2TPDARGS
++ start-stop-daemon --start --exec openl2tpd $OPENL2TPDARGS
++ RETVAL=$?
+ fi
+- RETVAL=$?
+ echo
+ if [ $RETVAL -eq 0 ]; then
+ touch /var/lock/subsys/openl2tpd
+@@ -52,7 +52,7 @@ stop() {
+ echo -n $"Stopping $prog: "
+ if [ ! -e /var/lock/subsys/openl2tpd ]; then
+ echo -n $"cannot stop openl2tpd: openl2tpd is not running."
+- failure $"cannot stop openl2tpd: openl2tpd is not running."
++ #failure $"cannot stop openl2tpd: openl2tpd is not running."
+ echo
+ return 1;
+ fi
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service
new file mode 100644
index 000000000..7b3faf672
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/openl2tpd.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=The open L2TP implementation
+After=network.target remote-fs.target nss-lookup.target rpcbind.target
+Requires=rpcbind.service
+
+[Service]
+Type=forking
+PIDFile=@STATEDIR@/run/openl2tpd.pid
+EnvironmentFile=@SYSCONFDIR@/default/openl2tpd
+ExecStartPre=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -sq l2tp_ppp || @BASE_SBINDIR@/modprobe -sq pppol2tp"
+ExecStart=@SBINDIR@/openl2tpd $OPENL2TPDARGS
+ExecStartPost=@BASE_BINDIR@/sh -c 'if [ -n "$OPENL2TPD_CONFIG_FILE" ]; then sleep 1; @BINDIR@/l2tpconfig config restore file=$OPENL2TPD_CONFIG_FILE; fi'
+ExecStopPost=@BASE_BINDIR@/sh -c "@BASE_SBINDIR@/modprobe -rsq l2tp_ppp || @BASE_SBINDIR@/modprobe -rsq pppol2tp"
+SuccessExitStatus=1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
new file mode 100644
index 000000000..01c9c7b44
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp/run-ptest
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+TMP_DIR=`mktemp -d /tmp/std.26.tmp.XXXXXX`
+
+# restore the file if exist
+restore_file()
+{
+ filelist="test_procs.tcl tunnel.test session.test"
+ for file in ${filelist}
+ do
+ if [ -f ${TMP_DIR}/${file} ]; then
+ mv ${TMP_DIR}/${file} ${OPENL2TP_DIR}
+ fi
+ done
+}
+
+exit_cus()
+{
+ restore_file
+ echo $1
+ exit $2
+}
+
+if [ -d /usr/lib64/openl2tp/ptest ]; then
+ OPENL2TP_DIR="/usr/lib64/openl2tp"
+elif [ -d /usr/lib/openl2tp/ptest ]; then
+ OPENL2TP_DIR="/usr/lib/openl2tp"
+else
+ exit_cus "The openl2tp ptest directory not installed, skip the test" 1
+fi
+
+#read -p "Please input the network interface you use to test(such as eth0, em1 etc):" ETH_TEST
+echo "Please input the network interface you use to test(such as eth0, em1 etc):"
+read ETH_TEST > /dev/null
+
+if [ x"$ETH_TEST" = x ]; then
+ exit_cus "The network interface cannot be null" 1
+fi
+ifconfig | grep $ETH_TEST > /dev/null || exit_cus "The network interface you provide is invalid" 1
+
+# check openl2tp related kernel config
+zcat /proc/config.gz | grep CONFIG_L2TP=y > /dev/null || exit_cus "Failed to check CONFIG_L2TP=y, skip the tests." 1
+zcat /proc/config.gz | grep CONFIG_PPPOL2TP=m > /dev/null || exit_cus "Failed to check CONFIG_PPPOL2TP=m, skip the tests." 1
+
+SYSV_INIT="/etc/init.d/rpcbind"
+if [ -e ${SYSV_INIT} ]; then
+ ${SYSV_INIT} status > /dev/null || ${SYSV_INIT} start > /dev/null
+else
+ systemctl status rpcbind > /dev/null || systemctl start rpcbind > /dev/null
+fi
+
+which systemctl > /dev/null && systemctl status rpcbind > /dev/null || service rpcbind status > /dev/null
+[ $? -ne 0 ] && exit_cus "Failed to start rpcbind service, skip the tests." 1
+
+# backup the below files
+cp ${OPENL2TP_DIR}/ptest/test_procs.tcl $TMP_DIR
+cp ${OPENL2TP_DIR}/ptest/tunnel.test $TMP_DIR
+cp ${OPENL2TP_DIR}/ptest/session.test $TMP_DIR
+
+# customise the config
+if [ x"$ETH_TEST" = x ]; then
+ exit_cus "Please set ETH_TEST which used to test first, skip the tests." 1
+fi
+
+sed -i 's/eth2/'\"$ETH_TEST\"'/g' ${OPENL2TP_DIR}/ptest/test_procs.tcl
+test_ip="`ifconfig $ETH_TEST | grep 'inet ' | sed 's/^.*inet addr://g' | \
+ sed 's/ *Mask.*$//g'|sed 's/ *Bcast.*$//g'`"
+sed -i 's/192.168.0.1/'"$test_ip"'/g' ${OPENL2TP_DIR}/ptest/tunnel.test
+
+# load module l2tp_ppp
+modprobe l2tp_ppp > /dev/null
+lsmod | grep l2tp_ppp > /dev/null || exit_cus "FAIL: Load module l2tp_ppp" 2
+
+# start openl2tpd
+ps aux | grep openl2tpd | grep -v grep > /dev/null && killall openl2tpd > /dev/null
+ppp_path=`rpm -ql openl2tp | grep ppp_null.so`
+echo "test it here"
+/usr/sbin/openl2tpd -d all -D -f -p ${ppp_path} & > /dev/null
+
+# prepare the test env
+rm -rf $OPENL2TP_DIR/results
+mkdir -p $OPENL2TP_DIR/results || exit_cus "FAIL: mkdir $OPENL2TP_DIR/results" 2
+cp /usr/bin/l2tpconfig ${OPENL2TP_DIR} || exit_cus "FAIL: copy /usr/bin/l2tpconfig to ${OPENL2TP_DIR}" 2
+
+# start the test
+cd ${OPENL2TP_DIR}/ptest && tclsh all.tcl -preservecore 3 -verbose bps -tmpdir $OPENL2TP_DIR/results -outfile test-l2tpd.result -constraints "l2tpdRunning peerProfile tunnelProfile sessionProfile pppProfile system" -match "peer_profile-1.1 tunnel_profile-1.1 session_profile-1.1 ppp_profile-1.1 system-1.1"
+
+# check the result
+PASSNUM=`grep PASS $OPENL2TP_DIR/results/test-l2tpd.result | wc -l`
+FAILNUM=`grep FAIL $OPENL2TP_DIR/results/test-l2tpd.result | wc -l`
+if [ $PASSNUM -ne 0 ] && [ $FAILNUM -eq 0 ]; then
+ echo "PASS: openl2tp"
+else
+ echo "FAIL: openl2tp"
+fi
+
+restore_file
diff --git a/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb
new file mode 100644
index 000000000..1f6b4ded3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/openl2tp/openl2tp_1.8.bb
@@ -0,0 +1,99 @@
+SUMMARY = "An L2TP client/server, designed for VPN use."
+DESCRIPTION = "OpenL2TP is an open source L2TP client / server, written \
+specifically for Linux. It has been designed for use as an enterprise \
+L2TP VPN server or in commercial, Linux-based, embedded networking \
+products and is able to support hundreds of sessions, each with \
+different configuration. It is used by several ISPs to provide \
+L2TP services and by corporations to implement L2TP VPNs."
+HOMEPAGE = "http://www.openl2tp.org/"
+SECTION = "net"
+
+# cli and usl use license LGPL-2.1
+LICENSE = "GPL-2.0 & LGPL-2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9d9259cbbf00945adc25a470c1d3585 \
+ file://LICENSE;md5=f8970abd5ea9be701a0deedf5afd77a5 \
+ file://cli/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \
+ file://usl/LICENSE;md5=9c1387a3c5213aa40671438af3e00793 \
+ "
+
+DEPENDS = "popt flex readline"
+
+SRC_URI = "ftp://ftp.openl2tp.org/releases/${BP}/${BP}.tar.gz \
+ file://Makefile-modify-CFLAGS-to-aviod-build-error.patch \
+ file://openl2tp-simplify-gcc-warning-hack.patch \
+ file://Makefile-obey-LDFLAGS.patch \
+ file://0001-test-pppd_dummy.c-Fix-return-value.patch \
+ file://0001-Use-1-instead-of-WAIT_ANY.patch \
+ file://0002-cli-include-fcntl.h-for-O_CREAT-define.patch \
+ file://0003-cli-Define-_GNU_SOURCE-for-getting-sighandler_t.patch \
+ file://0001-l2tp_api-Included-needed-headers.patch \
+ file://openl2tpd-initscript-fix.patch \
+ file://openl2tpd-initscript-fix-sysconfig.patch \
+ file://openl2tpd-initscript-fix-warning.patch \
+ file://openl2tpd.service \
+ file://openl2tpd-enable-tests.patch \
+ file://run-ptest \
+ file://fix_linux_4.15_compile.patch \
+ "
+
+SRC_URI_append_libc-musl = "\
+ file://0004-Adjust-for-linux-kernel-headers-assumptions-on-glibc.patch \
+ file://0002-user-ipv6-structures.patch \
+ file://0001-l2tp_api.c-include-rpc-clnt.h-for-resultproc_t.patch \
+ "
+SRC_URI[md5sum] = "e3d08dedfb9e6a9a1e24f6766f6dadd0"
+SRC_URI[sha256sum] = "1c97704d4b963a87fbc0e741668d4530933991515ae9ab0dffd11b5444f4860f"
+
+inherit autotools-brokensep pkgconfig systemd ptest
+
+SYSTEMD_SERVICE_${PN} = "openl2tpd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CPPFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+PARALLEL_MAKE = ""
+EXTRA_OEMAKE = 'CFLAGS="${CFLAGS} -Wno-unused-but-set-variable" CPPFLAGS="${CPPFLAGS}" OPT_CFLAGS="${CFLAGS}"'
+
+do_compile_prepend() {
+ sed -i -e "s:SYS_LIBDIR=.*:SYS_LIBDIR=${libdir}:g" \
+ -e 's:$(CROSS_COMPILE)as:${AS}:g' \
+ -e 's:$(CROSS_COMPILE)ld:${LD}:g' \
+ -e 's:$(CROSS_COMPILE)gcc:${CC}:g' \
+ -e 's:$(CROSS_COMPILE)ar:${AR}:g' \
+ -e 's:$(CROSS_COMPILE)nm:${NM}:g' \
+ -e 's:$(CROSS_COMPILE)strip:${STRIP}:g' \
+ -e 's:$(CROSS_COMPILE)install:install:g' \
+ -e 's:CPPFLAGS-y:CPPFLAGS:g' \
+ ${S}/Makefile
+}
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/default
+ install -m 0755 ${S}/etc/rc.d/init.d/openl2tpd ${D}${sysconfdir}/init.d/openl2tpd
+ install -m 0755 ${S}/etc/sysconfig/openl2tpd ${D}${sysconfdir}/default/openl2tpd
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0644 ${WORKDIR}/openl2tpd.service ${D}${systemd_system_unitdir}/openl2tpd.service
+ sed -i -e 's,@STATEDIR@,${localstatedir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@BINDIR@,${bindir},g' \
+ -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
+ -e 's,@BASE_BINDIR@,${base_bindir},g' \
+ ${D}${systemd_system_unitdir}/openl2tpd.service
+ fi
+}
+
+do_install_ptest () {
+ for i in all.tcl configfile.test peer_profile.test ppp_profile.test \
+ session_profile.test session.test system.test test_procs.tcl \
+ thirdparty_lns.test tunnel_profile.test tunnel.test; do
+ install -m 0755 ${S}/test/$i ${D}${PTEST_PATH}
+ done
+}
+
+RDEPENDS_${PN} = "ppp ppp-l2tp bash"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/0001-include-missing-sys-types.h.patch b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/0001-include-missing-sys-types.h.patch
new file mode 100644
index 000000000..804bf1234
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/0001-include-missing-sys-types.h.patch
@@ -0,0 +1,28 @@
+From f6c4d2468ae0dadd2f35680d61b98b2a59077328 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 7 Jul 2017 10:31:03 -0700
+Subject: [PATCH] include missing sys/types.h
+
+Fixes errors seen on musl
+pqueue.h:21:3: error: unknown type name 'u_int32_t'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ pqueue.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/pqueue.h b/pqueue.h
+index c37ba7b..ae4cc6a 100644
+--- a/pqueue.h
++++ b/pqueue.h
+@@ -3,6 +3,7 @@
+
+ #include <time.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+
+ /* wait this many seconds for missing packets before forgetting about them */
+ #define DEFAULT_PACKET_TIMEOUT 0.3
+--
+2.13.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/options.pptp b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/options.pptp
new file mode 100644
index 000000000..f446e22a6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux/options.pptp
@@ -0,0 +1,30 @@
+#
+# Lock the port
+#
+lock
+
+#
+# We don't need the tunnel server to authenticate itself
+#
+noauth
+
+#
+# Turn off transmission protocols we know won't be used
+#
+nobsdcomp
+nodeflate
+
+#
+# We want MPPE
+# (option naming specific to ppp 2.4.0 with unofficial patch)
+#
+#mppe-40
+mppe-128
+#mppe-stateless
+
+#
+# We want a sane mtu/mru
+# (ppp 2.4.0 with unofficial patch)
+#
+#mtu 1000
+#mru 1000
diff --git a/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.9.0.bb b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.9.0.bb
new file mode 100644
index 000000000..10c9170fb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.9.0.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Client for Microsoft PPTP VPNs"
+DESCRIPTION = "PPTP Client is a Linux, FreeBSD, NetBSD \
+ and OpenBSD client for the proprietary Microsoft Point-to-Point \
+ Tunneling Protocol, PPTP. Allows connection to a PPTP based \
+ Virtual Private Network (VPN) as used by employers and some \
+ cable and ADSL internet service providers."
+HOMEPAGE = "http://pptpclient.sourceforge.net"
+SECTION = "net"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/pptpclient/pptp-${PV}.tar.gz \
+ file://options.pptp \
+ file://0001-include-missing-sys-types.h.patch \
+ "
+
+SRC_URI[md5sum] = "b2117b377f65294a9786f80f0235d308"
+SRC_URI[sha256sum] = "0b1e8cbfc578d3f5ab12ee87c5c2c60419abfe9cc445690a8a19c320b11c9201"
+
+S = "${WORKDIR}/pptp-${PV}"
+
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+
+do_install() {
+ install -d ${D}${sbindir} ${D}${sysconfdir}/ppp ${D}${mandir}/man8
+ install -m 555 pptp ${D}${sbindir}
+ install -m 644 pptp.8 ${D}${mandir}/man8
+ install -m 644 ${WORKDIR}/options.pptp ${D}${sysconfdir}/ppp
+}
+
+RDEPENDS_${PN} = "ppp"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service
new file mode 100644
index 000000000..76f9f61e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/bgpd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=BGP routing daemon
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/bgpd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/bgpd.pid
+ExecStart=@SBINDIR@/bgpd -d $bgpd_options -f @SYSCONFDIR@/quagga/bgpd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/bgpd.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service
new file mode 100644
index 000000000..9bfe7b65e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/isisd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=IS-IS routing daemon
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/isisd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+ExecStart=@SBINDIR@/isisd -d $isisd_options -f /etc/quagga/isisd.conf
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service
new file mode 100644
index 000000000..a2e493b42
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospf6d.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=OSPF routing daemon for IPv6
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/ospf6d.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/ospf6d.pid
+ExecStart=@SBINDIR@/ospf6d -d $ospf6d_options -f @SYSCONFDIR@/quagga/ospf6d.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospf6d.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service
new file mode 100644
index 000000000..0c62cbce5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ospfd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=OSPF routing daemon
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/ospfd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/ospfd.pid
+ExecStart=@SBINDIR@/ospfd -d $ospfd_options -f @SYSCONFDIR@/quagga/ospfd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ospfd.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default
new file mode 100644
index 000000000..4c4bc2307
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.default
@@ -0,0 +1,12 @@
+# If this option is set the /etc/init.d/quagga script automatically loads
+# the config via "vtysh -b" when the servers are started.
+vtysh_enable=yes
+
+# Bind all daemons to loopback only by default
+zebra_options=" --daemon -A 127.0.0.1"
+bgpd_options=" --daemon -A 127.0.0.1"
+ospfd_options=" --daemon -A 127.0.0.1"
+ospf6d_options="--daemon -A ::1"
+ripd_options=" --daemon -A 127.0.0.1"
+ripngd_options="--daemon -A ::1"
+isisd_options=" --daemon -A 127.0.0.1"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init
new file mode 100644
index 000000000..df1beb712
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.init
@@ -0,0 +1,200 @@
+#!/bin/sh
+#
+# /etc/init.d/quagga -- start/stop the Quagga routing daemons
+#
+# Based on debian version by Endre Hirling <endre@mail.elte.hu> and
+# Christian Hammers <ch@debian.org>.
+#
+
+### BEGIN INIT INFO
+# Provides: quagga
+# Required-Start: $local_fs $network $remote_fs $syslog
+# Required-Stop: $local_fs $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start and stop the Quagga routing suite
+# Description: Quagga is a routing suite for IP routing protocols like
+# BGP, OSPF, RIP and others. This script contols the main
+# daemon "quagga" as well as the individual protocol daemons.
+### END INIT INFO
+
+# NOTE: sbin must be before bin so we get the iproute2 ip and not the
+# busybox ip command. The busybox one flushes all routes instead of just
+# the dynamic routes
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin
+D_PATH=/usr/sbin
+C_PATH=/etc/quagga
+
+# Keep zebra first and do not list watchquagga!
+DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd"
+
+# Print the name of the pidfile.
+pidfile()
+{
+ echo "/var/run/quagga/$1.pid"
+}
+
+# Check if daemon is started by using the pidfile.
+started()
+{
+ [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0
+ return 1
+}
+
+# Loads the config via vtysh -b if configured to do so.
+vtysh_b ()
+{
+ # Rember, that all variables have been incremented by 1 in convert_daemon_prios()
+ if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then
+ /usr/bin/vtysh -b
+ fi
+}
+
+# Check if the daemon is activated and if its executable and config files
+# are in place.
+# params: daemon name
+# returns: 0=ok, 1=error
+check_daemon()
+{
+ # If the integrated config file is used the others are not checked.
+ if [ -r "$C_PATH/Quagga.conf" ]; then
+ return 0
+ fi
+
+ # check for config file
+ if [ ! -r "$C_PATH/$1.conf" ]; then
+ return 1
+ fi
+ return 0
+}
+
+# Starts the server if it's not alrady running according to the pid file.
+# The Quagga daemons creates the pidfile when starting.
+start()
+{
+ if ! check_daemon $1; then echo -n " (!$1)"; return; fi
+ echo -n " $1"
+ start-stop-daemon \
+ --start \
+ --pidfile=`pidfile $1` \
+ --exec "$D_PATH/$1" \
+ -- \
+ `eval echo "$""$1""_options"`
+
+}
+
+# Stop the daemon given in the parameter, printing its name to the terminal.
+stop()
+{
+ if ! started "$1" ; then
+ echo -n " (!$1)"
+ return 0
+ else
+ PIDFILE=`pidfile $1`
+ PID=`cat $PIDFILE 2>/dev/null`
+ start-stop-daemon --stop --quiet --exec "$D_PATH/$1"
+ #
+ # Now we have to wait until $DAEMON has _really_ stopped.
+ #
+ if test -n "$PID" && kill -0 $PID 2>/dev/null; then
+ echo -n " (waiting) ."
+ cnt=0
+ while kill -0 $PID 2>/dev/null; do
+ cnt=`expr $cnt + 1`
+ if [ $cnt -gt 60 ]; then
+ # Waited 120 secs now, fail.
+ echo -n "Failed.. "
+ break
+ fi
+ sleep 2
+ echo -n "."
+ done
+ fi
+ echo -n " $1"
+ rm -f `pidfile $1`
+ fi
+}
+
+stop_all()
+{
+ local daemon_list
+ daemon_list=${1:-$DAEMONS}
+
+ echo -n "Stopping Quagga daemons:"
+ for daemon_name in $daemon_list; do
+ stop "$daemon_name"
+ done
+ echo "."
+}
+
+start_all()
+{
+ local daemon_list
+ daemon_list=${1:-$DAEMONS}
+
+ echo -n "Starting Quagga daemons:"
+ for daemon_name in $daemon_list; do
+ start "$daemon_name"
+ done
+ echo "."
+}
+
+status_all()
+{
+ local daemon_list
+ daemon_list=${1:-$DAEMONS}
+ res=1
+
+ echo -n "quagga: "
+ for daemon_name in $daemon_list; do
+ if started "$daemon_name" ; then
+ id=`cat \`pidfile $daemon_name\``
+ echo -n "$daemon_name (pid $id) "
+ res=0
+ fi
+ done
+ if [ $res -eq 0 ]; then
+ echo "is running..."
+ else
+ echo "is stopped..."
+ fi
+ exit $res
+}
+
+#########################################################
+# Main program #
+#########################################################
+
+# Load configuration
+test -f /etc/default/quagga && . /etc/default/quagga
+
+case "$1" in
+ start)
+ cd $C_PATH/
+ start_all $2
+ vtysh_b
+ ;;
+
+ stop)
+ stop_all $2
+ echo "Removing all routes made by zebra."
+ ip route flush proto zebra
+ ;;
+
+ status)
+ status_all $2
+ ;;
+
+ restart|force-reload)
+ $0 stop $2
+ sleep 1
+ $0 start $2
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam
new file mode 100644
index 000000000..3541a975a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/quagga.pam
@@ -0,0 +1,13 @@
+#
+# The PAM configuration file for the quagga `vtysh' service
+#
+
+# This allows root to change user infomation without being
+# prompted for a password
+auth sufficient pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth include common-auth
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service
new file mode 100644
index 000000000..1d20389e8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=RIP routing daemon
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/ripd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/ripd.pid
+ExecStart=@SBINDIR@/ripd -d $ripd_options -f @SYSCONFDIR@/quagga/ripd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripd.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service
new file mode 100644
index 000000000..0355ad12a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/ripngd.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=RIP routing daemon for IPv6
+BindTo=zebra.service
+After=zebra.service
+ConditionPathExists=@SYSCONFDIR@/quagga/ripngd.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/ripngd.pid
+ExecStart=@SBINDIR@/ripngd -d $ripngd_options -f @SYSCONFDIR@/quagga/ripngd.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/ripngd.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga
new file mode 100644
index 000000000..1f28c0b24
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga
@@ -0,0 +1,3 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d quagga quagga 0755 /var/run/quagga none
+d quagga quagga 0755 /var/log/quagga none
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default
new file mode 100644
index 000000000..2d601ec97
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.default
@@ -0,0 +1,12 @@
+# Watchquagga configuration
+#watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd"
+watch_daemons="zebra"
+
+# To enable restarts when multiple daemons are being used, uncomment this line (but first be sure to edit
+# the WATCH_DAEMONS line to reflect the daemons you are actually using):
+#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"
+
+# Since we are using one quagga daemon for now, use the following line. If using
+# multiple daemons, comment the line below and uncoment the line mentioned
+# above.
+watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init
new file mode 100644
index 000000000..5ddd94a3d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/watchquagga.init
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: watchquagga
+# Required-Start: $local_fs $network $remote_fs $syslog
+# Required-Stop: $local_fs $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: start and stop the Quagga watchdog
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+# Load configuration
+test -f /etc/default/watchquagga && . /etc/default/watchquagga
+
+# Check that there are daemons to be monitored.
+[ -z "$watch_daemons" ] && exit 0
+
+pidfile="/var/run/quagga/watchquagga.pid"
+
+case "$1" in
+ start)
+ echo -n "Starting quagga watchdog daemon: watchquagga"
+ start-stop-daemon --start \
+ --pidfile $pidfile \
+ --exec /usr/sbin/watchquagga \
+ -- -d $watch_options $watch_daemons
+ echo "."
+ ;;
+
+ stop)
+ echo -n "Stopping quagga watchdog daemon: watchquagga"
+ start-stop-daemon --stop --quiet \
+ --pidfile $pidfile
+ echo "."
+ ;;
+
+ status)
+ echo -n "watchquagga "
+ res=1
+ [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null
+ if [ $? -eq 0 ]; then
+ echo "(pid `cat $pidfile`) is running..."
+ res=0
+ else
+ echo "is stopped..."
+ fi
+ exit $res
+ ;;
+
+ restart|force-reload)
+ $0 stop $2
+ sleep 1
+ $0 start $2
+ ;;
+
+ *)
+ echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service
new file mode 100644
index 000000000..e4fb6c808
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/files/zebra.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=GNU Zebra routing manager
+Wants=network.target
+Before=network.target
+ConditionPathExists=@SYSCONFDIR@/quagga/zebra.conf
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/quagga
+PIDFile=@localstatedir@/run/quagga/zebra.pid
+ExecStartPre=@BASE_SBINDIR@/ip route flush proto zebra
+ExecStart=@SBINDIR@/zebra -d $zebra_options -f @SYSCONFDIR@/quagga/zebra.conf
+ExecStopPost=@base_bindir@/rm -rf @localstatedir@/run/quagga/zebra.pid
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc
new file mode 100644
index 000000000..dfd6aa7eb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga.inc
@@ -0,0 +1,232 @@
+SUMMARY = "BGP/OSPF/RIP routing daemon"
+DESCRIPTION = "Quagga is a routing software suite, providing \
+implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for \
+Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. \
+Quagga is a fork of GNU Zebra which was developed by Kunihiro \
+Ishiguro. The Quagga tree aims to build a more involved community \
+around Quagga than the current centralised model of GNU Zebra."
+HOMEPAGE = "http://www.nongnu.org/quagga/"
+SECTION = "net"
+
+
+LICENSE = "GPL-2.0 & LGPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=81bcece21748c91ba9992349a91ec11d \
+ file://COPYING.LIB;md5=01ef24401ded36cd8e5d18bfe947240c"
+
+DEPENDS = "readline ncurses perl-native c-ares"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'snmp', 'net-snmp', '', d)}"
+SNMP_CONF="${@bb.utils.contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}"
+
+# the "ip" command from busybox is not sufficient (flush by protocol flushes all routes)
+RDEPENDS_${PN} += "iproute2"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/quagga/quagga-${PV}.tar.gz; \
+ file://quagga.init \
+ file://quagga.default \
+ file://watchquagga.init \
+ file://watchquagga.default \
+ file://volatiles.03_quagga \
+ file://quagga.pam \
+ file://bgpd.service \
+ file://isisd.service \
+ file://ospf6d.service \
+ file://ospfd.service \
+ file://ripd.service \
+ file://ripngd.service \
+ file://zebra.service \
+ "
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
+PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap"
+PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam"
+
+inherit autotools update-rc.d useradd systemd pkgconfig
+
+SYSTEMD_PACKAGES = "${PN} ${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd"
+SYSTEMD_SERVICE_${PN}-bgpd = "bgpd.service"
+SYSTEMD_SERVICE_${PN}-isisd = "isisd.service"
+SYSTEMD_SERVICE_${PN}-ospf6d = "ospf6d.service"
+SYSTEMD_SERVICE_${PN}-ospfd = "ospfd.service"
+SYSTEMD_SERVICE_${PN}-ripd = "ripd.service"
+SYSTEMD_SERVICE_${PN}-ripngd = "ripngd.service"
+SYSTEMD_SERVICE_${PN} = "zebra.service"
+
+EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \
+ --localstatedir=${localstatedir}/run/quagga \
+ --enable-exampledir=${docdir}/quagga/examples/ \
+ --enable-vtysh \
+ --enable-isisd \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '--enable-watchquagga', '--disable-watchquagga', d)} \
+ --enable-ospfclient=yes \
+ --enable-multipath=64 \
+ --enable-user=quagga \
+ --enable-group=quagga \
+ --enable-vty-group=quaggavty \
+ --enable-configfile-mask=0640 \
+ --enable-logfile-mask=0640 \
+ --enable-rtadv \
+ --enable-linux24-tcp-md5 \
+ ap_cv_cc_pie=no \
+ ${SNMP_CONF}"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
+
+do_install () {
+ # Install init script and default settings
+ install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \
+ ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga
+ install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga
+ install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga
+ install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga
+ install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga
+
+ # Install sample configurations for the daemons
+ for f in bgpd vtysh isisd ospfd ripngd zebra ripd ospf6d; do
+ install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample
+ done
+
+ for f in bgpd vtysh isisd ospfd ripngd zebra ripd ospf6d; do
+ touch ${D}${sysconfdir}/quagga/$f.conf
+ done
+ chown quagga:quaggavty ${D}${sysconfdir}/quagga
+ chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf
+ chmod 750 ${D}${sysconfdir}/quagga
+ chmod 640 ${D}${sysconfdir}/quagga/*.conf
+
+ # Install quagga
+ oe_runmake install DESTDIR=${D} prefix=${prefix} \
+ sbindir=${sbindir} \
+ sysconfdir=${sysconfdir}/quagga \
+ localstatedir=${localstatedir}/run/quagga
+
+ # Fix hardcoded paths
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/*
+ sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/*
+
+ # For PAM
+ for feature in ${DISTRO_FEATURES}; do
+ if [ "$feature" = "pam" ]; then
+ install -D -m 644 ${WORKDIR}/quagga.pam ${D}/${sysconfdir}/pam.d/quagga
+ break
+ fi
+ done
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ echo "d /var/run/quagga 0755 quagga quagga -" \
+ > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
+ fi
+
+ # Remove sysinit script if sysvinit is not in DISTRO_FEATURES
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
+ rm -rf ${D}${sysconfdir}/init.d/
+ rm -f ${D}${sysconfdir}/default/watchquagga
+ fi
+
+ install -d ${D}${systemd_unitdir}/system
+ for i in bgpd isisd ospf6d ospfd ripd ripngd zebra; do
+ install -m 0644 ${WORKDIR}/$i.service ${D}${systemd_unitdir}/system
+ done
+ sed -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ -e 's,@SBINDIR@,${sbindir},g' \
+ -e 's,@base_bindir@,${base_bindir},g' \
+ -e 's,@localstatedir@,${localstatedir},g' \
+ -i ${D}${systemd_unitdir}/system/*.service
+}
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}"
+pkg_postinst_${PN} () {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+ systemctl $OPTS mask quagga.service
+ fi
+}
+
+# Split into a main package and separate per-protocol packages
+PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-bgpd \
+ ${PN}-ripd ${PN}-ripngd ${PN}-isisd \
+ ${PN}-ospfclient ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${PN}-watchquagga', '', d)}"
+
+RDEPENDS_${PN} += "${PN}-bgpd ${PN}-isisd ${PN}-ospf6d ${PN}-ospfd ${PN}-ripd ${PN}-ripngd"
+
+FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*"
+FILES_${PN}-ospf6d = "${sbindir}/ospf6d"
+FILES_${PN}-bgpd = "${sbindir}/bgpd"
+FILES_${PN}-ripd = "${sbindir}/ripd"
+FILES_${PN}-ripngd = "${sbindir}/ripngd"
+FILES_${PN}-isisd = "${sbindir}/isisd"
+FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*"
+FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \
+ ${sysconfdir}/init.d/watchquagga"
+
+# Indicate that the default files are configuration files
+CONFFILES_${PN} = "${sysconfdir}/default/quagga \
+ ${sysconfdir}/quagga/bgpd.conf \
+ ${sysconfdir}/quagga/vtysh.conf \
+ ${sysconfdir}/quagga/isisd.conf \
+ ${sysconfdir}/quagga/ospfd.conf \
+ ${sysconfdir}/quagga/ripngd.conf \
+ ${sysconfdir}/quagga/zebra.conf \
+ ${sysconfdir}/quagga/ripd.conf \
+ ${sysconfdir}/quagga/ospf6d.conf \
+ "
+CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga"
+
+# Stop the names being rewritten due to the internal shared libraries
+DEBIAN_NOAUTONAME_${PN}-ospfd = "1"
+DEBIAN_NOAUTONAME_${PN}-ospfclient = "1"
+
+# Main init script starts all deamons
+# Seperate init script for watchquagga
+INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga"
+INITSCRIPT_NAME_${PN} = "quagga"
+INITSCRIPT_PARAMS_${PN} = "defaults 15 85"
+INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga"
+INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10"
+
+# Add quagga's user and group
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga -G quaggavty --shell /bin/false quagga"
+
+pkg_postinst_${PN} () {
+ if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+}
+
+# Stop apps before uninstall
+pkg_prerm_${PN} () {
+ ${sysconfdir}/init.d/quagga stop
+}
+
+pkg_prerm_${PN}-ospfd () {
+ ${sysconfdir}/init.d/quagga stop ospfd
+}
+
+pkg_prerm_${PN}-ospf6d () {
+ ${sysconfdir}/init.d/quagga stop ospf6d
+}
+
+pkg_prerm_${PN}-bgpd () {
+ ${sysconfdir}/init.d/quagga stop bgpd
+}
+
+pkg_prerm_${PN}-ripd () {
+ ${sysconfdir}/init.d/quagga stop ripd
+}
+
+pkg_prerm_${PN}-ripngd () {
+ ${sysconfdir}/init.d/quagga stop ripngd
+}
+
+pkg_prerm_${PN}-isisd () {
+ ${sysconfdir}/init.d/quagga stop isisd
+}
diff --git a/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb
new file mode 100644
index 000000000..a7697a1ae
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/quagga/quagga_1.2.4.bb
@@ -0,0 +1,4 @@
+require quagga.inc
+
+SRC_URI[md5sum] = "eced21b054d71c9e1b7c6ac43286a166"
+SRC_URI[sha256sum] = "e364c082c3309910e1eb7b068bf39ee298e2f2f3f31a6431a5c115193bd653d3"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch
new file mode 100644
index 000000000..ecc2d74e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/Modify-configure.in-and-etc-Makefile.am.patch
@@ -0,0 +1,84 @@
+From 45b97b474ce2d0ad56828db11edde8562bb47a43 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Tue, 2 Dec 2014 02:33:53 +0900
+Subject: [PATCH] Modify configure.in and etc/Makefile.am
+
+this patch is from Fedora to fix error:
+"conftest.c:26:9: error: unknown type name 'not'"
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ configure.in | 6 +++++-
+ etc/Makefile.am | 9 ++++++---
+ etc/radiusclient.conf.in | 2 +-
+ 3 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 812f640..3a8af99 100644
+--- a/configure.in
++++ b/configure.in
+@@ -29,6 +29,9 @@ AC_SUBST(LIBVERSION)
+ pkgsysconfdir=${sysconfdir}/$PACKAGE
+ AC_SUBST(pkgsysconfdir)
+
++pkgdatadir=${datadir}/$PACKAGE
++AC_SUBST(pkgdatadir)
++
+ AC_PROG_LIBTOOL
+
+ AC_PROG_CC
+@@ -118,7 +121,8 @@ then
+ ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_UTSNAME_DOMAINNAME),
+- AC_MSG_RESULT(no)
++ AC_MSG_RESULT(no),
++ AC_MSG_RESULT(assume no),
+ )
+ fi
+
+diff --git a/etc/Makefile.am b/etc/Makefile.am
+index 39b6975..a3c403f 100644
+--- a/etc/Makefile.am
++++ b/etc/Makefile.am
+@@ -14,9 +14,11 @@ CLEANFILES = *~ radiusclient.conf
+
+ sbindir = @sbindir@
+ pkgsysconfdir = @pkgsysconfdir@
+-pkgsysconf_DATA = issue port-id-map radiusclient.conf \
+- dictionary dictionary.ascend dictionary.compat dictionary.merit \
+- dictionary.sip
++pkgsysconf_DATA = issue port-id-map radiusclient.conf
++
++pkgdatadir = @pkgdatadir@
++pkgdata_DATA = dictionary dictionary.ascend dictionary.compat \
++ dictionary.merit dictionary.sip
+
+ EXTRA_DIST = issue port-id-map dictionary dictionary.ascend \
+ dictionary.compat dictionary.merit servers radiusclient.conf.in \
+@@ -25,6 +27,7 @@ EXTRA_DIST = issue port-id-map dictionary dictionary.ascend \
+ radiusclient.conf: radiusclient.conf.in
+ sed -e 's|@sbin''dir@|$(sbindir)|g' \
+ -e 's|@pkgsysconf''dir@|$(pkgsysconfdir)|g' \
++ -e 's|@pkgdata''dir@|$(pkgdatadir)|g' \
+ <$(srcdir)/radiusclient.conf.in >radiusclient.conf
+
+ install-data-local: servers
+diff --git a/etc/radiusclient.conf.in b/etc/radiusclient.conf.in
+index 948bc2f..aac9973 100644
+--- a/etc/radiusclient.conf.in
++++ b/etc/radiusclient.conf.in
+@@ -47,7 +47,7 @@ servers @pkgsysconfdir@/servers
+
+ # dictionary of allowed attributes and values
+ # just like in the normal RADIUS distributions
+-dictionary @pkgsysconfdir@/dictionary
++dictionary @pkgdatadir@/dictionary
+
+ # program to call for a RADIUS authenticated login
+ login_radius @sbindir@/login.radius
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/config-site.radiusclient-ng-0.5.6 b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/config-site.radiusclient-ng-0.5.6
new file mode 100644
index 000000000..a30c144b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng/config-site.radiusclient-ng-0.5.6
@@ -0,0 +1 @@
+ac_cv_func_uname=no
diff --git a/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb
new file mode 100644
index 000000000..95faa65b1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/radiusclient-ng/radiusclient-ng_0.5.6.bb
@@ -0,0 +1,36 @@
+SUMMARY = "RADIUS protocol client library"
+DESCRIPTION = "Portable, easy-to-use and standard compliant library suitable \
+for developing free and commercial software that need support for a RADIUS \
+protocol (RFCs 2128 and 2139)."
+HOMEPAGE = "http://sourceforge.net/projects/radiusclient-ng.berlios/"
+SECTION = "net"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/r/${BPN}/${BPN}_${PV}.orig.tar.gz \
+ file://Modify-configure.in-and-etc-Makefile.am.patch \
+ file://config-site.radiusclient-ng-${PV}"
+
+SRC_URI[md5sum] = "6fb7d4d0aefafaee7385831ac46a8e9c"
+SRC_URI[sha256sum] = "282a9f1355f190efbb06c0d7c4e062eaa652caf342ed3ad361ac595f72f09f14"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3e47566c9271b786693d8a08792dbf41"
+
+inherit autotools-brokensep
+
+EXTRA_OECONF += "--disable-static"
+
+do_configure_prepend () {
+ export CONFIG_SITE=./config-site.${P}
+}
+
+do_compile_prepend() {
+ for m in `find . -name "Makefile"` ; do
+ sed -i -e 's:^program_transform_name =.*:program_transform_name =:g' ${m}
+ done
+}
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+ rm -f ${D}${libdir}/*.la
+ rm -f ${D}${sbindir}/radexample
+}
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch
new file mode 100644
index 000000000..7601f0d32
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0001-ppoe-Dont-include-linux-if_ether.h.patch
@@ -0,0 +1,28 @@
+From fdb64d21560bfdafeefccc7d20e105e4857faa99 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 19:20:07 -0700
+Subject: [PATCH] ppoe: Dont include linux/if_ether.h
+
+Fixes build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/pppoe.h | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/pppoe.h b/src/pppoe.h
+index ec067a0..281879c 100644
+--- a/src/pppoe.h
++++ b/src/pppoe.h
+@@ -127,10 +127,6 @@ typedef unsigned long UINT32_t;
+ #error Could not find a 32-bit integer type
+ #endif
+
+-#ifdef HAVE_LINUX_IF_ETHER_H
+-#include <linux/if_ether.h>
+-#endif
+-
+ #include <netinet/in.h>
+
+ #ifdef HAVE_NETINET_IF_ETHER_H
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch
new file mode 100644
index 000000000..2103b3888
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/0002-Enable-support-for-the-kernel-module.patch
@@ -0,0 +1,23 @@
+From 31b6eecd7e5ebfb9a37915f28823e5af9d1062b4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Mar 2017 19:24:53 -0700
+Subject: [PATCH] Enable support for the kernel module
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/configure.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/configure.in b/src/configure.in
+index cae0976..951a042 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -33,6 +33,7 @@ AC_CHECK_HEADERS(linux/if_pppox.h, [], [],
+ #include<net/ethernet.h>
+ #include<linux/if.h>
+ #include<linux/in.h>
++#include<linux/in6.h>
+ ])
+
+ dnl Checks for typedefs, structures, and compiler characteristics.
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.in-Error-fix.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.in-Error-fix.patch
new file mode 100644
index 000000000..bbd516fde
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.in-Error-fix.patch
@@ -0,0 +1,57 @@
+From bdd20b7a584a20504dfabb409a41ee2b9ae41657 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Wed, 19 Aug 2015 13:52:57 +0900
+Subject: [PATCH] configure.in: Error fix.
+
+the error is: conftest.c:9:28: fatal error: ac_nonexistent.h:
+No such file or directory #include <ac_nonexistent.h>
+
+Upstream-Status: pending
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+
+---
+ src/configure.in | 30 ------------------------------
+ 1 file changed, 30 deletions(-)
+
+diff --git a/src/configure.in b/src/configure.in
+index 1714e69..cae0976 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -195,36 +195,6 @@ if test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes"
+ fi
+
+-dnl Figure out packing order of structures
+-AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[
+-if test "${rpppoe_cv_pack_bitfields+set}" != set ; then
+-AC_TRY_RUN([
+-union foo {
+- struct bar {
+- unsigned int ver:4;
+- unsigned int type:4;
+- } bb;
+- unsigned char baz;
+-};
+-
+-int
+-main(void)
+-{
+- union foo x;
+- x.bb.ver = 1;
+- x.bb.type = 2;
+- if (x.baz == 0x21) {
+- return 1;
+- } else if (x.baz == 0x12) {
+- return 0;
+- } else {
+- return 2;
+- }
+-}], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
+-$ECHO "no defaults for cross-compiling"; exit 1)
+-fi
+-])
+-
+ if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
+ AC_MSG_RESULT(reversed)
+ AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields])
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.patch
new file mode 100644
index 000000000..be892803e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure.patch
@@ -0,0 +1,19 @@
+From c96dda04ec024bdef2a15d374e5f8242e041cad4 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Fri, 18 Jul 2014 08:25:16 +0000
+
+---
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index ac1a7e4..11b9f31 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1,4 +1,4 @@
+-AC_INIT(src/pppoe.c)
+-AM_INIT_AUTOMAKE([rp-pppoe], [3.8])
++AC_INIT([rp-pppoe], [3.8])
++AM_INIT_AUTOMAKE([foreign])
+ AC_CONFIG_SUBDIRS(src)
+ AC_OUTPUT(Makefile)
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure_in_cross.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure_in_cross.patch
new file mode 100644
index 000000000..3b945934f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/configure_in_cross.patch
@@ -0,0 +1,153 @@
+From 172907f31d64da4c3f289a439fd605d2ab51b24a Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Wed, 19 Aug 2015 12:17:03 +0900
+Subject: [PATCH] configure in cross
+
+Update the configure script to cross-compiling with OE. This hard-codes
+a few target paths, reworks a few tests to be more friendly for cross
+and drops other tests.
+
+Upstream-Status: Inappropriate [build system specific changes]
+
+---
+ src/configure.in | 66 ++++++++++++++------------------------------------------
+ 1 file changed, 16 insertions(+), 50 deletions(-)
+
+diff --git a/src/configure.in b/src/configure.in
+index 90a07df..1d30243 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -5,6 +5,13 @@ AC_INIT(pppoe.c)
+ dnl pppd directory for kernel-mode PPPoE
+ PPPD_DIR=ppp-2.4.1.pppoe2
+
++dnl hard code some paths
++PPPD=/usr/sbin/pppd
++ID=/usr/bin/id
++ECHO=/bin/echo
++AC_ARG_VAR(PPPD)
++AC_ARG_VAR(ID)
++
+ AC_CONFIG_HEADER(config.h)
+
+ AC_PREFIX_DEFAULT(/usr)
+@@ -45,7 +52,7 @@ ac_cv_struct_sockaddr_ll=no)
+ AC_MSG_RESULT($ac_cv_struct_sockaddr_ll)
+
+ if test "$ac_cv_struct_sockaddr_ll" = yes ; then
+-AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL)
++AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL])
+ fi
+
+ dnl Check for N_HDLC line discipline
+@@ -58,7 +65,7 @@ AC_TRY_COMPILE([
+ ac_cv_n_hdlc=no)
+ AC_MSG_RESULT($ac_cv_n_hdlc)
+ if test "$ac_cv_n_hdlc" = yes ; then
+-AC_DEFINE(HAVE_N_HDLC)
++AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC])
+ fi
+
+ AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no)
+@@ -106,7 +113,7 @@ PPPD_INCDIR=""
+ if test "$ac_cv_header_linux_if_pppox_h" = yes ; then
+ if test "$ac_cv_pluginpath" != no ; then
+ LINUX_KERNELMODE_PLUGIN=rp-pppoe.so
+- AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE)
++ AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE])
+ PPPD_INCDIR=$ac_cv_pluginpath
+ fi
+ fi
+@@ -116,7 +123,7 @@ if test "$PPPD_INCDIR" = "" ; then
+ fi
+
+ if test "$ac_cv_debugging" = "yes" ; then
+- AC_DEFINE(DEBUGGING_ENABLED)
++ AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled])
+ fi
+
+ AC_SUBST(LINUX_KERNELMODE_PLUGIN)
+@@ -142,15 +149,8 @@ AC_CHECK_SIZEOF(unsigned short)
+ AC_CHECK_SIZEOF(unsigned int)
+ AC_CHECK_SIZEOF(unsigned long)
+
+-dnl Check for location of pppd
+-AC_PATH_PROG(PPPD, pppd, NOTFOUND, $PATH:/sbin:/usr/sbin:/usr/local/sbin)
+-AC_PATH_PROG(ECHO, echo, echo)
+-
+-dnl Check for setsid (probably Linux-specific)
+-AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin)
+-
+ dnl Check for an "id" which accepts "-u" option -- hack for Solaris.
+-AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
++dnl AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH)
+
+ dnl Check for Linux-specific kernel support for PPPoE
+ AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support)
+@@ -195,44 +195,8 @@ if test "$GCC" = yes; then
+ CFLAGS="$CFLAGS -fno-strict-aliasing -Wall -Wstrict-prototypes"
+ fi
+
+-dnl If we couldn't find pppd, die
+-if test "$PPPD" = "NOTFOUND"; then
+- AC_MSG_WARN([*** Oops! I couldn't find pppd, the PPP daemon anywhere.])
+- AC_MSG_WARN([*** You must install pppd, version 2.3.10 or later.])
+- AC_MSG_WARN([*** I will keep going, but it may not work.])
+- PPPD=pppd
+-fi
+-
+-dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than
+-dnl 2.3.7 -- stop
+-
+-PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'`
+-
+-case "$PPPD_VERSION" in
+-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)
+- AC_MSG_WARN([*** Oops! Your version of pppd is $PPPD_VERSION, which is too old.])
+- AC_MSG_WARN([*** You need at least 2.3.7 (2.3.10 or newer recommended.])
+- AC_MSG_WARN([*** I will keep going, but it may not work.])
+- ;;
+-
+-2.3.7|2.3.8|2.3.9)
+- AC_MSG_WARN([*** Warning. Your version of pppd is $PPPD_VERSION. You will])
+- AC_MSG_WARN([*** not be able to use connect-on-demand. Upgrade to pppd])
+- AC_MSG_WARN([*** 2.3.10 or newer if you need connect-on-demand.])
+- ;;
+-
+-2*|3*|4*|5*|6*|7*|8*|9*)
+- ;;
+-
+-*)
+- AC_MSG_WARN([*** Oops. I cannot figure out what version of pppd you have.])
+- AC_MSG_WARN([*** All I got back was '$PPPD_VERSION'])
+- AC_MSG_WARN([*** I will keep going, but it may not work.])
+- ;;
+-esac
+-
+ dnl Figure out packing order of structures
+-AC_MSG_CHECKING([packing order of bit fields])
++AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[
+ if test "${rpppoe_cv_pack_bitfields+set}" != set ; then
+ AC_TRY_RUN([
+ union foo {
+@@ -259,10 +223,11 @@ main(void)
+ }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
+ $ECHO "no defaults for cross-compiling"; exit 0)
+ fi
++])
+
+ if test "$rpppoe_cv_pack_bitfields" = "rev" ; then
+ AC_MSG_RESULT(reversed)
+- AC_DEFINE(PACK_BITFIELDS_REVERSED)
++ AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields])
+ else
+ AC_MSG_RESULT(normal)
+ fi
+@@ -326,6 +291,7 @@ AC_SUBST(PPPOE_SERVER_DEPS)
+ AC_SUBST(RDYNAMIC)
+ AC_SUBST(LIBEVENT)
+ AC_SUBST(ECHO)
++AC_SUBST(HAVE_STRUCT_SOCKADDR_LL)
+ AC_SUBST(LDFLAGS)
+
+ datadir_evaluated=`eval echo $datadir`
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/discard-use-of-dnl-in-Makefile.am.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/discard-use-of-dnl-in-Makefile.am.patch
new file mode 100644
index 000000000..9801f6e27
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/discard-use-of-dnl-in-Makefile.am.patch
@@ -0,0 +1,25 @@
+From f658181c58347c3e2b0ee4f0a6a3d19162921471 Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Tue, 12 Jun 2012 14:26:16 -0400
+Subject: [PATCH] discard use of dnl in Makefile.am
+
+Since Makefile.am is not processed by m4, but by automake, 'dnl' does
+not introduce a comment.
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index eff6977..3091c33 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,5 +1,5 @@
+ PACKAGE = rp-pppoe
+ VERSION = 3.8
+
+-dnl AM_CFLAGS = -Wall -DDEBUG
++##dnl AM_CFLAGS = -Wall -DDEBUG
+ SUBDIRS = src
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/dont-swallow-errors.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/dont-swallow-errors.patch
new file mode 100644
index 000000000..8a857888b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/dont-swallow-errors.patch
@@ -0,0 +1,26 @@
+From a9a7322273c51882af58c35ba288a0fae00ba841 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Wed, 19 Aug 2015 12:33:41 +0900
+Subject: [PATCH] don't swallow errors
+
+Further fixup to the configure scripts to not swallow errors
+
+Upstream-Status: Pending
+
+---
+ src/configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/configure.in b/src/configure.in
+index 1d30243..1714e69 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -221,7 +221,7 @@ main(void)
+ return 2;
+ }
+ }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev,
+-$ECHO "no defaults for cross-compiling"; exit 0)
++$ECHO "no defaults for cross-compiling"; exit 1)
+ fi
+ ])
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.default b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.default
new file mode 100644
index 000000000..996d57f3c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.default
@@ -0,0 +1,22 @@
+# PPPoE Server options
+
+# Maximum segment size, not used for in kernel PPPoE
+#MSS=1412
+
+# Device(s) - Space seperated list of devices to listen on
+#DEVICES="eth1"
+
+# Local IP
+#LOCAL_IP=10.0.0.1
+
+# Starting remote IP
+#REMOTE_IP=10.67.15.1
+
+# Service name
+#SERVICE_NAME="acme"
+
+# Maximum number of sessions, default is 16
+#MAX_SESSIONS=64
+
+# Access concentrator name, default is the hostname
+#ACCESS_CONCENTRATOR_NAME="pppoe-rtr-1"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.init b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.init
new file mode 100755
index 000000000..21afe0be3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.init
@@ -0,0 +1,59 @@
+#! /bin/sh
+
+test -f /usr/sbin/pppoe-server || exit 0
+test -f /etc/default/pppoe-server && . /etc/default/pppoe-server
+
+case $1 in
+ start)
+ OPTIONS=""
+ if [ -n "$MSS" ]; then
+ OPTIONS="$OPTIONS -m $MSS"
+ fi
+ if [ -n "$DEVICES" ]; then
+ for i in $DEVICES; do
+ OPTIONS="$OPTIONS -I $i"
+ done
+ fi
+ if [ -n "$LOCAL_IP" ]; then
+ OPTIONS="$OPTIONS -L $LOCAL_IP"
+ fi
+ if [ -n "$REMOTE_IP" ]; then
+ OPTIONS="$OPTIONS -R $REMOTE_IP"
+ fi
+ if [ -n "$SERVICE_NAME" ]; then
+ OPTIONS="$OPTIONS -S $SERVICE_NAME"
+ fi
+ if [ -n "$MAX_SESSIONS" ]; then
+ OPTIONS="$OPTIONS -N $MAX_SESSIONS"
+ fi
+ if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then
+ OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME"
+ fi
+ echo -n "Starting PPPoE server: pppoe-server"
+ start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping PPPoE server: pppoe-server"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS
+ echo "."
+ ;;
+ status)
+ pid=$(pidof pppoe-server)
+ if [ -n "$pid" ] ; then
+ echo "Running with pid $pid"
+ else
+ echo "Not running"
+ fi
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.service b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.service
new file mode 100644
index 000000000..41e0b9e85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-server.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=PPPOE Service
+After=network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/pppoe-server
+ExecStart=@SBINDIR@/pppoe-server
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-src-restrictions.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-src-restrictions.patch
new file mode 100644
index 000000000..03697ff1f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/pppoe-src-restrictions.patch
@@ -0,0 +1,31 @@
+From a6a85ec5c85cbd3c86743b6e2fa391198869bff8 Mon Sep 17 00:00:00 2001
+From: Tom Rini <tom_rini@mentor.com>
+Date: Wed, 27 Jul 2011 03:46:52 +0000
+Subject: [PATCH] rp-pppoe: Port from oe.dev
+
+Relax restrictions on the PPPoE src address, as per debian bug
+293811:
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293811
+
+Upstream-Status: Inappropriate [Backport from Debian]
+
+---
+ src/discovery.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/discovery.c b/src/discovery.c
+index 7ee259d..5213a37 100644
+--- a/src/discovery.c
++++ b/src/discovery.c
+@@ -472,8 +472,8 @@ waitForPADO(PPPoEConnection *conn, int timeout)
+ if (!packetIsForMe(conn, &packet)) continue;
+
+ if (packet.code == CODE_PADO) {
+- if (NOT_UNICAST(packet.ethHdr.h_source)) {
+- printErr("Ignoring PADO packet from non-unicast MAC address");
++ if (BROADCAST(packet.ethHdr.h_source)) {
++ printErr("Ignoring broadcast PADO packet");
+ continue;
+ }
+ #ifdef PLUGIN
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/top-autoconf.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/top-autoconf.patch
new file mode 100644
index 000000000..f64da4fa2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/top-autoconf.patch
@@ -0,0 +1,41 @@
+From 0b62f71eb5d44d4a57103566ba58022b6304fa4f Mon Sep 17 00:00:00 2001
+From: Tom Rini <tom_rini@mentor.com>
+Date: Wed, 27 Jul 2011 03:46:52 +0000
+Subject: [PATCH] rp-pppoe: Port from oe.dev
+
+The autoconf stuff is all in a subdirectory, which is rather annoying
+as OE expects patches to be applied and autoconf stuff to be done in
+S. This adds enough autoconf at the top level to allow it to be
+called there - all it does is run a sub autoconf stuff in the src
+directory.
+
+Upstream-Status: Inappropriate [build system specific change]
+
+---
+ Makefile.am | 5 +++++
+ configure.in | 4 ++++
+ 2 files changed, 9 insertions(+)
+ create mode 100644 Makefile.am
+ create mode 100644 configure.in
+
+diff --git a/Makefile.am b/Makefile.am
+new file mode 100644
+index 0000000..eff6977
+--- /dev/null
++++ b/Makefile.am
+@@ -0,0 +1,5 @@
++PACKAGE = rp-pppoe
++VERSION = 3.8
++
++dnl AM_CFLAGS = -Wall -DDEBUG
++SUBDIRS = src
+diff --git a/configure.in b/configure.in
+new file mode 100644
+index 0000000..ac1a7e4
+--- /dev/null
++++ b/configure.in
+@@ -0,0 +1,4 @@
++AC_INIT(src/pppoe.c)
++AM_INIT_AUTOMAKE([rp-pppoe], [3.8])
++AC_CONFIG_SUBDIRS(src)
++AC_OUTPUT(Makefile)
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/update-config.patch b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/update-config.patch
new file mode 100644
index 000000000..c759e09aa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.12/update-config.patch
@@ -0,0 +1,41 @@
+From 4d34e0d7d790ec41b0afb731c7dc1b1ee90dd377 Mon Sep 17 00:00:00 2001
+From: Tom Rini <tom_rini@mentor.com>
+Date: Wed, 27 Jul 2011 03:46:52 +0000
+Subject: [PATCH] rp-pppoe: Port from oe.dev
+
+Set the timeout to 0 since we don't want pppoe to try reconnecting,
+we want whatever is calling it to reconnect. Lots of odd things
+happen when you have pppoe retrying itself.
+
+The path for the plugin is wrong, it's now part of ppp and is in a
+ppp's plugin lib directory. If no path is specified then that's where
+ppp looks, so that's what we do here.
+
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configs/pppoe.conf | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configs/pppoe.conf b/configs/pppoe.conf
+index c222b2f..65618a5 100644
+--- a/configs/pppoe.conf
++++ b/configs/pppoe.conf
+@@ -66,7 +66,7 @@ DEFAULTROUTE=yes
+ # to connect forever after pppoe-start is called. Otherwise, it will
+ # give out after CONNECT_TIMEOUT seconds and will not attempt to
+ # connect again, making it impossible to reach.
+-CONNECT_TIMEOUT=30
++CONNECT_TIMEOUT=0
+
+ # How often in seconds pppoe-start polls to check if link is up
+ CONNECT_POLL=2
+@@ -115,7 +115,7 @@ PPPOE_TIMEOUT=80
+ FIREWALL=NONE
+
+ # Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
+-# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
++# plugin, use LINUX_PLUGIN=rp-pppoe.so
+ LINUX_PLUGIN=
+
+ # Any extra arguments to pass to pppoe. Normally, use a blank string
diff --git a/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb
new file mode 100644
index 000000000..fbe015f5e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.12.bb
@@ -0,0 +1,77 @@
+SUMMARY = "A user-mode PPPoE client and server suite for Linux"
+HOMEPAGE = "http://www.roaringpenguin.com/products/pppoe"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=a194eaefae2be54ee3221339b10d0581"
+
+PR = "r10"
+
+SRC_URI = "http://www.roaringpenguin.com/files/download/${BP}.tar.gz \
+ file://top-autoconf.patch \
+ file://configure_in_cross.patch \
+ file://pppoe-src-restrictions.patch \
+ file://update-config.patch \
+ file://dont-swallow-errors.patch \
+ file://discard-use-of-dnl-in-Makefile.am.patch \
+ file://configure.patch \
+ file://pppoe-server.default \
+ file://pppoe-server.init \
+ file://configure.in-Error-fix.patch \
+ file://pppoe-server.service \
+ file://0001-ppoe-Dont-include-linux-if_ether.h.patch \
+ file://0002-Enable-support-for-the-kernel-module.patch \
+ "
+
+SRC_URI[md5sum] = "216eb52b69062b92a64ee37fd71f4b66"
+SRC_URI[sha256sum] = "00794e04031546b0e9b8cf286f2a6d1ccfc4a621b2a3abb2d7ef2a7ab7cc86c2"
+
+inherit autotools-brokensep update-rc.d systemd
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/pppoe-server.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/pppoe-server.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/pppoe-server.service
+ install -d ${D}${datadir}/doc/${PN}
+ if [ -f ${D}${datadir}/doc/README ]; then
+ mv ${D}${datadir}/doc/README ${D}${datadir}/doc/${PN}/
+ fi
+}
+
+do_install() {
+ # Install init script and default settings
+ install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/pppoe-server.default ${D}${sysconfdir}/default/pppoe-server
+ install -m 0755 ${WORKDIR}/pppoe-server.init ${D}${sysconfdir}/init.d/pppoe-server
+ # Install
+ oe_runmake -C ${S} DESTDIR=${D} docdir=${docdir} install
+ chmod 4755 ${D}${sbindir}/pppoe
+}
+
+SYSTEMD_PACKAGES = "${PN}-server"
+SYSTEMD_SERVICE_${PN}-server = "pppoe-server.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+# Insert server package before main package
+PACKAGES = "${PN}-dbg ${PN}-server ${PN}-relay ${PN}-sniff ${PN} ${PN}-doc"
+
+FILES_${PN}-server = "${sysconfdir}/default/pppoe-server \
+ ${sysconfdir}/init.d/pppoe-server \
+ ${sbindir}/pppoe-server \
+ ${sysconfdir}/ppp/pppoe-server-options"
+FILES_${PN}-relay = "${sbindir}/pppoe-relay"
+FILES_${PN}-sniff = "${sbindir}/pppoe-sniff"
+
+CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe.conf \
+ ${sysconfdir}/ppp/firewall-standalone \
+ ${sysconfdir}/ppp/firewall-masq"
+CONFFILES_${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \
+ ${sysconfdir}/default/pppoe-server"
+
+INITSCRIPT_PACKAGES = "${PN}-server"
+INITSCRIPT_NAME_${PN}-server = "pppoe-server"
+INITSCRIPT_PARAMS_${PN}-server = "defaults 92 8"
+
+RDEPENDS_${PN} = "ppp"
+RDEPENDS_${PN}-server = "${PN}"
+RRECOMMENDS_${PN} = "ppp-oe"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks/makefile-add-ldflags.patch
new file mode 100644
index 000000000..21464188c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile.in, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index cad6706..0ed55c5 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -50,7 +50,7 @@ ${SAVE}: ${SAVE}.c
+ ${SHCC} ${CFLAGS} ${INCLUDES} -static -o ${SAVE} ${SAVE}.c
+
+ ${SHLIB}: ${OBJS} ${COMMON}.o ${PARSER}.o
+- ${SHCC} ${CFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
++ ${SHCC} ${CFLAGS} ${LDFLAGS} ${INCLUDES} -nostdlib -shared -o ${SHLIB} ${OBJS} ${COMMON}.o ${PARSER}.o ${DYNLIB_FLAGS} ${SPECIALLIBS} ${LIBS}
+ ln -sf ${SHLIB} ${LIB_NAME}.so
+
+ %.so: %.c
diff --git a/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb b/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb
new file mode 100644
index 000000000..b2757f6dd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/tsocks/tsocks_1.8beta5.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Libraries and wrapper for using a SOCKS proxy"
+DESCRIPTION = "The role of tsocks is to allow non SOCKS aware \
+applications (e.g telnet, ssh, ftp etc) to use SOCKS without any \
+modification. It does this by intercepting the calls that applications \
+make to establish network connections and negotating them through a \
+SOCKS server as necessary."
+HOMEPAGE = "http://sourceforge.net/projects/tsocks/"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+SRC_URI = "http://downloads.sourceforge.net/tsocks/tsocks-${PV}.tar.gz \
+ file://makefile-add-ldflags.patch \
+ "
+
+SRC_URI[md5sum] = "51caefd77e5d440d0bbd6443db4fc0f8"
+SRC_URI[sha256sum] = "849d7ef5af80d03e76cc05ed9fb8fa2bcc2b724b51ebfd1b6be11c7863f5b347"
+
+inherit autotools-brokensep
+
+S = "${WORKDIR}/tsocks-1.8"
+
+FILES_${PN} = "${libdir}/* ${bindir}/tsocks"
+FILES_${PN}-dev = ""
+INSANE_SKIP_${PN} = "dev-so"
+
+EXTRA_OEMAKE = "SHCC='${CC} -fPIC ${LDFLAGS}'"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch b/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch
new file mode 100644
index 000000000..b932ebbb4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp/0001-Use-foreign-switch-for-automake.patch
@@ -0,0 +1,28 @@
+From 748bc693cf24baf42e459e12f152349e392b6737 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 20 Dec 2016 21:32:11 -0800
+Subject: [PATCH] Use foreign switch for automake
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 64cc9994..19ccd4a3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -29,7 +29,7 @@ dnl SUCH DAMAGE.
+ dnl
+
+ AC_INIT([libusrsctp], [0.9.3.0])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+
+ AC_PROG_CC
+ AC_PROG_LIBTOOL
+--
+2.11.0
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb b/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb
new file mode 100644
index 000000000..3ec746684
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/usrsctp/usrsctp_git.bb
@@ -0,0 +1,24 @@
+DESCRIPTION = "This is a userland SCTP stack supporting FreeBSD, Linux, Mac OS X and Windows."
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ffcf846341f3856d79a483eafa18e2a5"
+
+SRCREV = "dbfc1b8c4cf1a46a4d8987ba542d5ff06bdaf14c"
+SRC_URI = "git://github.com/sctplab/usrsctp;protocol=https;branch=master \
+ file://0001-Use-foreign-switch-for-automake.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+DEPENDS += "openssl"
+
+CFLAGS += "-DSCTP_USE_OPENSSL_SHA1 -fPIC"
+LDFLAGS += "-lssl -lcrypto"
+
+PACKAGECONFIG ?= "disablewarnings inet inet6"
+PACKAGECONFIG[disablewarnings] = "--disable-warnings-as-errors,,"
+PACKAGECONFIG[inet] = "--enable-inet,--disable-inet,"
+PACKAGECONFIG[inet6] = "--enable-inet6,--disable-inet6,"
+
+EXTRA_OECONF += "--disable-debug"
diff --git a/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
new file mode 100644
index 000000000..d037c7cfc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc
@@ -0,0 +1,41 @@
+SUMMARY = "Xelerance version of the Layer 2 Tunneling Protocol (L2TP) daemon"
+HOMEPAGE = "http://www.xelerance.com/software/xl2tpd/"
+SECTION = "net"
+DEPENDS = "ppp virtual/kernel"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "git://github.com/xelerance/xl2tpd.git \
+"
+
+S = "${WORKDIR}/git"
+
+inherit update-rc.d
+
+do_compile () {
+ oe_runmake CFLAGS="${CFLAGS} -DLINUX" LDFLAGS="${LDFLAGS}" PREFIX="${prefix}" KERNELSRC=${STAGING_KERNEL_DIR} all
+}
+
+do_install () {
+ oe_runmake PREFIX="${D}${prefix}" install
+
+ install -d ${D}${sysconfdir}/init.d
+ touch ${D}${sysconfdir}/xl2tpd.conf
+ install -m 0755 debian/xl2tpd.init ${D}${sysconfdir}/init.d/xl2tpd
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/xl2tpd
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/xl2tpd
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/xl2tpd
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/xl2tpd
+
+ install -d ${D}${sysconfdir}/default
+ install -m 0644 debian/xl2tpd.default ${D}${sysconfdir}/default/xl2tpd
+}
+
+CONFFILES_${PN} += "${sysconfdir}/xl2tpd.conf ${sysconfdir}/default/xl2tpd"
+
+INITSCRIPT_PACKAGES = "${PN}"
+INITSCRIPT_NAME_${PN} = "xl2tpd"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb
new file mode 100644
index 000000000..df2ec52c6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_1.3.6.bb
@@ -0,0 +1,7 @@
+require xl2tpd.inc
+
+# The SRCREV corresponds to v1.3.6.
+# Adding tag=v1.3.6 to the SRC_URI will force access to the upstream repo.
+#
+SRCREV = "5619e1771048e74b729804e8602f409af0f3faea"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb
new file mode 100644
index 000000000..88ae5d6f8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb
@@ -0,0 +1,8 @@
+require xl2tpd.inc
+
+# This is v1.3.6 plus some commits. There is no tag for this commit.
+#
+PV = "1.3.9+git${SRCPV}"
+
+SRCREV = "f114c10ac532051badeca0132b144a2f1596f047"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch
new file mode 100644
index 000000000..b4d6d94b0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch
@@ -0,0 +1,69 @@
+From 549773fdaf1fb003b84f25df386a07d299cdeb3e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Jul 2017 21:25:33 -0700
+Subject: [PATCH] zeroconf: Rename arp_op to avoid namespace conflicts with C
+ library
+
+on musl e.g. we get
+In file included from /mnt/a/oe/build/tmp/work/corei7-64-bec-linux-musl/zeroconf/0.9-r1/recipe-sysroot/usr/include/net/ethernet.h:10:0,
+
+This is because in musl arp_op is a define which is included
+and causes the conflict
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ zeroconf.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/zeroconf.c b/zeroconf.c
+index 812d34b..f27e907 100644
+--- a/zeroconf.c
++++ b/zeroconf.c
+@@ -14,8 +14,6 @@
+
+ #include <sys/types.h>
+ #include <sys/socket.h>
+-#include <linux/rtnetlink.h>
+-#include <linux/if.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -34,6 +32,8 @@
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <limits.h>
++#include <linux/rtnetlink.h>
++#include <linux/if.h>
+
+ #include "delay.h"
+
+@@ -108,7 +108,7 @@ int arp_conflict(struct intf *intf, struct arp_packet *pkt);
+ void arp_packet_dump(struct arp_packet *pkt);
+ void arp_packet_send(int as,
+ struct intf *intf,
+- short int arp_op,
++ short int arpop,
+ int null_sender);
+ void arp_probe(int as, struct intf *intf);
+ void arp_claim(int as, struct intf *intf);
+@@ -1591,7 +1591,7 @@ int arp_conflict(struct intf *intf, struct arp_packet *pkt)
+
+ void arp_packet_send(int as,
+ struct intf *intf,
+- short int arp_op,
++ short int arpop,
+ int null_sender)
+ {
+
+@@ -1605,7 +1605,7 @@ void arp_packet_send(int as,
+ ap.arp.ar_pro = htons(ARP_IP_PROTO);
+ ap.arp.ar_hln = ETH_ALEN;
+ ap.arp.ar_pln = 4; /* octets in IPv4 address */
+- ap.arp.ar_op = htons(arp_op);
++ ap.arp.ar_op = htons(arpop);
+
+ /* filling with 0xff sets the destination to
+ * the broadcast link-layer address for free
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch
new file mode 100644
index 000000000..328e574a9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch
@@ -0,0 +1,19 @@
+| zeroconf.c: In function 'main':
+| zeroconf.c:145: error: 'PATH_MAX' undeclared (first use in this function)
+
+RP - 4/9/09
+
+Upstream-Status: Pending
+
+Index: zeroconf-0.9/zeroconf.c
+===================================================================
+--- zeroconf-0.9.orig/zeroconf.c 2009-09-04 10:05:25.000000000 +0100
++++ zeroconf-0.9/zeroconf.c 2009-09-04 10:05:42.000000000 +0100
+@@ -33,6 +33,7 @@
+ #include <net/if_arp.h>
+ #include <sys/time.h>
+ #include <signal.h>
++#include <limits.h>
+
+ #include "delay.h"
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf
new file mode 100644
index 000000000..0c9d15ba1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+if [ ! -x /usr/sbin/zeroconf ]; then
+ exit 0
+fi
+
+# IPv4 link-local addresses (zeroconf) are
+# only applicable on the 'inet' address family
+[ "X$ADDRFAM" != "Xinet" ] && exit 0
+
+# However there are some methods where it doesn't
+# make any sense to configure an IPv4LL address
+
+# not on loopback
+[ "X$METHOD" = "Xloopback" ] && exit 0
+
+# not on ppp or wvdial either
+[ "X$METHOD" = "Xppp" ] && exit 0
+[ "X$METHOD" = "Xwvdial" ] && exit 0
+
+# The administrator may have blacklisted interfaces
+# or only want zeroconf in a fallback situation
+[ -f /etc/default/zeroconf ] &&
+ . /etc/default/zeroconf
+
+[ -n "$DISABLE" ] && exit 0
+
+for BLACK in $IFBLACKLIST; do
+ case $IFACE in
+ $BLACK)
+ exit 0
+ ;;
+ esac
+done
+
+# should we only allocate an address if we do not already have one?
+if [ -n "$FALLBACK" ]; then
+ /sbin/ip addr show $IFACE scope global | grep -q "inet"
+ IP=$?
+ if [ $IP -eq 0 ]; then
+ /sbin/ip route add 169.254.0.0/16 dev $IFACE
+ exit 0
+ fi
+fi
+
+# otherwise, run if we aren't already going
+if [ ! -r /var/run/zeroconf.$IFACE.pid ]; then
+ /usr/sbin/zeroconf -i $IFACE
+fi
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/makefile-add-ldflags.patch
new file mode 100644
index 000000000..c5a4414db
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 77f3364..c98083f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -18,7 +18,7 @@ clean:
+
+ zeroconf: zeroconf.o delay.o
+ $(Q)echo "Creating $@"
+- $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
++ $(Q)$(CC) $(CFLAGS) ${LDFLAGS} -o $@ $^ $(LIBS)
+
+
+ # Automatic dependency generation
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default
new file mode 100644
index 000000000..cc07b275f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default
@@ -0,0 +1,17 @@
+# Default for zeroconf
+
+# disable zeroconf
+# If you want to disable zeroconf completely, uncomment the following line
+# this may be useful if you are debugging zeroconf or starting it manually
+#DISABLE=yes
+
+# black-listed interfaces
+# Interfaces which you never wish to have zeroconf run on should
+# be listed here. e.g. "eth2 wlan1" in a space seperated string
+IFBLACKLIST=""
+
+# fallback only
+# If you would only like a link-local address if you were unable to
+# obtain an address via DHCP then uncomment the following line
+#FALLBACK=yes
+
diff --git a/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb
new file mode 100644
index 000000000..753d83298
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb
@@ -0,0 +1,37 @@
+SUMMARY = "IPv4 link-local address allocator"
+DESCRIPTION = "Zeroconf is a program that is used to claim IPv4 \
+link-local addresses. IPv4 link-local addresses are useful when setting \
+up ad-hoc networking between devices without the involvement of a either \
+a DHCP server or network administrator. \
+These addresses are allocated from the 169.254.0.0/16 address range and \
+are normally attached to each Ethernet device in your computer. \
+Addresses are assigned randomly by each host and, in case of collision, \
+both hosts (are supposed to) renumber."
+AUTHOR = "Anand Kumria <wildfire@progsoc.uts.edu.au>"
+HOMEPAGE = "http://www.progsoc.org/~wildfire/zeroconf/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4 \
+ file://zeroconf.c;beginline=1;endline=13;md5=a5bada96e1e34b08eb7446b28e2630b2"
+SECTION = "net"
+
+PR = "r1"
+
+SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.gz \
+ file://compilefix.patch \
+ file://makefile-add-ldflags.patch \
+ file://zeroconf-default \
+ file://debian-zeroconf \
+ file://0001-zeroconf-Rename-arp_op-to-avoid-namespace-conflicts-.patch \
+ "
+
+SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2"
+SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b"
+
+do_install () {
+ install -d ${D}${sbindir}
+ install -d ${D}${sysconfdir}/network/if-up.d
+ install -d ${D}${sysconfdir}/default
+ install -c -m 755 ${S}/zeroconf ${D}${sbindir}/zeroconf
+ install -c -m 755 ${WORKDIR}/debian-zeroconf ${D}${sysconfdir}/network/if-up.d/zeroconf
+ install -c ${WORKDIR}/zeroconf-default ${D}${sysconfdir}/default/zeroconf
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch
new file mode 100644
index 000000000..ec89b7a53
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/aoe-stat-no-bashism.patch
@@ -0,0 +1,27 @@
+From 38c97e590fde19213f6ba31e72d1c227db869427 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 31 Aug 2014 22:28:38 -0700
+Subject: [PATCH] aoe-stat.in: no bashism
+
+The checkbashisms shows there is no bashism, so use /bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ aoe-stat.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/aoe-stat.in b/aoe-stat.in
+index 50e6ac6..0c1d6f5 100755
+--- a/aoe-stat.in
++++ b/aoe-stat.in
+@@ -1,4 +1,4 @@
+-#! /bin/bash
++#! /bin/sh
+ # aoe-stat - collate and present information about AoE storage
+ # Copyright 2012, CORAID, Inc., and licensed under GPL v.2.
+
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/makefile-add-ldflags.patch
new file mode 100644
index 000000000..726d8c564
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools/makefile-add-ldflags.patch
@@ -0,0 +1,31 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 0c56ade..79f2e2b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -68,17 +68,17 @@ clean :
+ rm -f ${CONF_SCRIPTS} ${AOE_PING_OBJ} ${AOE_CFG_OBJ} ${SANCHECK_OBJ} ${PROGS}
+
+ aoeping : ${AOE_PING_OBJ}
+- ${CC} ${CFLAGS} -o $@ ${AOE_PING_OBJ}
++ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${AOE_PING_OBJ}
+ aoeping.o : aoeping.c dat.h fns.h
+ ${CC} ${CFLAGS} -o $@ -c $<
+ linux.o : linux.c config.h
+ ${CC} ${CFLAGS} -o $@ -c $<
+ aoecfg: ${AOE_CFG_OBJ}
+- ${CC} ${CFLAGS} -o $@ ${AOE_CFG_OBJ}
++ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${AOE_CFG_OBJ}
+ aoecfg.o : aoecfg.c dat.h fns.h
+ ${CC} ${CFLAGS} -o $@ -c $<
+ aoe-sancheck : ${SANCHECK_OBJ}
+- -$(CC) $(CFLAGS) -o $@ ${SANCHECK_OBJ} $(SANCHECKLIBS)
++ -$(CC) $(CFLAGS) ${LDFLAGS} -o $@ ${SANCHECK_OBJ} $(SANCHECKLIBS)
+ aoe-sancheck.o : aoe-sancheck.c
+ -$(CC) $(CFLAGS) -o $@ -c $<
+
diff --git a/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools_36.bb b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools_36.bb
new file mode 100644
index 000000000..9b73b442a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/aoetools/aoetools_36.bb
@@ -0,0 +1,26 @@
+SUMMARY = "ATA over Ethernet Tools"
+DESCRIPTION = " \
+The aoetools are programs for users of the ATA over Ethernet (AoE)network \
+storage protocol, a simple protocol for using storage over anethernet LAN. \
+The vblade program (storage target) exports a blockdevice using AoE. \
+"
+HOMEPAGE = "http://sourceforge.net/projects/${BPN}"
+SECTION = "admin"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+RRECOMMENDS_${PN} = "kernel-module-aoe"
+
+SRC_URI = "http://sourceforge.net/projects/${BPN}/files/${BPN}/${BPN}-${PV}.tar.gz \
+ file://aoe-stat-no-bashism.patch \
+ file://makefile-add-ldflags.patch \
+ "
+SRC_URI[md5sum] = "bff30daa988a65f69d4448ce4726a6db"
+SRC_URI[sha256sum] = "fb5e2cd0de7644cc1ec04ee3aeb43211cf7445a0c19e13d6b3ed5a8fbdf215ff"
+
+# EXTRA_OEMAKE is typically: -e MAKEFLAGS=
+# the -e causes problems as CFLAGS is modified in the Makefile.
+EXTRA_OEMAKE = ""
+
+do_install() {
+ oe_runmake DESTDIR=${D} install
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch
new file mode 100644
index 000000000..e8be45e6b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch
@@ -0,0 +1,79 @@
+From a2021f0bc0f029dfa05dcca5db3d2ec77904d41a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 30 Mar 2017 12:33:51 -0700
+Subject: [PATCH] Use ARPCFLAGS for package specific compiler flags
+
+This leaves room for setting CFLAGS in environment
+which OE uses to pass tweaks
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 15 +++++++--------
+ extensions/Makefile | 5 ++++-
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 7bead0d..336db6b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,15 +7,13 @@ LIBDIR:=$(PREFIX)/lib
+ BINDIR:=$(PREFIX)/sbin
+ MANDIR:=$(PREFIX)/man
+ man8dir=$(MANDIR)/man8
+-INITDIR:=/etc/rc.d/init.d
++INITDIR:=/etc/init.d
+ SYSCONFIGDIR:=/etc/sysconfig
+ DESTDIR:=
+
+ MANS = arptables.8 arptables-save.8 arptables-restore.8
+
+-COPT_FLAGS:=-O2
+-CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG
+-
++ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\"
+ ifndef ARPT_LIBDIR
+ ARPT_LIBDIR:=$(LIBDIR)/arptables
+ endif
+@@ -25,13 +23,13 @@ include extensions/Makefile
+ all: arptables libarptc/libarptc.a
+
+ arptables.o: arptables.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+
+ arptables-standalone.o: arptables-standalone.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+
+ libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c
+- $(CC) $(CFLAGS) -c -o $@ $<
++ $(CC) $(ARPCFLAGS) $(CFLAGS) -c -o $@ $<
+
+ libarptc/libarptc.a: libarptc/libarptc.o
+ $(AR) rcs $@ $<
+@@ -53,7 +51,8 @@ scripts: arptables-save arptables-restore arptables.sysv
+ install -m 0755 arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore
+ cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_
+ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi
+- if test -d $(DESTDIR)$(INITDIR); then install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi
++ install -d $(DESTDIR)$(INITDIR)
++ install -m 0755 arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables
+ rm -f arptables-save_ arptables-restore_ arptables.sysv_
+
+ .PHONY: install-man
+diff --git a/extensions/Makefile b/extensions/Makefile
+index 0189cc9..b046425 100644
+--- a/extensions/Makefile
++++ b/extensions/Makefile
+@@ -4,4 +4,7 @@ EXT_FUNC+=standard mangle CLASSIFY MARK
+ EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o)
+
+ extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
+- $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $<
++ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
++
++extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h
++ $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $<
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch
new file mode 100644
index 000000000..0875344fe
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-arpt-get-target-fix.patch
@@ -0,0 +1,30 @@
+arptables: fix the redefinition of 'arpt_get_target'
+
+Upstream-Status: Pending
+
+This function is already defined as a static inline function in
+include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the
+inline will not work, and the redefinition error will happen
+
+Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c
+index 35736db..addd3f9 100644
+--- a/libarptc/libarptc_incl.c
++++ b/libarptc/libarptc_incl.c
+@@ -11,14 +11,6 @@
+ /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See
+ COPYING for details). */
+
+-#ifndef __OPTIMIZE__
+-STRUCT_ENTRY_TARGET *
+-GET_TARGET(STRUCT_ENTRY *e)
+-{
+- return (void *)e + e->target_offset;
+-}
+-#endif
+-
+ static int sockfd = -1;
+ static void *arptc_fn = NULL;
+
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch
new file mode 100644
index 000000000..24956c4ca
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-init-busybox.patch
@@ -0,0 +1,77 @@
+Index: arptables-v0.0.3-4/arptables.sysv
+===================================================================
+--- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300
++++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300
+@@ -12,10 +12,10 @@
+ # config: __SYSCONFIG__/arptables
+
+ source /etc/init.d/functions
+-source /etc/sysconfig/network
++# source /etc/sysconfig/network
+
+ # Check that networking is up.
+-[ ${NETWORKING} = "no" ] && exit 0
++# [ ${NETWORKING} = "no" ] && exit 0
+
+ [ -x __EXEC_PATH__/arptables ] || exit 1
+ [ -x __EXEC_PATH__/arptables-save ] || exit 1
+@@ -28,32 +28,30 @@
+ desc="Arp filtering"
+
+ start() {
+- echo -n $"Starting $desc ($prog): "
++ echo -n "Starting $desc ($prog): "
+ __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1
+
+ if [ $RETVAL -eq 0 ]; then
+- success "$prog startup"
+- rm -f /var/lock/subsys/$prog
++ echo "$prog ok"
++ touch /var/lock/subsys/$prog
+ else
+- failure "$prog startup"
++ echo "$prog failed"
+ fi
+
+- echo
+ return $RETVAL
+ }
+
+ stop() {
+- echo -n $"Stopping $desc ($prog): "
++ echo -n "Stopping $desc ($prog): "
+ __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1
+
+ if [ $RETVAL -eq 0 ]; then
+- success "$prog shutdown"
+- rm -f %{_localstatedir}/lock/subsys/$prog
++ echo "$prog stopped"
++ rm -f /var/lock/subsys/$prog
+ else
+- failure "$prog shutdown"
++ echo "$prog failed to stop"
+ fi
+
+- echo
+ return $RETVAL
+ }
+
+@@ -63,15 +61,14 @@
+ }
+
+ save() {
+- echo -n $"Saving $desc ($prog): "
++ echo -n "Saving $desc ($prog): "
+ __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1
+
+ if [ $RETVAL -eq 0 ]; then
+- success "$prog saved"
++ echo "$prog saved"
+ else
+- failure "$prog saved"
++ echo "$prog is not saved"
+ fi
+- echo
+ }
+
+ case "$1" in
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch
new file mode 100644
index 000000000..f332658bc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables-remove-bashism.patch
@@ -0,0 +1,37 @@
+From cd312bc0e3686404428878d23b8888cba09a20e1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 18 Sep 2014 19:46:58 -0700
+Subject: [PATCH] arptables.sysv: remove bashism
+
+Use "." to replace of "source", and change /bin/bash to /bin/sh, the
+echo $"foo" works well in busybox.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ arptables.sysv | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/arptables.sysv b/arptables.sysv
+index 7a90bd2..7710376 100644
+--- a/arptables.sysv
++++ b/arptables.sysv
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # init script for arptables
+ #
+@@ -11,7 +11,7 @@
+ #
+ # config: __SYSCONFIG__/arptables
+
+-source /etc/init.d/functions
++. /etc/init.d/functions
+ # source /etc/sysconfig/network
+
+ # Check that networking is up.
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service
new file mode 100644
index 000000000..f9fd56df0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables/arptables.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Arp filtering arptables
+After=network.target
+Requires=network.target
+
+[Service]
+Type=oneshot
+ExecStartPre=/bin/sh -c "mkdir -p /etc/sysconfig; if [ ! -f /etc/sysconfig/arptables ]; then /usr/sbin/arptables-save > /etc/sysconfig/arptables; fi"
+ExecStart=/bin/sh -c "/usr/sbin/arptables-restore < /etc/sysconfig/arptables"
+ExecStartPost=/bin/sh -c "touch /var/lock/subsys/arptables"
+RemainAfterExit=yes
+ExecStop=/bin/sh -c "/usr/sbin/arptables-restore < /dev/null"
+ExecStopPost=/bin/sh -c "rm -f /var/lock/subsys/arptables"
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb b/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb
new file mode 100644
index 000000000..cec1d1f77
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/arptables/arptables_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Administration tool for arp packet filtering"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+SRCREV = "f4ab8f63f11a72f14687a6646d04ae1bae3fa45f"
+PV = "0.0.4+git${SRCPV}"
+
+SRC_URI = " \
+ git://git.netfilter.org/arptables \
+ file://0001-Use-ARPCFLAGS-for-package-specific-compiler-flags.patch \
+ file://arptables-init-busybox.patch \
+ file://arptables-arpt-get-target-fix.patch \
+ file://arptables-remove-bashism.patch \
+ file://arptables.service \
+"
+SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5"
+SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928"
+
+S = "${WORKDIR}/git"
+SYSTEMD_SERVICE_${PN} = "arptables.service"
+
+inherit systemd
+
+EXTRA_OEMAKE = "'BINDIR=${sbindir}' 'MANDIR=${mandir}'"
+
+do_install() {
+ oe_runmake install DESTDIR=${D}
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/arptables.service ${D}${systemd_unitdir}/system
+ fi
+}
+
+RDEPENDS_${PN} += "perl"
+
+# the install target is not multi-job safe, but it doesn't do much
+# so we just install serially
+#
+PARALLEL_MAKEINST = "-j1"
diff --git a/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch
new file mode 100644
index 000000000..0a72c6b2c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0005-build-don-t-ignore-CFLAGS-from-environment.patch
@@ -0,0 +1,40 @@
+From 9d63838d12c772dfe33371e2bb8b8191625539f2 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:37:48 -0400
+Subject: [PATCH] build: don't ignore CFLAGS from environment
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We need to take them into account so as to behave nicely towards
+build environments which expect to be able to set them, e.g. for
+optimisation flags, or debug options.
+
+Therefore they need to be added to the compiler command line of
+every source file, and in addition, the same CFLAGS that were
+used during compilation must also always be used during linking!
+
+Upstream-Status: Pending
+
+Signed-off-by: André Draszik <git@andred.net>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ brctl/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/brctl/Makefile.in b/brctl/Makefile.in
+index e1956d6..eff260c 100644
+--- a/brctl/Makefile.in
++++ b/brctl/Makefile.in
+@@ -34,7 +34,7 @@ install: $(PROGRAMS)
+ $(INSTALL) -m 755 $(PROGRAMS) $(DESTDIR)$(sbindir)
+
+ brctl: $(brctl_OBJECTS) ../libbridge/libbridge.a
+- $(CC) $(LDFLAGS) $(brctl_OBJECTS) $(LIBS) -o brctl
++ $(CC) $(CFLAGS) $(LDFLAGS) $(brctl_OBJECTS) $(LIBS) -o brctl
+
+ %.o: %.c brctl.h
+ $(CC) $(CFLAGS) $(INCLUDE) -c $<
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
new file mode 100644
index 000000000..3f65761f5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch
@@ -0,0 +1,51 @@
+From c924f66743c054d7ebafef90ca1bbebc96732357 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:48:33 -0400
+Subject: [PATCH] libbridge: Modifying the AR to cross toolchain
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Makefile uses the host “ar” tool when it should be using the ar from
+the target toolchain.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ configure.ac | 1 +
+ libbridge/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8b2e2ea..8426b7c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -12,6 +12,10 @@ dnl Checks for programs.
+ AC_PROG_CC
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
+
+ dnl Checks for header files.
+ AC_HEADER_STDC
+diff --git a/libbridge/Makefile.in b/libbridge/Makefile.in
+index 7932bfe..bd55e9b 100644
+--- a/libbridge/Makefile.in
++++ b/libbridge/Makefile.in
+@@ -1,7 +1,7 @@
+
+ KERNEL_HEADERS=-I@KERNEL_HEADERS@
+
+-AR=ar
++AR=@AR@
+ RANLIB=@RANLIB@
+
+ CC=@CC@
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
new file mode 100644
index 000000000..8a23a3070
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch
@@ -0,0 +1,33 @@
+From 824f838cc9c7b8a44174358446993d61be7bbb3f Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Mon, 30 Oct 2017 13:18:20 -0400
+Subject: [PATCH] include missing kernel header
+
+Fixes errors like
+
+| /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
+| In file included from ../libbridge/libbridge.h:24:0,
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ libbridge/libbridge.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libbridge/libbridge.h b/libbridge/libbridge.h
+index c038b92..fd09306 100644
+--- a/libbridge/libbridge.h
++++ b/libbridge/libbridge.h
+@@ -24,6 +24,7 @@
+ #include <sys/time.h>
+ #include <netinet/in.h>
+
++#include <linux/in6.h>
+ #include <linux/if.h>
+ #include <linux/if_bridge.h>
+
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
new file mode 100644
index 000000000..1c87c48bf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/bridge-utils/bridge-utils_1.6.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Tools for ethernet bridging"
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge"
+SECTION = "net"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37"
+
+SRCREV = "42c1aefc303fdf891fbb099ea51f00dca83ab606"
+
+SRC_URI = "\
+ git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridge-utils.git \
+ file://kernel-headers.patch \
+ file://0005-build-don-t-ignore-CFLAGS-from-environment.patch \
+ file://0006-libbridge-Modifying-the-AR-to-cross-toolchain.patch \
+"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "sysfsutils"
+
+inherit autotools-brokensep update-alternatives
+
+ALTERNATIVE_${PN} = "brctl"
+ALTERNATIVE_PRIORITY[brctl] = "100"
+ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl"
+
+EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}"
+
+do_install_append () {
+ install -d ${D}/${datadir}/bridge-utils
+ install -d ${D}/${sysconfdir}/network/if-pre-up.d
+ install -d ${D}/${sysconfdir}/network/if-post-down.d
+}
+
+RRECOMMENDS_${PN} = "kernel-module-bridge"
diff --git a/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch b/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch
new file mode 100644
index 000000000..5dd4c7d77
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares/cmake-install-libcares.pc.patch
@@ -0,0 +1,105 @@
+From 7e1ae687916fd5878ee755afbdea6b10494e0b92 Mon Sep 17 00:00:00 2001
+From: Alexey Firago <alexey_firago@mentor.com>
+Date: Wed, 26 Jul 2017 23:21:25 +0300
+Subject: [PATCH] cmake: Install libcares.pc
+
+Prepare and install libcares.pc file during cmake build, so libraries
+using pkg-config to find libcares will not fail.
+
+Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
+---
+ CMakeLists.txt | 21 +++++++++++++++++++++
+ libcares.pc.cmakein | 20 ++++++++++++++++++++
+ 2 files changed, 41 insertions(+)
+ create mode 100644 libcares.pc.cmakein
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 364b6c7..0016b67 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -173,21 +173,29 @@ ADD_DEFINITIONS(${SYSFLAGS})
+
+
+ # Tell C-Ares about libraries to depend on
++# Also pass these libraries to pkg-config file
++SET(CARES_PRIVATE_LIBS_LIST)
+ IF (HAVE_LIBRESOLV)
+ LIST (APPEND CARES_DEPENDENT_LIBS resolv)
++ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lresolv")
+ ENDIF ()
+ IF (HAVE_LIBNSL)
+ LIST (APPEND CARES_DEPENDENT_LIBS nsl)
++ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lnsl")
+ ENDIF ()
+ IF (HAVE_LIBSOCKET)
+ LIST (APPEND CARES_DEPENDENT_LIBS socket)
++ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lsocket")
+ ENDIF ()
+ IF (HAVE_LIBRT)
+ LIST (APPEND CARES_DEPENDENT_LIBS rt)
++ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lrt")
+ ENDIF ()
+ IF (WIN32)
+ LIST (APPEND CARES_DEPENDENT_LIBS ws2_32)
++ LIST (APPEND CARES_PRIVATE_LIBS_LIST "-lws2_32")
+ ENDIF ()
++string (REPLACE ";" " " CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS_LIST}")
+
+
+ # When checking for symbols, we need to make sure we set the proper
+@@ -489,6 +497,13 @@ CONFIGURE_FILE (ares_build.h.cmake ${PROJECT_BINARY_DIR}/ares_build.h)
+ # Write ares_config.h configuration file. This is used only for the build.
+ CONFIGURE_FILE (ares_config.h.cmake ${PROJECT_BINARY_DIR}/ares_config.h)
+
++# Pass required CFLAGS to pkg-config in case of static library
++IF (CARES_STATIC)
++ SET (CPPFLAG_CARES_STATICLIB "-DCARES_STATICLIB")
++ENDIF()
++
++# Write ares_config.h configuration file. This is used only for the build.
++CONFIGURE_FILE (libcares.pc.cmakein ${PROJECT_BINARY_DIR}/libcares.pc @ONLY)
+
+ # TRANSFORM_MAKEFILE_INC
+ #
+@@ -625,6 +640,12 @@ IF (CARES_INSTALL)
+ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" DESTINATION ${CMAKECONFIG_INSTALL_DIR})
+ ENDIF ()
+
++# pkg-config file
++IF (CARES_INSTALL)
++ SET (PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
++ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" DESTINATION ${PKGCONFIG_INSTALL_DIR})
++ENDIF ()
++
+ # Legacy chain-building variables (provided for compatibility with old code).
+ # Don't use these, external code should be updated to refer to the aliases directly (e.g., Cares::cares).
+ SET (CARES_FOUND 1 CACHE INTERNAL "CARES LIBRARY FOUND")
+diff --git a/libcares.pc.cmakein b/libcares.pc.cmakein
+new file mode 100644
+index 0000000..f29fede
+--- /dev/null
++++ b/libcares.pc.cmakein
+@@ -0,0 +1,20 @@
++#***************************************************************************
++# Project ___ __ _ _ __ ___ ___
++# / __|____ / _` | '__/ _ \/ __|
++# | (_|_____| (_| | | | __/\__ \
++# \___| \__,_|_| \___||___/
++#
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=@CMAKE_INSTALL_PREFIX@
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
++
++Name: c-ares
++URL: http://daniel.haxx.se/projects/c-ares/
++Description: asynchronous DNS lookup library
++Version: @VERSION@
++Requires:
++Requires.private:
++Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@
++Libs: -L${libdir} -lcares
++Libs.private: @CARES_PRIVATE_LIBS@
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares_1.13.0.bb b/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares_1.13.0.bb
new file mode 100644
index 000000000..70e497f5f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/c-ares/c-ares_1.13.0.bb
@@ -0,0 +1,24 @@
+# Copyright (c) 2012-2014 LG Electronics, Inc.
+SUMMARY = "c-ares is a C library that resolves names asynchronously."
+HOMEPAGE = "http://daniel.haxx.se/projects/c-ares/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=f4b026880834eb01c035c5e5cb47ccac"
+SRCREV = "3be1924221e1326df520f8498d704a5c4c8d0cce"
+PV = "1.13.0+gitr${SRCPV}"
+
+SRC_URI = "\
+ git://github.com/c-ares/c-ares.git \
+ file://cmake-install-libcares.pc.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+PACKAGES =+ "${PN}-utils"
+
+FILES_${PN}-dev += "${libdir}/cmake"
+FILES_${PN}-utils = "${bindir}"
+
+BBCLASSEXTEND = "native"
diff --git a/meta-openembedded/meta-networking/recipes-support/chrony/chrony/arm_eabi.patch b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/arm_eabi.patch
new file mode 100644
index 000000000..92a2dbd93
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/arm_eabi.patch
@@ -0,0 +1,63 @@
+ chrony: fix build failure for arma9
+
+ Eliminate references to syscalls not available
+ for ARM_EABI. Also add a dependency on libseccomp
+ which is needed for scfilter to work.
+
+ Set PACKAGECONFIG to not enable scfilter, since
+ kernel CONFIG_SECCOMP is unlikely to be set. This
+ aligns the usage of libseccomp with that of other packages.
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Joe Slater <jslater@windriver.com>
+
+ Refresh patch for new upstream version.
+
+ Signed-off-by: Robert Joslyn <robert.joslyn@redrectangle.org>
+
+--- a/sys_linux.c
++++ b/sys_linux.c
+@@ -465,14 +465,14 @@ SYS_Linux_EnableSystemCallFilter(int lev
+ const int syscalls[] = {
+ /* Clock */
+ SCMP_SYS(adjtimex), SCMP_SYS(clock_gettime), SCMP_SYS(gettimeofday),
+- SCMP_SYS(settimeofday), SCMP_SYS(time),
++ SCMP_SYS(settimeofday),
+ /* Process */
+ SCMP_SYS(clone), SCMP_SYS(exit), SCMP_SYS(exit_group), SCMP_SYS(getpid),
+- SCMP_SYS(getrlimit), SCMP_SYS(rt_sigaction), SCMP_SYS(rt_sigreturn),
++ SCMP_SYS(rt_sigaction), SCMP_SYS(rt_sigreturn),
+ SCMP_SYS(rt_sigprocmask), SCMP_SYS(set_tid_address), SCMP_SYS(sigreturn),
+ SCMP_SYS(wait4),
+ /* Memory */
+- SCMP_SYS(brk), SCMP_SYS(madvise), SCMP_SYS(mmap), SCMP_SYS(mmap2),
++ SCMP_SYS(brk), SCMP_SYS(madvise), SCMP_SYS(mmap2),
+ SCMP_SYS(mprotect), SCMP_SYS(mremap), SCMP_SYS(munmap), SCMP_SYS(shmdt),
+ /* Filesystem */
+ SCMP_SYS(access), SCMP_SYS(chmod), SCMP_SYS(chown), SCMP_SYS(chown32),
+@@ -483,14 +483,21 @@
+ SCMP_SYS(bind), SCMP_SYS(connect), SCMP_SYS(getsockname),
+ SCMP_SYS(recvfrom), SCMP_SYS(recvmmsg), SCMP_SYS(recvmsg),
+ SCMP_SYS(sendmmsg), SCMP_SYS(sendmsg), SCMP_SYS(sendto),
+- /* TODO: check socketcall arguments */
+- SCMP_SYS(socketcall),
+ /* General I/O */
+ SCMP_SYS(_newselect), SCMP_SYS(close), SCMP_SYS(open), SCMP_SYS(openat), SCMP_SYS(pipe),
+- SCMP_SYS(poll), SCMP_SYS(read), SCMP_SYS(futex), SCMP_SYS(select),
++ SCMP_SYS(poll), SCMP_SYS(read), SCMP_SYS(futex),
+ SCMP_SYS(set_robust_list), SCMP_SYS(write),
+ /* Miscellaneous */
+ SCMP_SYS(getrandom), SCMP_SYS(sysinfo), SCMP_SYS(uname),
++ /* not always available */
++#if ! defined(__ARM_EABI__)
++ SCMP_SYS(time),
++ SCMP_SYS(getrlimit),
++ SCMP_SYS(select),
++ SCMP_SYS(mmap),
++ /* TODO: check socketcall arguments */
++ SCMP_SYS(socketcall),
++#endif
+ };
+
+ const int socket_domains[] = {
diff --git a/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chrony.conf b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chrony.conf
new file mode 100644
index 000000000..8d226d31a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chrony.conf
@@ -0,0 +1,44 @@
+# Use public NTP servers from the pool.ntp.org project.
+# Please consider joining the pool project if possible by running your own
+# server(s).
+# If you are a vendor distributing a product using chrony, you *MUST*
+# read and comply with http://www.pool.ntp.org/vendors.html
+pool 0.openembedded.pool.ntp.org iburst
+
+# Use a local timeserver in preference to the pool, if it's reachable.
+#server 192.168.22.22 iburst minpoll 2 prefer
+
+# Sync to pulse-per-second from an onboard GPS.
+#refclock PPS /dev/pps0 poll 0 prefer
+# You'll want to enable CONFIG_PPS and CONFIG_PPS_CLIENT_GPIO in your kernel,
+# and an entry something like this in your device tree:
+# pps {
+# compatible = "pps-gpio";
+# gpios = <&ps7_gpio_0 56 0>;
+# };
+
+# In first three updates step the system clock instead of slew
+# if the adjustment is larger than 1 second.
+makestep 1.0 3
+
+# Record the rate at which the system clock gains/loses time,
+# improving accuracy after reboot
+driftfile /var/lib/chrony/drift
+
+# Enable kernel synchronization of the hardware real-time clock (RTC).
+rtcsync
+
+# Allow NTP client access from local network.
+#allow 192.168/16
+
+# Serve time even if not synchronized to any NTP server.
+#local stratum 10
+
+# Specify file containing keys for NTP authentication.
+#keyfile /etc/chrony.keys
+
+# Specify directory for log files.
+logdir /var/log/chrony
+
+# Select which information is logged.
+#log measurements statistics tracking
diff --git a/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd
new file mode 100644
index 000000000..04f1b681c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/chrony/chrony/chronyd
@@ -0,0 +1,58 @@
+#! /bin/sh
+
+# System V init script for chrony
+# Adapted from the script already in meta-networking for ntpd
+
+### BEGIN INIT INFO
+# Provides: chrony
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Start chrony time daemon
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+DAEMON=/usr/sbin/chronyd
+PIDFILE=/var/run/chronyd.pid
+
+test -x $DAEMON -a -r /etc/chrony.conf || exit 0
+
+# Source function library.
+. /etc/init.d/functions
+
+# Functions to do individual actions
+startdaemon(){
+ echo -n "Starting chronyd: "
+ start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- "$@"
+ echo "done"
+}
+stopdaemon(){
+ echo -n "Stopping chronyd: "
+ start-stop-daemon --stop --quiet --oknodo -p $PIDFILE
+ echo "done"
+}
+
+case "$1" in
+ start)
+ startdaemon
+ ;;
+ stop)
+ stopdaemon
+ ;;
+ force-reload | restart | reload)
+ stopdaemon
+ startdaemon
+ ;;
+ status)
+ status /usr/sbin/chronyd;
+ exit $?
+ ;;
+ *)
+ echo "Usage: chronyd { start | stop | status | restart | reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-support/chrony/chrony_3.2.bb b/meta-openembedded/meta-networking/recipes-support/chrony/chrony_3.2.bb
new file mode 100644
index 000000000..8b90a354e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/chrony/chrony_3.2.bb
@@ -0,0 +1,134 @@
+SUMMARY = "Versatile implementation of the Network Time Protocol"
+DESCRIPTION = "Chrony can synchronize the system clock with NTP \
+servers, reference clocks (e.g. GPS receiver), and manual input using \
+wristwatch and keyboard. It can also operate as an NTPv4 (RFC 5905) \
+server and peer to provide a time service to other computers in the \
+network. \
+\
+It is designed to perform well in a wide range of conditions, \
+including intermittent network connections, heavily congested \
+networks, changing temperatures (ordinary computer clocks are \
+sensitive to temperature), and systems that do not run continuously, or \
+run on a virtual machine. \
+\
+Typical accuracy between two machines on a LAN is in tens, or a few \
+hundreds, of microseconds; over the Internet, accuracy is typically \
+within a few milliseconds. With a good hardware reference clock \
+sub-microsecond accuracy is possible. \
+\
+Two programs are included in chrony: chronyd is a daemon that can be \
+started at boot time and chronyc is a command-line interface program \
+which can be used to monitor chronyd's performance and to change \
+various operating parameters whilst it is running. \
+\
+This recipe produces two binary packages: 'chrony' which contains chronyd, \
+the configuration file and the init script, and 'chronyc' which contains \
+the client program only."
+
+HOMEPAGE = "https://chrony.tuxfamily.org/"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "https://download.tuxfamily.org/chrony/chrony-${PV}.tar.gz \
+ file://chrony.conf \
+ file://chronyd \
+ file://arm_eabi.patch \
+"
+SRC_URI[md5sum] = "f4c4eb0dc92f35ee4bb7d3dcd8029ecb"
+SRC_URI[sha256sum] = "329f6718dd8c3ece3eee78be1f4821cbbeb62608e7d23f25da293cfa433c4116"
+
+DEPENDS = "pps-tools"
+
+# Note: Despite being built via './configure; make; make install',
+# chrony does not use GNU Autotools.
+inherit update-rc.d systemd
+
+# Configuration options:
+# - For command line editing support in chronyc, you may specify either
+# 'editline' or 'readline' but not both. editline is smaller, but
+# many systems already have readline for other purposes so you might want
+# to choose that instead. However, beware license incompatibility
+# since chrony is GPLv2 and readline versions after 6.0 are GPLv3+.
+# You can of course choose neither, but if you're that tight on space
+# consider dropping chronyc entirely (you can use it remotely with
+# appropriate chrony.conf options).
+# - Security-related:
+# - 'sechash' is omitted by default because it pulls in nss which is huge.
+# - 'privdrop' allows chronyd to run as non-root; would need changes to
+# chrony.conf and init script.
+# - 'scfilter' enables support for system call filtering, but requires the
+# kernel to have CONFIG_SECCOMP enabled.
+PACKAGECONFIG ??= "editline \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[readline] = "--without-editline,--without-readline,readline"
+PACKAGECONFIG[editline] = ",--without-editline,libedit"
+PACKAGECONFIG[sechash] = "--without-tomcrypt,--disable-sechash,nss"
+PACKAGECONFIG[privdrop] = ",--disable-privdrop,libcap"
+PACKAGECONFIG[scfilter] = "--enable-scfilter,--without-seccomp,libseccomp"
+PACKAGECONFIG[ipv6] = ",--disable-ipv6,"
+PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+
+# --disable-static isn't supported by chrony's configure script.
+DISABLE_STATIC = ""
+
+do_configure() {
+ ./configure --sysconfdir=${sysconfdir} --bindir=${bindir} --sbindir=${sbindir} \
+ --localstatedir=${localstatedir} --datarootdir=${datadir} \
+ ${PACKAGECONFIG_CONFARGS}
+}
+
+do_install() {
+ # Binaries
+ install -d ${D}${bindir}
+ install -m 0755 ${S}/chronyc ${D}${bindir}
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/chronyd ${D}${sbindir}
+
+ # Config file
+ install -d ${D}${sysconfdir}
+ install -m 644 ${WORKDIR}/chrony.conf ${D}${sysconfdir}
+
+ # System V init script
+ install -d ${D}${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/chronyd ${D}${sysconfdir}/init.d
+
+ # systemd unit configuration file
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/examples/chronyd.service ${D}${systemd_unitdir}/system/
+
+ # Variable data (for drift and/or rtc file)
+ install -d ${D}${localstatedir}/lib/chrony
+
+ # Log files
+ install -d ${D}${localstatedir}/log/chrony
+
+ # Fix hard-coded paths in config files and init scripts
+ sed -i -e 's!/var/!${localstatedir}/!g' -e 's!/etc/!${sysconfdir}/!g' \
+ -e 's!/usr/sbin/!${sbindir}/!g' -e 's!/usr/bin/!${bindir}/!g' \
+ ${D}${sysconfdir}/chrony.conf \
+ ${D}${sysconfdir}/init.d/chronyd \
+ ${D}${systemd_unitdir}/system/chronyd.service
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/chronyd
+ sed -i 's!^EnvironmentFile=.*!EnvironmentFile=-${sysconfdir}/default/chronyd!' ${D}${systemd_unitdir}/system/chronyd.service
+}
+
+FILES_${PN} = "${sbindir}/chronyd ${sysconfdir} ${localstatedir}"
+CONFFILES_${PN} = "${sysconfdir}/chrony.conf"
+INITSCRIPT_NAME = "chronyd"
+INITSCRIPT_PARAMS = "defaults"
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "chronyd.service"
+
+# It's probably a bad idea to run chrony and another time daemon on
+# the same system. systemd includes the SNTP client 'timesyncd', which
+# will be disabled by chronyd.service, however it will remain on the rootfs
+# wasting 150 kB unless you put 'PACKAGECONFIG_remove_pn-systemd = "timesyncd"'
+# in a conf file or bbappend somewhere.
+RCONFLICTS_${PN} = "ntp ntimed"
+
+# Separate the client program into its own package
+PACKAGES =+ "chronyc"
+FILES_chronyc = "${bindir}/chronyc"
diff --git a/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb b/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb
new file mode 100644
index 000000000..198e3ef98
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cifs/cifs-utils_git.bb
@@ -0,0 +1,37 @@
+DESCRIPTION = "A a package of utilities for doing and managing mounts of the Linux CIFS filesystem."
+HOMEPAGE = "http://wiki.samba.org/index.php/LinuxCIFS_utils"
+SECTION = "otherosfs"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PV = "6.7"
+
+SRCREV = "8101a07871f185c7044fa2ca221b282ab4607c8b"
+SRC_URI = "git://git.samba.org/cifs-utils.git \
+ file://0001-mount.cifs-Remove-data_blob.h-include.patch \
+ "
+
+S = "${WORKDIR}/git"
+DEPENDS += "libtalloc"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cap] = "--with-libcap,--without-libcap,libcap"
+# when enabled, it creates ${bindir}/cifscreds and --ignore-fail-on-non-empty in do_install_append is needed
+PACKAGECONFIG[cifscreds] = "--enable-cifscreds,--disable-cifscreds,keyutils"
+# when enabled, it creates ${sbindir}/cifs.upcall and --ignore-fail-on-non-empty in do_install_append is needed
+PACKAGECONFIG[cifsupcall] = "--enable-cifsupcall,--disable-cifsupcall,krb5 libtalloc keyutils"
+PACKAGECONFIG[cifsidmap] = "--enable-cifsidmap,--disable-cifsidmap,keyutils samba"
+PACKAGECONFIG[cifsacl] = "--enable-cifsacl,--disable-cifsacl,samba"
+PACKAGECONFIG[pam] = "--enable-pam --with-pamdir=${base_libdir}/security,--disable-pam,libpam keyutils"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+ # Remove empty /usr/bin and /usr/sbin directories since the mount helper
+ # is installed to /sbin
+ rmdir --ignore-fail-on-non-empty ${D}${bindir} ${D}${sbindir}
+}
+
+FILES_${PN} += "${base_libdir}/security"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug"
+RRECOMMENDS_${PN} = "kernel-module-cifs"
diff --git a/meta-openembedded/meta-networking/recipes-support/cifs/files/0001-mount.cifs-Remove-data_blob.h-include.patch b/meta-openembedded/meta-networking/recipes-support/cifs/files/0001-mount.cifs-Remove-data_blob.h-include.patch
new file mode 100644
index 000000000..07f2a5726
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cifs/files/0001-mount.cifs-Remove-data_blob.h-include.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+Signed-off-by: S. Lockwood-Childs <sjl@vctlabs.com>
+
+From 272d523a57a4e8791d625a479128613be5e401f5 Mon Sep 17 00:00:00 2001
+From: Thomas Witt <pyromaniac@exherbo.org>
+Date: Wed, 15 Mar 2017 20:20:44 +0000
+Subject: [PATCH] mount.cifs: Remove data_blob.h include
+
+data_blob.h includes talloc.h from libtalloc, but that is only marked as
+a dependency for cifs.upcall. No symbols from that header are used by
+cifs.mount, so remove it to avoid the libtalloc dependency
+
+Signed-off-by: Thomas Witt <pyromaniac@exherbo.org>
+---
+ mount.cifs.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/mount.cifs.c b/mount.cifs.c
+index 13b71ef..2612feb 100644
+--- a/mount.cifs.c
++++ b/mount.cifs.c
+@@ -61,7 +61,6 @@
+ #include "mount.h"
+ #include "util.h"
+ #include "resolve_host.h"
+-#include "data_blob.h"
+
+ #ifndef MS_MOVE
+ #define MS_MOVE 8192
+--
+1.9.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb
new file mode 100644
index 000000000..31875ea50
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-docs_2.40.0.bb
@@ -0,0 +1,25 @@
+require cim-schema.inc
+
+SECTION = "doc"
+
+LICENSE = "DMTF"
+
+SRC_URI = "http://dmtf.org/sites/default/files/cim/cim_schema_v2400/cim_schema_${PV}Final-Doc.zip \
+ file://LICENSE \
+ "
+SRC_URI[md5sum] = "3d01940bc1085c6c42184c25fb61f739"
+SRC_URI[sha256sum] = "3174cf0f8657b19d80dc59e184778d8e553da424728cb2966fe9d5428dd84267"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=eecc6f71a56ff3caf17f15bf7aeac7b4"
+
+do_unpack() {
+ unzip -q ${DL_DIR}/cim_schema_${PV}Final-Doc.zip -d ${S}
+ cp -f ${FILE_DIRNAME}/files/LICENSE ${WORKDIR}/
+}
+
+do_install() {
+ install -d -m 0755 ${D}${datadir}/doc/cim-schema-${PV}-docs
+ cp -R --no-dereference --preserve=mode,links -v ${S}/* ${D}${datadir}/doc/cim-schema-${PV}-docs
+}
+
+FILES_${PN} = "${datadir}/doc/*"
+FILES_${PN}-doc = ""
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-exper_2.50.0.bb b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-exper_2.50.0.bb
new file mode 100644
index 000000000..90ea882b7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-exper_2.50.0.bb
@@ -0,0 +1,29 @@
+require cim-schema.inc
+
+LICENSE = "DMTF"
+
+RCONFLICTS_${PN} = "cim-schema-final"
+
+SRC_URI = "http://dmtf.org/sites/default/files/cim/cim_schema_v2500/cim_schema_${PV}Experimental-MOFs.zip;subdir=${BPN}-${PV} \
+ file://LICENSE \
+"
+SRC_URI[md5sum] = "ee4ad6441a2b65ca60a3abc53e3ec629"
+SRC_URI[sha256sum] = "a44d67881325e267ef46b72eabe0c69f90470b1033b1ce7c26d9ba99072adb50"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=eecc6f71a56ff3caf17f15bf7aeac7b4"
+
+do_install() {
+ install -d -m 0755 ${D}${datadir}/mof/cimv${PV}/
+ install -d -m 0755 ${D}${datadir}/doc/cim-schema-${PV}
+ install -m 644 ${WORKDIR}/LICENSE ${D}${datadir}/doc/cim-schema-${PV}
+
+ cp -R --no-dereference --preserve=mode,links -v ${S}/* ${D}${datadir}/mof/cimv${PV}/
+ chown -R root:root ${D}${datadir}/mof/cimv${PV}
+ for i in `find ${D}${datadir}/mof/cimv${PV} -name "*.mof"`; do
+ sed -i -e 's/\r//g' $i
+ done
+ ln -s cimv${PV} ${D}${datadir}/mof/cim-current
+ ln -s cim_schema_${PV}.mof ${D}${datadir}/mof/cim-current/CIM_Schema.mof
+}
+
+FILES_${PN} = "${datadir}/mof/* ${datadir}/doc/*"
+FILES_${PN}-doc = ""
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-final_2.40.0.bb b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-final_2.40.0.bb
new file mode 100644
index 000000000..a14de46db
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema-final_2.40.0.bb
@@ -0,0 +1,34 @@
+require cim-schema.inc
+
+LICENSE = "DMTF"
+
+RCONFLICTS_${PN} = "cim-schema-exper"
+
+SRC_URI = "http://dmtf.org/sites/default/files/cim/cim_schema_v2400/cim_schema_${PV}Final-MOFs.zip \
+ file://LICENSE \
+"
+SRC_URI[md5sum] = "a9bdf17c7374e3b5b7adeaac4842c4ad"
+SRC_URI[sha256sum] = "dbfa3064ea427acd71a4bebbc172ca2dc44b0b09a6d83b0945b9ffa988a9058a"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=eecc6f71a56ff3caf17f15bf7aeac7b4"
+
+do_unpack() {
+ unzip -q ${DL_DIR}/cim_schema_${PV}Final-MOFs.zip -d ${S}
+ cp -f ${FILE_DIRNAME}/files/LICENSE ${WORKDIR}/
+}
+
+do_install() {
+ install -d -m 0755 ${D}${datadir}/mof/cimv${PV}/
+ install -d -m 0755 ${D}${datadir}/doc/cim-schema-${PV}
+ install -m 644 ${WORKDIR}/LICENSE ${D}${datadir}/doc/cim-schema-${PV}
+
+ cp -R --no-dereference --preserve=mode,links -v ${S}/* ${D}${datadir}/mof/cimv${PV}/
+ chown -R root:root ${D}${datadir}/mof/cimv${PV}/
+ for i in `find ${D}${datadir}/mof/cimv${PV} -name "*.mof"`; do
+ sed -i -e 's/\r//g' $i
+ done
+ ln -s cimv${PV} ${D}${datadir}/mof/cim-current
+ ln -s cim_schema_${PV}.mof ${D}${datadir}/mof/cim-current/CIM_Schema.mof
+}
+
+FILES_${PN} = "${datadir}/mof/* ${datadir}/doc/*"
+FILES_${PN}-doc = ""
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema.inc b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema.inc
new file mode 100644
index 000000000..b9171e474
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema.inc
@@ -0,0 +1,9 @@
+SUMMARY = "Common Information Model (CIM) Schema"
+DESCRIPTION = "Common Information Model (CIM) is a model for describing overall\
+management information in a network or enterprise environment. CIM\
+consists of a specification and a schema. The specification defines the\
+details for integration with other management models. The schema\
+provides the actual model descriptions."
+
+HOMEPAGE = "http://www.dmtf.org/"
+SECTION = "libs"
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema/files/LICENSE b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema/files/LICENSE
new file mode 100644
index 000000000..54a28120e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/cim-schema/files/LICENSE
@@ -0,0 +1,34 @@
+// Copyright 1998-2008 Distributed Management Task Force, Inc. (DMTF).
+// All rights reserved.
+// DMTF is a not-for-profit association of industry members dedicated
+// to promoting enterprise and systems management and interoperability.
+// DMTF specifications and documents may be reproduced by
+// members and non-members, provided that correct attribution is given.
+// As DMTF specifications may be revised from time to time,
+// the particular version and release date should always be noted.
+//
+// Implementation of certain elements of this standard or proposed
+// standard may be subject to third party patent rights, including
+// provisional patent rights (herein "patent rights"). DMTF makes
+// no representations to users of the standard as to the existence
+// of such rights, and is not responsible to recognize, disclose, or
+// identify any or all such third party patent right, owners or
+// claimants, nor for any incomplete or inaccurate identification or
+// disclosure of such rights, owners or claimants. DMTF shall have no
+// liability to any party, in any manner or circumstance, under any
+// legal theory whatsoever, for failure to recognize, disclose, or
+// identify any such third party patent rights, or for such party's
+// reliance on the standard or incorporation thereof in its product,
+// protocols or testing procedures. DMTF shall have no liability to
+// any party implementing such standard, whether such implementation
+// is foreseeable or not, nor to any patent owner or claimant, and shall
+// have no liability or responsibility for costs or losses incurred if
+// a standard is withdrawn or modified after publication, and shall be
+// indemnified and held harmless by any party implementing the
+// standard from any and all claims of infringement by a patent owner
+// for such implementations.
+//
+// For information about patents held by third-parties which have
+// notified the DMTF that, in their opinion, such patent may relate to
+// or impact implementations of DMTF standards, visit
+// http://www.dmtf.org/about/policies/disclosures.php.
diff --git a/meta-openembedded/meta-networking/recipes-support/cim-schema/files/LICENSE b/meta-openembedded/meta-networking/recipes-support/cim-schema/files/LICENSE
new file mode 100644
index 000000000..54a28120e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/cim-schema/files/LICENSE
@@ -0,0 +1,34 @@
+// Copyright 1998-2008 Distributed Management Task Force, Inc. (DMTF).
+// All rights reserved.
+// DMTF is a not-for-profit association of industry members dedicated
+// to promoting enterprise and systems management and interoperability.
+// DMTF specifications and documents may be reproduced by
+// members and non-members, provided that correct attribution is given.
+// As DMTF specifications may be revised from time to time,
+// the particular version and release date should always be noted.
+//
+// Implementation of certain elements of this standard or proposed
+// standard may be subject to third party patent rights, including
+// provisional patent rights (herein "patent rights"). DMTF makes
+// no representations to users of the standard as to the existence
+// of such rights, and is not responsible to recognize, disclose, or
+// identify any or all such third party patent right, owners or
+// claimants, nor for any incomplete or inaccurate identification or
+// disclosure of such rights, owners or claimants. DMTF shall have no
+// liability to any party, in any manner or circumstance, under any
+// legal theory whatsoever, for failure to recognize, disclose, or
+// identify any such third party patent rights, or for such party's
+// reliance on the standard or incorporation thereof in its product,
+// protocols or testing procedures. DMTF shall have no liability to
+// any party implementing such standard, whether such implementation
+// is foreseeable or not, nor to any patent owner or claimant, and shall
+// have no liability or responsibility for costs or losses incurred if
+// a standard is withdrawn or modified after publication, and shall be
+// indemnified and held harmless by any party implementing the
+// standard from any and all claims of infringement by a patent owner
+// for such implementations.
+//
+// For information about patents held by third-parties which have
+// notified the DMTF that, in their opinion, such patent may relate to
+// or impact implementations of DMTF standards, visit
+// http://www.dmtf.org/about/policies/disclosures.php.
diff --git a/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/01-support-cross-compile-for-linux-os.patch b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/01-support-cross-compile-for-linux-os.patch
new file mode 100644
index 000000000..c9195b4f4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/01-support-cross-compile-for-linux-os.patch
@@ -0,0 +1,24 @@
+support cross-compile for linux-os.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+diff -Nurp ctdb-2.5.1.orig/configure ctdb-2.5.1/configure
+--- ctdb-2.5.1.orig/configure 2015-05-07 16:24:28.545000238 +0900
++++ ctdb-2.5.1/configure 2015-05-07 16:28:20.894000244 +0900
+@@ -10692,10 +10692,16 @@ if test x"$libreplace_cv_HAVE_GETADDRINF
+ # see bug 5910, use our replacements if we detect
+ # a broken system.
+ if test "$cross_compiling" = yes; then :
++ case "$target_os" in
++ *linux*)
++ ;;
++ *)
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+ $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ as_fn_error $? "cannot run test program while cross compiling
+ See \`config.log' for more details" "$LINENO" 5; }
++ ;;
++ esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
diff --git a/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/02-link-rep_snprintf-for-ltdbtool.patch b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/02-link-rep_snprintf-for-ltdbtool.patch
new file mode 100644
index 000000000..1294fe41b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/02-link-rep_snprintf-for-ltdbtool.patch
@@ -0,0 +1,17 @@
+link rep_snprintf from lib/replace/snprintf.o for ltdbtool
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+Index: ctdb-2.5.6/Makefile.in
+===================================================================
+--- ctdb-2.5.6.orig/Makefile.in
++++ ctdb-2.5.6/Makefile.in
+@@ -176,7 +176,7 @@ bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.
+ @echo Linking $@
+ $(WRAPPER) $(CC) $(CFLAGS) -o $@ tools/ctdb.o tools/ctdb_vacuum.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
+
+-bin/ltdbtool: tools/ltdbtool.o $(TDB_OBJ)
++bin/ltdbtool: tools/ltdbtool.o $(TDB_OBJ) lib/replace/snprintf.o
+ @echo Linking $@
+ $(WRAPPER) $(CC) $(CFLAGS) -o $@ $+ $(LIB_FLAGS)
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/service-ensure-the-PID-directory-is-created.patch b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/service-ensure-the-PID-directory-is-created.patch
new file mode 100644
index 000000000..a7e987b85
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb/service-ensure-the-PID-directory-is-created.patch
@@ -0,0 +1,25 @@
+From f02ff7383f1cc0c118732352ccbae476c7b3b3ba Mon Sep 17 00:00:00 2001
+From: Mark Asselstine <mark.asselstine@windriver.com>
+Date: Tue, 17 Nov 2015 16:17:00 -0500
+Subject: [PATCH] service: ensure the PID directory is created
+
+Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
+---
+ config/ctdb.service | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/config/ctdb.service b/config/ctdb.service
+index ea37c30..8537105 100644
+--- a/config/ctdb.service
++++ b/config/ctdb.service
+@@ -5,6 +5,7 @@ After=network.target
+ [Service]
+ Type=forking
+ LimitCORE=infinity
++RuntimeDirectory=/run/ctdb
+ PIDFile=/run/ctdb/ctdbd.pid
+ ExecStart=/usr/sbin/ctdbd_wrapper /run/ctdb/ctdbd.pid start
+ ExecStop=/usr/sbin/ctdbd_wrapper /run/ctdb/ctdbd.pid stop
+--
+2.1.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb
new file mode 100644
index 000000000..b5a60645c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ctdb/ctdb_2.5.6.bb
@@ -0,0 +1,57 @@
+DESCRIPTION = "CTDB is a cluster implementation of the TDB database \
+used by Samba and other projects to store temporary data. If an \
+application is already using TDB for temporary data it is very easy \
+to convert that application to be cluster aware and use CTDB instead."
+HOMEPAGE = "https://ctdb.samba.org/"
+LICENSE = "GPL-2.0+ & LGPL-3.0+ & GPL-3.0+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
+ file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
+ "
+
+SRC_URI = "https://ftp.samba.org/pub/${BPN}/${BP}.tar.gz \
+ file://01-support-cross-compile-for-linux-os.patch \
+ file://02-link-rep_snprintf-for-ltdbtool.patch \
+ file://service-ensure-the-PID-directory-is-created.patch \
+ "
+
+SRC_URI[md5sum] = "efc50109f90a4c790124c35e4ba234ad"
+SRC_URI[sha256sum] = "fc1cdd7efcc91afc629f21408281bba5da107b9c17e74bdee2f28a532d14f874"
+
+inherit autotools-brokensep pkgconfig systemd
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libtdb] = "--without-included-tdb,--with-included-tdb,libtdb"
+
+PARALLEL_MAKE = ""
+
+DEPENDS += "popt libtevent libtalloc libldb"
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+# ctdbd_wrapper requires pgrep, hence procps
+RDEPENDS_${PN} += "procps"
+
+do_configure() {
+ oe_runconf
+}
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${S}/config/ctdb.service ${D}${systemd_unitdir}/system
+ sed -i -e 's,/usr/sbin/,${sbindir}/,' ${D}${systemd_unitdir}/system/ctdb.service
+ sed -i -e 's,\([=\ ]\)/run/,\1${localstatedir}/run/,' ${D}${systemd_unitdir}/system/ctdb.service
+
+ rm -r ${D}/${localstatedir}/run
+}
+
+# The systemd service is disabled by default, as the service will fail to
+# start without /etc/ctdb/nodes. If the user supplies this, they can re-enable
+# the service.
+SYSTEMD_AUTO_ENABLE = "disable"
+SYSTEMD_SERVICE_${PN} = "ctdb.service"
+
+# onnode is a shell script with bashisms and bash #!
+RDEPENDS_${PN} += "bash"
diff --git a/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb b/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb
new file mode 100644
index 000000000..340f57dc7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/curlpp/curlpp_0.8.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "C++ library for client-side URL transfers"
+HOMEPAGE = "http://www.curlpp.org/"
+SECTION = "libdevel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "curl"
+DEPENDS_class-native = "curl-native"
+
+SRC_URI = "git://github.com/jpbarrette/curlpp.git"
+
+SRCREV = "592552a165cc569dac7674cb7fc9de3dc829906f"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig binconfig
+
+do_install_append () {
+ sed -i 's,${STAGING_DIR_TARGET},,g' ${D}${libdir}/pkgconfig/curlpp.pc
+}
+
+PACKAGES =+ "libcurlpp libcurlpp-dev libcurlpp-staticdev"
+
+FILES_lib${BPN} = "${libdir}/lib*.so.*"
+
+FILES_lib${BPN}-dev = "${includedir} \
+ ${libdir}/pkgconfig \
+ ${bindir}/*-config \
+"
+
+FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
new file mode 100644
index 000000000..4f4bbf144
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq.inc
@@ -0,0 +1,83 @@
+SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server"
+HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html"
+SECTION = "net"
+# GPLv3 was added in version 2.41 as license option
+LICENSE = "GPLv2 | GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+ file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504"
+
+#at least versions 2.69 and prior are moved to the archive folder on the server
+SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV').split('.')[1]) > 69]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \
+ file://init \
+ file://dnsmasq.conf \
+ file://dnsmasq-resolvconf.service \
+ file://dnsmasq-noresolvconf.service \
+"
+
+inherit pkgconfig update-rc.d systemd
+
+INITSCRIPT_NAME = "dnsmasq"
+INITSCRIPT_PARAMS = "defaults"
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[dbus] = ",,dbus"
+PACKAGECONFIG[idn] = ",,libidn"
+PACKAGECONFIG[conntrack] = ",,libnetfilter-conntrack"
+PACKAGECONFIG[lua] = ",,lua"
+PACKAGECONFIG[resolvconf] = ",,,resolvconf"
+EXTRA_OEMAKE = "\
+ 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)}' \
+ 'CFLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'resolvconf', 'file://dnsmasq.resolvconf file://99_dnsmasq file://dnsmasq-resolvconf-helper', '', d)}"
+
+do_compile_append() {
+ # build dhcp_release
+ cd ${S}/contrib/lease-tools
+ oe_runmake
+}
+
+do_install () {
+ oe_runmake "PREFIX=${D}${prefix}" \
+ "BINDIR=${D}${bindir}" \
+ "MANDIR=${D}${mandir}" \
+ install
+ install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d
+ install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/
+ install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq
+
+ install -d ${D}${systemd_unitdir}/system
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
+ install -m 0644 ${WORKDIR}/dnsmasq-resolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
+ else
+ install -m 0644 ${WORKDIR}/dnsmasq-noresolvconf.service ${D}${systemd_unitdir}/system/dnsmasq.service
+ fi
+
+ install -m 0755 ${S}/contrib/lease-tools/dhcp_release ${D}${bindir}
+
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'dbus', d)}" ]; then
+ install -d ${D}${sysconfdir}/dbus-1/system.d
+ install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/
+ fi
+ if [ "${@bb.utils.filter('PACKAGECONFIG', 'resolvconf', d)}" ]; then
+ install -d ${D}${sysconfdir}/resolvconf/update.d/
+ install -m 0755 ${WORKDIR}/dnsmasq.resolvconf ${D}${sysconfdir}/resolvconf/update.d/dnsmasq
+
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/99_dnsmasq ${D}${sysconfdir}/default/volatiles
+ install -m 0755 ${WORKDIR}/dnsmasq-resolvconf-helper ${D}${bindir}
+ fi
+}
+
+CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "dnsmasq.service"
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch
new file mode 100644
index 000000000..0991dd8b9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq/lua.patch
@@ -0,0 +1,30 @@
+From be1b3d2d0f1608cba5efee73d6aac5ad0709041b Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 9 Sep 2014 10:24:58 -0400
+Subject: [PATCH] Upstream-status: Inappropriate [OE specific]
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 73ea23e..ed3eeb9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -59,8 +59,8 @@ idn2_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFI
+ idn2_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LIBIDN2 $(PKG_CONFIG) --libs libidn2`
+ ct_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --cflags libnetfilter_conntrack`
+ ct_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_CONNTRACK $(PKG_CONFIG) --libs libnetfilter_conntrack`
+-lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua5.2`
+-lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.2`
++lua_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --cflags lua`
++lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua`
+ nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags nettle hogweed`
+ nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --libs nettle hogweed`
+ gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
+--
+2.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq_2.78.bb b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq_2.78.bb
new file mode 100644
index 000000000..4d1dc6e69
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/dnsmasq_2.78.bb
@@ -0,0 +1,8 @@
+require dnsmasq.inc
+
+SRC_URI += "\
+ file://lua.patch \
+"
+
+SRC_URI[dnsmasq-2.78.md5sum] = "3bb97f264c73853f802bf70610150788"
+SRC_URI[dnsmasq-2.78.sha256sum] = "c92e5d78aa6353354d02aabf74590d08980bb1385d8a00b80ef9bc80430aa1dc"
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/99_dnsmasq b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/99_dnsmasq
new file mode 100644
index 000000000..f52ce4e8f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/99_dnsmasq
@@ -0,0 +1 @@
+d root root 0755 /run/dnsmasq none
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-noresolvconf.service b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-noresolvconf.service
new file mode 100644
index 000000000..0c64fab00
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-noresolvconf.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=DNS forwarder and DHCP server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/dnsmasq.pid
+ExecStartPre=/usr/bin/dnsmasq --test
+ExecStart=/usr/bin/dnsmasq -x /run/dnsmasq.pid -7 /etc/dnsmasq.d --local-service
+ExecStop=/bin/kill $MAINPID
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper
new file mode 100644
index 000000000..db54d467e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf-helper
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# Borrowing heavily from the dnsmasq initscript's version of support for
+# resolvconf, intended for use in systemd-only configurations.
+#
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dnsmasq
+NAME=dnsmasq
+
+# Most configuration options in /etc/default/dnsmasq are deprecated
+# but still honoured.
+if [ -r /etc/default/$NAME ]; then
+ . /etc/default/$NAME
+fi
+
+start_resolvconf()
+{
+ # If interface "lo" is explicitly disabled in /etc/default/dnsmasq
+ # Then dnsmasq won't be providing local DNS, so don't add it to
+ # the resolvconf server set.
+ for interface in $DNSMASQ_EXCEPT
+ do
+ [ $interface = lo ] && return
+ done
+
+ if [ -x /sbin/resolvconf ] ; then
+ echo "nameserver 127.0.0.1" |
+ /sbin/resolvconf -a lo.$NAME
+ fi
+ return 0
+}
+
+stop_resolvconf()
+{
+ if [ -x /sbin/resolvconf ] ; then
+ /sbin/resolvconf -d lo.$NAME
+ fi
+ return 0
+}
+
+case "$1" in
+ start)
+ start_resolvconf
+ exit 0
+ ;;
+ stop)
+ stop_resolvconf
+ exit 0
+ ;;
+ restart)
+ stop_resolvconf
+ start_resolvconf
+ exit 0
+ ;;
+ *)
+ echo "Usage: /etc/init.d/$NAME {start|stop|restart}" >&2
+ exit 3
+ ;;
+esac
+
+exit 0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf.service b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf.service
new file mode 100644
index 000000000..2980f7def
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq-resolvconf.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=DNS forwarder and DHCP server
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/dnsmasq.pid
+ExecStartPre=/usr/bin/dnsmasq --test
+ExecStart=/usr/bin/dnsmasq -x /run/dnsmasq.pid -7 /etc/dnsmasq.d --local-service
+ExecStartPost=/usr/bin/dnsmasq-resolvconf-helper start
+ExecStopPre=/usr/bin/dnsmasq-resolvconf-helper stop
+ExecStop=/bin/kill $MAINPID
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf
new file mode 100755
index 000000000..9e5ab9f81
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf
@@ -0,0 +1,298 @@
+# Configuration file for dnsmasq.
+#
+# Format is one option per line, legal options are the same
+# as the long options legal on the command line. See
+# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
+
+# Listen on this specific port instead of the standard DNS port
+# (53). Setting this to zero completely disables DNS function,
+# leaving only DHCP and/or TFTP.
+#port=5353
+
+# Change these lines if you want dnsmasq to serve MX records.
+# Only one of mx-host and mx-target need be set, the other defaults
+# to the name of the host running dnsmasq.
+#mx-host=
+#mx-target=
+#selfmx
+#localmx
+
+# The following two options make you a better netizen, since they
+# tell dnsmasq to filter out queries which the public DNS cannot
+# answer, and which load the servers (especially the root servers)
+# uneccessarily. If you have a dial-on-demand link they also stop
+# these requests from bringing up the link uneccessarily.
+
+# Never forward plain names (with a dot or domain part)
+domain-needed
+# Never forward addresses in the non-routed address spaces.
+bogus-priv
+
+
+# Uncomment this to filter useless windows-originated DNS requests
+# which can trigger dial-on-demand links needlessly.
+# Note that (amongst other things) this blocks all SRV requests,
+# so don't use it if you use eg Kerberos.
+#filterwin2k
+
+# Change this line if you want dns to get its upstream servers from
+# somewhere other that /etc/resolv.conf
+#resolv-file=
+
+# By default, dnsmasq will send queries to any of the upstream
+# servers it knows about and tries to favour servers to are known
+# to be up. Uncommenting this forces dnsmasq to try each query
+# with each server strictly in the order they appear in
+# /etc/resolv.conf
+#strict-order
+
+# If you don't want dnsmasq to read /etc/resolv.conf or any other
+# file, getting its servers for this file instead (see below), then
+# uncomment this
+#no-resolv
+
+# If you don't want dnsmasq to poll /etc/resolv.conf or other resolv
+# files for changes and re-read them then uncomment this.
+#no-poll
+
+# Add other name servers here, with domain specs if they are for
+# non-public domains.
+#server=/localnet/192.168.0.1
+
+# Add local-only domains here, queries in these domains are answered
+# from /etc/hosts or DHCP only.
+#local=/localnet/
+
+# Add domains which you want to force to an IP address here.
+# The example below send any host in doubleclick.net to a local
+# webserver.
+#address=/doubleclick.net/127.0.0.1
+
+# You no longer (as of version 1.7) need to set these to enable
+# dnsmasq to read /etc/ppp/resolv.conf since dnsmasq now uses the
+# "dip" group to achieve this.
+#user=
+#group=
+
+# If you want dnsmasq to listen for requests only on specified interfaces
+# (and the loopback) give the name of the interface (eg eth0) here.
+# Repeat the line for more than one interface.
+#interface=
+# Or you can specify which interface _not_ to listen on
+#except-interface=
+# Or which to listen on by address (remember to include 127.0.0.1 if
+# you use this.)
+#listen-address=127.0.0.1
+
+# On systems which support it, dnsmasq binds the wildcard address,
+# even when it is listening on only some interfaces. It then discards
+# requests that it shouldn't reply to. This has the advantage of
+# working even when interfaces come and go and change address. If you
+# want dnsmasq to really bind only the interfaces it is listening on,
+# uncomment this option. About the only time you may need this is when
+# running another nameserver on the same machine.
+#bind-interfaces
+
+# If you don't want dnsmasq to read /etc/hosts, uncomment the
+# following line.
+#no-hosts
+# or if you want it to read another file, as well as /etc/hosts, use
+# this.
+#addn-hosts=/etc/banner_add_hosts
+
+# Set this (and domain: see below) if you want to have a domain
+# automatically added to simple names in a hosts-file.
+#expand-hosts
+
+# Set the domain for dnsmasq. this is optional, but if it is set, it
+# does the following things.
+# 1) Allows DHCP hosts to have fully qualified domain names, as long
+# as the domain part matches this setting.
+# 2) Sets the "domain" DHCP option thereby potentially setting the
+# domain of all systems configured by DHCP
+# 3) Provides the domain part for "expand-hosts"
+#domain=thekelleys.org.uk
+
+# Uncomment this to enable the integrated DHCP server, you need
+# to supply the range of addresses available for lease and optionally
+# a lease time. If you have more than one network, you will need to
+# repeat this for each network on which you want to supply DHCP
+# service.
+#dhcp-range=192.168.0.50,192.168.0.150,12h
+#dhcp-range=10.0.0.10,10.0.0.200,2h
+
+# This is an example of a DHCP range where the netmask is given. This
+# is needed for networks we reach the dnsmasq DHCP server via a relay
+# agent. If you don't know what a DHCP relay agent is, you probably
+# don't need to worry about this.
+#dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h
+
+# This is an example of a DHCP range with a network-id, so that
+# some DHCP options may be set only for this network.
+#dhcp-range=red,192.168.0.50,192.168.0.150
+
+# Supply parameters for specified hosts using DHCP. There are lots
+# of valid alternatives, so we will give examples of each. Note that
+# IP addresses DO NOT have to be in the range given above, they just
+# need to be on the same network. The order of the parameters in these
+# do not matter, it's permissble to give name,adddress and MAC in any order
+
+# Always allocate the host with ethernet address 11:22:33:44:55:66
+# The IP address 192.168.0.60
+#dhcp-host=11:22:33:44:55:66,192.168.0.60
+
+# Always set the name of the host with hardware address
+# 11:22:33:44:55:66 to be "fred"
+#dhcp-host=11:22:33:44:55:66,fred
+
+# Always give the host with ethernet address 11:22:33:44:55:66
+# the name fred and IP address 192.168.0.60 and lease time 45 minutes
+#dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m
+
+# Give the machine which says it's name is "bert" IP address
+# 192.168.0.70 and an infinite lease
+#dhcp-host=bert,192.168.0.70,infinite
+
+# Always give the host with client identifier 01:02:02:04
+# the IP address 192.168.0.60
+#dhcp-host=id:01:02:02:04,192.168.0.60
+
+# Always give the host with client identifier "marjorie"
+# the IP address 192.168.0.60
+#dhcp-host=id:marjorie,192.168.0.60
+
+# Enable the address given for "judge" in /etc/hosts
+# to be given to a machine presenting the name "judge" when
+# it asks for a DHCP lease.
+#dhcp-host=judge
+
+# Never offer DHCP service to a machine whose ethernet
+# address is 11:22:33:44:55:66
+#dhcp-host=11:22:33:44:55:66,ignore
+
+# Ignore any client-id presented by the machine with ethernet
+# address 11:22:33:44:55:66. This is useful to prevent a machine
+# being treated differently when running under different OS's or
+# between PXE boot and OS boot.
+#dhcp-host=11:22:33:44:55:66,id:*
+
+# Send extra options which are tagged as "red" to
+# the machine with ethernet address 11:22:33:44:55:66
+#dhcp-host=11:22:33:44:55:66,net:red
+
+# Send extra options which are tagged as "red" to any machine whose
+# DHCP vendorclass string includes the substring "Linux"
+#dhcp-vendorclass=red,Linux
+
+# Send extra options which are tagged as "red" to any machine one
+# of whose DHCP userclass strings includes the substring "accounts"
+#dhcp-userclass=red,accounts
+
+# If this line is uncommented, dnsmasq will read /etc/ethers and act
+# on the ethernet-address/IP pairs found there just as if they had
+# been given as --dhcp-host options. Useful if you keep
+# MAC-address/host mappings there for other purposes.
+#read-ethers
+
+# Send options to hosts which ask for a DHCP lease.
+# See RFC 2132 for details of available options.
+# Note that all the common settings, such as netmask and
+# broadcast address, DNS server and default route, are given
+# sane defaults by dnsmasq. You very likely will not need any
+# any dhcp-options. If you use Windows clients and Samba, there
+# are some options which are recommended, they are detailed at the
+# end of this section.
+# For reference, the common options are:
+# subnet mask - 1
+# default router - 3
+# DNS server - 6
+# broadcast address - 28
+
+# Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5
+#dhcp-option=42,192.168.0.4,10.10.0.5
+
+# Set the NTP time server address to be the same machine as
+# is running dnsmasq
+#dhcp-option=42,0.0.0.0
+
+# Set the NIS domain name to "welly"
+#dhcp-option=40,welly
+
+# Set the default time-to-live to 50
+#dhcp-option=23,50
+
+# Set the "all subnets are local" flag
+#dhcp-option=27,1
+
+# Send the etherboot magic flag and then etherboot options (a string).
+#dhcp-option=128,e4:45:74:68:00:00
+#dhcp-option=129,NIC=eepro100
+
+# Specify an option which will only be sent to the "red" network
+# (see dhcp-range for the declaration of the "red" network)
+#dhcp-option=red,42,192.168.1.1
+
+# The following DHCP options set up dnsmasq in the same way as is specified
+# for the ISC dhcpcd in
+# http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt
+# adapted for a typical dnsmasq installation where the host running
+# dnsmasq is also the host running samba.
+# you may want to uncomment them if you use Windows clients and Samba.
+#dhcp-option=19,0 # option ip-forwarding off
+#dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s)
+#dhcp-option=45,0.0.0.0 # netbios datagram distribution server
+#dhcp-option=46,8 # netbios node type
+#dhcp-option=47 # empty netbios scope.
+
+
+# Set the boot filename and tftpd server name and address
+# for BOOTP. You will only need this is you want to
+# boot machines over the network.
+#dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3
+
+# Set the limit on DHCP leases, the default is 150
+#dhcp-lease-max=150
+
+# The DHCP server needs somewhere on disk to keep its lease database.
+# This defaults to a sane location, but if you want to change it, use
+# the line below.
+#dhcp-leasefile=/var/lib/misc/dnsmasq.leases
+
+# Set the cachesize here.
+#cache-size=150
+
+# If you want to disable negative caching, uncomment this.
+#no-negcache
+
+# Normally responses which come form /etc/hosts and the DHCP lease
+# file have Time-To-Live set as zero, which conventionally means
+# do not cache further. If you are happy to trade lower load on the
+# server for potentially stale date, you can set a time-to-live (in
+# seconds) here.
+#local-ttl=
+
+# If you want dnsmasq to detect attempts by Verisign to send queries
+# to unregistered .com and .net hosts to its sitefinder service and
+# have dnsmasq instead return the correct NXDOMAIN response, uncomment
+# this line. You can add similar lines to do the same for other
+# registries which have implemented wildcard A records.
+#bogus-nxdomain=64.94.110.11
+
+# If you want to fix up DNS results from upstream servers, use the
+# alias option. This only works for IPv4.
+# This alias makes a result of 1.2.3.4 appear as 5.6.7.8
+#alias=1.2.3.4,5.6.7.8
+# and this maps 1.2.3.x to 5.6.7.x
+#alias=1.2.3.0,5.6.7.0,255.255.255.0
+
+# For debugging purposes, log each DNS query as it passes through
+# dnsmasq.
+#log-queries
+
+# Include a another lot of configuration options.
+#conf-file=/etc/dnsmasq.more.conf
+
+
+
+
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.resolvconf b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.resolvconf
new file mode 100755
index 000000000..06cd25cec
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/dnsmasq.resolvconf
@@ -0,0 +1,84 @@
+#!/bin/sh
+#
+# Script to update the resolver list for dnsmasq
+#
+# N.B. Resolvconf may run us even if dnsmasq is not (yet) running.
+# If dnsmasq is installed then we go ahead and update the resolver list
+# in case dnsmasq is started later.
+#
+# Assumption: On entry, PWD contains the resolv.conf-type files.
+#
+# This file is part of the dnsmasq package.
+#
+
+set -e
+
+RUN_DIR="/run/dnsmasq"
+RSLVRLIST_FILE="${RUN_DIR}/resolv.conf"
+TMP_FILE="${RSLVRLIST_FILE}_new.$$"
+MY_NAME_FOR_RESOLVCONF="dnsmasq"
+
+[ -x /usr/bin/dnsmasq ] || exit 0
+[ -x /lib/resolvconf/list-records ] || exit 1
+
+PATH=/bin:/sbin
+
+report_err() { echo "$0: Error: $*" >&2 ; }
+
+# Stores arguments (minus duplicates) in RSLT, separated by spaces
+# Doesn't work properly if an argument itself contains whitespace
+uniquify()
+{
+ RSLT=""
+ while [ "$1" ] ; do
+ for E in $RSLT ; do
+ [ "$1" = "$E" ] && { shift ; continue 2 ; }
+ done
+ RSLT="${RSLT:+$RSLT }$1"
+ shift
+ done
+}
+
+if [ ! -d "$RUN_DIR" ] && ! mkdir --parents --mode=0755 "$RUN_DIR" ; then
+ report_err "Failed trying to create directory $RUN_DIR"
+ exit 1
+fi
+
+RSLVCNFFILES=""
+for F in $(/lib/resolvconf/list-records --after "lo.$MY_NAME_FOR_RESOLVCONF") ; do
+ case "$F" in
+ "lo.$MY_NAME_FOR_RESOLVCONF")
+ # Omit own record
+ ;;
+ lo.*)
+ # Include no more records after one for a local nameserver
+ RSLVCNFFILES="${RSLVCNFFILES:+$RSLVCNFFILES }$F"
+ break
+ ;;
+ *)
+ RSLVCNFFILES="${RSLVCNFFILES:+$RSLVCNFFILES }$F"
+ ;;
+ esac
+done
+
+NMSRVRS=""
+if [ "$RSLVCNFFILES" ] ; then
+ uniquify $(sed -n -e 's/^[[:space:]]*nameserver[[:space:]]\+//p' $RSLVCNFFILES)
+ NMSRVRS="$RSLT"
+fi
+
+# Dnsmasq uses the mtime of $RSLVRLIST_FILE, with a resolution of one second,
+# to detect changes in the file. This means that if a resolvconf update occurs
+# within one second of the previous one then dnsmasq may fail to notice the
+# more recent change. To work around this problem we sleep one second here
+# if necessary in order to ensure that the new mtime is different.
+if [ -f "$RSLVRLIST_FILE" ] && [ "$(stat -c %X "$RSLVRLIST_FILE")" = "$(date +%s)" ] ; then
+ sleep 1
+fi
+
+clean_up() { rm -f "$TMP_FILE" ; }
+trap clean_up EXIT
+: >| "$TMP_FILE"
+for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMP_FILE" ; done
+mv -f "$TMP_FILE" "$RSLVRLIST_FILE"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/init b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/init
new file mode 100644
index 000000000..51c95dfed
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnsmasq/files/init
@@ -0,0 +1,117 @@
+#!/bin/sh
+DAEMON=/usr/bin/dnsmasq
+NAME=dnsmasq
+DESC="DNS forwarder and DHCP server"
+ARGS="-7 /etc/dnsmasq.d"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+if [ -r /etc/default/$NAME ]
+then
+ . /etc/default/$NAME
+fi
+
+DNSMASQ_CONF="/etc/dnsmasq.conf"
+test "/etc/dnsmasq.d/*" != '/etc/dnsmasq.d/*' && DNSMASQ_CONF="${DNSMASQ_CONF} /etc/dnsmasq.d/*"
+
+test -z "${PIDFILE}" && PIFILE="/run/dnsmasq.pid"
+
+if [ -z "$IGNORE_RESOLVCONF" ]
+then
+ egrep -h -q '^no-resolv' ${DNSMASQ_CONF} && IGNORE_RESOLVCONF="yes"
+fi
+
+# RESOLV_CONF:
+# If the resolvconf package is installed then use the resolv conf file
+# that it provides as the default. Otherwise use /etc/resolv.conf as
+# the default.
+#
+# If IGNORE_RESOLVCONF is set in /etc/default/dnsmasq or an explicit
+# filename is set there then this inhibits the use of the resolvconf-provided
+# information.
+#
+# Note that if the resolvconf package is installed it is not possible to
+# override it just by configuration in /etc/dnsmasq.conf, it is necessary
+# to set IGNORE_RESOLVCONF=yes in /etc/default/dnsmasq.
+
+test -z "$RESOLV_CONF" -a "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf && \
+ RESOLV_CONF=/run/dnsmasq/resolv.conf
+
+start_resolvconf()
+{
+ if [ "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf ]
+ then
+ echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.$NAME
+ fi
+ :
+}
+
+stop_resolvconf()
+{
+ if [ "$IGNORE_RESOLVCONF" != "yes" -a -x /sbin/resolvconf ]
+ then
+ /sbin/resolvconf -d lo.$NAME
+ fi
+ :
+}
+
+case "$1" in
+ start)
+ echo -n "starting $DESC: $NAME... "
+ test -d /var/lib/misc/ || mkdir /var/lib/misc/
+ start-stop-daemon -S -x $DAEMON -- $ARGS \
+ ${RESOLV_CONF:+ -r $RESOLV_CONF} \
+ ${PIDFILE:+ -x $PIDFILE}
+ test $? -eq 0 && start_resolvconf
+ echo "done."
+ ;;
+ stop)
+ echo -n "stopping $DESC: $NAME... "
+ stop_resolvconf
+ start-stop-daemon -K -x $DAEMON
+ echo "done."
+ ;;
+ status)
+ echo -n "dnsmasq "
+ start-stop-daemon -q -K -t -x $DAEMON
+ RET=$?
+ if [ "$RET" = "0" ]; then
+ PID=`cat ${PIDFILE}`
+ echo "($PID) is running"
+ else
+ echo "is not running"
+ exit $RET
+ fi
+ ;;
+ restart)
+ echo "restarting $DESC: $NAME... "
+ $0 stop
+ $0 start
+ echo "done."
+ ;;
+ reload)
+ echo -n "reloading $DESC: $NAME... "
+ killall -HUP $(basename ${DAEMON})
+ echo "done."
+ ;;
+ systemd-start-resolvconf)
+ start_resolvconf
+ ;;
+ systemd-stop-resolvconf)
+ stop_resolvconf
+ ;;
+ systemd-exec)
+ test -d /var/lib/misc/ || mkdir /var/lib/misc/
+ exec $DAEMON --keep-in-foreground $ARGS \
+ ${RESOLV_CONF:+ -r $RESOLV_CONF} \
+ ${PIDFILE:+ -x $PIDFILE}
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|restart|reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-support/dnssec-conf/dnssec-conf_2.02.bb b/meta-openembedded/meta-networking/recipes-support/dnssec-conf/dnssec-conf_2.02.bb
new file mode 100644
index 000000000..ca59bd217
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dnssec-conf/dnssec-conf_2.02.bb
@@ -0,0 +1,35 @@
+SUMMARY = "DNSSEC and DLV configuration and priming tool"
+DESCRIPTION = "\
+DNSSEC configuration and priming tool. Keys are required until the root \
+is signed, as well as for local unpublished DNSSEC keys to be preloaded \
+into the recursive nameserver. These DNSSEC configuration files can be \
+directly included in the bind or unbound nameserver configuration files. \
+dnssec-conf includes a commandline configuration client for Bind and \
+Unbound, known DNSSEC keys, URL's to official publication pages of keys, \
+and harvested keys, as well a script to harvest DNSKEY's from DNS. \
+See also: system-config-dnssec"
+HOMEPAGE = "https://github.com/xelerance/dnssec-conf"
+SECTION = "net"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0636e73ff0215e8d672dc4c32c317bb3"
+DEPENDS += "xmlto-native docbook-xml-dtd4-native \
+ docbook-xsl-stylesheets-native libxslt-native"
+
+SRC_URI = "git://github.com/xelerance/dnssec-conf.git"
+SRCREV = "8e799683736b4a7b5e5e78f98fba0a6f48393537"
+
+S = "${WORKDIR}/git"
+
+do_install () {
+ rm -rf ${D}
+ make PREFIX=${prefix} DESTDIR=${D} ETCDIR=${D}${sysconfdir} install
+ # We no longer ship trust anchors. Most of these are in the DLV Registry now.
+ # and it prevents the problem of shipping outdated trust anchors.
+ # For DLV, we ship the ISC DLV Registry key
+ rm -rf ${D}${sysconfdir}/pki/dnssec-keys/harvest/*
+ rm -rf ${D}${sysconfdir}/pki/dnssec-keys/production/reverse/*
+ install -d -m 0755 ${D}${sysconfdir}/sysconfig
+ install -m 0644 packaging/fedora/dnssec.sysconfig ${D}${sysconfdir}/sysconfig/dnssec
+}
+
+RDEPENDS_${PN} = "python"
diff --git a/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch b/meta-openembedded/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..f86235076
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch
@@ -0,0 +1,66 @@
+From 07150f3a27681e034f18ab2ed2b68914c1e10af6 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Sat, 18 Jul 2015 05:03:57 +0900
+Subject: [PATCH] configure.ac: convert AC_TRY_RUN to AC_TRY_LINK statements
+
+This is not completely safe, but it's the least invasive fix.
+
+Upstream-Status: pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ configure.ac | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3b32614..94ec002 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -519,13 +519,10 @@ have_ioloop=no
+
+ if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then
+ AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[
+- AC_TRY_RUN([
++ AC_TRY_LINK([
+ #include <sys/epoll.h>
+-
+- int main()
+- {
+- return epoll_create(5) < 1;
+- }
++ ], [
++ epoll_create(5) < 1;
+ ], [
+ i_cv_epoll_works=yes
+ ], [
+@@ -653,7 +650,7 @@ fi
+ dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
+ dnl * It may also be broken in AIX.
+ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[
+- AC_TRY_RUN([
++ AC_TRY_LINK([
+ #define _XOPEN_SOURCE 600
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -662,7 +659,7 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[
+ #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
+ possibly broken posix_fallocate
+ #endif
+- int main() {
++ ], [
+ int fd = creat("conftest.temp", 0600);
+ int ret;
+ if (fd == -1) {
+@@ -671,8 +668,6 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[
+ }
+ ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0;
+ unlink("conftest.temp");
+- return ret;
+- }
+ ], [
+ i_cv_posix_fallocate_works=yes
+ ], [
+--
+1.8.4.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-doveadm-Fix-parallel-build.patch b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-doveadm-Fix-parallel-build.patch
new file mode 100644
index 000000000..65ae9bf91
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/0001-doveadm-Fix-parallel-build.patch
@@ -0,0 +1,38 @@
+From be9b3809b86fe593dbb16f0b981b3d315a27b799 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 22 Oct 2017 22:10:41 -0700
+Subject: [PATCH] doveadm: Fix parallel build
+
+Sometimes dovetail build fails with errors like
+
+doveadm-util.o: file not recognized: File truncated
+collect2: error: ld returned 1 exit status
+make[4]: *** [Makefile:812: test-doveadm-util] Error 1
+
+This is partial backport from
+
+https://github.com/dovecot/core/commit/b200bc3875fa06d42c8619865cc306c3297fcacc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/doveadm/Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/doveadm/Makefile.am b/src/doveadm/Makefile.am
+index c644646..6ae9144 100644
+--- a/src/doveadm/Makefile.am
++++ b/src/doveadm/Makefile.am
+@@ -180,8 +180,8 @@ test_libs = \
+ ../lib/liblib.la
+ test_deps = $(noinst_LTLIBRARIES) $(test_libs)
+
+-test_doveadm_util_SOURCES = test-doveadm-util.c
+-test_doveadm_util_LDADD = doveadm-util.o $(test_libs) $(MODULE_LIBS)
++test_doveadm_util_SOURCES = doveadm-util.c test-doveadm-util.c
++test_doveadm_util_LDADD = $(test_libs) $(MODULE_LIBS)
+ test_doveadm_util_DEPENDENCIES = $(test_deps)
+
+ check: check-am check-test
+--
+2.14.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.service b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.service
new file mode 100644
index 000000000..ca250ea5d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Dovecot IMAP/POP3 email server
+After=local-fs.target network.target
+
+[Service]
+Type=simple
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dovecot
+ExecStart=@SBINDIR@/dovecot -F
+ExecReload=/bin/kill -HUP $MAINPID
+NonBlocking=yes
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket
new file mode 100644
index 000000000..556e1a850
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket
@@ -0,0 +1,14 @@
+[Unit]
+Description=Dovecot IMAP/POP3 email server activation socket
+
+[Socket]
+#dovecot expects separate IPv4 and IPv6 sockets
+BindIPv6Only=ipv6-only
+ListenStream=0.0.0.0:143
+ListenStream=[::]:143
+ListenStream=0.0.0.0:993
+ListenStream=[::]:993
+KeepAlive=true
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.33.bb b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.33.bb
new file mode 100644
index 000000000..5ebda19eb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/dovecot/dovecot_2.2.33.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Dovecot is an open source IMAP and POP3 email server"
+HOMEPAGE = "https://www.dovecot.org/"
+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."
+SECTION = "mail"
+LICENSE = "LGPLv2.1 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b"
+
+SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
+ file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \
+ file://dovecot.service \
+ file://dovecot.socket \
+ file://0001-doveadm-Fix-parallel-build.patch \
+ "
+
+SRC_URI[md5sum] = "d61d1e923a22f9062cc9f47696882666"
+SRC_URI[sha256sum] = "e9483d68a7698d701bc06124fcf6e1b1f16380c2986c7ec0cf4e1475b9d0c218"
+
+DEPENDS = "openssl xz zlib bzip2 libcap icu"
+
+DEPENDS_append_libc-musl = " libtirpc"
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/tirpc"
+LDFLAGS_append_libc-musl = " -ltirpc"
+
+inherit autotools pkgconfig systemd useradd
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ldap pam', d)}"
+
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,"
+PACKAGECONFIG[ldap] = "--with-ldap=plugin,--without-ldap,openldap,"
+PACKAGECONFIG[lz4] = "--with-lz4,--without-lz4,lz4,"
+
+# From native build in armv7a-hf/eglibc
+CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \
+ i_cv_gmtime_max_time_t=32 \
+ i_cv_signed_time_t=yes \
+ i_cv_mmap_plays_with_write=yes \
+ i_cv_fd_passing=yes \
+ i_cv_c99_vsnprintf=yes \
+ lib_cv___va_copy=yes \
+ lib_cv_va_copy=yes \
+ lib_cv_va_val_copy=yes \
+ "
+
+# hardcode epoll() to avoid running unsafe tests
+# BSD needs kqueue and uclibc poll()
+EXTRA_OECONF = " --with-ioloop=epoll \
+ --with-systemdsystemunitdir=${systemd_unitdir}/system"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "dovecot.service dovecot.socket"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_install_append () {
+ install -d 755 ${D}/etc/dovecot
+ touch 644 ${D}/etc/dovecot/dovecot.conf
+ install -m 0644 ${WORKDIR}/dovecot.service ${D}${systemd_unitdir}/system
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/dovecot.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/dovecot.service
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "-r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovecot dovecot; \
+ -r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovenull dovenull"
+GROUPADD_PARAM_${PN} = "-f -r dovecot;-f -r dovenull"
+
+FILES_${PN} += "${libdir}/dovecot/*plugin.so \
+ ${libdir}/dovecot/libfs_compress.so \
+ ${libdir}/dovecot/libssl_iostream_openssl.so"
+FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a"
+FILES_${PN}-dev += "${libdir}/dovecot/libdovecot*.so"
+FILES_${PN}-dbg += "${libdir}/dovecot/*/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-fix-permission-bits-for-drbd.service.patch b/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-fix-permission-bits-for-drbd.service.patch
new file mode 100644
index 000000000..90dd1f861
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils/0001-Makefile.in-fix-permission-bits-for-drbd.service.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+Subject: Makefile.in: fix permission bits for drbd.service
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ scripts/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index 402b93b..4a45407 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -65,7 +65,7 @@ endif
+ # yes, debian apparently allows installing both types from the same package
+ ifneq ($(initscripttype),sysv) # "systemd" or "both"
+ install -d $(DESTDIR)$(systemdunitdir)
+- install -m 755 drbd.service $(DESTDIR)$(systemdunitdir)/
++ install -m 644 drbd.service $(DESTDIR)$(systemdunitdir)/
+ install -d $(DESTDIR)/lib/drbd/
+ install -m 755 drbd $(DESTDIR)/lib/drbd/
+ install -d $(DESTDIR)$(tmpfilesdir)/
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb b/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb
new file mode 100644
index 000000000..81f1cfec5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/drbd/drbd-utils_8.9.6.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Distributed block device driver for Linux"
+DESCRIPTION = "DRBD mirrors a block device over the network to another machine.\
+DRBD mirrors a block device over the network to another machine.\
+Think of it as networked raid 1. It is a building block for\
+setting up high availability (HA) clusters."
+HOMEPAGE = "http://www.drbd.org/"
+SECTION = "admin"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+
+SRC_URI = "http://www.linbit.com/downloads/drbd/utils/archive/${BP}.tar.gz \
+ file://0001-Makefile.in-fix-permission-bits-for-drbd.service.patch \
+ "
+SRC_URI[md5sum] = "76ed6d3190cd77b00890f3365353124b"
+SRC_URI[sha256sum] = "297b77c9b3f88de2e7dae459234f2753ea4fc2805282b2d276e35cf51e292913"
+
+SYSTEMD_SERVICE_${PN} = "drbd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+inherit autotools-brokensep systemd
+
+EXTRA_OECONF = " \
+ --with-initdir=/etc/init.d \
+ --without-pacemaker \
+ --without-rgmanager \
+ --without-bashcompletion \
+ --with-distro debian \
+ --with-initscripttype=both \
+ --with-systemdunitdir=${systemd_unitdir}/system \
+ --without-manual\
+ "
+
+do_install_append() {
+ # don't install empty /var/lock to avoid conflict with base-files
+ rm -rf ${D}${localstatedir}/lock
+}
+
+RDEPENDS_${PN} += "bash perl-module-getopt-long perl-module-exporter perl-module-constant perl-module-overloading perl-module-exporter-heavy"
+
+# The drbd items are explicitly put under /lib when installed.
+#
+FILES_${PN} += "/run"
+FILES_${PN} += "${nonarch_base_libdir}/drbd \
+ ${nonarch_libdir}/drbd \
+ ${nonarch_libdir}/tmpfiles.d"
+FILES_${PN}-dbg += "${nonarch_base_libdir}/drbd/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch b/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch
new file mode 100644
index 000000000..6414f7305
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/drbd/drbd/check_existence_of_modules_before_installing.patch
@@ -0,0 +1,24 @@
+If CONFIG_BLK_DEV_DRBD kernel config is enabled, then DRBD
+does not build drbd.ko here. Under this circumstance do_install
+task is going to fail with a below error:
+-- snip --
+| install: cannot stat ‘drbd.ko’: No such file or directory
+| make[1]: *** [install] Error 1
+-- snip --
+
+So, check for kernel module existence before installing.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+--- drbd-9.0.1-1/drbd/Makefile 2016-07-03 06:54:19.421538690 -0700
++++ drbd-9.0.1-1/drbd/Makefile_mod 2016-07-03 06:53:18.938801628 -0700
+@@ -158,7 +158,7 @@ else
+ fi
+ install -d $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR)
+ set -e ; for ko in $(MODOBJS); do \
+- install -m 644 $$ko $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR); \
++ [ -e $$ko ] && install -m 644 $$ko $(DESTDIR)/lib/modules/$(KERNELRELEASE)/$(MODSUBDIR); \
+ done
+ ifeq ($(DESTDIR),/)
+ ifeq ($(shell uname -r),$(KERNELRELEASE))
diff --git a/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb b/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb
new file mode 100644
index 000000000..fa4d10b4c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/drbd/drbd_9.0.8-1.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Distributed block device driver for Linux"
+DESCRIPTION = "DRBD is a block device which is designed to build high \
+ availability clusters. This is done by mirroring a whole \
+ block device via (a dedicated) network. You could see \
+ it as a network raid-1."
+HOMEPAGE = "http://oss.linbit.com/drbd/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+DEPENDS = "virtual/kernel"
+
+SRC_URI = "http://www.linbit.com/downloads/drbd/9.0/drbd-${PV}.tar.gz \
+ file://check_existence_of_modules_before_installing.patch"
+
+SRC_URI[md5sum] = "c1dd58043f46e9926b579aa65d4ea980"
+SRC_URI[sha256sum] = "87f72d46db9bad926415b3ab9f5f1397de8c581d2e2ec1addbdd5ce2604e6123"
+inherit module
+
+EXTRA_OEMAKE += "KDIR='${STAGING_KERNEL_DIR}'"
+
+do_install () {
+ oe_runmake install DESTDIR="${D}"
+}
+
+PNBLACKLIST[drbd] = "implicit declaration of function 'setup_timer'; 4.15 head file issue?"
diff --git a/meta-openembedded/meta-networking/recipes-support/esmtp/esmtp_1.2.bb b/meta-openembedded/meta-networking/recipes-support/esmtp/esmtp_1.2.bb
new file mode 100644
index 000000000..2da73e775
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/esmtp/esmtp_1.2.bb
@@ -0,0 +1,45 @@
+SUMMARY = "User configurable send-only Mail Transfer Agent"
+DESCRIPTION = "ESMTP is a user-configurable relay-only MTA \
+with a sendmail-compatible syntax, based on libESMTP and \
+supporting the AUTH (including the CRAM-MD5 and NTLM SASL \
+mechanisms) and StartTLS SMTP extensions."
+HOMEPAGE = "http://esmtp.sourceforge.net/"
+SECTION = "net"
+
+DEPENDS = "libesmtp"
+
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BPN}-${PV}.tar.bz2"
+
+# Have to set this or we get -L/lib in LDFLAGS
+EXTRA_OECONF = "--with-libesmtp=${STAGING_EXECPREFIXDIR}"
+
+inherit autotools update-alternatives
+
+ALTERNATIVE_${PN} = "sendmail"
+
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${bindir}/esmtp"
+ALTERNATIVE_PRIORITY = "10"
+
+ALTERNATIVE_${PN}-doc += "mailq.1 newaliases.1 sendmail.1"
+ALTERNATIVE_LINK_NAME[mailq.1] = "${mandir}/man1/mailq.1"
+ALTERNATIVE_LINK_NAME[newaliases.1] = "${mandir}/man1/newaliases.1"
+ALTERNATIVE_LINK_NAME[sendmail.1] = "${mandir}/man1/sendmail.1"
+
+SRC_URI[md5sum] = "79a9c1f9023d53f35bb82bf446150a72"
+SRC_URI[sha256sum] = "a0d26931bf731f97514da266d079d8bc7d73c65b3499ed080576ab606b21c0ce"
+
+do_install_append() {
+ # only one file /usr/lib/sendmail in ${D}${libdir}
+ rm -rf ${D}${libdir}
+}
+
+pkg_postinst_${PN}_linuxstdbase () {
+ # /usr/lib/sendmial is required by LSB core test
+ [ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
+
+FILES_${PN} += "${libdir}/"
diff --git a/meta-openembedded/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb b/meta-openembedded/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb
new file mode 100644
index 000000000..1d78288c8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Fetchmail retrieves mail from remote mail servers and forwards it via SMTP"
+HOMEPAGE = "http://www.fetchmail.info/"
+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."
+SECTION = "mail"
+LICENSE = "GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbb509e0303f5ded1cbfc0cc8705f28c"
+
+DEPENDS = "openssl"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "61b66faad044afa26e142bb1791aa2b3"
+SRC_URI[sha256sum] = "79b4c54cdbaf02c1a9a691d9948fcb1a77a1591a813e904283a8b614b757e850"
+
+inherit autotools gettext python-dir pythonnative
+
+EXTRA_OECONF = "--with-ssl=${STAGING_DIR_HOST}${prefix}"
+
+PACKAGES =+ "fetchmail-python"
+FILES_fetchmail-python = "${libdir}/${PYTHON_DIR}/*"
diff --git a/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb b/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb
new file mode 100644
index 000000000..82e3bf073
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/fping/fping_3.5.bb
@@ -0,0 +1,25 @@
+SUMMARY = "sends ICMP ECHO_REQUEST packets to network hosts"
+DESCRIPTION = "fping is a ping like program which uses the Internet Control \
+Message Protocol (ICMP) echo request to determine if a target host is \
+responding. fping differs from ping in that you can specify any number of \
+targets on the command line, or specify a file containing the lists of \
+targets to ping. Instead of sending to one target until it times out or \
+replies, fping will send out a ping packet and move on to the next target \
+in a round-robin fashion."
+HOMEPAGE = "http://www.fping.org/"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=09d77789fe32be35acde9637a5ee39b1"
+
+SRC_URI = "http://www.fping.org/dist/fping-${PV}.tar.gz"
+SRC_URI[md5sum] = "2e17cb655aa4eb59b5a4a38a89e746ed"
+SRC_URI[sha256sum] = "09b8960e235341bae6000085d38106357eae656a79e0119bd27e816c9003656a"
+
+S = "${WORKDIR}/fping-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF = "--enable-ipv4"
+
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb b/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb
new file mode 100644
index 000000000..0fd5f6fed
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/fwknop/fwknop_2.6.9.bb
@@ -0,0 +1,37 @@
+SUMMARY = "fwknop - Single Packet Authorization"
+HOMEPAGE = "http://www.cipherdyne.org/fwknop/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+ "
+inherit autotools-brokensep
+
+SRC_URI = "http://www.cipherdyne.org/${BPN}/download/${BPN}-${PV}.tar.bz2 \
+ "
+
+SRC_URI[md5sum] = "e2c49e9674888a028bd443a55c3aaa22"
+SRC_URI[sha256sum] = "5bf47fe1fd30e862d29464f762c0b8bf89b5e298665c37624d6707826da956d4"
+
+DEPENDS = "libpcap gpgme"
+
+EXTRA_OECONF = " --with-iptables=/usr/sbin/iptables \
+ "
+
+do_configure () {
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/config
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/config
+
+ aclocal
+ libtoolize --automake --copy --force
+ autoconf
+ autoheader
+ automake -a
+ oe_runconf
+}
+
+PACKAGES =+ "${PN}-client ${PN}-daemon"
+
+FILES_${PN}-client = "${bindir}/fwknop"
+FILES_${PN}-daemon = "${sbindir}/fwknopd \
+ ${sysconfdir}/fwknop/access.conf \
+ ${sysconfdir}/fwknop/fwknopd.conf"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/files/run-ptest b/meta-openembedded/meta-networking/recipes-support/geoip/files/run-ptest
new file mode 100644
index 000000000..14e96191f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/files/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+pdir=`dirname $0`
+cd ${pdir}/tests
+for i in ./benchmark ./test-geoip-city ; do
+ ${i} 1>/dev/null 2>&1;
+ if [ $? == 0 ]; then
+ echo PASS: $i;
+ else
+ echo FAIL: $i;
+ fi;
+done
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl/run-ptest b/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl/run-ptest
new file mode 100644
index 000000000..5404c247b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl/run-ptest
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# The tests contain hard-coded relative paths and must be
+# executed from $pdir.
+#
+pdir=`dirname $0`
+cd ${pdir}
+for i in t/*.t ; do
+ perl ${i} 1>/dev/null 2>&1;
+ if [ $? == 0 ]; then
+ echo PASS: $i;
+ else
+ echo FAIL: $i;
+ fi;
+done
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl_1.50.bb b/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl_1.50.bb
new file mode 100644
index 000000000..95147bdad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoip-perl_1.50.bb
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2014, 2015 Wind River Systems, Inc.
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+SUMMARY = "GeoIP perl API library to access location database"
+DESCRIPTION = "perl library for country/city/organization to IP address or hostname mapping"
+HOMEPAGE = "http://www.maxmind.com/app/ip-location"
+SECTION = "libdevel"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b7a36f55e8ba62aadd74e4f0886a405e"
+
+S = "${WORKDIR}/git"
+SRCREV = "47f7d49bd15cfc2e5f8c0f5c4068dc8bb0e10e96"
+SRC_URI = "git://github.com/maxmind/geoip-api-perl.git;protocol=https; \
+ file://run-ptest \
+"
+
+DEPENDS += "geoip"
+
+inherit cpan ptest
+
+EXTRA_CPANFLAGS = "LIBS='-L${STAGING_LIBDIR}' INC='-I${STAGING_INCDIR}'"
+
+
+# perl scripts and some special small data files
+#
+do_install_ptest () {
+ install -d -m 0755 ${D}${PTEST_PATH}/t/data
+
+ install ${S}/t/*.t* ${D}${PTEST_PATH}/t
+ install ${S}/t/data/* ${D}${PTEST_PATH}/t/data
+}
+
+FILES_${PN}-dbg += "${libdir}/perl/vendor_perl/*/auto/Geo/IP/.debug"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoip_1.6.11.bb b/meta-openembedded/meta-networking/recipes-support/geoip/geoip_1.6.11.bb
new file mode 100644
index 000000000..3527d0cba
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoip_1.6.11.bb
@@ -0,0 +1,90 @@
+SUMMARY = "C library for country/city/organization to IP address or hostname mapping"
+DESCRIPTION = "GeoIP is a C library that enables the user to find the country that any IP \
+address or hostname originates from. It uses a file based database that is \
+accurate as of March 2003. This database simply contains IP blocks as keys, and \
+countries as values. This database should be more complete and accurate than \
+using reverse DNS lookups."
+
+HOMEPAGE = "http://dev.maxmind.com/geoip/"
+SECTION = "libdevel"
+
+SRC_URI = "git://github.com/maxmind/geoip-api-c.git \
+ http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz;apply=no;name=GeoIP-dat \
+ http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz;apply=no;name=GeoIPv6-dat \
+ http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz;apply=no;name=GeoLiteCity-dat \
+ http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz;apply=no;name=GeoLiteCityv6-dat \
+ file://run-ptest \
+"
+SRCREV = "3169a8a88808c8df862e0b0355f99c738cce9f7e"
+
+SRC_URI[GeoIP-dat.md5sum] = "37c84ead332dda0362a5ac7b049b72d4"
+SRC_URI[GeoIP-dat.sha256sum] = "79ff1099e96c2dc1c2539c9a18aaa13a9afd085cae477df60d95f1644d42bc07"
+
+SRC_URI[GeoIPv6-dat.md5sum] = "e75b84a4044e81d6d4484e33816bc762"
+SRC_URI[GeoIPv6-dat.sha256sum] = "a009b0f21968d2868e6dd19d14f3c3b8cd60ae84a4bfc2970df34d771a04811e"
+
+SRC_URI[GeoLiteCity-dat.md5sum] = "4b6588d0bfe1af22e267ac90aa97f769"
+SRC_URI[GeoLiteCity-dat.sha256sum] = "8a6467033a528f68b1a97de24d9d0ce86c8e8e83683820e16e433ddbd3f712f7"
+
+SRC_URI[GeoLiteCityv6-dat.md5sum] = "ad0cb42518af7f752499425dca0952bb"
+SRC_URI[GeoLiteCityv6-dat.sha256sum] = "eda67f4204ba9fa5204a53cdb629167cca9394c712f5378bc723a8c29c0b440f"
+
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad \
+ file://LICENSE;md5=0388276749a542b0d611601fa7c1dcc8 "
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-static \
+ --disable-dependency-tracking "
+
+do_install() {
+ make DESTDIR=${D} install
+ install -d ${D}/${datadir}/GeoIP
+ install ${WORKDIR}/GeoIP.dat ${D}/${datadir}/GeoIP/
+ install ${WORKDIR}/GeoIPv6.dat ${D}/${datadir}/GeoIP/
+ install ${WORKDIR}/GeoLiteCity.dat ${D}/${datadir}/GeoIP/
+ install ${WORKDIR}/GeoLiteCityv6.dat ${D}/${datadir}/GeoIP/
+ ln -s GeoLiteCity.dat ${D}${datadir}/GeoIP/GeoIPCity.dat
+}
+
+PACKAGES =+ "${PN}-database"
+FILES_${PN}-database = ""
+FILES_${PN}-database += "${datadir}/GeoIP/*"
+
+# We cannot do much looking up without databases.
+#
+RDEPENDS_${PN} += "${PN}-database"
+
+inherit ptest
+
+do_configure_ptest() {
+ sed -i -e "s/noinst_PROGRAMS = /test_PROGRAMS = /g" \
+ -e 's:SRCDIR=\\"$(top_srcdir)\\":SRCDIR=\\"$(testdir)\\":' \
+ ${S}/test/Makefile.am
+
+ if ! grep "^testdir = " ${S}/test/Makefile.am ; then
+ sed -e '/EXTRA_PROGRAMS = /itestdir = ${PTEST_PATH}/tests' \
+ -i ${S}/test/Makefile.am
+ fi
+
+ sed -i -e "s:/usr/local/share:/usr/share:g" \
+ ${S}/test/benchmark.c
+
+ sed -i -e 's:"../data/:"/usr/share/GeoIP/:g' \
+ ${S}/test/test-geoip-city.c \
+ ${S}/test/test-geoip-isp.c \
+ ${S}/test/test-geoip-asnum.c \
+ ${S}/test/test-geoip-netspeed.c \
+ ${S}/test/test-geoip-org.c \
+ ${S}/test/test-geoip-region.c
+}
+
+
+do_install_ptest() {
+ oe_runmake -C test DESTDIR=${D} install-testPROGRAMS
+ install ${S}/test/*.txt ${D}${PTEST_PATH}/tests
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/GeoIP.conf b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/GeoIP.conf
new file mode 100644
index 000000000..134cfed1f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/GeoIP.conf
@@ -0,0 +1,11 @@
+# The following UserId and LicenseKey are required placeholders:
+UserId 999999
+LicenseKey 000000000000
+
+# Include one or more of the following ProductIds:
+# * GeoLite2-City - GeoLite 2 City
+# * GeoLite2-Country - GeoLite2 Country
+# * 506 - GeoLite Legacy Country
+# * 517 - GeoLite Legacy ASN
+# * 533 - GeoLite Legacy City
+ProductIds GeoLite2-City GeoLite2-Country 506 517 533
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/geoipupdate.cron b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/geoipupdate.cron
new file mode 100644
index 000000000..40597a856
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate-2.5.0/geoipupdate.cron
@@ -0,0 +1,5 @@
+# top of crontab
+MAILTO=your@email.com
+
+32 11 * * 4 /usr/local/bin/geoipupdate
+# end of crontab
diff --git a/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate_2.5.0.bb b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate_2.5.0.bb
new file mode 100644
index 000000000..f4eb2b799
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/geoip/geoipupdate_2.5.0.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Crontab entry to provide weekly updates of the GeoIP free databases."
+DESCRIPTION = "update databases for GeoIP"
+
+HOMEPAGE = "http://dev.maxmind.com/geoip/"
+SECTION = "net"
+
+DEPENDS = "zlib curl"
+
+SRC_URI = "https://github.com/maxmind/geoipupdate/releases/download/v2.5.0/geoipupdate-2.5.0.tar.gz \
+ file://GeoIP.conf \
+ file://geoipupdate.cron \
+ "
+SRC_URI[md5sum] = "28f633c49ec87ab01ad3c0fb0228a696"
+SRC_URI[sha256sum] = "5119fd0e338cd083e886228b26679c64bcbaade8a815be092aecf865a610ab26"
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "\
+file://ChangeLog.md;md5=11d2e31df0de2be3ccc3e2286c4dafcb \
+"
+FILES_${PN} = "/usr/share/GeoIP \
+ /etc/GeoIP.conf \
+ /etc/cron.d/geoipupdate.cron \
+ /usr/bin/geoipupdate \
+"
+inherit autotools
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}
+ install -d ${D}/${sysconfdir}/cron.d
+ install ${WORKDIR}/GeoIP.conf ${D}/${sysconfdir}/
+ install ${WORKDIR}/geoipupdate.cron ${D}/${sysconfdir}/cron.d/
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.9.bb b/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.9.bb
new file mode 100644
index 000000000..ea28b34aa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ifenslave/ifenslave_2.9.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Configure network interfaces for parallel routing"
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding"
+SECTION = "net"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=acc89812938cf9ad6b1debc37cea0253"
+
+
+SRCREV = "42bfbb9beb924672ca86b86e9679ac3d6b87d992"
+SRC_URI = "git://anonscm.debian.org/collab-maint/ifenslave.git"
+
+S = "${WORKDIR}/git"
+
+do_install() {
+ install -d ${D}${sbindir}
+ install -m 0755 ${S}/ifenslave ${D}${sbindir}/
+
+ install -m 0755 -D ${S}/debian/ifenslave.if-pre-up ${D}${sysconfdir}/network/if-pre-up.d/ifenslave
+ install -m 0755 -D ${S}/debian/ifenslave.if-post-down ${D}${sysconfdir}/network/if-post-down.d/ifenslave
+ install -m 0755 -D ${S}/debian/ifenslave.if-up ${D}${sysconfdir}/network/if-up.d/ifenslave
+ install -m 0644 -D ${S}/debian/ifenslave.8 ${D}${mandir}/man8/ifenslave.8
+}
+
+FILES_${PN}-doc_remove = "${mandir}"
+FILES_${PN} += "${mandir}/man8/ifenslave.8"
+
+RDEPENDS_${PN} = "man"
diff --git a/meta-openembedded/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb b/meta-openembedded/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb
new file mode 100644
index 000000000..0c8e494c1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/iftop/iftop_1.0pre4.bb
@@ -0,0 +1,14 @@
+SUMMARY = "iftop does for network usage what top(1) does for CPU usage"
+HOMEPAGE = "http://www.ex-parrot.com/pdw/iftop/"
+SECTION = "net"
+DEPENDS = "libpcap ncurses"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=76498170798db0f4f0fb685a225f702f"
+
+SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz"
+SRC_URI[md5sum] = "7e6decb4958e8a4890cccac335239f24"
+SRC_URI[sha256sum] = "f733eeea371a7577f8fe353d86dd88d16f5b2a2e702bd96f5ffb2c197d9b4f97"
+
+inherit autotools-brokensep
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc/0001-Makefile-pass-extra-linker-flags.patch b/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc/0001-Makefile-pass-extra-linker-flags.patch
new file mode 100644
index 000000000..38d306475
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc/0001-Makefile-pass-extra-linker-flags.patch
@@ -0,0 +1,31 @@
+From fd80c0599083013a1b583feba5d7473f52b35938 Mon Sep 17 00:00:00 2001
+From: Mariia Movchan <mmovchan@cisco.com>
+Date: Tue, 6 Mar 2018 16:03:39 +0200
+Subject: [PATCH] Makefile: pass extra linker flags
+
+Fixes
+ERROR: QA Issue: No GNU_HASH in the elf binary
+
+Upstream-Status: Pending
+
+Signed-off-by: Mariia Movchan <mmovchan@cisco.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8beff8f..047f02a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -8,7 +8,7 @@ LIBS?=
+ VERSION=0.2.2
+ CC?=gcc
+ CFLAGS?=-O2 -g -Wall
+-LDFLAGS=$(LIBS)
++LDFLAGS+=$(LIBS)
+
+ ifeq ($(USE_GEOIP),yes)
+ ifeq ($(USE_DYN_GEOIP),yes)
+--
+2.15.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc_0.2.2.bb b/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc_0.2.2.bb
new file mode 100644
index 000000000..b45642404
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipcalc/ipcalc_0.2.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool to assist in network address calculations for IPv4 and IPv6."
+HOMEPAGE = "https://github.com/nmav/ipcalc"
+
+SECTION = "net"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+S = "${WORKDIR}/git"
+SRCREV = "8348808a7869ca8f25a5b5deeaa418c2f6d52758"
+SRC_URI = "\
+ git://github.com/nmav/ipcalc.git;protocol=https; \
+ file://0001-Makefile-pass-extra-linker-flags.patch \
+"
+
+export USE_GEOIP = "no"
+
+do_install() {
+ install -d ${D}/${bindir}
+ install -m 0755 ${S}/ipcalc ${D}/${bindir}
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-build-with-clang.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-build-with-clang.patch
new file mode 100644
index 000000000..5c0914745
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-build-with-clang.patch
@@ -0,0 +1,115 @@
+From 9135ca401186fb14e5e5110bbb04d1ccc480360a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 15 Nov 2016 04:15:44 +0000
+Subject: [PATCH] Fix build with clang
+
+Fixes for following errors found by clang
+
+src/racoon/eaytest.c:316:6: error: comparison of array 'dnstr_w1' not equal to a null pointer is always true
+ [-Werror,-Wtautological-pointer-compare]
+ if (dnstr_w1 != NULL) {
+ ^~~~~~~~ ~~~~
+src/racoon/eaytest.c:326:6: error: comparison of array 'dnstr_w1' not equal to a null pointer is always true
+ [-Werror,-Wtautological-pointer-compare]
+ if (dnstr_w1 != NULL) {
+ ^~~~~~~~ ~~~~
+
+src/racoon/isakmp.c:1134:11: error: promoted type 'int' of K&R function parameter is not compatible with the
+ parameter type 'u_int8_t' (aka 'unsigned char') declared in a previous prototype [-Werror,-Wknr-promoted-parameter]
+ u_int8_t etype;
+ ^
+src/racoon/isakmp.c:184:48: note: previous declaration is here
+ struct sockaddr *, struct sockaddr *, u_int8_t));
+ ^
+ 1 error generated.
+
+src/racoon/racoonctl.c:1457:15: error: incompatible pointer types passing 'struct evt_async *' to parameter of type
+ 'caddr_t' (aka 'char *') [-Werror,-Wincompatible-pointer-types]
+ print_cfg(ec, len);
+ ^~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/racoon/eaytest.c | 4 ++--
+ src/racoon/isakmp.c | 10 +++++-----
+ src/racoon/racoonctl.c | 7 +++----
+ 3 files changed, 10 insertions(+), 11 deletions(-)
+
+diff --git a/src/racoon/eaytest.c b/src/racoon/eaytest.c
+index 1474bdc..d609e4f 100644
+--- a/src/racoon/eaytest.c
++++ b/src/racoon/eaytest.c
+@@ -313,7 +313,7 @@ certtest(ac, av)
+
+ printf("exact match: succeed.\n");
+
+- if (dnstr_w1 != NULL) {
++ if (dnstr_w1[0] != '\0') {
+ asn1dn = eay_str2asn1dn(dnstr_w1, strlen(dnstr_w1));
+ if (asn1dn == NULL || asn1dn->l == asn1dn0.l)
+ errx(1, "asn1dn length wrong for wildcard 1\n");
+@@ -323,7 +323,7 @@ certtest(ac, av)
+ printf("wildcard 1 match: succeed.\n");
+ }
+
+- if (dnstr_w1 != NULL) {
++ if (dnstr_w1[0] != '\0') {
+ asn1dn = eay_str2asn1dn(dnstr_w2, strlen(dnstr_w2));
+ if (asn1dn == NULL || asn1dn->l == asn1dn0.l)
+ errx(1, "asn1dn length wrong for wildcard 2\n");
+diff --git a/src/racoon/isakmp.c b/src/racoon/isakmp.c
+index 2672f7a..da7ebe8 100644
+--- a/src/racoon/isakmp.c
++++ b/src/racoon/isakmp.c
+@@ -567,7 +567,7 @@ isakmp_main(msg, remote, local)
+
+ /* it must be responder's 1st exchange. */
+ if (isakmp_ph1begin_r(msg, remote, local,
+- isakmp->etype) < 0)
++ (u_int8_t)isakmp->etype) < 0)
+ return -1;
+ break;
+
+@@ -1128,10 +1128,10 @@ isakmp_ph1begin_i(rmconf, remote, local)
+
+ /* new negotiation of phase 1 for responder */
+ static int
+-isakmp_ph1begin_r(msg, remote, local, etype)
+- vchar_t *msg;
+- struct sockaddr *remote, *local;
+- u_int8_t etype;
++isakmp_ph1begin_r(vchar_t *msg,
++ struct sockaddr *remote,
++ struct sockaddr *local,
++ u_int8_t etype)
+ {
+ struct isakmp *isakmp = (struct isakmp *)msg->v;
+ struct ph1handle *iph1;
+diff --git a/src/racoon/racoonctl.c b/src/racoon/racoonctl.c
+index da28ecd..bbf068e 100644
+--- a/src/racoon/racoonctl.c
++++ b/src/racoon/racoonctl.c
+@@ -1299,9 +1299,8 @@ print_evt(evtdump)
+ * Print ISAKMP mode config info (IP and banner)
+ */
+ void
+-print_cfg(buf, len)
+- caddr_t buf;
+- int len;
++print_cfg(caddr_t buf,
++ int len)
+ {
+ struct evt_async *evtdump = (struct evt_async *)buf;
+ struct isakmp_data *attr;
+@@ -1454,7 +1453,7 @@ handle_recv(combuf)
+ else if (evt_quit_event == ec->ec_type) {
+ switch (ec->ec_type) {
+ case EVT_PHASE1_MODE_CFG:
+- print_cfg(ec, len);
++ print_cfg((caddr_t)ec, len);
+ break;
+ default:
+ print_evt(ec);
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch
new file mode 100644
index 000000000..630ecdb5f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-header-issues-found-with-musl-libc.patch
@@ -0,0 +1,249 @@
+From 7d9585be093c9cb2428b373c0b0088bb778942d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 Mar 2017 21:37:47 -0700
+Subject: [PATCH] Fix header issues found with musl libc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/libipsec/ipsec_strerror.h | 3 +++
+ src/libipsec/libpfkey.h | 4 +++-
+ src/racoon/admin.c | 2 +-
+ src/racoon/backupsa.c | 6 +++---
+ src/racoon/cftoken.l | 4 ++++
+ src/racoon/logger.h | 3 +++
+ src/racoon/misc.h | 3 +++
+ src/racoon/missing/crypto/sha2/sha2.h | 3 +++
+ src/racoon/netdb_dnssec.h | 3 +++
+ src/racoon/pfkey.c | 1 -
+ src/racoon/plog.h | 2 ++
+ src/racoon/str2val.h | 3 +++
+ src/racoon/vmbuf.h | 3 +++
+ src/setkey/extern.h | 3 ++-
+ src/setkey/setkey.c | 1 -
+ 15 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/src/libipsec/ipsec_strerror.h b/src/libipsec/ipsec_strerror.h
+index 2b4264f..dac66a1 100644
+--- a/src/libipsec/ipsec_strerror.h
++++ b/src/libipsec/ipsec_strerror.h
+@@ -34,6 +34,9 @@
+ #ifndef _IPSEC_STRERROR_H
+ #define _IPSEC_STRERROR_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ extern int __ipsec_errcode;
+ extern void __ipsec_set_strerror __P((const char *));
+
+diff --git a/src/libipsec/libpfkey.h b/src/libipsec/libpfkey.h
+index 61d2f2a..f7991b7 100644
+--- a/src/libipsec/libpfkey.h
++++ b/src/libipsec/libpfkey.h
+@@ -34,6 +34,9 @@
+ #ifndef _LIBPFKEY_H
+ #define _LIBPFKEY_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ #ifndef KAME_LIBPFKEY_H
+ #define KAME_LIBPFKEY_H
+
+@@ -43,7 +46,6 @@
+
+ #define PRIORITY_OFFSET_POSITIVE_MAX 0x3fffffff
+ #define PRIORITY_OFFSET_NEGATIVE_MAX 0x40000000
+-
+ struct sadb_msg;
+ extern void pfkey_sadump __P((struct sadb_msg *));
+ extern void pfkey_sadump_withports __P((struct sadb_msg *));
+diff --git a/src/racoon/admin.c b/src/racoon/admin.c
+index 4b1875b..03ea3f8 100644
+--- a/src/racoon/admin.c
++++ b/src/racoon/admin.c
+@@ -36,7 +36,6 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
+-#include <sys/signal.h>
+ #include <sys/stat.h>
+ #include <sys/un.h>
+
+@@ -46,6 +45,7 @@
+ #include PATH_IPSEC_H
+
+
++#include <signal.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+diff --git a/src/racoon/backupsa.c b/src/racoon/backupsa.c
+index 82d74ca..95307ca 100644
+--- a/src/racoon/backupsa.c
++++ b/src/racoon/backupsa.c
+@@ -276,9 +276,9 @@ do { \
+ GETNEXTNUM(sa_args.a_keylen, strtoul);
+ GETNEXTNUM(sa_args.flags, strtoul);
+ GETNEXTNUM(sa_args.l_alloc, strtoul);
+- GETNEXTNUM(sa_args.l_bytes, strtouq);
+- GETNEXTNUM(sa_args.l_addtime, strtouq);
+- GETNEXTNUM(sa_args.l_usetime, strtouq);
++ GETNEXTNUM(sa_args.l_bytes, strtoull);
++ GETNEXTNUM(sa_args.l_addtime, strtoull);
++ GETNEXTNUM(sa_args.l_usetime, strtoull);
+ GETNEXTNUM(sa_args.seq, strtoul);
+
+ #undef GETNEXTNUM
+diff --git a/src/racoon/cftoken.l b/src/racoon/cftoken.l
+index 1701922..787f4a9 100644
+--- a/src/racoon/cftoken.l
++++ b/src/racoon/cftoken.l
+@@ -77,6 +77,10 @@
+
+ #include "cfparse.h"
+
++#ifndef GLOB_TILDE
++#define GLOB_TILDE 0
++#endif
++
+ int yyerrorcount = 0;
+
+ #if defined(YIPS_DEBUG)
+diff --git a/src/racoon/logger.h b/src/racoon/logger.h
+index 3fd3e94..67af5f0 100644
+--- a/src/racoon/logger.h
++++ b/src/racoon/logger.h
+@@ -34,6 +34,9 @@
+ #ifndef _LOGGER_H
+ #define _LOGGER_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ struct log {
+ int head;
+ int siz;
+diff --git a/src/racoon/misc.h b/src/racoon/misc.h
+index 3e758d9..30d9825 100644
+--- a/src/racoon/misc.h
++++ b/src/racoon/misc.h
+@@ -34,6 +34,9 @@
+ #ifndef _MISC_H
+ #define _MISC_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ #define BIT2STR(b) bit2str(b, sizeof(b)<<3)
+
+ #ifdef HAVE_FUNC_MACRO
+diff --git a/src/racoon/missing/crypto/sha2/sha2.h b/src/racoon/missing/crypto/sha2/sha2.h
+index 42bcc2a..c043dfe 100644
+--- a/src/racoon/missing/crypto/sha2/sha2.h
++++ b/src/racoon/missing/crypto/sha2/sha2.h
+@@ -40,6 +40,9 @@
+ #ifndef __SHA2_H__
+ #define __SHA2_H__
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+diff --git a/src/racoon/netdb_dnssec.h b/src/racoon/netdb_dnssec.h
+index a11209d..98fd813 100644
+--- a/src/racoon/netdb_dnssec.h
++++ b/src/racoon/netdb_dnssec.h
+@@ -34,6 +34,9 @@
+ #ifndef _NETDB_DNSSEC_H
+ #define _NETDB_DNSSEC_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ #ifndef T_CERT
+ #define T_CERT 37 /* defined by RFC2538 section 2 */
+ #endif
+diff --git a/src/racoon/pfkey.c b/src/racoon/pfkey.c
+index 8f26c19..a06c30e 100644
+--- a/src/racoon/pfkey.c
++++ b/src/racoon/pfkey.c
+@@ -59,7 +59,6 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <sys/queue.h>
+-#include <sys/sysctl.h>
+
+ #include <net/route.h>
+ #include <net/pfkeyv2.h>
+diff --git a/src/racoon/plog.h b/src/racoon/plog.h
+index ed43c8b..920c850 100644
+--- a/src/racoon/plog.h
++++ b/src/racoon/plog.h
+@@ -34,6 +34,8 @@
+ #ifndef _PLOG_H
+ #define _PLOG_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
+ #ifdef HAVE_STDARG_H
+ #include <stdarg.h>
+ #else
+diff --git a/src/racoon/str2val.h b/src/racoon/str2val.h
+index 4a7cec1..d3d698e 100644
+--- a/src/racoon/str2val.h
++++ b/src/racoon/str2val.h
+@@ -34,6 +34,9 @@
+ #ifndef _STR2VAL_H
+ #define _STR2VAL_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ extern caddr_t val2str __P((const char *, size_t));
+ extern char *str2val __P((const char *, int, size_t *));
+
+diff --git a/src/racoon/vmbuf.h b/src/racoon/vmbuf.h
+index 3f2f4ea..8287a00 100644
+--- a/src/racoon/vmbuf.h
++++ b/src/racoon/vmbuf.h
+@@ -34,6 +34,9 @@
+ #ifndef _VMBUF_H
+ #define _VMBUF_H
+
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
++
+ /*
+ * bp v
+ * v v
+diff --git a/src/setkey/extern.h b/src/setkey/extern.h
+index 6f439fa..a1d9d14 100644
+--- a/src/setkey/extern.h
++++ b/src/setkey/extern.h
+@@ -1,6 +1,7 @@
+ /* $NetBSD: extern.h,v 1.5 2009/03/06 11:45:03 tteras Exp $ */
+
+-
++#undef __P
++#define __P(protos) protos /* ANSI C prototypes */
+
+ void parse_init __P((void));
+ int parse __P((FILE **));
+diff --git a/src/setkey/setkey.c b/src/setkey/setkey.c
+index c400faa..51f8b75 100644
+--- a/src/setkey/setkey.c
++++ b/src/setkey/setkey.c
+@@ -40,7 +40,6 @@
+ #include <sys/socket.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+-#include <sys/sysctl.h>
+ #include <err.h>
+ #include <netinet/in.h>
+ #include <net/pfkeyv2.h>
+--
+2.12.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch
@@ -0,0 +1,33 @@
+From 738a9857be9c92ad2f70be88ccee238e3154a936 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe.macdonald@windriver.com>
+Date: Wed, 2 Oct 2013 14:20:37 -0400
+Subject: [PATCH] racoon/pfkey: avoid potential null-pointer dereference
+
+Building with -Werror=maybe-uninitialized revealed that 'remote' from
+pk_recvmigrate() could be used with uninitialized data in
+migrate_sp_ike_addresses(). Ensure it is always at a minimum assigned
+NULL.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
+---
+ src/racoon/pfkey.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/racoon/pfkey.c b/src/racoon/pfkey.c
+index d00b166..e0dc1db 100644
+--- a/src/racoon/pfkey.c
++++ b/src/racoon/pfkey.c
+@@ -3352,7 +3352,7 @@ pk_recvmigrate(mhp)
+ struct sockaddr *old_saddr, *new_saddr;
+ struct sockaddr *old_daddr, *new_daddr;
+ struct sockaddr *old_local, *old_remote;
+- struct sockaddr *local, *remote;
++ struct sockaddr *local, *remote = NULL;
+ struct sadb_x_kmaddress *kmaddr;
+ struct sadb_x_policy *xpl;
+ struct sadb_x_ipsecrequest *xisr_list;
+--
+1.7.9.5
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch
@@ -0,0 +1,87 @@
+From e48b9097dce7bc2bfbb9e9c542124d3b5cebab39 Mon Sep 17 00:00:00 2001
+From: Paul Barker <paul@paulbarker.me.uk>
+Date: Wed, 5 Mar 2014 13:39:14 +0000
+Subject: [PATCH] Don't link against libfl
+
+We can remove all references to yywrap by adding "%option noyywrap" statements
+to each flex source file that doesn't override yywrap. After this, we no longer
+need to link against libfl and so no longer get errors about undefined
+references to yylex.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+Upstream-status: Submitted 2014-03-11
+ see http://sourceforge.net/p/ipsec-tools/mailman/ipsec-tools-devel/thread/CANyK_8ewmxGA3vBVJW6s1APXPmxPR%2BDFWZ61EL8pCt288aKQ6w%40mail.gmail.com/#msg32088797
+---
+ src/libipsec/Makefile.am | 1 -
+ src/racoon/Makefile.am | 2 +-
+ src/racoon/cftoken.l | 2 ++
+ src/setkey/Makefile.am | 1 -
+ src/setkey/token.l | 2 ++
+ 5 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/libipsec/Makefile.am b/src/libipsec/Makefile.am
+index 6a4e3b3..df1e106 100644
+--- a/src/libipsec/Makefile.am
++++ b/src/libipsec/Makefile.am
+@@ -26,7 +26,6 @@ libipsec_la_SOURCES = \
+ # version is current:revision:age.
+ # See: http://www.gnu.org/manual/libtool-1.4.2/html_chapter/libtool_6.html#SEC32
+ libipsec_la_LDFLAGS = -version-info 0:1:0
+-libipsec_la_LIBADD = $(LEXLIB)
+
+ noinst_HEADERS = ipsec_strerror.h
+
+diff --git a/src/racoon/Makefile.am b/src/racoon/Makefile.am
+index dbaded9..0662957 100644
+--- a/src/racoon/Makefile.am
++++ b/src/racoon/Makefile.am
+@@ -38,7 +38,7 @@ racoon_SOURCES = \
+ cftoken.l cfparse.y prsa_tok.l prsa_par.y
+ EXTRA_racoon_SOURCES = isakmp_xauth.c isakmp_cfg.c isakmp_unity.c throttle.c \
+ isakmp_frag.c nattraversal.c security.c $(MISSING_ALGOS)
+-racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(LEXLIB) \
++racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) \
+ $(SECCTX_OBJS) vmbuf.o sockmisc.o misc.o ../libipsec/libipsec.la
+ racoon_DEPENDENCIES = \
+ $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(SECCTX_OBJS) \
+diff --git a/src/racoon/cftoken.l b/src/racoon/cftoken.l
+index 490242c..1701922 100644
+--- a/src/racoon/cftoken.l
++++ b/src/racoon/cftoken.l
+@@ -106,6 +106,8 @@ static int incstackp = 0;
+ static int yy_first_time = 1;
+ %}
+
++%option noyywrap
++
+ /* common seciton */
+ nl \n
+ ws [ \t]+
+diff --git a/src/setkey/Makefile.am b/src/setkey/Makefile.am
+index 746c1f1..389e6cf 100644
+--- a/src/setkey/Makefile.am
++++ b/src/setkey/Makefile.am
+@@ -13,7 +13,6 @@ setkey_SOURCES = \
+
+ setkey_LDFLAGS = ../libipsec/libipsec.la
+ setkey_DEPENDENCIES = ../libipsec/libipsec.la
+-setkey_LDADD = $(LEXLIB)
+
+ noinst_HEADERS = vchar.h extern.h
+ man8_MANS = setkey.8
+diff --git a/src/setkey/token.l b/src/setkey/token.l
+index ad3d843..eb23b76 100644
+--- a/src/setkey/token.l
++++ b/src/setkey/token.l
+@@ -88,6 +88,8 @@
+ #endif
+ %}
+
++%option noyywrap
++
+ /* common section */
+ nl \n
+ ws [ \t]+
+--
+1.9.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch
new file mode 100644
index 000000000..e9dd84aaa
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-cfparse-clear-memory-equal-to-size-of-array.patch
@@ -0,0 +1,30 @@
+From a5c59f6a1479947d33dba5191724cc5fc88a614b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Apr 2017 10:39:57 -0700
+Subject: [PATCH 2/2] cfparse: clear memory equal to size of array
+
+Fixes compiler error
+cfparse.y: In function 'set_isakmp_proposal':
+cfparse.y:2567:3: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/racoon/cfparse.y | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/racoon/cfparse.y b/src/racoon/cfparse.y
+index 0d9bd67..5d9c67b 100644
+--- a/src/racoon/cfparse.y
++++ b/src/racoon/cfparse.y
+@@ -2564,7 +2564,7 @@ set_isakmp_proposal(rmconf)
+ plog(LLV_DEBUG2, LOCATION, NULL,
+ "encklen=%d\n", s->encklen);
+
+- memset(types, 0, ARRAYLEN(types));
++ memset(types, 0, sizeof(types));
+ types[algclass_isakmp_enc] = s->algclass[algclass_isakmp_enc];
+ types[algclass_isakmp_hash] = s->algclass[algclass_isakmp_hash];
+ types[algclass_isakmp_dh] = s->algclass[algclass_isakmp_dh];
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch
new file mode 100644
index 000000000..8d270a62b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/configure.patch
@@ -0,0 +1,13 @@
+Index: ipsec-tools-0.8.1/configure.ac
+===================================================================
+--- ipsec-tools-0.8.1.orig/configure.ac 2013-01-08 12:43:29.000000000 +0000
++++ ipsec-tools-0.8.1/configure.ac 2014-07-18 07:51:30.045555880 +0000
+@@ -6,7 +6,7 @@
+ AC_CONFIG_SRCDIR([configure.ac])
+ AC_CONFIG_HEADERS(config.h)
+
+-AM_INIT_AUTOMAKE(dist-bzip2)
++AM_INIT_AUTOMAKE([foreign dist-bzip2])
+
+ AC_ENABLE_SHARED(no)
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2015-4047.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2015-4047.patch
new file mode 100644
index 000000000..5286376ac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2015-4047.patch
@@ -0,0 +1,36 @@
+[PATCH] fix CVE-2015-4047
+
+Upstream-Status: Backport
+
+http://www.openwall.com/lists/oss-security/2015/05/20/1
+
+racoon/gssapi.c in IPsec-Tools 0.8.2 allows remote attackers to cause
+a denial of service (NULL pointer dereference and IKE daemon crash) via
+a series of crafted UDP requests.
+
+https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-4047
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ src/racoon/gssapi.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/racoon/gssapi.c b/src/racoon/gssapi.c
+index e64b201..1ad3b42 100644
+--- a/src/racoon/gssapi.c
++++ b/src/racoon/gssapi.c
+@@ -192,6 +192,11 @@ gssapi_init(struct ph1handle *iph1)
+ gss_name_t princ, canon_princ;
+ OM_uint32 maj_stat, min_stat;
+
++ if (iph1->rmconf == NULL) {
++ plog(LLV_ERROR, LOCATION, NULL, "no remote config\n");
++ return -1;
++ }
++
+ gps = racoon_calloc(1, sizeof (struct gssapi_ph1_state));
+ if (gps == NULL) {
+ plog(LLV_ERROR, LOCATION, NULL, "racoon_calloc failed\n");
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2016-10396.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2016-10396.patch
new file mode 100644
index 000000000..bd0796554
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/fix-CVE-2016-10396.patch
@@ -0,0 +1,207 @@
+Upstream-Status: Backport [https://anonscm.debian.org/cgit/pkg-ipsec-tools/pkg-ipsec-tools.git/plain/debian/patches/CVE-2016-10396.patch?id=62ac12648a4eb7c5ba5dba0f81998d1acf310d8b]
+
+Fix CVE-2016-10396.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+Description: Fix remotely exploitable DoS. http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10396
+Source: vendor; https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=51682
+Bug-debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=867986
+
+Index: pkg-ipsec-tools/src/racoon/isakmp_frag.c
+===================================================================
+--- pkg-ipsec-tools.orig/src/racoon/isakmp_frag.c
++++ pkg-ipsec-tools/src/racoon/isakmp_frag.c
+@@ -1,4 +1,4 @@
+-/* $NetBSD: isakmp_frag.c,v 1.5 2009/04/22 11:24:20 tteras Exp $ */
++/* $NetBSD: isakmp_frag.c,v 1.5.36.1 2017/04/21 16:50:42 bouyer Exp $ */
+
+ /* Id: isakmp_frag.c,v 1.4 2004/11/13 17:31:36 manubsd Exp */
+
+@@ -173,6 +173,43 @@ vendorid_frag_cap(gen)
+ return ntohl(hp[MD5_DIGEST_LENGTH / sizeof(*hp)]);
+ }
+
++static int
++isakmp_frag_insert(struct ph1handle *iph1, struct isakmp_frag_item *item)
++{
++ struct isakmp_frag_item *pitem = NULL;
++ struct isakmp_frag_item *citem = iph1->frag_chain;
++
++ /* no frag yet, just insert at beginning of list */
++ if (iph1->frag_chain == NULL) {
++ iph1->frag_chain = item;
++ return 0;
++ }
++
++ do {
++ /* duplicate fragment number, abort (CVE-2016-10396) */
++ if (citem->frag_num == item->frag_num)
++ return -1;
++
++ /* need to insert before current item */
++ if (citem->frag_num > item->frag_num) {
++ if (pitem != NULL)
++ pitem->frag_next = item;
++ else
++ /* insert at the beginning of the list */
++ iph1->frag_chain = item;
++ item->frag_next = citem;
++ return 0;
++ }
++
++ pitem = citem;
++ citem = citem->frag_next;
++ } while (citem != NULL);
++
++ /* we reached the end of the list, insert */
++ pitem->frag_next = item;
++ return 0;
++}
++
+ int
+ isakmp_frag_extract(iph1, msg)
+ struct ph1handle *iph1;
+@@ -224,39 +261,43 @@ isakmp_frag_extract(iph1, msg)
+ item->frag_next = NULL;
+ item->frag_packet = buf;
+
+- /* Look for the last frag while inserting the new item in the chain */
+- if (item->frag_last)
+- last_frag = item->frag_num;
++ /* Check for the last frag before inserting the new item in the chain */
++ if (item->frag_last) {
++ /* if we have the last fragment, indices must match */
++ if (iph1->frag_last_index != 0 &&
++ item->frag_last != iph1->frag_last_index) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "Repeated last fragment index mismatch\n");
++ racoon_free(item);
++ vfree(buf);
++ return -1;
++ }
+
+- if (iph1->frag_chain == NULL) {
+- iph1->frag_chain = item;
+- } else {
+- struct isakmp_frag_item *current;
++ last_frag = iph1->frag_last_index = item->frag_num;
++ }
+
+- current = iph1->frag_chain;
+- while (current->frag_next) {
+- if (current->frag_last)
+- last_frag = item->frag_num;
+- current = current->frag_next;
+- }
+- current->frag_next = item;
++ /* insert fragment into chain */
++ if (isakmp_frag_insert(iph1, item) == -1) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "Repeated fragment index mismatch\n");
++ racoon_free(item);
++ vfree(buf);
++ return -1;
+ }
+
+- /* If we saw the last frag, check if the chain is complete */
++ /* If we saw the last frag, check if the chain is complete
++ * we have a sorted list now, so just walk through */
+ if (last_frag != 0) {
++ item = iph1->frag_chain;
+ for (i = 1; i <= last_frag; i++) {
+- item = iph1->frag_chain;
+- do {
+- if (item->frag_num == i)
+- break;
+- item = item->frag_next;
+- } while (item != NULL);
+-
++ if (item->frag_num != i)
++ break;
++ item = item->frag_next;
+ if (item == NULL) /* Not found */
+ break;
+ }
+
+- if (item != NULL) /* It is complete */
++ if (i > last_frag) /* It is complete */
+ return 1;
+ }
+
+@@ -291,15 +332,9 @@ isakmp_frag_reassembly(iph1)
+ }
+ data = buf->v;
+
++ item = iph1->frag_chain;
+ for (i = 1; i <= frag_count; i++) {
+- item = iph1->frag_chain;
+- do {
+- if (item->frag_num == i)
+- break;
+- item = item->frag_next;
+- } while (item != NULL);
+-
+- if (item == NULL) {
++ if (item->frag_num != i) {
+ plog(LLV_ERROR, LOCATION, NULL,
+ "Missing fragment #%d\n", i);
+ vfree(buf);
+@@ -308,6 +343,7 @@ isakmp_frag_reassembly(iph1)
+ }
+ memcpy(data, item->frag_packet->v, item->frag_packet->l);
+ data += item->frag_packet->l;
++ item = item->frag_next;
+ }
+
+ out:
+Index: pkg-ipsec-tools/src/racoon/isakmp_inf.c
+===================================================================
+--- pkg-ipsec-tools.orig/src/racoon/isakmp_inf.c
++++ pkg-ipsec-tools/src/racoon/isakmp_inf.c
+@@ -720,6 +720,7 @@ isakmp_info_send_nx(isakmp, remote, loca
+ #endif
+ #ifdef ENABLE_FRAG
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+
+Index: pkg-ipsec-tools/src/racoon/isakmp.c
+===================================================================
+--- pkg-ipsec-tools.orig/src/racoon/isakmp.c
++++ pkg-ipsec-tools/src/racoon/isakmp.c
+@@ -1072,6 +1072,7 @@ isakmp_ph1begin_i(rmconf, remote, local)
+ iph1->frag = 1;
+ else
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+ iph1->approval = NULL;
+@@ -1176,6 +1177,7 @@ isakmp_ph1begin_r(msg, remote, local, et
+ #endif
+ #ifdef ENABLE_FRAG
+ iph1->frag = 0;
++ iph1->frag_last_index = 0;
+ iph1->frag_chain = NULL;
+ #endif
+ iph1->approval = NULL;
+Index: pkg-ipsec-tools/src/racoon/handler.h
+===================================================================
+--- pkg-ipsec-tools.orig/src/racoon/handler.h
++++ pkg-ipsec-tools/src/racoon/handler.h
+@@ -1,4 +1,4 @@
+-/* $NetBSD: handler.h,v 1.25 2010/11/17 10:40:41 tteras Exp $ */
++/* $NetBSD: handler.h,v 1.26 2017/01/24 19:23:56 christos Exp $ */
+
+ /* Id: handler.h,v 1.19 2006/02/25 08:25:12 manubsd Exp */
+
+@@ -141,6 +141,7 @@ struct ph1handle {
+ #endif
+ #ifdef ENABLE_FRAG
+ int frag; /* IKE phase 1 fragmentation */
++ int frag_last_index;
+ struct isakmp_frag_item *frag_chain; /* Received fragments */
+ #endif
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch
new file mode 100644
index 000000000..36efc4917
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/glibc-2.20.patch
@@ -0,0 +1,23 @@
+squahes below warning
+ warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+
+Seen with glibc 2.20
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: ipsec-tools-0.8.2/src/include-glibc/glibc-bugs.h
+===================================================================
+--- ipsec-tools-0.8.2.orig/src/include-glibc/glibc-bugs.h 2006-09-09 09:22:08.000000000 -0700
++++ ipsec-tools-0.8.2/src/include-glibc/glibc-bugs.h 2014-09-03 22:27:22.551563888 -0700
+@@ -4,7 +4,11 @@
+ #define __GLIBC_BUGS_H__ 1
+
+ #define _XOPEN_SOURCE 500
++/* Legacy feature macro.*/
+ #define _BSD_SOURCE
++/* New feature macro that provides everything _BSD_SOURCE and
++ * _SVID_SOURCE provided and possibly more. */
++#define _DEFAULT_SOURCE
+
+ #include <features.h>
+ #include <sys/types.h>
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch b/meta-openembedded/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-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-Resend-UPDATE-message-when-received-EINTR-message.patch
@@ -0,0 +1,220 @@
+racoon: Resend UPDATE message when received EINTR message
+
+Upstream-Status: Pending
+
+While kernel is processing the UPDATE message which is sent from racoon,
+it maybe interrupted by system signal and if this case happens,
+kernel responds with an EINTR message to racoon and kernel fails to
+establish the corresponding SA.
+Fix this problem by resend the UPDATE message when EINTR(Interrupted
+system call) error happens.
+
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+---
+--- a/src/libipsec/libpfkey.h
++++ b/src/libipsec/libpfkey.h
+@@ -92,6 +92,12 @@
+ u_int16_t ctxstrlen; /* length of security context string */
+ };
+
++struct update_msg_info {
++ struct sadb_msg *update_msg;
++ int so;
++ int len;
++};
++
+ /* The options built into libipsec */
+ extern int libipsec_opt;
+ #define LIBIPSEC_OPT_NATT 0x01
+--- a/src/libipsec/pfkey.c
++++ b/src/libipsec/pfkey.c
+@@ -1219,7 +1219,8 @@
+ }
+ #endif
+
+-
++struct update_msg_info update_msg_send = {NULL, 0, 0};
++
+ /* sending SADB_ADD or SADB_UPDATE message to the kernel */
+ static int
+ pfkey_send_x1(struct pfkey_send_sa_args *sa_parms)
+@@ -1483,10 +1484,24 @@
+
+ /* send message */
+ len = pfkey_send(sa_parms->so, newmsg, len);
+- free(newmsg);
+
+- if (len < 0)
+- return -1;
++ if (newmsg->sadb_msg_type == SADB_UPDATE) {
++ if (update_msg_send.update_msg)
++ free(update_msg_send.update_msg);
++ update_msg_send.update_msg = newmsg;
++ update_msg_send.so = sa_parms->so;
++ update_msg_send.len = len;
++
++ if (len < 0) {
++ free(update_msg_send.update_msg);
++ update_msg_send.update_msg = NULL;
++ return -1;
++ }
++ } else {
++ free(newmsg);
++ if (len < 0)
++ return -1;
++ }
+
+ __ipsec_errcode = EIPSEC_NO_ERROR;
+ return len;
+--- a/src/racoon/session.c
++++ b/src/racoon/session.c
+@@ -100,6 +100,8 @@
+
+ #include "sainfo.h"
+
++extern struct update_msg_info update_msg_send;
++
+ struct fd_monitor {
+ int (*callback)(void *ctx, int fd);
+ void *ctx;
+@@ -348,6 +350,11 @@
+ close_sockets();
+ backupsa_clean();
+
++ if (update_msg_send.update_msg) {
++ free(update_msg_send.update_msg);
++ update_msg_send.update_msg = NULL;
++ }
++
+ plog(LLV_INFO, LOCATION, NULL, "racoon process %d shutdown\n", getpid());
+
+ exit(0);
+--- a/src/racoon/pfkey.c
++++ b/src/racoon/pfkey.c
+@@ -103,10 +103,12 @@
+ #include "crypto_openssl.h"
+ #include "grabmyaddr.h"
++#include "../libipsec/libpfkey.h"
+
+ #if defined(SADB_X_EALG_RIJNDAELCBC) && !defined(SADB_X_EALG_AESCBC)
+ #define SADB_X_EALG_AESCBC SADB_X_EALG_RIJNDAELCBC
+ #endif
+
++extern struct update_msg_info update_msg_send;
+ /* prototype */
+ static u_int ipsecdoi2pfkey_aalg __P((u_int));
+ static u_int ipsecdoi2pfkey_ealg __P((u_int));
+@@ -253,6 +255,13 @@
+ s_pfkey_type(msg->sadb_msg_type),
+ strerror(msg->sadb_msg_errno));
+
++ if (msg->sadb_msg_errno == EINTR &&
++ update_msg_send.update_msg) {
++ plog(LLV_DEBUG, LOCATION, NULL,
++ "pfkey update resend\n");
++ send(update_msg_send.so, (void *)update_msg_send.update_msg, (socklen_t)update_msg_send.len, 0);
++ }
++
+ goto end;
+ }
+
+@@ -498,6 +507,11 @@
+ {
+ flushsp();
+
++ if (update_msg_send.update_msg) {
++ free(update_msg_send.update_msg);
++ update_msg_send.update_msg = NULL;
++ }
++
+ if (pfkey_send_spddump(lcconf->sock_pfkey) < 0) {
+ plog(LLV_ERROR, LOCATION, NULL,
+ "libipsec sending spddump failed: %s\n",
+@@ -1295,6 +1309,8 @@
+ return 0;
+ }
+
++int update_received = 0;
++
+ static int
+ pk_recvupdate(mhp)
+ caddr_t *mhp;
+@@ -1307,6 +1323,13 @@
+ int incomplete = 0;
+ struct saproto *pr;
+
++ update_received = 1;
++
++ if (update_msg_send.update_msg) {
++ free(update_msg_send.update_msg);
++ update_msg_send.update_msg = NULL;
++ }
++
+ /* ignore this message because of local test mode. */
+ if (f_local)
+ return 0;
+@@ -4163,3 +4186,8 @@
+
+ return buf;
+ }
++
++int receive_from_isakmp()
++{
++ return pfkey_handler(NULL, lcconf->sock_pfkey);
++}
+--- a/src/racoon/pfkey.h
++++ b/src/racoon/pfkey.h
+@@ -71,5 +71,6 @@
+ extern u_int32_t pk_getseq __P((void));
+ extern const char *sadbsecas2str
+ __P((struct sockaddr *, struct sockaddr *, int, u_int32_t, int));
++extern int receive_from_isakmp __P((void));
+
+ #endif /* _PFKEY_H */
+--- a/src/racoon/isakmp_quick.c
++++ b/src/racoon/isakmp_quick.c
+@@ -774,6 +774,8 @@
+ return error;
+ }
+
++extern int update_received;
++
+ /*
+ * send to responder
+ * HDR*, HASH(3)
+@@ -892,6 +894,11 @@
+ }
+ plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n");
+
++ while (!update_received)
++ receive_from_isakmp();
++
++ update_received = 0;
++
+ /* Do ADD for responder */
+ if (pk_sendadd(iph2) < 0) {
+ plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n");
+@@ -1035,6 +1042,11 @@
+ }
+ plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n");
+
++ while (!update_received)
++ receive_from_isakmp();
++
++ update_received = 0;
++
+ /* Do ADD for responder */
+ if (pk_sendadd(iph2) < 0) {
+ plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n");
+@@ -1989,6 +2001,11 @@
+ }
+ plog(LLV_DEBUG, LOCATION, NULL, "pfkey update sent.\n");
+
++ while (!update_received)
++ receive_from_isakmp();
++
++ update_received = 0;
++
+ /* Do ADD for responder */
+ if (pk_sendadd(iph2) < 0) {
+ plog(LLV_ERROR, LOCATION, NULL, "pfkey add failed.\n");
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch
new file mode 100644
index 000000000..e272bc20f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-ivm.patch
@@ -0,0 +1,26 @@
+Subject: [PATCH] ipsec-tools: racoon: check several invalid ivm
+
+Upstream-Status: Pending
+
+Add checking for invalid ivm, or it will crash racoon.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ isakmp_cfg.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff -urpN a/src/racoon/isakmp_cfg.c b/src/racoon/isakmp_cfg.c
+--- a/src/racoon/isakmp_cfg.c
++++ b/src/racoon/isakmp_cfg.c
+@@ -171,6 +171,11 @@ isakmp_cfg_r(iph1, msg)
+ iph1->mode_cfg->last_msgid != packet->msgid )
+ iph1->mode_cfg->ivm =
+ isakmp_cfg_newiv(iph1, packet->msgid);
++ if(iph1->mode_cfg->ivm == NULL) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "failed to create new IV\n");
++ return;
++ }
+ ivm = iph1->mode_cfg->ivm;
+
+ dmsg = oakley_do_decrypt(iph1, msg, ivm->iv, ivm->ive);
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch
new file mode 100644
index 000000000..de1bdb407
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon-check-invalid-pointers.patch
@@ -0,0 +1,61 @@
+Subject: [PATCH] ipsec-tools: racoon: check several invalid pointers
+
+Upstream-Status: Pending
+
+Add checking for invalid pointers, or it will crash racoon.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ ipsec_doi.c | 5 +++--
+ isakmp_cfg.c | 7 +++++++
+ isakmp_quick.c | 6 ++++--
+ 3 files changed, 14 insertions(+), 4 deletions(-)
+
+diff -urpN a/src/racoon/ipsec_doi.c b/src/racoon/ipsec_doi.c
+--- a/src/racoon/ipsec_doi.c
++++ b/src/racoon/ipsec_doi.c
+@@ -3374,8 +3374,9 @@ ipsecdoi_chkcmpids( idt, ids, exact )
+
+ /* handle wildcard IDs */
+
+- if (idt == NULL || ids == NULL)
+- {
++ if (idt == NULL || ids == NULL ||
++ idt->v == NULL || idt->l == 0 ||
++ ids->v == NULL || ids->l == 0) {
+ if( !exact )
+ {
+ plog(LLV_DEBUG, LOCATION, NULL,
+diff -urpN a/src/racoon/isakmp_cfg.c b/src/racoon/isakmp_cfg.c
+--- a/src/racoon/isakmp_cfg.c
++++ b/src/racoon/isakmp_cfg.c
+@@ -1138,6 +1138,13 @@ isakmp_cfg_newiv(iph1, msgid)
+ return NULL;
+ }
+
++ if (iph1->ivm == NULL || iph1->ivm->iv == NULL ||
++ iph1->ivm->iv->v == NULL || iph1->ivm->iv->l == 0) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "isakmp_cfg_newiv called with invalid IV management\n");
++ return NULL;
++ }
++
+ if (ics->ivm != NULL)
+ oakley_delivm(ics->ivm);
+
+diff -urpN a/src/racoon/isakmp_quick.c b/src/racoon/isakmp_quick.c
+--- a/src/racoon/isakmp_quick.c
++++ b/src/racoon/isakmp_quick.c
+@@ -2243,8 +2243,10 @@ get_proposal_r(iph2)
+ int error = ISAKMP_INTERNAL_ERROR;
+
+ /* check the existence of ID payload */
+- if ((iph2->id_p != NULL && iph2->id == NULL)
+- || (iph2->id_p == NULL && iph2->id != NULL)) {
++ if ((iph2->id_p != NULL &&
++ (iph2->id == NULL || iph2->id->v == NULL || iph2->id->l == 0)) ||
++ (iph2->id != NULL &&
++ (iph2->id_p == NULL || iph2->id_p->v == NULL || iph2->id_p->l == 0))) {
+ plog(LLV_ERROR, LOCATION, NULL,
+ "Both IDs wasn't found in payload.\n");
+ return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf
new file mode 100644
index 000000000..6b507508b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf
@@ -0,0 +1,8 @@
+# Defaults for racoon service
+# sourced by racoon.service
+# installed at /etc/default/racoon by the maintainer scripts
+#
+# This is a POSIX shell fragment
+#
+# Arguments to pass to racoon
+RACOON_ARGS=""
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample
new file mode 100644
index 000000000..2948a4a35
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.conf.sample
@@ -0,0 +1,40 @@
+#
+# NOTE: This file will not be used if you use racoon-tool(8) to manage your
+# IPsec connections. racoon-tool will process racoon-tool.conf(5) and
+# generate a configuration (/var/lib/racoon/racoon.conf) and use it, instead
+# of this file.
+#
+# Simple racoon.conf
+#
+#
+# Please look in /usr/share/doc/racoon/examples for
+# examples that come with the source.
+#
+# Please read racoon.conf(5) for details, and alsoread setkey(8).
+#
+#
+# Also read the Linux IPSEC Howto up at
+# http://www.ipsec-howto.org/t1.html
+#
+log notify;
+path pre_shared_key "/etc/racoon/psk.txt";
+path certificate "/etc/racoon/certs";
+
+#remote 172.31.1.1 {
+# exchange_mode main,aggressive;
+# proposal {
+# encryption_algorithm 3des;
+# hash_algorithm sha1;
+# authentication_method pre_shared_key;
+# dh_group modp1024;
+# }
+# generate_policy off;
+#}
+#
+#sainfo address 192.168.203.10[any] any address 192.168.22.0/24[any] any {
+# pfs_group modp768;
+# encryption_algorithm 3des;
+# authentication_algorithm hmac_md5;
+# compression_algorithm deflate;
+#}
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service
new file mode 100644
index 000000000..a10e77027
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoon.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Racoon IKEv1 key management daemon for IPSEC
+After=syslog.target network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/default/racoon
+ExecStart=@SBINDIR@/racoon $RACOON_ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb
new file mode 100644
index 000000000..5cbeb15ad
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.2.bb
@@ -0,0 +1,96 @@
+DESCRIPTION = "IPsec-Tools is a port of KAME's IPsec utilities to the \
+Linux-2.6 IPsec implementation."
+HOMEPAGE = "http://ipsec-tools.sourceforge.net/"
+SECTION = "net"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://src/libipsec/pfkey.c;beginline=6;endline=31;md5=bc9b7ff40beff19fe6bc6aef26bd2b24"
+
+DEPENDS = "virtual/kernel openssl readline flex-native bison-native"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "http://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV}.tar.bz2 \
+ file://0002-Don-t-link-against-libfl.patch \
+ file://configure.patch \
+ file://0001-racoon-pfkey-avoid-potential-null-pointer-dereferenc.patch \
+ file://racoon-check-invalid-pointers.patch \
+ file://racoon-check-invalid-ivm.patch \
+ file://glibc-2.20.patch \
+ file://racoon-Resend-UPDATE-message-when-received-EINTR-message.patch \
+ file://racoon.conf.sample \
+ file://racoon.conf \
+ file://racoon.service \
+ file://fix-CVE-2015-4047.patch \
+ file://0001-Fix-build-with-clang.patch \
+ file://0001-Fix-header-issues-found-with-musl-libc.patch \
+ file://0002-cfparse-clear-memory-equal-to-size-of-array.patch \
+ file://fix-CVE-2016-10396.patch \
+ "
+SRC_URI[md5sum] = "d53ec14a0a3ece64e09e5e34b3350b41"
+SRC_URI[sha256sum] = "8eb6b38716e2f3a8a72f1f549c9444c2bc28d52c9536792690564c74fe722f2d"
+
+inherit autotools systemd
+
+# Options:
+# --enable-adminport enable admin port
+# --enable-rc5 enable RC5 encryption (patented)
+# --enable-idea enable IDEA encryption (patented)
+# --enable-gssapi enable GSS-API authentication
+# --enable-hybrid enable hybrid, both mode-cfg and xauth support
+# --enable-frag enable IKE fragmentation payload support
+# --enable-stats enable statistics logging function
+# --enable-dpd enable dead peer detection
+# --enable-samode-unspec enable to use unspecified a mode of SA
+# --disable-ipv6 disable ipv6 support
+# --enable-natt enable NAT-Traversal (yes/no/kernel)
+# --enable-natt-versions=list list of supported NAT-T versions delimited by coma.
+# --with-kernel-headers=/lib/modules/<uname>/build/include
+# where your Linux Kernel headers are installed
+# --with-readline support readline input (yes by default)
+# --with-flex use directiory (default: no)
+# --with-flexlib=<LIB> specify flex library.
+# --with-openssl=DIR specify OpenSSL directory
+# --with-libradius=DIR specify libradius path (like/usr/pkg)
+# --with-libpam=DIR specify libpam path (like/usr/pkg)
+#
+# Note: if you give it the actual kernel headers it won't build, it actually
+# needs to point at the linux-libc-headers version of the kernel headers.
+#
+EXTRA_OECONF = "--with-kernel-headers=${STAGING_INCDIR} \
+ --with-readline \
+ --with-openssl=${STAGING_LIBDIR}/.. \
+ --without-libradius \
+ --disable-security-context \
+ --enable-shared \
+ --enable-dpd \
+ --enable-natt=yes \
+ --sysconfdir=${sysconfdir}/racoon \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6=yes', '', d)}"
+
+# See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530527
+CFLAGS += "-fno-strict-aliasing"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,"
+PACKAGECONFIG[selinux] = "--enable-security-context,--disable-security-context,libselinux,"
+
+SYSTEMD_SERVICE_${PN} = "racoon.service"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/racoon
+ install -m 0644 ${WORKDIR}/racoon.conf.sample ${D}${sysconfdir}/racoon/racoon.conf
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/racoon.service ${D}${systemd_unitdir}/system
+
+ sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/racoon.service
+ sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/racoon.service
+
+ install -d ${D}${sysconfdir}/default/
+ install -m 0644 ${WORKDIR}/racoon.conf ${D}${sysconfdir}/default/racoon
+ fi
+}
+
+FILES_${PN} += "${sysconfdir}/racoon/racoon.conf \
+ ${sysconfdir}/default/racoon"
diff --git a/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch
new file mode 100644
index 000000000..7c3dfe4a8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0001-Modify-the-Makefile-for-cross-compile.patch
@@ -0,0 +1,97 @@
+From 58292175115bae7a4c3600d3022e59ea57213025 Mon Sep 17 00:00:00 2001
+From: Jianchuan Wang <jianchuan.wang@windriver.com>
+Date: Mon, 12 Jan 2015 15:53:23 +0800
+Subject: [PATCH] Modify the Makefile for cross compile.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ Makefile | 23 ++++++-----------------
+ libipvs/Makefile | 3 +--
+ 2 files changed, 7 insertions(+), 19 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index e4e03cc..461c021 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,10 +35,9 @@ ARCH = $(shell uname -m)
+ RPMSOURCEDIR = $(shell rpm --eval '%_sourcedir')
+ RPMSPECDIR = $(shell rpm --eval '%_specdir')
+
+-CC = gcc
+ INCLUDE =
+ SBIN = $(BUILD_ROOT)/sbin
+-MANDIR = usr/man
++MANDIR = usr/share/man
+ MAN = $(BUILD_ROOT)/$(MANDIR)/man8
+ INIT = $(BUILD_ROOT)/etc/rc.d/init.d
+ MKDIR = mkdir
+@@ -62,17 +61,7 @@ RPMBUILD = $(shell \
+ echo "/bin/rpm"; \
+ fi )
+
+-ifeq (,$(FORCE_GETOPT))
+-LIB_SEARCH = /lib64 /usr/lib64 /usr/local/lib64 /lib /usr/lib /usr/local/lib
+-POPT_LIB = $(shell for i in $(LIB_SEARCH); do \
+- if [ -f $$i/libpopt.a ]; then \
+- if nm $$i/libpopt.a | fgrep -q poptGetContext; then \
+- echo "-lpopt"; \
+- break; \
+- fi; \
+- fi; \
+-done)
+-endif
++POPT_LIB = -lpopt
+
+ ifneq (,$(POPT_LIB))
+ POPT_DEFINE = -DHAVE_POPT
+@@ -81,7 +70,7 @@ endif
+ OBJS = ipvsadm.o config_stream.o dynamic_array.o
+ LIBS = $(POPT_LIB)
+ ifneq (0,$(HAVE_NL))
+-LIBS += -lnl
++LIBS += -lnl-3 -lnl-genl-3
+ endif
+ DEFINES = -DVERSION=\"$(VERSION)\" -DSCHEDULERS=\"$(SCHEDULERS)\" \
+ -DPE_LIST=\"$(PE_LIST)\" $(POPT_DEFINE)
+@@ -91,13 +80,13 @@ DEFINES += $(shell if [ ! -f ../ip_vs.h ]; then \
+
+ .PHONY = all clean install dist distclean rpm rpms
+
+-all: libs ipvsadm
++all: ipvsadm
+
+ libs:
+ make -C libipvs
+
+-ipvsadm: $(OBJS) $(STATIC_LIBS)
+- $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
++ipvsadm: $(OBJS) libs
++ $(CC) $(CFLAGS) -o $@ $(OBJS) $(STATIC_LIBS) $(LIBS)
+
+ install: all
+ if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi
+diff --git a/libipvs/Makefile b/libipvs/Makefile
+index a527a7f..b7300ec 100644
+--- a/libipvs/Makefile
++++ b/libipvs/Makefile
+@@ -1,6 +1,5 @@
+ # Makefile for libipvs
+
+-CC = gcc
+ CFLAGS = -Wall -Wunused -Wstrict-prototypes -g -fPIC
+ ifneq (0,$(HAVE_NL))
+ CFLAGS += -DLIBIPVS_USE_NL
+@@ -18,7 +17,7 @@ SHARED_LIB = libipvs.so
+ all: $(STATIC_LIB) $(SHARED_LIB)
+
+ $(STATIC_LIB): libipvs.o ip_vs_nl_policy.o
+- ar rv $@ $^
++ $(AR) rv $@ $^
+
+ $(SHARED_LIB): libipvs.o ip_vs_nl_policy.o
+ $(CC) -shared -Wl,-soname,$@ -o $@ $^
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch
new file mode 100644
index 000000000..7896d6d1e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0002-Replace-nl_handle-to-nl_sock.patch
@@ -0,0 +1,63 @@
+From 2686213259b15df9cf1d969c5a14d62f14cfbaae Mon Sep 17 00:00:00 2001
+From: Jianchuan Wang <jianchuan.wang@windriver.com>
+Date: Thu, 8 Jan 2015 17:37:11 +0800
+Subject: [PATCH 2/2] Replace nl_handle to nl_sock.
+
+The nl_handle was replace with nl_sock in the libnl-3.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ libipvs/libipvs.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
+index a157e18..21a9bfa 100644
+--- a/libipvs/libipvs.c
++++ b/libipvs/libipvs.c
+@@ -32,7 +32,7 @@ static void* ipvs_func = NULL;
+ struct ip_vs_getinfo ipvs_info;
+
+ #ifdef LIBIPVS_USE_NL
+-static struct nl_handle *sock = NULL;
++static struct nl_sock *sock = NULL;
+ static int family, try_nl = 1;
+ #endif
+
+@@ -73,7 +73,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg
+ {
+ int err = EINVAL;
+
+- sock = nl_handle_alloc();
++ sock = nl_socket_alloc();
+ if (!sock) {
+ nlmsg_free(msg);
+ return -1;
+@@ -88,7 +88,7 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg
+
+ /* To test connections and set the family */
+ if (msg == NULL) {
+- nl_handle_destroy(sock);
++ nl_socket_free(sock);
+ sock = NULL;
+ return 0;
+ }
+@@ -104,12 +104,12 @@ int ipvs_nl_send_message(struct nl_msg *msg, nl_recvmsg_msg_cb_t func, void *arg
+
+ nlmsg_free(msg);
+
+- nl_handle_destroy(sock);
++ nl_socket_free(sock);
+
+ return 0;
+
+ fail_genl:
+- nl_handle_destroy(sock);
++ nl_socket_free(sock);
+ sock = NULL;
+ nlmsg_free(msg);
+ errno = err;
+--
+1.8.3.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch
new file mode 100644
index 000000000..800114f2c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/0003-ipvsadm-remove-dependency-on-bash.patch
@@ -0,0 +1,39 @@
+From 2f4cdf70cf92d3a9503d8ff045ba277db40bb4e7 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Monday, 13 Apr 2015 14:12:37 -0400
+Subject: [PATCH] ipvsadm: remove dependency on bash
+
+The save/restore scripts are very simple and don't depend on any BASH
+features at all, so switch the interpreter to /bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ ipvsadm-restore | 2 +-
+ ipvsadm-save | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ipvsadm-restore b/ipvsadm-restore
+index f24e1b3..a9fa8bc 100644
+--- a/ipvsadm-restore
++++ b/ipvsadm-restore
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # ipvsadm-restore - Restore IPVS rules
+ #
+ # A very simple wrapper to restore IPVS rules
+diff --git a/ipvsadm-save b/ipvsadm-save
+index f4d399e..af51638 100644
+--- a/ipvsadm-save
++++ b/ipvsadm-save
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # ipvsadm-save - Save IPVS rules
+ #
+ # A very simple wrapper to save IPVS rules
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/makefile-add-ldflags.patch
new file mode 100644
index 000000000..1bf1eed4c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 461c021..8bc9cde 100644
+--- a/Makefile
++++ b/Makefile
+@@ -86,7 +86,7 @@ libs:
+ make -C libipvs
+
+ ipvsadm: $(OBJS) libs
+- $(CC) $(CFLAGS) -o $@ $(OBJS) $(STATIC_LIBS) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(STATIC_LIBS) $(LIBS)
+
+ install: all
+ if [ ! -d $(SBIN) ]; then $(MKDIR) -p $(SBIN); fi
diff --git a/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb
new file mode 100644
index 000000000..b35a9f4a4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ipvsadm/ipvsadm_1.26.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Linux Virtual Server administration Utility"
+HOMEPAGE = "http://www.linux-vs.org/software/index.html"
+DESCRIPTION = "Ipvsadm is used to set up, maintain or inspect the virtual server \
+table in the Linux kernel. The Linux Virtual Server can be used to \
+build scalable network services based on a cluster of two or more nodes. \
+The active node of the cluster redirects service requests to a \
+collection of server hosts that will actually perform the services. \
+Supported features include two protocols (TCP and UDP), three packet-forwarding \
+methods (NAT, tunneling, and direct routing), and eight load balancing algorithms \
+(round robin, weighted round robin, least-connec-tion, weighted least-connection, \
+locality-based least-connection, locality-based least-connection with replication, \
+destination-hashing, and source-hashing)."
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://README;beginline=40;endline=56;md5=a54cba37b64924aa5008881607942892"
+
+DEPENDS += "libnl popt"
+
+SRC_URI = "http://www.linuxvirtualserver.org/software/kernel-2.6/${BP}.tar.gz \
+ file://0001-Modify-the-Makefile-for-cross-compile.patch \
+ file://0002-Replace-nl_handle-to-nl_sock.patch \
+ file://0003-ipvsadm-remove-dependency-on-bash.patch \
+ file://makefile-add-ldflags.patch \
+"
+
+SRC_URI[md5sum] = "eac3ba3f62cd4dea2da353aeddd353a8"
+SRC_URI[sha256sum] = "6d6c46fecb1c532a892616b4445c73b71730e8790d5630f60269fd9cbee0eb2d"
+
+do_compile() {
+ oe_runmake \
+ CC="${CC} -I${STAGING_INCDIR} -I${STAGING_INCDIR}/libnl3 -L${STAGING_LIBDIR}" \
+ all
+}
+
+do_install() {
+ oe_runmake 'BUILD_ROOT=${D}' install
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/include-topdir.patch b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/include-topdir.patch
new file mode 100644
index 000000000..90c4ce75e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/include-topdir.patch
@@ -0,0 +1,48 @@
+diff -Nurp libesmtp-1.0.6.org/crammd5/Makefile.am libesmtp-1.0.6/crammd5/Makefile.am
+--- libesmtp-1.0.6.org/crammd5/Makefile.am 2010-08-08 23:45:57.000000000 +0800
++++ libesmtp-1.0.6/crammd5/Makefile.am 2014-11-17 11:17:21.663624295 +0800
+@@ -2,7 +2,7 @@
+
+ libdir = @plugindir@
+
+-INCLUDES = -I@srcdir@
++INCLUDES = -I@srcdir@ -I@srcdir@/../
+ AM_CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
+
+ lib_LTLIBRARIES = sasl-cram-md5.la
+diff -Nurp libesmtp-1.0.6.org/login/Makefile.am libesmtp-1.0.6/login/Makefile.am
+--- libesmtp-1.0.6.org/login/Makefile.am 2010-08-08 23:45:56.000000000 +0800
++++ libesmtp-1.0.6/login/Makefile.am 2014-11-17 11:17:54.339623018 +0800
+@@ -2,7 +2,7 @@
+
+ libdir = @plugindir@
+
+-INCLUDES = -I@srcdir@
++INCLUDES = -I@srcdir@ -I@srcdir@/../
+
+ lib_LTLIBRARIES = sasl-login.la
+ AM_CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
+diff -Nurp libesmtp-1.0.6.org/ntlm/Makefile.am libesmtp-1.0.6/ntlm/Makefile.am
+--- libesmtp-1.0.6.org/ntlm/Makefile.am 2010-08-08 23:45:56.000000000 +0800
++++ libesmtp-1.0.6/ntlm/Makefile.am 2014-11-17 11:18:10.551622385 +0800
+@@ -2,7 +2,7 @@
+
+ libdir = @plugindir@
+
+-INCLUDES = -I@srcdir@
++INCLUDES = -I@srcdir@ -I@srcdir@/../
+ AM_CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
+
+ lib_LTLIBRARIES = sasl-ntlm.la
+diff -Nurp libesmtp-1.0.6.org/plain/Makefile.am libesmtp-1.0.6/plain/Makefile.am
+--- libesmtp-1.0.6.org/plain/Makefile.am 2010-08-08 23:45:54.000000000 +0800
++++ libesmtp-1.0.6/plain/Makefile.am 2014-11-17 11:18:33.355621494 +0800
+@@ -2,7 +2,7 @@
+
+ libdir = @plugindir@
+
+-INCLUDES = -I@srcdir@
++INCLUDES = -I@srcdir@ -I@srcdir@/../
+ AM_CFLAGS = @CFLAGS@ @EXTRA_CFLAGS@
+
+ lib_LTLIBRARIES = sasl-plain.la
diff --git a/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/snprintf.patch b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/snprintf.patch
new file mode 100644
index 000000000..d0d203ead
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp/snprintf.patch
@@ -0,0 +1,19 @@
+Use HAVE_WORKING_SNPRINTF to check for snprintf()
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libesmtp-1.0.6/missing.h
+===================================================================
+--- libesmtp-1.0.6.orig/missing.h
++++ libesmtp-1.0.6/missing.h
+@@ -43,7 +43,7 @@ int strncasecmp (const char *a, const ch
+ void *memrchr (const void *a, int c, size_t len);
+ #endif
+
+-#ifndef HAVE_SNPRINTF
++#ifndef HAVE_WORKING_SNPRINTF
+ #include <sys/types.h>
+ int snprintf(char *s, size_t n, const char *format, ...);
+ #endif
diff --git a/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp_1.0.6.bb b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp_1.0.6.bb
new file mode 100644
index 000000000..71c5d940b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libesmtp/libesmtp_1.0.6.bb
@@ -0,0 +1,38 @@
+SUMMARY = "SMTP client library"
+DESCRIPTION = "LibESMTP is a library to manage posting \
+(or submission of) electronic mail using SMTP to a \
+preconfigured Mail Transport Agent (MTA) such as Exim or PostFix."
+HOMEPAGE = "http://www.stafford.uklinux.net/libesmtp/"
+LICENSE = "LGPLv2+"
+SECTION = "libs"
+
+DEPENDS = "openssl"
+
+SRC_URI = "http://www.stafford.uklinux.net/libesmtp/libesmtp-${PV}.tar.bz2 \
+ file://include-topdir.patch \
+ file://snprintf.patch \
+ "
+SRC_URI[md5sum] = "bf3915e627fd8f35524a8fdfeed979c8"
+SRC_URI[sha256sum] = "d0a61a5c52d99fa7ce7d00ed0a07e341dbda67101dbed1ab0cdae3f37db4eb0b"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+inherit autotools binconfig
+
+EXTRA_OECONF = " \
+ --with-auth-plugin-dir=${libdir}/esmtp-plugins \
+ --enable-pthreads \
+ --enable-debug \
+ --enable-etrn \
+ --disable-isoc \
+ --disable-more-warnings \
+ --disable-static \
+"
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS} \
+ ${libdir}/esmtp-plugins/*${SOLIBSDEV}"
+
+FILES_${PN}-dev += "${libdir}/esmtp-plugins/*.la"
+FILES_${PN}-static += "${libdir}/esmtp-plugins/*.a"
+FILES_${PN}-dbg += "${libdir}/esmtp-plugins/.debug/"
diff --git a/meta-openembedded/meta-networking/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch
new file mode 100644
index 000000000..8ab094fa7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/avoid-openldap-unless-wanted.patch
@@ -0,0 +1,13 @@
+--- a/wscript 2015-11-18 12:43:33.000000000 +0100
++++ b/wscript 2015-11-18 12:46:25.000000000 +0100
+@@ -58,9 +58,7 @@
+ if conf.env.standalone_ldb:
+ conf.CHECK_XSLTPROC_MANPAGES()
+
+- # we need this for the ldap backend
+- if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
+- conf.env.ENABLE_LDAP_BACKEND = True
++ conf.env.ENABLE_LDAP_BACKEND = False
+
+ # we don't want any libraries or modules to rely on runtime
+ # resolution of symbols
diff --git a/meta-openembedded/meta-networking/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch
new file mode 100755
index 000000000..fdd312c0a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/do-not-import-target-module-while-cross-compile.patch
@@ -0,0 +1,58 @@
+Some modules such as dynamic library maybe cann't be imported while cross compile,
+we just check whether does the module exist.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+Index: ldb-1.1.26/buildtools/wafsamba/samba_bundled.py
+===================================================================
+--- ldb-1.1.26.orig/buildtools/wafsamba/samba_bundled.py
++++ ldb-1.1.26/buildtools/wafsamba/samba_bundled.py
+@@ -2,6 +2,7 @@
+
+ import sys
+ import Build, Options, Logs
++import imp, os
+ from Configure import conf
+ from samba_utils import TO_LIST
+
+@@ -230,17 +231,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
+ # versions
+ minversion = minimum_library_version(conf, libname, minversion)
+
+- try:
+- m = __import__(modulename)
+- except ImportError:
+- found = False
+- else:
++ # Find module in PYTHONPATH
++ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
++ if stuff:
+ try:
+- version = m.__version__
+- except AttributeError:
++ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
++ except ImportError:
+ found = False
++
++ if conf.env.CROSS_COMPILE:
++ # Some modules such as dynamic library maybe cann't be imported
++ # while cross compile, we just check whether the module exist
++ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
++ found = True
+ else:
+- found = tuplize_version(version) >= tuplize_version(minversion)
++ try:
++ version = m.__version__
++ except AttributeError:
++ found = False
++ else:
++ found = tuplize_version(version) >= tuplize_version(minversion)
++ finally:
++ if stuff[0]:
++ stuff[0].close()
++ else:
++ found = False
++
+ if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
+ Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
+ sys.exit(1)
diff --git a/meta-openembedded/meta-networking/recipes-support/libldb/libldb/options-1.3.1.patch b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/options-1.3.1.patch
new file mode 100644
index 000000000..ffe253b63
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libldb/libldb/options-1.3.1.patch
@@ -0,0 +1,193 @@
+From a4da3ab4d76013aaa731d43d52ccca1ebd37c395 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 21 Sep 2016 10:06:39 +0800
+Subject: [PATCH 1/1] ldb: Add configure options for packages
+
+Add configure options for the following packages:
+ - acl
+ - attr
+ - libaio
+ - libbsd
+ - libcap
+ - valgrind
+
+Upstream-Status: Inappropriate [oe deterministic build specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ lib/replace/system/wscript_configure | 6 ++-
+ lib/replace/wscript | 94 +++++++++++++++++++++++++++---------
+ wscript | 7 +++
+ 3 files changed, 83 insertions(+), 24 deletions(-)
+
+diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure
+index 2035474..10f9ae7 100644
+--- a/lib/replace/system/wscript_configure
++++ b/lib/replace/system/wscript_configure
+@@ -1,6 +1,10 @@
+ #!/usr/bin/env python
+
+-conf.CHECK_HEADERS('sys/capability.h')
++import Options
++
++if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
+
+ # solaris varients of getXXent_r
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 2f94d49..68b2d3a 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -23,6 +23,41 @@ def set_options(opt):
+ opt.PRIVATE_EXTENSION_DEFAULT('')
+ opt.RECURSE('buildtools/wafsamba')
+
++ opt.add_option('--with-acl',
++ help=("Enable use of acl"),
++ action="store_true", dest='enable_acl')
++ opt.add_option('--without-acl',
++ help=("Disable use of acl"),
++ action="store_false", dest='enable_acl', default=False)
++
++ opt.add_option('--with-attr',
++ help=("Enable use of attr"),
++ action="store_true", dest='enable_attr')
++ opt.add_option('--without-attr',
++ help=("Disable use of attr"),
++ action="store_false", dest='enable_attr', default=False)
++
++ opt.add_option('--with-libaio',
++ help=("Enable use of libaio"),
++ action="store_true", dest='enable_libaio')
++ opt.add_option('--without-libaio',
++ help=("Disable use of libaio"),
++ action="store_false", dest='enable_libaio', default=False)
++
++ opt.add_option('--with-libbsd',
++ help=("Enable use of libbsd"),
++ action="store_true", dest='enable_libbsd')
++ opt.add_option('--without-libbsd',
++ help=("Disable use of libbsd"),
++ action="store_false", dest='enable_libbsd', default=False)
++
++ opt.add_option('--with-libcap',
++ help=("Enable use of libcap"),
++ action="store_true", dest='enable_libcap')
++ opt.add_option('--without-libcap',
++ help=("Disable use of libcap"),
++ action="store_false", dest='enable_libcap', default=False)
++
+ @Utils.run_once
+ def configure(conf):
+ conf.RECURSE('buildtools/wafsamba')
+@@ -32,12 +67,25 @@ def configure(conf):
+ conf.DEFINE('HAVE_LIBREPLACE', 1)
+ conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
+
+- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
+- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
++ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
++ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
+ conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
+- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+- conf.CHECK_HEADERS('shadow.h sys/acl.h')
+- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
++ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
++ conf.CHECK_HEADERS('shadow.h')
++ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
++
++ if Options.options.enable_acl:
++ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
++
++ if Options.options.enable_attr:
++ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
++
++ if Options.options.enable_libaio:
++ conf.CHECK_HEADERS('libaio.h')
++
++ if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_HEADERS('port.h')
+ conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
+ conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
+@@ -73,7 +121,9 @@ def configure(conf):
+
+ conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
+
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++ if Options.options.enable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
+ conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+ conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+ conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+@@ -266,22 +316,20 @@ def configure(conf):
+
+ conf.CHECK_FUNCS('prctl dirname basename')
+
+- strlcpy_in_bsd = False
+-
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS('setproctitle_init'):
+- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ if Options.options.enable_libbsd:
++ # libbsd on some platforms provides strlcpy and strlcat
++ if not conf.CHECK_FUNCS('strlcpy strlcat'):
++ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
++ checklibc=True)
++ if not conf.CHECK_FUNCS('getpeereid'):
++ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
++ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS('setproctitle_init'):
++ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
++
++ if not conf.CHECK_FUNCS('closefrom'):
++ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+@@ -632,7 +680,7 @@ removeea setea
+ # look for a method of finding the list of network interfaces
+ for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+ bsd_for_strlcpy = ''
+- if strlcpy_in_bsd:
++ if Options.options.enable_libbsd:
+ bsd_for_strlcpy = ' bsd'
+ if conf.CHECK_CODE('''
+ #define %s 1
+diff --git a/wscript b/wscript
+index 8ae5be3..a178cc4 100644
+--- a/wscript
++++ b/wscript
+@@ -31,6 +31,13 @@ def set_options(opt):
+ opt.RECURSE('lib/replace')
+ opt.tool_options('python') # options for disabling pyc or pyo compilation
+
++ opt.add_option('--with-valgrind',
++ help=("enable use of valgrind"),
++ action="store_true", dest='enable_valgrind')
++ opt.add_option('--without-valgrind',
++ help=("disable use of valgrind"),
++ action="store_false", dest='enable_valgrind', default=False)
++
+ def configure(conf):
+ conf.RECURSE('lib/tdb')
+ conf.RECURSE('lib/tevent')
+--
+2.16.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.3.1.bb b/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.3.1.bb
new file mode 100644
index 000000000..7e14cde35
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libldb/libldb_1.3.1.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://ldb.samba.org"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & LGPL-2.1+ & GPL-3.0+"
+
+DEPENDS += "libtdb libtalloc libtevent popt"
+RDEPENDS_pyldb += "python"
+
+SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
+ file://do-not-import-target-module-while-cross-compile.patch \
+ file://options-1.3.1.patch \
+ "
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[ldap] = ",,openldap"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'ldap', '', 'file://avoid-openldap-unless-wanted.patch', d)}"
+
+LIC_FILES_CHKSUM = "file://pyldb.h;endline=24;md5=dfbd238cecad76957f7f860fbe9adade \
+ file://man/ldb.3.xml;beginline=261;endline=262;md5=137f9fd61040c1505d1aa1019663fd08 \
+ file://tools/ldbdump.c;endline=19;md5=a7d4fc5d1f75676b49df491575a86a42"
+
+SRC_URI[md5sum] = "e5233f202bca27f6ce8474fb8ae65983"
+SRC_URI[sha256sum] = "b19f2c9f55ae0f46aa5ebaea0bf1a47ec1ac135e1d78af0f6318cf50bf62cbd2"
+
+inherit waf-samba
+
+S = "${WORKDIR}/ldb-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+ --disable-rpath-install \
+ --bundled-libraries=cmocka \
+ --builtin-libraries=replace \
+ --with-modulesdir=${libdir}/ldb/modules \
+ --with-privatelibdir=${libdir}/ldb \
+ --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+ "
+
+PACKAGES =+ "pyldb pyldb-dbg pyldb-dev"
+
+NOAUTOPACKAGEDEBUG = "1"
+
+FILES_${PN} += "${libdir}/ldb/*"
+FILES_${PN}-dbg += "${bindir}/.debug/* \
+ ${libdir}/.debug/* \
+ ${libdir}/ldb/.debug/* \
+ ${libdir}/ldb/modules/ldb/.debug/*"
+
+FILES_pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
+ ${libdir}/libpyldb-util.so.* \
+ "
+FILES_pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
+ ${libdir}/.debug/libpyldb-util.so.*"
+FILES_pyldb-dev = "${libdir}/libpyldb-util.so"
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch
new file mode 100644
index 000000000..26b5e250c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-Fix-comparison-types.patch
@@ -0,0 +1,38 @@
+From ed4422979b221c8613ca02eb5c57cb80009366d1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:13:24 -0700
+Subject: [PATCH 1/2] Fix comparison types
+
+Fixes
+error: comparison between pointer and integer ('char *' and 'int')
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ clients/memflush.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/clients/memflush.cc b/clients/memflush.cc
+index 8bd0dbf..71545ea 100644
+--- a/clients/memflush.cc
++++ b/clients/memflush.cc
+@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
+ {
+ options_parse(argc, argv);
+
+- if (opt_servers == false)
++ if (opt_servers == NULL)
+ {
+ char *temp;
+
+@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
+ opt_servers= strdup(temp);
+ }
+
+- if (opt_servers == false)
++ if (opt_servers == NULL)
+ {
+ std::cerr << "No Servers provided" << std::endl;
+ exit(EXIT_FAILURE);
+--
+2.12.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch
new file mode 100644
index 000000000..06febc5b1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0001-configure.ac-Do-not-configure-build-aux.patch
@@ -0,0 +1,28 @@
+From fa0fe001a5373c1ef9ff2175555b14fc07399e1b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:01:44 -0700
+Subject: [PATCH] configure.ac: Do not configure build-aux
+
+Fixes
+configure: error: cannot find install-sh, install.sh, or shtool
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 17b7351..0263112 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -17,7 +17,6 @@ AC_INIT([libmemcached],VERSION_NUMBER,[http://libmemcached.org/])
+ AC_PROG_CC([cc gcc clang])
+ AC_PROG_CXX([c++ g++ clang++])
+
+-AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
+
+ AC_CANONICAL_HOST
+--
+2.12.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch
new file mode 100644
index 000000000..e1e1be8c6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch
@@ -0,0 +1,30 @@
+From e95609e4ae40a794ed198924505fd22d7d86a124 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 18 Mar 2017 10:16:14 -0700
+Subject: [PATCH 2/2] POSIX_SPAWN_USEVFORK is not linux specific but glibc
+ specific
+
+Fixes
+cmdline.cc:206:12: error: use of undeclared identifier 'POSIX_SPAWN_USEVFORK'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libtest/cmdline.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
+index 29a22de..34f0a89 100644
+--- a/libtest/cmdline.cc
++++ b/libtest/cmdline.cc
+@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
+
+ fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+
+-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
++#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
+ // Use USEVFORK on linux
+ flags |= POSIX_SPAWN_USEVFORK;
+ #endif
+--
+2.12.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/files/crosscompile.patch b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/crosscompile.patch
new file mode 100644
index 000000000..63511bff5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/files/crosscompile.patch
@@ -0,0 +1,30 @@
+ libmemcached/backtrace.cc | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- libmemcached-1.0.15.orig/libmemcached/backtrace.cc
++++ libmemcached-1.0.15/libmemcached/backtrace.cc
+@@ -75,10 +75,11 @@ void custom_backtrace(void)
+ {
+ for (int x= 0; x < stack_frames; x++)
+ {
+ bool was_demangled= false;
+
++#if USE_DEMANGLE == 1
+ if (USE_DEMANGLE)
+ {
+ #ifdef HAVE_DLFCN_H
+ Dl_info dlinfo;
+ if (dladdr(backtrace_buffer[x], &dlinfo))
+@@ -107,11 +108,11 @@ void custom_backtrace(void)
+ dlinfo.dli_fname);
+ }
+ }
+ #endif
+ }
+-
++#endif
+ if (was_demangled == false)
+ {
+ fprintf(stderr, "?%d %p in %s\n", x, backtrace_buffer[x], symbollist[x]);
+ }
+ }
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc
new file mode 100644
index 000000000..e86f832f8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached.inc
@@ -0,0 +1,15 @@
+DESCRIPTION = "open source C/C++ client library and tools for the memcached server"
+DEPENDS = "libevent util-linux"
+SECTION = "libdevel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=865490941c91ba790f0ea78dec93bd60"
+
+SRC_URI = "http://launchpad.net/libmemcached/1.0/${PV}/+download/libmemcached-${PV}.tar.gz"
+
+TARGET_LDFLAGS += "-luuid"
+TARGET_CFLAGS += "-D__USE_GNU -D_GNU_SOURCE"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[sasl] = "--enable-sasl,--disable-sasl,cyrus-sasl"
+
+inherit autotools gettext pkgconfig
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb
new file mode 100644
index 000000000..56778c048
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.18.bb
@@ -0,0 +1,10 @@
+require libmemcached.inc
+
+SRC_URI += "\
+ file://crosscompile.patch \
+ file://0001-configure.ac-Do-not-configure-build-aux.patch \
+ file://0001-Fix-comparison-types.patch \
+ file://0002-POSIX_SPAWN_USEVFORK-is-not-linux-specific-but-glibc.patch \
+ "
+SRC_URI[md5sum] = "b3958716b4e53ddc5992e6c49d97e819"
+SRC_URI[sha256sum] = "e22c0bb032fde08f53de9ffbc5a128233041d9f33b5de022c0978a2149885f82"
diff --git a/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb
new file mode 100644
index 000000000..cdf8415ff
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb
@@ -0,0 +1,4 @@
+require libmemcached.inc
+
+SRC_URI[md5sum] = "d59a462a92d296f76bff2d9bc72b2516"
+SRC_URI[sha256sum] = "3efa86c9733eaad55d7119cb16769424e2aa6c22b3392e8f973946fce6678d81"
diff --git a/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch
new file mode 100644
index 000000000..a3ee9ccd9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/avoid-attr-unless-wanted.patch
@@ -0,0 +1,20 @@
+--- a/lib/replace/wscript 2015-11-13 16:04:04.000000000 +0100
++++ b/lib/replace/wscript 2015-11-13 16:23:20.000000000 +0100
+@@ -636,8 +636,6 @@
+ if not bld.CONFIG_SET('HAVE_INET_ATON'): REPLACE_SOURCE += ' inet_aton.c'
+ if not bld.CONFIG_SET('HAVE_INET_NTOP'): REPLACE_SOURCE += ' inet_ntop.c'
+ if not bld.CONFIG_SET('HAVE_INET_PTON'): REPLACE_SOURCE += ' inet_pton.c'
+- if not bld.CONFIG_SET('HAVE_GETXATTR') or bld.CONFIG_SET('XATTR_ADDITIONAL_OPTIONS'):
+- REPLACE_SOURCE += ' xattr.c'
+
+ bld.SAMBA_LIBRARY('replace',
+ source=REPLACE_SOURCE,
+@@ -648,7 +646,7 @@
+ # at the moment:
+ # hide_symbols=bld.BUILTIN_LIBRARY('replace'),
+ private_library=True,
+- deps='crypt dl nsl socket rt attr' + extra_libs)
++ deps='crypt dl nsl socket rt ' + extra_libs)
+
+ bld.SAMBA_SUBSYSTEM('replace-test',
+ source='''test/testsuite.c test/strptime.c
diff --git a/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/options-2.1.10.patch b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/options-2.1.10.patch
new file mode 100644
index 000000000..63f21e775
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc/options-2.1.10.patch
@@ -0,0 +1,184 @@
+From efc1b02144f23fdf84dbc5ff15307815e0f2a425 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 14 Sep 2016 11:11:35 +0800
+Subject: [PATCH] talloc: Add configure options for packages
+
+Add configure options for the following packages:
+ - acl
+ - attr
+ - libaio
+ - libbsd
+ - libcap
+ - valgrind
+
+Upstream-Status: Inappropriate [oe deterministic build specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Modified to apply to version 2.1.10.
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+---
+ lib/replace/system/wscript_configure | 6 ++-
+ lib/replace/wscript | 85 ++++++++++++++++++++++++++++--------
+ wscript | 7 ++-
+ 3 files changed, 79 insertions(+), 19 deletions(-)
+
+Index: talloc-2.1.11/lib/replace/system/wscript_configure
+===================================================================
+--- talloc-2.1.11.orig/lib/replace/system/wscript_configure
++++ talloc-2.1.11/lib/replace/system/wscript_configure
+@@ -1,6 +1,10 @@
+ #!/usr/bin/env python
+
+-conf.CHECK_HEADERS('sys/capability.h')
++import Options
++
++if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
+
+ # solaris varients of getXXent_r
+Index: talloc-2.1.11/lib/replace/wscript
+===================================================================
+--- talloc-2.1.11.orig/lib/replace/wscript
++++ talloc-2.1.11/lib/replace/wscript
+@@ -23,6 +23,41 @@ def set_options(opt):
+ opt.PRIVATE_EXTENSION_DEFAULT('')
+ opt.RECURSE('buildtools/wafsamba')
+
++ opt.add_option('--with-acl',
++ help=("Enable use of acl"),
++ action="store_true", dest='enable_acl')
++ opt.add_option('--without-acl',
++ help=("Disable use of acl"),
++ action="store_false", dest='enable_acl', default=False)
++
++ opt.add_option('--with-attr',
++ help=("Enable use of attr"),
++ action="store_true", dest='enable_attr')
++ opt.add_option('--without-attr',
++ help=("Disable use of attr"),
++ action="store_false", dest='enable_attr', default=False)
++
++ opt.add_option('--with-libaio',
++ help=("Enable use of libaio"),
++ action="store_true", dest='enable_libaio')
++ opt.add_option('--without-libaio',
++ help=("Disable use of libaio"),
++ action="store_false", dest='enable_libaio', default=False)
++
++ opt.add_option('--with-libbsd',
++ help=("Enable use of libbsd"),
++ action="store_true", dest='enable_libbsd')
++ opt.add_option('--without-libbsd',
++ help=("Disable use of libbsd"),
++ action="store_false", dest='enable_libbsd', default=False)
++
++ opt.add_option('--with-libcap',
++ help=("Enable use of libcap"),
++ action="store_true", dest='enable_libcap')
++ opt.add_option('--without-libcap',
++ help=("Disable use of libcap"),
++ action="store_false", dest='enable_libcap', default=False)
++
+ @Utils.run_once
+ def configure(conf):
+ conf.RECURSE('buildtools/wafsamba')
+@@ -32,12 +67,25 @@ def configure(conf):
+ conf.DEFINE('HAVE_LIBREPLACE', 1)
+ conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
+
+- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
+- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
++ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
++ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
+ conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
+- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+- conf.CHECK_HEADERS('shadow.h sys/acl.h')
+- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
++ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
++ conf.CHECK_HEADERS('shadow.h')
++ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
++
++ if Options.options.enable_acl:
++ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
++
++ if Options.options.enable_attr:
++ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
++
++ if Options.options.enable_libaio:
++ conf.CHECK_HEADERS('libaio.h')
++
++ if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_HEADERS('port.h')
+ conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
+ conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
+@@ -73,7 +121,9 @@ def configure(conf):
+
+ conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
+
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++ if Options.options.enable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
+ conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+ conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+ conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+@@ -267,21 +317,21 @@ def configure(conf):
+ conf.CHECK_FUNCS('prctl dirname basename')
+
+ strlcpy_in_bsd = False
+-
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
++ if Options.options.enable_libbsd:
++ # libbsd on some platforms provides strlcpy and strlcat
++ if not conf.CHECK_FUNCS('strlcpy strlcat'):
++ if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+ checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS('setproctitle_init'):
+- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
++ strlcpy_in_bsd = True
++ if not conf.CHECK_FUNCS('getpeereid'):
++ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
++ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS('setproctitle_init'):
++ conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
+
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ if not conf.CHECK_FUNCS('closefrom'):
++ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+Index: talloc-2.1.11/wscript
+===================================================================
+--- talloc-2.1.11.orig/wscript
++++ talloc-2.1.11/wscript
+@@ -32,7 +32,12 @@ def set_options(opt):
+ opt.add_option('--enable-talloc-compat1',
+ help=("Build talloc 1.x.x compat library [False]"),
+ action="store_true", dest='TALLOC_COMPAT1', default=False)
+-
++ opt.add_option('--with-valgrind',
++ help=("enable use of valgrind"),
++ action="store_true", dest='enable_valgrind')
++ opt.add_option('--without-valgrind',
++ help=("disable use of valgrind"),
++ action="store_false", dest='enable_valgrind', default=False)
+
+ def configure(conf):
+ conf.RECURSE('lib/replace')
diff --git a/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.11.bb b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.11.bb
new file mode 100644
index 000000000..848cf4d99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtalloc/libtalloc_2.1.11.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://talloc.samba.org"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & GPL-3.0+"
+LIC_FILES_CHKSUM = "file://talloc.h;beginline=3;endline=27;md5=a301712782cad6dd6d5228bfa7825249 \
+ file://pytalloc.h;beginline=1;endline=18;md5=2c498cc6f2263672483237b20f46b43d"
+
+
+SRC_URI = "https://samba.org/ftp/talloc/talloc-${PV}.tar.gz \
+ file://options-2.1.10.patch \
+"
+SRC_URI[md5sum] = "452596f904ca2b10322bdaabf147a721"
+SRC_URI[sha256sum] = "639eb35556a0af999123c4d883e79be05ff9f00ab4f9e4ac2e5775f9c5eeeed3"
+
+inherit waf-samba
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
+
+S = "${WORKDIR}/talloc-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+ --disable-rpath-install \
+ --bundled-libraries=NONE \
+ --builtin-libraries=replace \
+ --disable-silent-rules \
+ --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+ "
+
+PACKAGES += "pytalloc pytalloc-dbg pytalloc-dev"
+
+FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
+ ${libdir}/libpytalloc-util.so.2 \
+ ${libdir}/libpytalloc-util.so.2.1.1 \
+ "
+FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
+ ${libdir}/.debug/libpytalloc-util.so.2.1.1"
+FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so"
+RDEPENDS_pytalloc = "python"
diff --git a/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/do-not-check-xsltproc-manpages.patch b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/do-not-check-xsltproc-manpages.patch
new file mode 100644
index 000000000..bcc45c9fc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/do-not-check-xsltproc-manpages.patch
@@ -0,0 +1,15 @@
+Don't check manpages for xsltproc.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+--- tdb-1.3.0.orig/wscript 2015-04-22 09:52:32.366000222 +0900
++++ tdb-1.3.0/wscript 2015-04-22 09:51:57.720000205 +0900
+@@ -90,7 +90,7 @@ def configure(conf):
+ not conf.env.disable_tdb_mutex_locking):
+ conf.define('USE_TDB_MUTEX_LOCKING', 1)
+
+- conf.CHECK_XSLTPROC_MANPAGES()
++ conf.find_program('xsltproc', var='XSLTPROC')
+
+ if not conf.env.disable_python:
+ # also disable if we don't have the python libs installed
diff --git a/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/tdb-Add-configure-options-for-packages.patch b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/tdb-Add-configure-options-for-packages.patch
new file mode 100644
index 000000000..272921e56
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb/tdb-Add-configure-options-for-packages.patch
@@ -0,0 +1,184 @@
+From 24911f36bcb00412e5dc4cd11fda139e09d58798 Mon Sep 17 00:00:00 2001
+From: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+Date: Tue, 1 Aug 2017 03:12:09 +0900
+Subject: [PATCH] From 10ac5e5fdda44adcc2a159b6f9a2d51a51361057 Mon Sep 17
+ 00:00:00 2001 From: Jackie Huang <jackie.huang@windriver.com> Date: Wed, 21
+ Sep 2016 10:46:19 +0800 Subject: [PATCH] tdb: Add configure options for
+ packages
+
+Add configure options for the following packages:
+ - acl
+ - attr
+ - libaio
+ - libbsd
+ - libcap
+ - valgrind
+
+Upstream-Status: Inappropriate [oe deterministic build specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Update for libtdb_1.3.14.
+
+Signed-off-by: Huang Qiyu <huangqy.fnst@cn.fujitsu.com>
+---
+ lib/replace/system/wscript_configure | 6 ++-
+ lib/replace/wscript | 85 ++++++++++++++++++++++++++++--------
+ wscript | 7 ++-
+ 3 files changed, 79 insertions(+), 19 deletions(-)
+
+diff --git a/lib/replace/system/wscript_configure b/lib/replace/system/wscript_configure
+index 2035474..10f9ae7 100644
+--- a/lib/replace/system/wscript_configure
++++ b/lib/replace/system/wscript_configure
+@@ -1,6 +1,10 @@
+ #!/usr/bin/env python
+
+-conf.CHECK_HEADERS('sys/capability.h')
++import Options
++
++if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_FUNCS('getpwnam_r getpwuid_r getpwent_r')
+
+ # solaris varients of getXXent_r
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 7c50e1d..15df5c3 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -23,6 +23,41 @@ def set_options(opt):
+ opt.PRIVATE_EXTENSION_DEFAULT('')
+ opt.RECURSE('buildtools/wafsamba')
+
++ opt.add_option('--with-acl',
++ help=("Enable use of acl"),
++ action="store_true", dest='enable_acl')
++ opt.add_option('--without-acl',
++ help=("Disable use of acl"),
++ action="store_false", dest='enable_acl', default=False)
++
++ opt.add_option('--with-attr',
++ help=("Enable use of attr"),
++ action="store_true", dest='enable_attr')
++ opt.add_option('--without-attr',
++ help=("Disable use of attr"),
++ action="store_false", dest='enable_attr', default=False)
++
++ opt.add_option('--with-libaio',
++ help=("Enable use of libaio"),
++ action="store_true", dest='enable_libaio')
++ opt.add_option('--without-libaio',
++ help=("Disable use of libaio"),
++ action="store_false", dest='enable_libaio', default=False)
++
++ opt.add_option('--with-libbsd',
++ help=("Enable use of libbsd"),
++ action="store_true", dest='enable_libbsd')
++ opt.add_option('--without-libbsd',
++ help=("Disable use of libbsd"),
++ action="store_false", dest='enable_libbsd', default=False)
++
++ opt.add_option('--with-libcap',
++ help=("Enable use of libcap"),
++ action="store_true", dest='enable_libcap')
++ opt.add_option('--without-libcap',
++ help=("Disable use of libcap"),
++ action="store_false", dest='enable_libcap', default=False)
++
+ @Utils.run_once
+ def configure(conf):
+ conf.RECURSE('buildtools/wafsamba')
+@@ -32,12 +67,25 @@ def configure(conf):
+ conf.DEFINE('HAVE_LIBREPLACE', 1)
+ conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
+
+- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
+- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
++ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
++ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
+ conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
+- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+- conf.CHECK_HEADERS('shadow.h sys/acl.h')
+- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
++ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
++ conf.CHECK_HEADERS('shadow.h')
++ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
++
++ if Options.options.enable_acl:
++ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
++
++ if Options.options.enable_attr:
++ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
++
++ if Options.options.enable_libaio:
++ conf.CHECK_HEADERS('libaio.h')
++
++ if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_HEADERS('port.h')
+ conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
+ conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
+@@ -73,7 +121,9 @@ def configure(conf):
+
+ conf.CHECK_CODE('', headers='rpc/rpc.h rpcsvc/yp_prot.h', define='HAVE_RPCSVC_YP_PROT_H')
+
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++ if Options.options.enable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++
+ conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+ conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+ conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+@@ -251,17 +301,18 @@ def configure(conf):
+
+ conf.CHECK_FUNCS('prctl dirname basename')
+
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True)
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+-
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ if Options.options.enable_libbsd:
++ # libbsd on some platforms provides strlcpy and strlcat
++ if not conf.CHECK_FUNCS('strlcpy strlcat'):
++ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
++ checklibc=True)
++ if not conf.CHECK_FUNCS('getpeereid'):
++ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
++ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
++
++ if not conf.CHECK_FUNCS('closefrom'):
++ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+diff --git a/wscript b/wscript
+index 1c9655a..8c20d3b 100644
+--- a/wscript
++++ b/wscript
+@@ -62,7 +62,12 @@ def set_options(opt):
+ help=("Disable the use of pthread robust mutexes"),
+ action="store_true", dest='disable_tdb_mutex_locking',
+ default=False)
+-
++ opt.add_option('--with-valgrind',
++ help=("enable use of valgrind"),
++ action="store_true", dest='enable_valgrind')
++ opt.add_option('--without-valgrind',
++ help=("disable use of valgrind"),
++ action="store_false", dest='enable_valgrind', default=False)
+
+ def configure(conf):
+ conf.env.disable_tdb_mutex_locking = getattr(Options.options,
+--
+2.7.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.15.bb b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.15.bb
new file mode 100644
index 000000000..302a306b3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtdb/libtdb_1.3.15.bb
@@ -0,0 +1,44 @@
+SUMMARY = "The tdb library"
+HOMEPAGE = "http://tdb.samba.org/"
+SECTION = "libs"
+LICENSE = "LGPL-3.0+ & GPL-3.0+"
+
+LIC_FILES_CHKSUM = "file://tools/tdbdump.c;endline=18;md5=b59cd45aa8624578126a8c98f48018c4 \
+ file://include/tdb.h;endline=27;md5=f5bb544641d3081821bcc1dd58310be6"
+
+SRC_URI = "https://samba.org/ftp/tdb/tdb-${PV}.tar.gz \
+ file://do-not-check-xsltproc-manpages.patch \
+ file://tdb-Add-configure-options-for-packages.patch \
+"
+
+SRC_URI[md5sum] = "60ece3996acc8d85b6f713199da971a6"
+SRC_URI[sha256sum] = "b4a1bf3833601bd9f10aff363cb750860aef9ce5b4617989239923192f946728"
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+S = "${WORKDIR}/tdb-${PV}"
+
+inherit waf-samba
+
+EXTRA_OECONF += "--disable-rpath \
+ --bundled-libraries=NONE \
+ --builtin-libraries=replace \
+ --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+ "
+
+PACKAGES += "tdb-tools python-tdb python-tdb-dbg"
+
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_tdb-tools = "${bindir}/*"
+FILES_python-tdb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_python-tdb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*"
+RDEPENDS_python-tdb = "python"
diff --git a/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch
new file mode 100644
index 000000000..35890335a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/avoid-attr-unless-wanted.patch
@@ -0,0 +1,22 @@
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 079761d..07e0104 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -793,8 +793,6 @@ def build(bld):
+ if not bld.CONFIG_SET('HAVE_INET_ATON'): REPLACE_SOURCE += ' inet_aton.c'
+ if not bld.CONFIG_SET('HAVE_INET_NTOP'): REPLACE_SOURCE += ' inet_ntop.c'
+ if not bld.CONFIG_SET('HAVE_INET_PTON'): REPLACE_SOURCE += ' inet_pton.c'
+- if not bld.CONFIG_SET('HAVE_GETXATTR') or bld.CONFIG_SET('XATTR_ADDITIONAL_OPTIONS'):
+- REPLACE_SOURCE += ' xattr.c'
+
+ if not bld.CONFIG_SET('HAVE_CLOSEFROM'):
+ REPLACE_SOURCE += ' closefrom.c'
+@@ -808,7 +806,7 @@ def build(bld):
+ # at the moment:
+ # hide_symbols=bld.BUILTIN_LIBRARY('replace'),
+ private_library=True,
+- deps='crypt dl nsl socket rt attr' + extra_libs)
++ deps='crypt dl nsl socket rt ' + extra_libs)
+
+ replace_test_cflags="-Wno-format-zero-length"
+ if bld.CONFIG_SET('HAVE_WNO_FORMAT_TRUNCATION'):
diff --git a/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/options-0.9.36.patch b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/options-0.9.36.patch
new file mode 100644
index 000000000..363c5867c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent/options-0.9.36.patch
@@ -0,0 +1,176 @@
+From c3e2e4f89cf37b27609fd02ad67eb02d0015cc1e Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Wed, 21 Sep 2016 09:57:49 +0800
+Subject: [PATCH 1/1] tevent: Add configure options for packages
+
+Add configure options for the following packages:
+ - acl
+ - attr
+ - libaio
+ - libbsd
+ - libcap
+ - valgrind
+
+Upstream-Status: Inappropriate [oe deterministic build specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Modified to apply to version 0.9.33.
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+---
+ lib/replace/wscript | 89 ++++++++++++++++++++++++++++++++++++++++-------------
+ wscript | 7 ++++-
+ 2 files changed, 73 insertions(+), 23 deletions(-)
+
+diff --git a/lib/replace/wscript b/lib/replace/wscript
+index 2c638b7..079761d 100644
+--- a/lib/replace/wscript
++++ b/lib/replace/wscript
+@@ -23,6 +23,41 @@ def set_options(opt):
+ opt.PRIVATE_EXTENSION_DEFAULT('')
+ opt.RECURSE('buildtools/wafsamba')
+
++ opt.add_option('--with-acl',
++ help=("Enable use of acl"),
++ action="store_true", dest='enable_acl')
++ opt.add_option('--without-acl',
++ help=("Disable use of acl"),
++ action="store_false", dest='enable_acl', default=False)
++
++ opt.add_option('--with-attr',
++ help=("Enable use of attr"),
++ action="store_true", dest='enable_attr')
++ opt.add_option('--without-attr',
++ help=("Disable use of attr"),
++ action="store_false", dest='enable_attr', default=False)
++
++ opt.add_option('--with-libaio',
++ help=("Enable use of libaio"),
++ action="store_true", dest='enable_libaio')
++ opt.add_option('--without-libaio',
++ help=("Disable use of libaio"),
++ action="store_false", dest='enable_libaio', default=False)
++
++ opt.add_option('--with-libbsd',
++ help=("Enable use of libbsd"),
++ action="store_true", dest='enable_libbsd')
++ opt.add_option('--without-libbsd',
++ help=("Disable use of libbsd"),
++ action="store_false", dest='enable_libbsd', default=False)
++
++ opt.add_option('--with-libcap',
++ help=("Enable use of libcap"),
++ action="store_true", dest='enable_libcap')
++ opt.add_option('--without-libcap',
++ help=("Disable use of libcap"),
++ action="store_false", dest='enable_libcap', default=False)
++
+ @Utils.run_once
+ def configure(conf):
+ conf.RECURSE('buildtools/wafsamba')
+@@ -32,12 +67,25 @@ def configure(conf):
+ conf.DEFINE('HAVE_LIBREPLACE', 1)
+ conf.DEFINE('LIBREPLACE_NETWORK_CHECKS', 1)
+
+- conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
+- conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
++ conf.CHECK_HEADERS('linux/types.h crypt.h locale.h compat.h')
++ conf.CHECK_HEADERS('compat.h ctype.h dustat.h')
+ conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
+- conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+- conf.CHECK_HEADERS('shadow.h sys/acl.h')
+- conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
++ conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
++ conf.CHECK_HEADERS('shadow.h')
++ conf.CHECK_HEADERS('sys/attributes.h sys/dir.h sys/epoll.h')
++
++ if Options.options.enable_acl:
++ conf.CHECK_HEADERS('acl/libacl.h sys/acl.h')
++
++ if Options.options.enable_attr:
++ conf.CHECK_HEADERS('attr/attributes.h attr/xattr.h')
++
++ if Options.options.enable_libaio:
++ conf.CHECK_HEADERS('libaio.h')
++
++ if Options.options.enable_libcap:
++ conf.CHECK_HEADERS('sys/capability.h')
++
+ conf.CHECK_HEADERS('port.h')
+ conf.CHECK_HEADERS('sys/fcntl.h sys/filio.h sys/filsys.h sys/fs/s5param.h sys/fs/vx/quota.h')
+ conf.CHECK_HEADERS('sys/id.h sys/ioctl.h sys/ipc.h sys/mman.h sys/mode.h sys/ndir.h sys/priv.h')
+@@ -101,7 +149,8 @@ def configure(conf):
+ conf.CHECK_HEADERS('sys/fileio.h sys/filesys.h sys/dustat.h sys/sysmacros.h')
+ conf.CHECK_HEADERS('xfs/libxfs.h netgroup.h')
+
+- conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
++ if Options.options.enable_valgrind:
++ conf.CHECK_HEADERS('valgrind.h valgrind/valgrind.h valgrind/memcheck.h')
+ conf.CHECK_HEADERS('nss_common.h nsswitch.h ns_api.h')
+ conf.CHECK_HEADERS('sys/extattr.h sys/ea.h sys/proplist.h sys/cdefs.h')
+ conf.CHECK_HEADERS('utmp.h utmpx.h lastlog.h')
+@@ -294,22 +343,18 @@ def configure(conf):
+
+ conf.CHECK_FUNCS('prctl dirname basename')
+
+- strlcpy_in_bsd = False
+-
+- # libbsd on some platforms provides strlcpy and strlcat
+- if not conf.CHECK_FUNCS('strlcpy strlcat'):
+- if conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
+- checklibc=True):
+- strlcpy_in_bsd = True
+- if not conf.CHECK_FUNCS('getpeereid'):
+- conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
+- conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+- if not conf.CHECK_FUNCS('setproctitle_init'):
+- conf.CHECK_FUNCS_IN('setproctitle_init', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if Options.options.enable_libbsd:
++ # libbsd on some platforms provides strlcpy and strlcat
++ if not conf.CHECK_FUNCS('strlcpy strlcat'):
++ conf.CHECK_FUNCS_IN('strlcpy strlcat', 'bsd', headers='bsd/string.h',
++ checklibc=True)
++ if not conf.CHECK_FUNCS('getpeereid'):
++ conf.CHECK_FUNCS_IN('getpeereid', 'bsd', headers='sys/types.h bsd/unistd.h')
++ if not conf.CHECK_FUNCS_IN('setproctitle', 'setproctitle', headers='setproctitle.h'):
++ conf.CHECK_FUNCS_IN('setproctitle', 'bsd', headers='sys/types.h bsd/unistd.h')
+
+- if not conf.CHECK_FUNCS('closefrom'):
+- conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
++ if not conf.CHECK_FUNCS('closefrom'):
++ conf.CHECK_FUNCS_IN('closefrom', 'bsd', headers='bsd/unistd.h')
+
+ conf.CHECK_CODE('''
+ struct ucred cred;
+@@ -660,7 +705,7 @@ removeea setea
+ # look for a method of finding the list of network interfaces
+ for method in ['HAVE_IFACE_GETIFADDRS', 'HAVE_IFACE_AIX', 'HAVE_IFACE_IFCONF', 'HAVE_IFACE_IFREQ']:
+ bsd_for_strlcpy = ''
+- if strlcpy_in_bsd:
++ if Options.options.enable_libbsd:
+ bsd_for_strlcpy = ' bsd'
+ if conf.CHECK_CODE('''
+ #define %s 1
+diff --git a/wscript b/wscript
+index 94d190f..742f779 100644
+--- a/wscript
++++ b/wscript
+@@ -22,7 +22,12 @@ def set_options(opt):
+ opt.PRIVATE_EXTENSION_DEFAULT('tevent', noextension='tevent')
+ opt.RECURSE('lib/replace')
+ opt.RECURSE('lib/talloc')
+-
++ opt.add_option('--with-valgrind',
++ help=("enable use of valgrind"),
++ action="store_true", dest='enable_valgrind')
++ opt.add_option('--without-valgrind',
++ help=("disable use of valgrind"),
++ action="store_false", dest='enable_valgrind', default=False)
+
+ def configure(conf):
+ conf.RECURSE('lib/replace')
+--
+2.16.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb
new file mode 100644
index 000000000..c91b221b1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/libtevent/libtevent_0.9.36.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
+HOMEPAGE = "http://tevent.samba.org"
+SECTION = "libs"
+LICENSE = "LGPLv3+"
+
+DEPENDS += "libtalloc libtirpc"
+RDEPENDS_python-tevent = "python"
+
+SRC_URI = "https://samba.org/ftp/tevent/tevent-${PV}.tar.gz \
+ file://options-0.9.36.patch \
+"
+LIC_FILES_CHKSUM = "file://tevent.h;endline=26;md5=4e458d658cb25e21efc16f720e78b85a"
+
+SRC_URI[md5sum] = "87d67bca75b231814435c47bec0aff8a"
+SRC_URI[sha256sum] = "bd2b6be3fd1601ed7f176e99111e322c57d58e425cc149ee80c7dd4fed263b4c"
+
+inherit waf-samba
+
+PACKAGECONFIG ??= "\
+ ${@bb.utils.filter('DISTRO_FEATURES', 'acl', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)} \
+"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[libaio] = "--with-libaio,--without-libaio,libaio"
+PACKAGECONFIG[libbsd] = "--with-libbsd,--without-libbsd,libbsd"
+PACKAGECONFIG[libcap] = "--with-libcap,--without-libcap,libcap"
+PACKAGECONFIG[valgrind] = "--with-valgrind,--without-valgrind,valgrind"
+
+SRC_URI += "${@bb.utils.contains('PACKAGECONFIG', 'attr', '', 'file://avoid-attr-unless-wanted.patch', d)}"
+
+S = "${WORKDIR}/tevent-${PV}"
+
+EXTRA_OECONF += "--disable-rpath \
+ --bundled-libraries=NONE \
+ --builtin-libraries=replace \
+ --with-libiconv=${STAGING_DIR_HOST}${prefix}\
+ --without-gettext \
+ "
+
+PACKAGES += "python-tevent python-tevent-dbg"
+
+FILES_python-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_python-tevent-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug"
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-fix-compile-error-with-linux-kernel-v4.8.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-fix-compile-error-with-linux-kernel-v4.8.patch
new file mode 100644
index 000000000..583a6ca60
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-fix-compile-error-with-linux-kernel-v4.8.patch
@@ -0,0 +1,74 @@
+From 7cdafc0dee8054f82777ed3bf6d4c8b5582d09ad Mon Sep 17 00:00:00 2001
+From: Dengke Du <dengke.du@windriver.com>
+Date: Tue, 18 Oct 2016 07:56:02 +0000
+Subject: [PATCH] fix compile error with linux kernel v4.8
+
+In src/maint/zntune.c, the glibc time.h is included before linux
+time.h, so when compile the zntune.c, it break down by errors:
+
+ redefinition of 'struct timespec' 'struct timeval'
+ 'struct timezone' 'struct itimerval'
+
+We should exclude the linux time.h by disable linux/atm_zatm.h and
+move some useful definition in linux/atm_zatm.h to zntune.c to resolve
+it.
+
+Upstream-status: Pending
+
+Signed-off-by: Dengke Du <dengke.du@windriver.com>
+---
+ src/include/atm_zatm.h | 26 ++++++++++++++++++++++++++
+ src/maint/zntune.c | 3 +--
+ 2 files changed, 27 insertions(+), 2 deletions(-)
+ create mode 100644 src/include/atm_zatm.h
+
+diff --git a/src/include/atm_zatm.h b/src/include/atm_zatm.h
+new file mode 100644
+index 0000000..7d64f4d
+--- /dev/null
++++ b/src/include/atm_zatm.h
+@@ -0,0 +1,26 @@
++#include <linux/atmapi.h>
++#include <linux/atmioc.h>
++
++#define ZATM_GETPOOL _IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
++ /* get pool statistics */
++#define ZATM_GETPOOLZ _IOW('a',ATMIOC_SARPRV+2,struct atmif_sioc)
++ /* get statistics and zero */
++#define ZATM_SETPOOL _IOW('a',ATMIOC_SARPRV+3,struct atmif_sioc)
++
++struct zatm_pool_info {
++ int ref_count; /* free buffer pool usage counters */
++ int low_water,high_water; /* refill parameters */
++ int rqa_count,rqu_count; /* queue condition counters */
++ int offset,next_off; /* alignment optimizations: offset */
++ int next_cnt,next_thres; /* repetition counter and threshold */
++}; /* set pool parameters */
++
++struct zatm_pool_req {
++ int pool_num; /* pool number */
++ struct zatm_pool_info info; /* actual information */
++};
++
++#define ZATM_OAM_POOL 0 /* free buffer pool for OAM cells */
++#define ZATM_AAL0_POOL 1 /* free buffer pool for AAL0 cells */
++#define ZATM_AAL5_POOL_BASE 2 /* first AAL5 free buffer pool */
++#define ZATM_LAST_POOL ZATM_AAL5_POOL_BASE+10 /* max. 64 kB */
+diff --git a/src/maint/zntune.c b/src/maint/zntune.c
+index 62d62ab..bb93eab 100644
+--- a/src/maint/zntune.c
++++ b/src/maint/zntune.c
+@@ -13,9 +13,8 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <atm.h>
++#include <atm_zatm.h>
+ #include <sys/time.h> /* for struct timeval, although it's not used */
+-#include <linux/atm_zatm.h>
+-
+
+ static void usage(const char *name)
+ {
+--
+2.9.0
+
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
new file mode 100644
index 000000000..87e7dc3c6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0001-ttcp-Add-printf-format-string.patch
@@ -0,0 +1,34 @@
+From b83fd54584fabd5d24f6645b4a3cf345c9d2020d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:11:59 -0700
+Subject: [PATCH 1/3] ttcp: Add printf format string
+
+Fixes compiler warnings when format security is enabled
+
+| ../../../linux-atm-2.5.2/src/test/ttcp.c:666:21: error: format not a string literal and no format arguments [-Werror=format-security]
+| fprintf(stderr, Usage);
+| ^~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/test/ttcp.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/test/ttcp.c b/src/test/ttcp.c
+index acb9185..337cee5 100644
+--- a/src/test/ttcp.c
++++ b/src/test/ttcp.c
+@@ -663,7 +663,7 @@ int no_check = 0;
+ exit(0);
+
+ usage:
+- fprintf(stderr, Usage);
++ fprintf(stderr, "%s", Usage);
+ exit(1);
+ }
+
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
new file mode 100644
index 000000000..ce061231c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0002-sigd-Replace-on_exit-API-with-atexit.patch
@@ -0,0 +1,30 @@
+From 27fa80dc8045e71c30dd2abea835206d5c8f6c71 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:18:56 -0700
+Subject: [PATCH 2/3] sigd: Replace on_exit() API with atexit()
+
+on_exit is not universally available
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/sigd/atmsigd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sigd/atmsigd.c b/src/sigd/atmsigd.c
+index 52e41c7..b766606 100644
+--- a/src/sigd/atmsigd.c
++++ b/src/sigd/atmsigd.c
+@@ -517,7 +517,7 @@ int main(int argc,char **argv)
+ exit(0);
+ }
+ }
+- (void) on_exit(trace_on_exit,NULL);
++ atexit(trace_on_exit);
+ poll_loop();
+ close_all();
+ for (sig = entities; sig; sig = sig->next) stop_saal(&sig->saal);
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
new file mode 100644
index 000000000..0302286dc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch
@@ -0,0 +1,37 @@
+From fe954b2fb17d813aaab3e926cee76144314a115a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 16:22:55 -0700
+Subject: [PATCH 3/3] mpoad: Drop old hack to compile with very old glibc
+
+Use poll.h instead of sys/poll.h
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mpoad/io.c | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/src/mpoad/io.c b/src/mpoad/io.c
+index 69900c2..8d1433f 100644
+--- a/src/mpoad/io.c
++++ b/src/mpoad/io.c
+@@ -10,14 +10,7 @@
+ #include <errno.h>
+ #include <sys/ioctl.h>
+ #include <sys/param.h> /* for OPEN_MAX */
+-#if __GLIBC__ >= 2
+-#include <sys/poll.h>
+-#else /* ugly hack to make it compile on RH 4.2 - WA */
+-#include <syscall.h>
+-#include <linux/poll.h>
+-#define SYS_poll 168
+-_syscall3(int,poll,struct pollfd *,ufds,unsigned int,nfds,int,timeout);
+-#endif
++#include <poll.h>
+ #include <atm.h>
+ #include <linux/types.h>
+ #include <linux/atmioc.h>
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/install-from-buildir.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/install-from-buildir.patch
new file mode 100644
index 000000000..d1380eb2a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/install-from-buildir.patch
@@ -0,0 +1,19 @@
+install binaries from builddir not srcdir.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+--- linux-atm-2.5.2.orig/src/extra/Makefile.am 2010-12-21 05:07:22.000000000 +0800
++++ linux-atm-2.5.2/src/extra/Makefile.am 2014-12-22 10:56:04.458563269 +0800
+@@ -9,9 +9,9 @@ CLEANFILES = pca200e.bin pca200e_ecd.bin
+
+ install-exec-hook:
+ $(MKDIR_P) $(DESTDIR)/lib/firmware
+- $(INSTALL_DATA) $(srcdir)/pca200e.bin $(DESTDIR)/lib/firmware
+- $(INSTALL_DATA) $(srcdir)/pca200e_ecd.bin2 $(DESTDIR)/lib/firmware
+- $(INSTALL_DATA) $(srcdir)/sba200e_ecd.bin2 $(DESTDIR)/lib/firmware
++ $(INSTALL_DATA) $(builddir)/pca200e.bin $(DESTDIR)/lib/firmware
++ $(INSTALL_DATA) $(builddir)/pca200e_ecd.bin2 $(DESTDIR)/lib/firmware
++ $(INSTALL_DATA) $(builddir)/sba200e_ecd.bin2 $(DESTDIR)/lib/firmware
+
+ %.bin %.bin2: %.data
+ objcopy -Iihex $< -Obinary $@.gz
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/link-with-ldflags.patch b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/link-with-ldflags.patch
new file mode 100644
index 000000000..62fad2a54
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm/link-with-ldflags.patch
@@ -0,0 +1,38 @@
+LDFLAGS_FOR_BUILD should be required when doing link for qgen.
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+diff -Nurp linux-atm-2.5.2.orig/configure.in linux-atm-2.5.2/configure.in
+--- linux-atm-2.5.2.orig/configure.in 2010-12-28 23:36:07.000000000 +0800
++++ linux-atm-2.5.2/configure.in 2014-12-22 10:25:23.830510932 +0800
+@@ -66,6 +66,7 @@ else
+ fi
+ AC_SUBST(CC_FOR_BUILD)
+ AC_SUBST(CFLAGS_FOR_BUILD)
++AC_SUBST(LDFLAGS_FOR_BUILD)
+ dnl Add -d flag to bison/yacc to create intermediate .h files
+ YACC="$YACC -d"
+
+diff -Nurp linux-atm-2.5.2.orig/src/qgen/Makefile.am linux-atm-2.5.2/src/qgen/Makefile.am
+--- linux-atm-2.5.2.orig/src/qgen/Makefile.am 2010-12-28 22:29:31.000000000 +0800
++++ linux-atm-2.5.2/src/qgen/Makefile.am 2014-12-22 10:23:51.914508318 +0800
+@@ -5,7 +5,7 @@ qgen_SOURCES = common.c common.h file.c
+ qgen_LDADD = -lfl
+
+ COMPILE = @CC_FOR_BUILD@ @CFLAGS_FOR_BUILD@
+-LINK = @CC_FOR_BUILD@ @CFLAGS_FOR_BUILD@ -o $@
++LINK = @CC_FOR_BUILD@ @CFLAGS_FOR_BUILD@ @LDFLAGS_FOR_BUILD@ -o $@
+
+ #TESTS = $(check_PROGRAMS)
+
+diff -Nurp linux-atm-2.5.2.orig/src/qgen/Makefile.in linux-atm-2.5.2/src/qgen/Makefile.in
+--- linux-atm-2.5.2.orig/src/qgen/Makefile.in 2010-12-29 00:06:11.000000000 +0800
++++ linux-atm-2.5.2/src/qgen/Makefile.in 2014-12-22 10:23:51.914508318 +0800
+@@ -106,6 +106,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+ LD = @LD@
+ LDFLAGS = @LDFLAGS@
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
+ LEX = @LEX@
+ LEXLIB = @LEXLIB@
+ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
diff --git a/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
new file mode 100644
index 000000000..9fce4fba6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/linux-atm/linux-atm_2.5.2.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Drivers and tools to support ATM networking under Linux"
+HOMEPAGE = "http://linux-atm.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "GPL-2.0 & LGPL-2.0"
+
+DEPENDS = "virtual/kernel flex flex-native"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "http://nchc.dl.sourceforge.net/project/${BPN}/${BPN}/${PV}/${BPN}-${PV}.tar.gz \
+ file://link-with-ldflags.patch \
+ file://install-from-buildir.patch \
+ file://0001-fix-compile-error-with-linux-kernel-v4.8.patch \
+ file://0001-ttcp-Add-printf-format-string.patch \
+ file://0002-sigd-Replace-on_exit-API-with-atexit.patch \
+ file://0003-mpoad-Drop-old-hack-to-compile-with-very-old-glibc.patch \
+"
+
+SRC_URI[md5sum] = "d49499368c3cf15f73a05d9bce8824a8"
+SRC_URI[sha256sum] = "9645481a2b16476b59220aa2d6bc5bc41043f291326c9b37581018fbd16dd53a"
+
+LIC_FILES_CHKSUM = "\
+file://COPYING;md5=d928de9537d846935a98af3bbc6e6ee1 \
+file://COPYING.GPL;md5=ac2db169b9309e240555bc77be4f1a33 \
+file://COPYING.LGPL;md5=6e29c688d912da12b66b73e32b03d812"
+
+inherit autotools pkgconfig
+
+# The firmware is explicitly put under /lib when installed.
+#
+
+FILES_${PN} += "/lib/firmware"
diff --git a/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/run-ptest b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/run-ptest
new file mode 100644
index 000000000..e67f18e55
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+sh v4test.sh
+sh v6test.sh
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v4test.sh b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v4test.sh
new file mode 100644
index 000000000..513085699
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v4test.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+echo "v4test starting:"
+for t in $(find -maxdepth 1 -type f \! -name test\*_v6 -name test\*); do
+ echo "$t";
+ if $t; then
+ echo "PASS: $t"; echo "";
+ else
+ echo "FAIL: $t"; echo "";
+ fi
+ sleep 1;
+done
diff --git a/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v6test.sh b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v6test.sh
new file mode 100644
index 000000000..3a667df82
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools/v6test.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+echo "v6test starting:"
+for t in $(find -maxdepth 1 -name test\*_v6); do
+ echo "$t";
+ if $t; then
+ echo "PASS: $t"; echo "";
+ else
+ echo "FAIL: $t"; echo "";
+ fi
+ sleep 1;
+done
diff --git a/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
new file mode 100644
index 000000000..121cc9945
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lksctp-tools/lksctp-tools_1.0.17.bb
@@ -0,0 +1,62 @@
+SUMMARY = "The Linux Kernel Stream Control Transmission Protocol (lksctp) project"
+HOMEPAGE = "http://lksctp.org"
+SECTION = "net"
+LICENSE = "LGPLv2.1 & GPLv2"
+
+LIC_FILES_CHKSUM = " \
+ file://COPYING.lib;md5=0a1b79af951c42a9c8573533fbba9a92 \
+ file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e \
+"
+
+SRCREV = "736b91d340e3f2519714f2930ed63b164d363511"
+
+PV .= "+git${SRCPV}"
+LK_REL = "1.0.17"
+
+SRC_URI = " \
+ git://github.com/sctp/lksctp-tools.git \
+ file://run-ptest \
+ file://v4test.sh \
+ file://v6test.sh \
+"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
+
+inherit autotools pkgconfig binconfig ptest
+
+do_install_ptest () {
+ install -m 0755 ${WORKDIR}/v4test.sh ${D}${PTEST_PATH}
+ install -m 0755 ${WORKDIR}/v6test.sh ${D}${PTEST_PATH}
+ for testcase in `find ${B}/src/apps/.libs ${B}/src/func_tests/.libs -maxdepth 1 -type f -executable`; do
+ install $testcase ${D}${PTEST_PATH}
+ done
+}
+
+SOLIBVERSION="${LK_REL}"
+SOLIBMAJORVERSION="1"
+
+PACKAGES =+ "${PN}-withsctp ${PN}-utils"
+
+FILES_${PN} = " \
+ ${libdir}/libsctp.so.${SOLIBVERSION} \
+ ${libdir}/libsctp.so.${SOLIBMAJORVERSION} \
+"
+
+FILES_${PN}-withsctp = " \
+ ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBVERSION} \
+ ${libdir}/lksctp-tools/libwithsctp.so.${SOLIBMAJORVERSION} \
+"
+
+FILES_${PN}-dev += " \
+ ${libdir}/libsctp.so \
+ ${libdir}/lksctp-tools/libwithsctp.so \
+ ${datadir}/lksctp-tools/*.c \
+ ${datadir}/lksctp-tools/*.h \
+"
+
+FILES_${PN}-utils = "${bindir}/*"
+
+RRECOMMENDS_${PN}-utils += "kernel-module-sctp"
+RRECOMMENDS_${PN}-ptest += "kernel-module-sctp"
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch
new file mode 100644
index 000000000..8e906f7ce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Fix-build-errors-with-clang.patch
@@ -0,0 +1,34 @@
+From 5f9e80acb0a1ac399839bf160e43f6120c4b5128 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 18 Oct 2016 23:49:09 +0000
+Subject: [PATCH] Fix build errors with clang
+
+| ../../../../../../../workspace/sources/lowpan-tools/src/coordinator.c:313:50: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
+| fprintf(stderr, "Opt: %c (%hhx)\n", (char)opt, opt);
+| ~~~~ ^~~
+| %x
+| 1 error generated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/coordinator.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/coordinator.c b/src/coordinator.c
+index c139aae..f0de6d2 100644
+--- a/src/coordinator.c
++++ b/src/coordinator.c
+@@ -310,7 +310,7 @@ int main(int argc, char **argv)
+ #else
+ opt = getopt(argc, argv, "l:f:d:m:n:i:s:p:c:hv");
+ #endif
+- fprintf(stderr, "Opt: %c (%hhx)\n", opt, opt);
++ fprintf(stderr, "Opt: %c (%hhx)\n", opt, (unsigned char)opt);
+ if (opt == -1)
+ break;
+
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
new file mode 100644
index 000000000..1453b75d5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-Remove-newline-from-format-line.patch
@@ -0,0 +1,32 @@
+From a36afac485745cf980fba1809526f2025cb4d101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 23 Apr 2017 00:16:45 -0700
+Subject: [PATCH] Remove newline from format line
+
+Fixes
+
+error: '__builtin___snprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
+ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+ ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/addrdb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/addrdb/addrdb.c b/addrdb/addrdb.c
+index 4bb7f79..05d53f3 100644
+--- a/addrdb/addrdb.c
++++ b/addrdb/addrdb.c
+@@ -178,7 +178,7 @@ int addrdb_dump_leases(const char *lease_file)
+ continue;
+ }
+ snprintf(hwaddr_buf, sizeof(hwaddr_buf),
+- "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
++ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
+ lease->hwaddr[0], lease->hwaddr[1],
+ lease->hwaddr[2], lease->hwaddr[3],
+ lease->hwaddr[4], lease->hwaddr[5],
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
new file mode 100644
index 000000000..0a81a2252
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch
@@ -0,0 +1,44 @@
+From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Mon, 27 Mar 2017 17:55:06 -0700
+Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The %union definition uses the time_t structure. In order to use this
+structure, the <time.h> header has to be included. Otherwise, the build
+breaks with some C libraries, such as musl:
+
+In file included from coord-config-lex.l:23:0:
+coord-config-parse.y:107:2: error: unknown type name ‘time_t’
+ time_t timestamp;
+ ^
+
+This patch includes <time.h> using the '%code requires' directive of
+Yacc.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ addrdb/coord-config-parse.y | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
+index 2e10a88..85ee058 100644
+--- a/addrdb/coord-config-parse.y
++++ b/addrdb/coord-config-parse.y
+@@ -102,6 +102,10 @@
+
+ %}
+
++%code requires {
++#include <time.h>
++}
++
+ %union {
+ unsigned long number;
+ time_t timestamp;
+--
+2.12.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch
new file mode 100644
index 000000000..493832bb8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-coordinator-Fix-strncpy-range-warning.patch
@@ -0,0 +1,30 @@
+From f017353b8f3170ce79e7addc127056c0142f087b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 1 Apr 2018 14:31:05 -0700
+Subject: [PATCH] coordinator: Fix strncpy range warning
+
+Fixes
+error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/coordinator.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/coordinator.c b/src/coordinator.c
+index c139aae..ca49418 100644
+--- a/src/coordinator.c
++++ b/src/coordinator.c
+@@ -296,7 +296,8 @@ int main(int argc, char **argv)
+ if(!lease_file)
+ lease_file = LEASE_FILE;
+
+- strncpy(pname, argv[0], PATH_MAX);
++ strncpy(pname, argv[0], PATH_MAX - 1);
++ pname[PATH_MAX - 1] = '\0';
+
+ pid_file = getenv("PID_FILE");
+ if (!pid_file)
+--
+2.16.3
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
new file mode 100644
index 000000000..68393067d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/0001-src-iz.c-Undef-dprintf-before-redefining.patch
@@ -0,0 +1,27 @@
+From ad088233608ba2205511da4f270f8ba29844b84c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 8 Apr 2017 09:02:02 -0700
+Subject: [PATCH] src/iz.c: Undef dprintf before redefining
+
+Clang is picky and warns about macros redefinition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/iz.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/iz.c b/src/iz.c
+index 32be1a8..886f0a5 100644
+--- a/src/iz.c
++++ b/src/iz.c
+@@ -60,6 +60,7 @@ static int iz_seq = 0;
+ /* Parsed options */
+ static int iz_debug = 0;
+
++#undef dprintf
+ #define dprintf(lvl, fmt...) \
+ do { \
+ if (iz_debug >= lvl) \
+--
+2.12.2
+
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch
new file mode 100644
index 000000000..9ecd707b4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch
@@ -0,0 +1,41 @@
+Disable building manpages so that make install doesn't fail due to lack of help2man
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 46c4017..d6ed312 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -9,11 +9,6 @@ izcoordinator_DESC = "simple coordinator for IEEE 802.15.4 network"
+ iz_DESC = "configure an IEEE 802.15.4 interface"
+ izchat_DESC = "simple chat program using IEEE 802.15.4"
+
+-if MANPAGES
+-dist_man_MANS = $(manpages)
+-endif
+-EXTRA_DIST = $(manpages)
+-
+ izattach_SOURCES = serial.c
+
+ iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c
+@@ -27,18 +22,6 @@ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB)
+ iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
+ iz_LDADD = $(LDADD) $(NL_LIBS)
+
+-izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(izattach_DESC) $(builddir)/izattach
+-
+-izcoordinator.8: $(izcoordinator_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(izcoordinator_DESC) $(builddir)/izcoordinator
+-
+-iz.8: $(iz_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 8 -N -n $(iz_DESC) $(builddir)/iz
+-
+-izchat.1: $(izchat_SOURCES) $(top_srcdir)/configure.ac
+- -$(HELP2MAN) -o $@ -s 1 -N -n $(izchat_DESC) $(builddir)/izchat
+-
+ install-data-hook:
+ $(mkinstalldirs) $(DESTDIR)`dirname $(leasefile)`
+ $(mkinstalldirs) $(DESTDIR)`dirname $(pidfile)`
diff --git a/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
new file mode 100644
index 000000000..d0fe59c98
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing the Linux LoWPAN stack"
+DESCRIPTION = "This is a set of utils to manage the Linux LoWPAN stack. \
+The LoWPAN stack aims for IEEE 802.15.4-2003 (and for lesser extent IEEE 802.15.4-2006) compatibility."
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "flex-native bison-native libnl python"
+
+PV = "0.3.1+git${SRCPV}"
+SRC_URI = "git://github.com/linux-wpan/lowpan-tools \
+ file://no-help2man.patch \
+ file://0001-Fix-build-errors-with-clang.patch \
+ file://0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch \
+ file://0001-src-iz.c-Undef-dprintf-before-redefining.patch \
+ file://0001-Remove-newline-from-format-line.patch \
+ file://0001-coordinator-Fix-strncpy-range-warning.patch \
+ "
+SRCREV = "1c2d8674cc6f4b1166a066e8822e295c105ae7a2"
+
+S = "${WORKDIR}/git"
+
+inherit autotools python-dir pkgconfig
+
+CACHED_CONFIGUREVARS += "am_cv_python_pythondir=${PYTHON_SITEPACKAGES_DIR}/lowpan-tools"
+
+CFLAGS += "-Wno-initializer-overrides"
+
+do_install_append() {
+ rmdir ${D}${localstatedir}/run
+}
+
+FILES_${PN}-dbg += "${libexecdir}/lowpan-tools/.debug/"
+
+PACKAGES =+ "${PN}-python"
+FILES_${PN}-python = "${libdir}/python*"
diff --git a/meta-openembedded/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb b/meta-openembedded/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb
new file mode 100644
index 000000000..a90177f19
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Tool to view/change network interface MAC addresses"
+DESCRIPTION = "A GNU/Linux utility for viewing/manipulating the MAC address of network interfaces."
+HOMEPAGE = "http://www.alobbs.com/macchanger"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+SECTION = "net"
+
+SRC_URI = "${GNU_MIRROR}/macchanger/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "79b7cdaeca3d8ebafa764c4b0dd03ab7"
+SRC_URI[sha256sum] = "d44bfa27cb29c5a718627cb3ef3aa42eb5130426545eb2031120826cd73fa8fe"
+
+FILES_${PN} = " \
+ ${bindir}/${BPN} \
+ ${datadir}/${BPN}/wireless.list \
+ ${datadir}/${BPN}/OUI.list \
+"
+
+FILES_${PN}-doc = " \
+ ${datadir}/info \
+ ${datadir}/man \
+"
+
+inherit autotools
diff --git a/meta-openembedded/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch b/meta-openembedded/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch
new file mode 100644
index 000000000..544b840fe
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/memcached/memcached/memcached-add-hugetlbfs-check.patch
@@ -0,0 +1,32 @@
+memcached: add knob to detect whether hugetlbfs are checked
+
+Add knob to detect whether hugetlbfs are checked or not.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7f22f21..21691b9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -314,7 +314,12 @@ fi
+ dnl ----------------------------------------------------------------------------
+
+ AC_SEARCH_LIBS(umem_cache_create, umem)
+-AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs)
++AC_ARG_ENABLE(hugetlbfs,
++ [AS_HELP_STRING([--enable-hugetlbfs],[Enable hugetlbfs])])
++
++if test "x$enable_hugetlbfs" = "xyes"; then
++ AC_SEARCH_LIBS(gethugepagesizes, hugetlbfs)
++fi
+
+ AC_HEADER_STDBOOL
+ AH_BOTTOM([#if HAVE_STDBOOL_H
+--
+1.8.3.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.5.0.bb b/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.5.0.bb
new file mode 100644
index 000000000..fd3d171f0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/memcached/memcached_1.5.0.bb
@@ -0,0 +1,52 @@
+SUMMARY = "A high-performance memory object caching system"
+DESCRIPTION = "\
+ memcached optimizes specific high-load serving applications that are designed \
+ to take advantage of its versatile no-locking memory access system. Clients \
+ are available in several different programming languages, to suit the needs \
+ of the specific application. Traditionally this has been used in mod_perl \
+ apps to avoid storing large chunks of data in Apache memory, and to share \
+ this burden across several machines."
+SECTION = "web"
+HOMEPAGE = "http://memcached.org/"
+LICENSE = "BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff"
+
+inherit autotools
+
+DEPENDS += "libevent"
+RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \
+ perl-module-tie-hash bash \
+ "
+
+SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \
+ file://memcached-add-hugetlbfs-check.patch \
+ "
+SRC_URI[md5sum] = "81326513f60d7ba482f8131975cd55ae"
+SRC_URI[sha256sum] = "c001f812024bb461b5e4d7d0506daab63dff9614eea26f46536c3b7e1e601c32"
+
+# set the same COMPATIBLE_HOST as libhugetlbfs
+COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64|arm).*-linux'
+
+python __anonymous () {
+ endianness = d.getVar('SITEINFO_ENDIANNESS')
+ if endianness == 'le':
+ d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=little")
+ else:
+ d.appendVar('EXTRA_OECONF', " ac_cv_c_endian=big")
+}
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[hugetlbfs] = "--enable-hugetlbfs, --disable-hugetlbfs, libhugetlbfs"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "memcached"
+INITSCRIPT_PARAMS = "defaults"
+
+do_install_append() {
+ install -D -m 755 ${S}/scripts/memcached-init ${D}${sysconfdir}/init.d/memcached
+ mkdir -p ${D}/usr/share/memcached/scripts
+ install -m 755 ${S}/scripts/memcached-tool ${D}/usr/share/memcached/scripts
+ install -m 755 ${S}/scripts/start-memcached ${D}/usr/share/memcached/scripts
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb b/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb
new file mode 100644
index 000000000..9d3275e2d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/mtr/mtr_0.87.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Combined traceroute and ping utility"
+DESCRIPTION = "mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool."
+HOMEPAGE = "http://www.bitwizard.nl/mtr/"
+SECTION = "net"
+DEPENDS = "ncurses"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://ui/mtr.c;beginline=5;endline=16;md5=af1fafbbfa1bfd48af839f4bb3221106"
+
+PV .= "+git${SRCPV}"
+
+SRCREV = "e6d0a7e93129e8023654ebf58dfa8135d1b1af56"
+SRC_URI = "git://github.com/traviscross/mtr"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--without-gtk"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+PACKAGES += "${PN}-bash-completions"
+
+FILES_${PN}-bash-completions = "${datadir}/bash-completion/"
diff --git a/meta-openembedded/meta-networking/recipes-support/nbd/nbd_3.11.bb b/meta-openembedded/meta-networking/recipes-support/nbd/nbd_3.11.bb
new file mode 100644
index 000000000..2ad75bda6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nbd/nbd_3.11.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Network Block Device"
+HOMEPAGE = "http://nbd.sourceforge.net"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "73d11644a28b9f335292cdb3bdc4b74b"
+SRC_URI[sha256sum] = "14420f74cb16dc609a9302ed1efd653064bed7a8357e9d73daabc33608e3f2a0"
+
+inherit autotools pkgconfig
+
+PACKAGES = "${PN}-client ${PN}-server ${PN}-dbg ${PN}-trdump ${PN}-doc"
+
+FILES_${PN}-client = "${sbindir}/${BPN}-client"
+FILES_${PN}-server = "${bindir}/${BPN}-server"
+FILES_${PN}-trdump = "${bindir}/${BPN}-trdump"
diff --git a/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb b/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb
new file mode 100644
index 000000000..4b072f7e7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ncp/libowfat_0.31.bb
@@ -0,0 +1,27 @@
+SUMMARY = "reimplement libdjb"
+DESCRIPTION = "libowfat is a library of general purpose APIs extracted from Dan \
+Bernstein's software (libdjb), reimplemented and covered by the GNU \
+General Public License Version 2 (no later versions)."
+HOMEPAGE = "http://www.fefe.de/libowfat"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI = "https://www.fefe.de/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "120798fab86cfd72dc6b12284d248dd0"
+SRC_URI[sha256sum] = "d1e4ac1cfccbb7dc51d77d96398e6302d229ba7538158826c84cb4254c7e8a12"
+
+EXTRA_OEMAKE = "\
+ DIET= \
+ CC='${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}' \
+ CCC='${CC}' CFLAGS='${CFLAGS} -I.' CFLAGS_OPT='${CFLAGS} -I.' \
+"
+
+do_install() {
+ make install \
+ DESTDIR=${D} \
+ INCLUDEDIR=${includedir}/${BPN} \
+ LIBDIR=${libdir} \
+ MAN3DIR=${mandir}/man3
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb b/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb
new file mode 100644
index 000000000..f42223b1f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ncp/ncp_1.2.4.bb
@@ -0,0 +1,31 @@
+SUMMARY = "a fast file copy tool for LANs"
+DESCRIPTION = "ncp is a utility for copying files in a LAN. It has absolutely no \
+security or integrity checking, no throttling, no features, except \
+one: you don't have to type the coordinates of your peer."
+HOMEPAGE = "http://www.fefe.de/ncp"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+DEPENDS = "libowfat"
+
+SRC_URI = "https://dl.fefe.de/${BP}.tar.bz2"
+SRC_URI[md5sum] = "421c4855bd3148b7d0a4342942b4bf13"
+SRC_URI[sha256sum] = "6cfa72edd5f7717bf7a4a93ccc74c4abd89892360e2e0bb095a73c24b9359b88"
+
+EXTRA_OEMAKE = "\
+ DIET= \
+ DEBUG=nostrip \
+ CC='${CC}' CFLAGS='${CFLAGS} -I${STAGING_INCDIR}/libowfat' LDFLAGS='${LDFLAGS}' \
+"
+
+do_install() {
+ install -d -m0755 ${D}${bindir} ${D}${mandir}/man1
+
+ install -m0755 ncp ${D}${bindir}
+ ln -sf ncp ${D}${bindir}/npoll
+ ln -sf ncp ${D}${bindir}/npush
+
+ install -m0644 ncp.1 npush.1 ${D}${mandir}/man1
+ ln -sf npush.1 ${D}${mandir}/man1/npoll.1
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch
new file mode 100644
index 000000000..eeae5326d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch
@@ -0,0 +1,34 @@
+From 1ee2c998933c4a3d7e7b386352cbdb12f270774c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 6 Sep 2017 20:50:48 -0700
+Subject: [PATCH] autogen: Do not symlink gettext.h from build host
+
+This will create a dependency on build host having gettext
+installed which may not always be the case.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Inappropriate [Cross-compile specific]
+ autogen.sh | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 3371011..bbc7add 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -25,12 +25,6 @@ echo "Running autoreconf ..."
+ autoreconf -sfi
+ unlink po/Makevars.template
+
+-for d in /usr /usr/local /opt/gettext /usr/pkg $HOME ; do
+- if test -f $d/share/gettext/gettext.h ; then
+- ln -sf $d/share/gettext/gettext.h include/gettext.h
+- fi
+-done
+-
+ test -f "include/gettext.h" || {
+ echo "Error: can't find <gettext.h> convenience C header."
+ echo "Please put a link to it by hand as include/gettext.h"
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch
new file mode 100644
index 000000000..dc58b5b79
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0001-replace-VLAIS-with-malloc-free-pair.patch
@@ -0,0 +1,124 @@
+From 3a7d5396e633e6c02a4583be7faf3d79d0d33748 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 11:14:41 -0700
+Subject: [PATCH 1/2] replace VLAIS with malloc/free pair
+
+Makes it compatible with non-gnu compilers
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/trace-icmp.c | 7 +++++--
+ src/trace-tcp.c | 14 ++++++++++----
+ src/trace-udp.c | 7 +++++--
+ 3 files changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/src/trace-icmp.c b/src/trace-icmp.c
+index 842938e..c76cb54 100644
+--- a/src/trace-icmp.c
++++ b/src/trace-icmp.c
+@@ -43,16 +43,19 @@ send_echo_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ struct
+ {
+ struct icmp6_hdr ih;
+- uint8_t payload[plen - sizeof (struct icmp6_hdr)];
++ uint8_t *payload;
+ } packet;
+ memset (&packet, 0, plen);
++ packet.payload = malloc(plen - sizeof (struct icmp6_hdr));
+
+ packet.ih.icmp6_type = ICMP6_ECHO_REQUEST;
+ packet.ih.icmp6_id = htons (getpid ());
+ packet.ih.icmp6_seq = htons ((ttl << 8) | (n & 0xff));
+ (void)port;
+
+- return send_payload (fd, &packet.ih, plen, ttl);
++ ssize_t ret = send_payload (fd, &packet.ih, plen, ttl);
++ free(packet.payload);
++ return ret;
+ }
+
+
+diff --git a/src/trace-tcp.c b/src/trace-tcp.c
+index 940f918..62d22ff 100644
+--- a/src/trace-tcp.c
++++ b/src/trace-tcp.c
+@@ -54,10 +54,11 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ struct
+ {
+ struct tcphdr th;
+- uint8_t payload[plen - sizeof (struct tcphdr)];
++ uint8_t *payload;
+ } packet;
+
+ memset (&packet, 0, sizeof (packet));
++ packet.payload = malloc(plen - sizeof (struct tcphdr));
+ packet.th.th_sport = sport;
+ packet.th.th_dport = port;
+ packet.th.th_seq = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
+@@ -65,7 +66,9 @@ send_syn_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ packet.th.th_flags = TH_SYN | (ecn ? (TH_ECE | TH_CWR) : 0);
+ packet.th.th_win = htons (TCP_WINDOW);
+
+- return send_payload (fd, &packet, plen, ttl);
++ ssize_t ret = send_payload (fd, &packet, plen, ttl);
++ free(packet.payload);
++ return ret;
+ }
+
+
+@@ -131,10 +134,11 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ struct
+ {
+ struct tcphdr th;
+- uint8_t payload[plen - sizeof (struct tcphdr)];
++ uint8_t *payload;
+ } packet;
+
+ memset (&packet, 0, sizeof (packet));
++ packet.payload = malloc(plen - sizeof (struct tcphdr));
+ packet.th.th_sport = sport;
+ packet.th.th_dport = port;
+ packet.th.th_ack = htonl ((ttl << 24) | (n << 16) | (uint16_t)getpid ());
+@@ -142,7 +146,9 @@ send_ack_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ packet.th.th_flags = TH_ACK;
+ packet.th.th_win = htons (TCP_WINDOW);
+
+- return send_payload (fd, &packet, plen, ttl);
++ ssize_t ret = send_payload (fd, &packet, plen, ttl);
++ free(packet.payload);
++ return ret;
+ }
+
+
+diff --git a/src/trace-udp.c b/src/trace-udp.c
+index 4adde6b..a6cbb07 100644
+--- a/src/trace-udp.c
++++ b/src/trace-udp.c
+@@ -46,9 +46,10 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ struct
+ {
+ struct udphdr uh;
+- uint8_t payload[plen - sizeof (struct udphdr)];
++ uint8_t *payload;
+ } packet;
+ memset (&packet, 0, plen);
++ packet.payload = malloc(plen - sizeof (struct udphdr));
+
+ (void)n;
+ packet.uh.uh_sport = sport;
+@@ -61,7 +62,9 @@ send_udp_probe (int fd, unsigned ttl, unsigned n, size_t plen, uint16_t port)
+ /*if (plen > sizeof (struct udphdr))
+ packet.payload[0] = (uint8_t)ttl;*/
+
+- return send_payload (fd, &packet, plen, ttl);
++ ssize_t ret = send_payload (fd, &packet, plen, ttl);
++ free(packet.payload);
++ return ret;
+ }
+
+
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch
new file mode 100644
index 000000000..3cc2ba80c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6/0002-Do-not-undef-_GNU_SOURCE.patch
@@ -0,0 +1,30 @@
+From 2a50154fbce38fd36be7e14f5cd4a8b03c65c72f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 31 Aug 2017 11:15:37 -0700
+Subject: [PATCH 2/2] Do not undef _GNU_SOURCE
+
+There are functions from tcp.h which are under _GNU_SOURCE
+in musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/trace-tcp.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/src/trace-tcp.c b/src/trace-tcp.c
+index 62d22ff..380008e 100644
+--- a/src/trace-tcp.c
++++ b/src/trace-tcp.c
+@@ -21,7 +21,6 @@
+ # include <config.h>
+ #endif
+
+-#undef _GNU_SOURCE
+ #define _DEFAULT_SOURCE 1
+
+ #include <string.h>
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6_git.bb b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
new file mode 100644
index 000000000..cebc1d9cd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ndisc6/ndisc6_git.bb
@@ -0,0 +1,76 @@
+DESCRIPTION = "This package includes some useful diagnostics tools for \
+IPv6 networks, including ndisc6, rdisc6, tcptraceroute6 and traceroute6."
+SECTION = "net"
+HOMEPAGE = "http://www.remlab.net/ndisc6/"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+PV = "1.0.4+git${SRCPV}"
+SRCREV = "4c794b5512d23c649def1f94a684225dcbb6ac3e"
+SRC_URI = "git://git.remlab.net/git/ndisc6.git;protocol=http \
+ file://0001-replace-VLAIS-with-malloc-free-pair.patch \
+ file://0002-Do-not-undef-_GNU_SOURCE.patch \
+ file://0001-autogen-Do-not-symlink-gettext.h-from-build-host.patch \
+ "
+
+S = "${WORKDIR}/git"
+
+inherit autotools gettext
+
+EXTRA_OECONF += "PERL=${USRBINPATH}/perl"
+
+LDFLAGS += "-fuse-ld=gold"
+LDFLAGS_remove_riscv64 = "-fuse-ld=gold"
+
+TOOLCHAIN = "gcc"
+
+USE_NLS = "yes"
+
+do_configure_prepend() {
+ cp ${STAGING_DATADIR_NATIVE}/gettext/gettext.h ${S}/include
+ ${S}/autogen.sh
+}
+
+do_install_append () {
+ rm -rf ${D}${localstatedir}
+ # Enable SUID bit for applications that need it
+ chmod 4555 ${D}${bindir}/rltraceroute6
+ chmod 4555 ${D}${bindir}/ndisc6
+ chmod 4555 ${D}${bindir}/rdisc6
+}
+ALLOW_EMPTY_${PN} = "1"
+
+# Split into seperate packages since we normal don't want them all
+# The main package is left empty and therefore not created.
+PACKAGES += "${PN}-ndisc6 ${PN}-tcpspray6 ${PN}-rdisc6 \
+ ${PN}-tcptraceroute6 ${PN}-rltraceroute6 \
+ ${PN}-tracert6 ${PN}-rdnssd ${PN}-misc"
+FILES_${PN} = ""
+FILES_${PN}-ndisc6 = "${bindir}/ndisc6"
+FILES_${PN}-tcpspray6 = "${bindir}/tcpspray6"
+FILES_${PN}-rdisc6 = "${bindir}/rdisc6"
+FILES_${PN}-tcptraceroute6 = "${bindir}/tcptraceroute6"
+FILES_${PN}-rltraceroute6 = "${bindir}/rltraceroute6"
+FILES_${PN}-tracert6 = "${bindir}/tracert6"
+FILES_${PN}-rdnssd = "${sbindir}/rdnssd ${sysconfdir}/rdnssd"
+FILES_${PN}-misc = "${bindir}/dnssort ${bindir}/name2addr ${bindir}/tcpspray ${bindir}/addr2name"
+
+DESCRIPTION_${PN}-ndisc6 = "ICMPv6 Neighbor Discovery tool. \
+Performs IPv6 neighbor discovery in userland. Replaces arping from the \
+IPv4 world."
+DESCRIPTION_${PN}-rdisc6 = "ICMPv6 Router Discovery tool. \
+Queries IPv6 routers on the network for advertised prefixes. Can be used \
+to detect rogue IPv6 routers, monitor legitimate IPv6 routers."
+DESCRITPION_${PN}-tcpspray6 = "Performs bandwidth measurements of TCP \
+sessions between the local system and a remote echo server in either IPv6 \
+or IPv4."
+
+DESCRITPION_${PN}-rdnssd = "Daemon to autoconfigure the list of DNS \
+servers through slateless IPv6 autoconfiguration."
+
+# The tcptraceroute6 and tracert6 commands depend on rltraceroute6 to
+# perform the actual trace operation.
+RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6"
+RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6"
+RDEPENDS_${PN}-misc += "perl"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch b/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch
new file mode 100644
index 000000000..0966b6580
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd/0001-bundle-own-base64-encode-decode-functions.patch
@@ -0,0 +1,379 @@
+From ccd166b73eaae4dd1e1785c63ceb9b303568ed46 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 11:30:49 -0700
+Subject: [PATCH] bundle own base64 encode/decode functions
+
+Not all libc implementations provide it.
+as an aside libresolv is no longer needed
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile | 4 +-
+ base64.c | 313 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ netcat.c | 2 +
+ socks.c | 3 +
+ 4 files changed, 320 insertions(+), 2 deletions(-)
+ create mode 100644 base64.c
+
+Index: netcat-openbsd-1.105/Makefile
+===================================================================
+--- netcat-openbsd-1.105.orig/Makefile
++++ netcat-openbsd-1.105/Makefile
+@@ -1,9 +1,9 @@
+ # $OpenBSD: Makefile,v 1.6 2001/09/02 18:45:41 jakob Exp $
+
+ PROG= nc
+-SRCS= netcat.c atomicio.c socks.c
++SRCS= netcat.c atomicio.c socks.c base64.c
+
+-LIBS= `pkg-config --libs libbsd` -lresolv
++LIBS= `pkg-config --libs libbsd`
+ OBJS= $(SRCS:.c=.o)
+ CFLAGS= -g -O2
+ LDFLAGS= -Wl,--no-add-needed
+Index: netcat-openbsd-1.105/base64.c
+===================================================================
+--- /dev/null
++++ netcat-openbsd-1.105/base64.c
+@@ -0,0 +1,313 @@
++/*
++ * Copyright (c) 1996-1999 by Internet Software Consortium.
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
++ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
++ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
++ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
++ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
++ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
++ * SOFTWARE.
++ */
++
++/*
++ * Portions Copyright (c) 1995 by International Business Machines, Inc.
++ *
++ * International Business Machines, Inc. (hereinafter called IBM) grants
++ * permission under its copyrights to use, copy, modify, and distribute this
++ * Software with or without fee, provided that the above copyright notice and
++ * all paragraphs of this notice appear in all copies, and that the name of IBM
++ * not be used in connection with the marketing of any product incorporating
++ * the Software or modifications thereof, without specific, written prior
++ * permission.
++ *
++ * To the extent it has a right to do so, IBM grants an immunity from suit
++ * under its patents, if any, for the use, sale or manufacture of products to
++ * the extent that such products are used for performing Domain Name System
++ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
++ * granted for any product per se or for any other function of any product.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
++ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
++ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
++ */
++
++#if !defined(LINT) && !defined(CODECENTER)
++static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $";
++#endif /* not lint */
++
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/socket.h>
++
++#include <netinet/in.h>
++#include <arpa/inet.h>
++#include <arpa/nameser.h>
++
++#include <ctype.h>
++#include <resolv.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#define Assert(Cond) if (!(Cond)) abort()
++
++static const char Base64[] =
++ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
++static const char Pad64 = '=';
++
++/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
++ The following encoding technique is taken from RFC 1521 by Borenstein
++ and Freed. It is reproduced here in a slightly edited form for
++ convenience.
++
++ A 65-character subset of US-ASCII is used, enabling 6 bits to be
++ represented per printable character. (The extra 65th character, "=",
++ is used to signify a special processing function.)
++
++ The encoding process represents 24-bit groups of input bits as output
++ strings of 4 encoded characters. Proceeding from left to right, a
++ 24-bit input group is formed by concatenating 3 8-bit input groups.
++ These 24 bits are then treated as 4 concatenated 6-bit groups, each
++ of which is translated into a single digit in the base64 alphabet.
++
++ Each 6-bit group is used as an index into an array of 64 printable
++ characters. The character referenced by the index is placed in the
++ output string.
++
++ Table 1: The Base64 Alphabet
++
++ Value Encoding Value Encoding Value Encoding Value Encoding
++ 0 A 17 R 34 i 51 z
++ 1 B 18 S 35 j 52 0
++ 2 C 19 T 36 k 53 1
++ 3 D 20 U 37 l 54 2
++ 4 E 21 V 38 m 55 3
++ 5 F 22 W 39 n 56 4
++ 6 G 23 X 40 o 57 5
++ 7 H 24 Y 41 p 58 6
++ 8 I 25 Z 42 q 59 7
++ 9 J 26 a 43 r 60 8
++ 10 K 27 b 44 s 61 9
++ 11 L 28 c 45 t 62 +
++ 12 M 29 d 46 u 63 /
++ 13 N 30 e 47 v
++ 14 O 31 f 48 w (pad) =
++ 15 P 32 g 49 x
++ 16 Q 33 h 50 y
++
++ Special processing is performed if fewer than 24 bits are available
++ at the end of the data being encoded. A full encoding quantum is
++ always completed at the end of a quantity. When fewer than 24 input
++ bits are available in an input group, zero bits are added (on the
++ right) to form an integral number of 6-bit groups. Padding at the
++ end of the data is performed using the '=' character.
++
++ Since all base64 input is an integral number of octets, only the
++ -------------------------------------------------
++ following cases can arise:
++
++ (1) the final quantum of encoding input is an integral
++ multiple of 24 bits; here, the final unit of encoded
++ output will be an integral multiple of 4 characters
++ with no "=" padding,
++ (2) the final quantum of encoding input is exactly 8 bits;
++ here, the final unit of encoded output will be two
++ characters followed by two "=" padding characters, or
++ (3) the final quantum of encoding input is exactly 16 bits;
++ here, the final unit of encoded output will be three
++ characters followed by one "=" padding character.
++ */
++
++int
++b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) {
++ size_t datalength = 0;
++ u_char input[3];
++ u_char output[4];
++ size_t i;
++
++ while (2 < srclength) {
++ input[0] = *src++;
++ input[1] = *src++;
++ input[2] = *src++;
++ srclength -= 3;
++
++ output[0] = input[0] >> 2;
++ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
++ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
++ output[3] = input[2] & 0x3f;
++ Assert(output[0] < 64);
++ Assert(output[1] < 64);
++ Assert(output[2] < 64);
++ Assert(output[3] < 64);
++
++ if (datalength + 4 > targsize)
++ return (-1);
++ target[datalength++] = Base64[output[0]];
++ target[datalength++] = Base64[output[1]];
++ target[datalength++] = Base64[output[2]];
++ target[datalength++] = Base64[output[3]];
++ }
++
++ /* Now we worry about padding. */
++ if (0 != srclength) {
++ /* Get what's left. */
++ input[0] = input[1] = input[2] = '\0';
++ for (i = 0; i < srclength; i++)
++ input[i] = *src++;
++
++ output[0] = input[0] >> 2;
++ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
++ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
++ Assert(output[0] < 64);
++ Assert(output[1] < 64);
++ Assert(output[2] < 64);
++
++ if (datalength + 4 > targsize)
++ return (-1);
++ target[datalength++] = Base64[output[0]];
++ target[datalength++] = Base64[output[1]];
++ if (srclength == 1)
++ target[datalength++] = Pad64;
++ else
++ target[datalength++] = Base64[output[2]];
++ target[datalength++] = Pad64;
++ }
++ if (datalength >= targsize)
++ return (-1);
++ target[datalength] = '\0'; /* Returned value doesn't count \0. */
++ return (datalength);
++}
++//libresolv_hidden_def (b64_ntop)
++
++/* skips all whitespace anywhere.
++ converts characters, four at a time, starting at (or after)
++ src from base - 64 numbers into three 8 bit bytes in the target area.
++ it returns the number of data bytes stored at the target, or -1 on error.
++ */
++
++int
++b64_pton(char const *src, u_char *target, size_t targsize) {
++ int tarindex, state, ch;
++ char *pos;
++
++ state = 0;
++ tarindex = 0;
++
++ while ((ch = *src++) != '\0') {
++ if (isspace(ch)) /* Skip whitespace anywhere. */
++ continue;
++
++ if (ch == Pad64)
++ break;
++
++ pos = strchr(Base64, ch);
++ if (pos == 0) /* A non-base64 character. */
++ return (-1);
++
++ switch (state) {
++ case 0:
++ if (target) {
++ if ((size_t)tarindex >= targsize)
++ return (-1);
++ target[tarindex] = (pos - Base64) << 2;
++ }
++ state = 1;
++ break;
++ case 1:
++ if (target) {
++ if ((size_t)tarindex + 1 >= targsize)
++ return (-1);
++ target[tarindex] |= (pos - Base64) >> 4;
++ target[tarindex+1] = ((pos - Base64) & 0x0f)
++ << 4 ;
++ }
++ tarindex++;
++ state = 2;
++ break;
++ case 2:
++ if (target) {
++ if ((size_t)tarindex + 1 >= targsize)
++ return (-1);
++ target[tarindex] |= (pos - Base64) >> 2;
++ target[tarindex+1] = ((pos - Base64) & 0x03)
++ << 6;
++ }
++ tarindex++;
++ state = 3;
++ break;
++ case 3:
++ if (target) {
++ if ((size_t)tarindex >= targsize)
++ return (-1);
++ target[tarindex] |= (pos - Base64);
++ }
++ tarindex++;
++ state = 0;
++ break;
++ default:
++ abort();
++ }
++ }
++
++ /*
++ * We are done decoding Base-64 chars. Let's see if we ended
++ * on a byte boundary, and/or with erroneous trailing characters.
++ */
++
++ if (ch == Pad64) { /* We got a pad char. */
++ ch = *src++; /* Skip it, get next. */
++ switch (state) {
++ case 0: /* Invalid = in first position */
++ case 1: /* Invalid = in second position */
++ return (-1);
++
++ case 2: /* Valid, means one byte of info */
++ /* Skip any number of spaces. */
++ for ((void)NULL; ch != '\0'; ch = *src++)
++ if (!isspace(ch))
++ break;
++ /* Make sure there is another trailing = sign. */
++ if (ch != Pad64)
++ return (-1);
++ ch = *src++; /* Skip the = */
++ /* Fall through to "single trailing =" case. */
++ /* FALLTHROUGH */
++
++ case 3: /* Valid, means two bytes of info */
++ /*
++ * We know this char is an =. Is there anything but
++ * whitespace after it?
++ */
++ for ((void)NULL; ch != '\0'; ch = *src++)
++ if (!isspace(ch))
++ return (-1);
++
++ /*
++ * Now make sure for cases 2 and 3 that the "extra"
++ * bits that slopped past the last full byte were
++ * zeros. If we don't check them, they become a
++ * subliminal channel.
++ */
++ if (target && target[tarindex] != 0)
++ return (-1);
++ }
++ } else {
++ /*
++ * We ended by seeing the end of the string. Make sure we
++ * have no partial bytes lying around.
++ */
++ if (state != 0)
++ return (-1);
++ }
++
++ return (tarindex);
++}
+Index: netcat-openbsd-1.105/netcat.c
+===================================================================
+--- netcat-openbsd-1.105.orig/netcat.c
++++ netcat-openbsd-1.105/netcat.c
+@@ -169,6 +169,9 @@ static int connect_with_timeout(int fd,
+ socklen_t salen, int ctimeout);
+ static void quit();
+
++int b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);
++int b64_pton(char const *src, u_char *target, size_t targsize);
++
+ int
+ main(int argc, char *argv[])
+ {
+Index: netcat-openbsd-1.105/socks.c
+===================================================================
+--- netcat-openbsd-1.105.orig/socks.c
++++ netcat-openbsd-1.105/socks.c
+@@ -53,6 +53,9 @@
+ #define SOCKS_DOMAIN 3
+ #define SOCKS_IPV6 4
+
++int b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);
++int b64_pton(char const *src, u_char *target, size_t targsize);
++
+ int remote_connect(const char *, const char *, struct addrinfo);
+ int socks_connect(const char *, const char *, struct addrinfo,
+ const char *, const char *, struct addrinfo, int,
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb b/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb
new file mode 100644
index 000000000..9d7420f8c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb
@@ -0,0 +1,56 @@
+require netcat.inc
+SUMMARY = "OpenBSD Netcat"
+HOMEPAGE = "http://ftp.debian.org"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=ee6bbaacb5db5f2973818f0902c3ae6f"
+
+DEPENDS += "glib-2.0 libbsd"
+do_patch[depends] = "quilt-native:do_populate_sysroot"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz;name=netcat \
+ ${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz;name=netcat-patch;subdir=${BP} \
+ file://0001-bundle-own-base64-encode-decode-functions.patch \
+ "
+
+SRC_URI[netcat.md5sum] = "7e67b22f1ad41a1b7effbb59ff28fca1"
+SRC_URI[netcat.sha256sum] = "40653fe66c1516876b61b07e093d826e2a5463c5d994f1b7e6ce328f3edb211e"
+SRC_URI[netcat-patch.md5sum] = "e914f8eb7eda5c75c679dd77787ac76b"
+SRC_URI[netcat-patch.sha256sum] = "eee759327ffea293e81d0dde67921b7fcfcad279ffd7a2c9d037bbc8f882b363"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE += "'LDFLAGS=${LDFLAGS}'"
+
+do_configure[noexec] = "1"
+
+netcat_do_patch() {
+ cd ${S}
+ quilt pop -a || true
+ if [ -d ${S}/.pc-netcat ]; then
+ rm -rf ${S}/.pc
+ mv ${S}/.pc-netcat ${S}/.pc
+ QUILT_PATCHES=${S}/debian/patches quilt pop -a
+ rm -rf ${S}/.pc ${S}/debian
+ fi
+ QUILT_PATCHES=${S}/debian/patches quilt push -a
+ mv ${S}/.pc ${S}/.pc-netcat
+}
+
+do_unpack[cleandirs] += "${S}"
+
+python do_patch() {
+ bb.build.exec_func('netcat_do_patch', d)
+ bb.build.exec_func('patch_do_patch', d)
+}
+
+do_compile() {
+ cd ${S}
+ pkgrel=4
+ oe_runmake CFLAGS="$CFLAGS -DDEBIAN_VERSION=\"\\\"${pkgrel}\\\"\""
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 755 ${S}/nc ${D}${bindir}/nc.${BPN}
+}
+ALTERNATIVE_PRIORITY = "60"
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc b/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc
new file mode 100644
index 000000000..15441645b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat.inc
@@ -0,0 +1,15 @@
+SUMMARY = "GNU Netcat"
+HOMEPAGE = "http://netcat.sourceforge.net"
+DESCRIPTION = "A simple Unix utility which reads and writes data across network \
+connections using TCP or UDP protocol. It is designed to be a reliable \
+'back-end' tool that can be used directly or easily driven by other \
+programs and scripts. At the same time it is a feature-rich network \
+debugging and exploration tool, since it can create almost any kind of \
+connection you would need and has several interesting built-in \
+capabilities."
+
+SECTION = "net"
+inherit update-alternatives gettext pkgconfig
+
+ALTERNATIVE_${PN} = "nc"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch
new file mode 100644
index 000000000..dd1938a99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch
@@ -0,0 +1,34 @@
+Make netcat_flag_count() return positive value
+
+C language has 3 distinct char types:
+ char
+ unsigned char
+ signed char
+A char has the same range of values as signed char on X86,
+but same as unsigned char on PPC which made netcat_flag_count
+return a negative value, now we force variable c as signed char
+to make netcat_flag_count return positive value.
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/flagset.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/flagset.c b/src/flagset.c
+index 442b634..54ac898 100644
+--- a/src/flagset.c
++++ b/src/flagset.c
+@@ -134,7 +134,7 @@ unsigned short netcat_flag_next(unsigned short port)
+
+ int netcat_flag_count(void)
+ {
+- register char c;
++ register signed char c;
+ register int i;
+ int ret = 0;
+
+--
+1.7.5.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch
new file mode 100644
index 000000000..5cbcb08e8
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch
@@ -0,0 +1,25 @@
+Apparently somewhere along the line HAVE_LOCALE_H was changed to
+HAVE_LC_MESSAGES. Adjust netcat to match.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: netcat-0.7.1/src/intl.h
+===================================================================
+--- netcat-0.7.1.orig/src/intl.h
++++ netcat-0.7.1/src/intl.h
+@@ -25,11 +25,11 @@
+ #ifdef ENABLE_NLS
+ #include <libintl.h>
+
+-#ifdef HAVE_LOCALE_H
++#if defined(HAVE_LC_MESSAGES) || defined(HAVE_LOCALE_H)
+ #include <locale.h>
+ #else
+ #error You must have locale.h in your system
+-#endif /* HAVE_LOCALE_H */
++#endif /* HAVE_LC_MESSAGES || HAVE_LOCALE_H */
+
+ /* Our dear (and very common) gettext macros */
+ #define _(String) gettext(String)
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch
new file mode 100644
index 000000000..9b0ed58d6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch
@@ -0,0 +1,32 @@
+Replace obsoleted AM_CONFIG_HEADER flagged by autoconf 2.69
+locale.h check was picked from old gettext macros but with new aclocal
+it picks the right 0.18 gettext.m4 and does not get the check
+therefore we explicitly add it to configure.ac
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: netcat-0.7.1/configure.ac
+===================================================================
+--- netcat-0.7.1.orig/configure.ac 2013-01-18 01:30:01.928069739 -0800
++++ netcat-0.7.1/configure.ac 2013-01-18 01:32:50.568073009 -0800
+@@ -26,8 +26,7 @@
+ AC_PREREQ(2.53)
+
+ dnl without this order in this file, automake will be confused!
+-AM_CONFIG_HEADER(config.h)
+-
++AC_CONFIG_HEADERS(config.h)
+ dnl check for programs. first the c compiler.
+ AC_PROG_CC
+ AC_PROG_CPP
+@@ -56,7 +55,7 @@
+ AC_LBL_LIBRARY_NET
+
+ dnl Fortunately we have Solaris...
+-AC_CHECK_HEADERS(sys/sockio.h)
++AC_CHECK_HEADERS(sys/sockio.h locale.h)
+
+ AC_CHECK_FUNCS(srandom random)
+ if test $ac_cv_func_srandom = no; then
diff --git a/meta-openembedded/meta-networking/recipes-support/netcat/netcat_0.7.1.bb b/meta-openembedded/meta-networking/recipes-support/netcat/netcat_0.7.1.bb
new file mode 100644
index 000000000..d961af542
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcat/netcat_0.7.1.bb
@@ -0,0 +1,22 @@
+require netcat.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PR = "r3"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/netcat/netcat-${PV}.tar.bz2 \
+ file://obsolete_autoconf_macros.patch \
+ file://netcat-locale_h.patch \
+ file://make-netcat_flag_count_work.patch \
+"
+
+SRC_URI[md5sum] = "0a29eff1736ddb5effd0b1ec1f6fe0ef"
+SRC_URI[sha256sum] = "b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb"
+
+inherit autotools
+
+do_install_append() {
+ install -d ${D}${bindir}
+ mv ${D}${bindir}/nc ${D}${bindir}/nc.${BPN}
+}
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta-openembedded/meta-networking/recipes-support/netcf/netcf_0.2.8.bb b/meta-openembedded/meta-networking/recipes-support/netcf/netcf_0.2.8.bb
new file mode 100644
index 000000000..9a6f60ea2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netcf/netcf_0.2.8.bb
@@ -0,0 +1,71 @@
+SUMMARY = "netcf"
+DESCRIPTION = "netcf is a cross-platform network configuration library."
+HOMEPAGE = "https://pagure.io/netcf"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=fb919cc88dbe06ec0b0bd50e001ccf1f"
+
+SRCREV = "2c5d4255857531bc09d91dcd02e86545f29004d4"
+PV .= "+git${SRCPV}"
+
+SRC_URI = "git://pagure.io/netcf.git;protocol=https \
+"
+
+DEPENDS += "augeas libnl libxslt libxml2 gnulib"
+
+S = "${WORKDIR}/git"
+
+inherit gettext autotools pkgconfig systemd
+
+EXTRA_OECONF_append_class-target = " --with-driver=redhat"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG[systemd] = "--with-sysinit=systemd,--with-sysinit=initscripts,"
+
+EXTRA_AUTORECONF += "-I ${S}/gnulib/m4"
+
+do_configure_prepend() {
+ currdir=`pwd`
+ cd ${S}
+
+ # avoid bootstrap cloning gnulib on every configure
+ # the dir starts out empty from the pkg, but unconditionally blow it
+ # away so if we reconfigure due to gnulib sysroot sig changes, we will
+ # get the newer gnulib content into the build here.
+ rm -rf ${S}/.gnulib
+ cp -rf ${STAGING_DATADIR}/gnulib ${S}/.gnulib
+
+ # --force to avoid errors on reconfigure e.g if recipes changed we depend on
+ # | bootstrap: running: libtoolize --quiet
+ # | libtoolize: error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
+ # | ...
+ ./bootstrap --force --no-git --gnulib-srcdir=.gnulib
+
+ cd $currdir
+}
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ if [ -d "${D}${libdir}/systemd/system" ]; then
+ if [ "${systemd_unitdir}" != "${libdir}/systemd" ] ; then
+ mv ${D}${libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
+ rm -rf ${D}${libdir}/systemd/
+ fi
+ elif [ "${systemd_unitdir}" != "${nonarch_libdir}/systemd" ] ; then
+ mv ${D}${nonarch_libdir}/systemd/system/* ${D}${systemd_unitdir}/system/
+ rm -rf ${D}${nonarch_libdir}/systemd/
+ fi
+ else
+ mv ${D}${sysconfdir}/rc.d/init.d/ ${D}${sysconfdir}
+ rm -rf ${D}${sysconfdir}/rc.d/
+ fi
+}
+
+FILES_${PN} += " \
+ ${libdir} \
+ ${nonarch_libdir} \
+ "
+
+SYSTEMD_SERVICE_${PN} = "netcf-transaction.service"
diff --git a/meta-openembedded/meta-networking/recipes-support/netperf/files/cpu_set.patch b/meta-openembedded/meta-networking/recipes-support/netperf/files/cpu_set.patch
new file mode 100644
index 000000000..434b79049
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netperf/files/cpu_set.patch
@@ -0,0 +1,30 @@
+Subject: [PATCH] netperf: fix CPU_SETSIZE to build with eglibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ src/netlib.c | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/src/netlib.c b/src/netlib.c
+index 206e002..e33aae6 100644
+--- a/src/netlib.c
++++ b/src/netlib.c
+@@ -2265,7 +2265,12 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map)
+ fall-back on what we had before, which is to use just the size of
+ an unsigned long. raj 2006-09-14 */
+
+-#if defined(__CPU_SETSIZE)
++#if defined(CPU_SETSIZE)
++#define NETPERF_CPU_SETSIZE CPU_SETSIZE
++#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp)
++#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp)
++ typedef cpu_set_t netperf_cpu_set_t;
++#elif defined(__CPU_SETSIZE)
+ #define NETPERF_CPU_SETSIZE __CPU_SETSIZE
+ #if defined(__CPU_SET_S)
+ #define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp)
+--
+1.7.1.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/netperf/files/init b/meta-openembedded/meta-networking/recipes-support/netperf/files/init
new file mode 100644
index 000000000..8ba2a6373
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netperf/files/init
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>.
+# Modified for Debian by Christoph Lameter <clameter@debian.org>
+# Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz>
+
+### BEGIN INIT INFO
+# Provides: netperf
+# Required-Start: $remote_fs $local_fs $time
+# Required-Stop: $remote_fs $local_fs $time
+# Should-Start: $network $named
+# Should-Stop: $network $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: network benchmark
+### END INIT INFO
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/sbin/netserver
+
+test -f $DAEMON || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting network benchmark server: netserver"
+ start-stop-daemon -S -x $DAEMON > /dev/null 2>&1
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping network benchmark server: netserver"
+ start-stop-daemon -K -x $DAEMON
+ echo "."
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its config files on the fly
+ # for example by sending it SIGHUP, do it here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this a do-nothing entry.
+ #
+ # start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON
+ # ;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ start-stop-daemon -K -x $DAEMON
+ sleep 1
+ start-stop-daemon -S -x $DAEMON
+ ;;
+ *)
+ echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-support/netperf/files/vfork.patch b/meta-openembedded/meta-networking/recipes-support/netperf/files/vfork.patch
new file mode 100644
index 000000000..eff98bfde
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netperf/files/vfork.patch
@@ -0,0 +1,58 @@
+Subject: [PATCH] netperf: fix vfork/fork
+
+Upstream-Status: Pending
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ src/netserver.c | 12 ++++++++++--
+ 1 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/netserver.c b/src/netserver.c
+index 379a106..f6a8b09 100644
+--- a/src/netserver.c
++++ b/src/netserver.c
+@@ -1020,7 +1020,7 @@ process_requests()
+ void
+ spawn_child() {
+
+-#if defined(HAVE_FORK)
++#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+
+ if (debug) {
+ fprintf(where,
+@@ -1038,7 +1038,11 @@ spawn_child() {
+
+ signal(SIGCLD,SIG_IGN);
+
++#if defined(HAVE_FORK)
+ switch (fork()) {
++#else
++ switch (vfork()) {
++#endif
+ case -1:
+ fprintf(where,
+ "%s: fork() error %s (errno %d)\n",
+@@ -1405,7 +1409,7 @@ scan_netserver_args(int argc, char *argv[]) {
+
+ void
+ daemonize() {
+-#if defined(HAVE_FORK)
++#if defined(HAVE_FORK) || defined(HAVE_VFORK)
+
+ if (debug) {
+ fprintf(where,
+@@ -1419,7 +1423,11 @@ daemonize() {
+ fflush(stdout);
+ fflush(stderr);
+
++#if defined(HAVE_FORK)
+ switch (fork()) {
++#else
++ switch (vfork()) {
++#endif
+ case -1:
+ fprintf(stderr,
+ "%s: fork() error %s (errno %d)\n",
+--
+1.7.1.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/netperf/netperf_git.bb b/meta-openembedded/meta-networking/recipes-support/netperf/netperf_git.bb
new file mode 100644
index 000000000..f0e0f9cf1
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/netperf/netperf_git.bb
@@ -0,0 +1,66 @@
+SUMMARY = "A networking benchmarking tool"
+DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more."
+SECTION = "net"
+HOMEPAGE = "http://www.netperf.org/"
+LICENSE = "netperf"
+LICENSE_FLAGS = "non-commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6"
+
+PV = "2.7.0+git${SRCPV}"
+
+SRC_URI="git://github.com/HewlettPackard/netperf.git \
+ file://cpu_set.patch \
+ file://vfork.patch \
+ file://init"
+
+SRCREV = "f482bab49fcedee46fc5b755da127f608325cd13"
+
+S = "${WORKDIR}/git"
+
+inherit update-rc.d autotools
+
+# cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros
+CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE"
+
+# set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files
+# larger than 2GB
+CFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', \
+ ' -D_FILE_OFFSET_BITS=64', '', d)}"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[sctp] = "--enable-sctp,--disable-sctp,lksctp-tools,"
+
+# autotools.bbclass attends to include m4 files with path depth <= 2 by
+# "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4.
+do_configure_prepend() {
+ test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files
+}
+
+do_install() {
+ sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init
+
+ install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d
+ install -m 4755 src/netperf ${D}${bindir}
+ install -m 4755 src/netserver ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf
+
+ # man
+ install -d ${D}${mandir}/man1/
+ install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1
+ install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1
+
+ # move scripts to examples directory
+ install -d ${D}${docdir}/netperf/examples
+ install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/
+
+ # docs ..
+ install -m 0644 ${S}/COPYING ${D}${docdir}/netperf
+ install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf
+ install -m 0644 ${S}/README ${D}${docdir}/netperf
+ install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf
+}
+
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'sctp', 'kernel-module-sctp', '', d)}"
+
+INITSCRIPT_NAME="netperf"
+INITSCRIPT_PARAMS="defaults"
diff --git a/meta-openembedded/meta-networking/recipes-support/nghttp2/nghttp2_1.26.0.bb b/meta-openembedded/meta-networking/recipes-support/nghttp2/nghttp2_1.26.0.bb
new file mode 100644
index 000000000..3ccd486be
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nghttp2/nghttp2_1.26.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "HTTP/2 C Library and tools"
+HOMEPAGE = "https://nghttp2.org/"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=764abdf30b2eadd37ce47dcbce0ea1ec"
+
+SRC_URI = "https://github.com/nghttp2/nghttp2/releases/download/v${PV}/nghttp2-${PV}.tar.bz2"
+SRC_URI[md5sum] = "926f07ad3b50f38f7d8935ced04716cf"
+SRC_URI[sha256sum] = "0df4229f4123b5aa96e834ebcfdffe954e93d986f0252fd10123d50c6f010983"
+
+DEPENDS = "libxml2 openssl zlib jansson cunit c-ares"
+
+inherit cmake pythonnative python-dir
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/files/ypbind.init b/meta-openembedded/meta-networking/recipes-support/nis/files/ypbind.init
new file mode 100644
index 000000000..669c19ca0
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/files/ypbind.init
@@ -0,0 +1,107 @@
+#! /bin/sh
+# Copyright (c) 2004 Author: Thorsten Kukuk <kukuk@suse.de>
+#
+# /etc/init.d/ypbind
+#
+# and symbolic its link
+#
+# /usr/sbin/rcypbind
+#
+# System startup script for the ypbind daemon
+#
+### BEGIN INIT INFO
+# Provides: ypbind
+# Required-Start: $remote_fs $portmap
+# Should-Start: ypserv slpd
+# Required-Stop: portmap
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Start ypbind (necessary for a NIS client)
+# Description: ypbind finds the server for NIS domains and maintains
+# the NIS binding information.
+### END INIT INFO
+
+# Need to use status function
+. /etc/init.d/functions
+
+YPBIND_BIN=/usr/sbin/ypbind
+pidfile=/var/run/ypbind.pid
+YPDOMAINNAME_bin=/usr/bin/ypdomainname
+
+[ -f /etc/default/ypbind ] && . /etc/default/ypbind
+
+case "$1" in
+ start)
+ echo -n "Starting ypbind"
+ ## If the domainname is not set, skip starting of ypbind
+ ## and return with "program not configured"
+ $YPDOMAINNAME_bin >/dev/null 2>&1
+ if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
+ if [ -f /etc/defaultdomain ]; then
+ XDOMAINNAME=`cat /etc/defaultdomain`
+ $YPDOMAINNAME_bin "$XDOMAINNAME"
+ fi
+ $YPDOMAINNAME_bin >/dev/null 2>&1
+ if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
+ # Tell the user this has skipped
+ echo -n " . . . . . . . . . . No domainname set"
+ # service is not configured
+ exit 1
+ fi
+ fi
+
+ ## If we don't have a /etc/yp.conf file, skip starting of
+ ## ypbind and return with "program not configured"
+ ## if you add the -broadcast Option later, comment this out.
+ if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then
+ # Tell the user this has skipped
+ echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}"
+ # service is not configured
+ exit 1
+ fi
+
+ # evaluate the OPTIONS for ypbind-mt
+ OPTIONS=""
+ test "$YPBIND_LOCAL_ONLY" = "yes" && OPTIONS="-local-only $OPTIONS"
+ test "$YPBIND_BROADCAST" = "yes" && OPTIONS="-broadcast $OPTIONS"
+ test "$YPBIND_BROKEN_SERVER" = "yes" && OPTIONS="-broken-server $OPTIONS"
+
+ start-stop-daemon --start --quiet --pidfile $pidfile --exec $YPBIND_BIN -- $YPBIND_OPTIONS $OPTIONS
+ if [ $? -eq 0 ]; then
+ notfound=1
+ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
+ ypwhich >/dev/null 2>&1 && { notfound=0 ; break; };
+ echo -n " ."
+ sleep 1;
+ done
+ if [ $notfound -eq 1 ]; then
+ echo -n " ${warn}No NIS server found${norm}";
+ fi
+ else
+ exit 1
+ fi
+ ;;
+ stop)
+ echo -n "Shutting down ypbind"
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ # Remove static data, else glibc will continue to use NIS
+ rm -f /var/yp/binding/* /var/run/ypbind.pid
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ reload | force-reload)
+ echo -n "Reload service ypbind"
+ start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile
+ ;;
+ status)
+ echo -n "Checking for ypbind: "
+ status $YPBIND_BIN
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+ exit 1
+ ;;
+esac
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/nis.inc b/meta-openembedded/meta-networking/recipes-support/nis/nis.inc
new file mode 100644
index 000000000..200eaf74d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/nis.inc
@@ -0,0 +1,31 @@
+# This include file contains global definitions for the
+# various NIS packages.
+#
+# These packages will only function correctly with glibc -
+# the rpcsvc functionality is not present in uclibc
+DESCRIPTION = "NIS Server and Tools"
+HOMEPAGE = "http://www.linux-nis.org/nis/"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+inherit autotools gettext pkgconfig
+
+# install is broken because src/Makefile heroically adds '-s'
+# to the install flags - passing -s to the build /usr/bin/install!
+# install-strip gets it right but installs ypbind -m <default>,
+# not -m 555. In an OE build this is not, so far as I can see,
+# a security problem (and this fix to the build problem is *much*
+# easier and more maintainable.)
+do_install() {
+ oe_runmake 'DESTDIR=${D}' install-strip
+}
+
+# An attempt to build on uclibc will fail, causing annoyance,
+# so force the package to be skipped here (this will cause a
+# 'nothing provides' error)
+python () {
+ os = d.getVar("TARGET_OS", True)
+ if os == "linux-uclibc":
+ raise bb.parse.SkipRecipe("NIS functionality requires rpcsvc/yp.h, uClibC does not provide this")
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/domainname.service b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/domainname.service
new file mode 100644
index 000000000..21aa92cb3
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools/domainname.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NIS Domainname
+
+[Service]
+Type=oneshot
+EnvironmentFile=/etc/nisdomainname
+ExecStart=/usr/bin/domainname $NISDOMAINNAME
+RemainAfterExit=true
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_2.14.bb b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_2.14.bb
new file mode 100644
index 000000000..8c6837bac
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_2.14.bb
@@ -0,0 +1,34 @@
+# This package builds tools to manage NIS
+# The source package is utils/net/NIS/yp-tools
+#
+require nis.inc
+
+SUMMARY = "NIS client programs"
+DESCRIPTION = " \
+Network Information Service tools. \
+This package contains ypcat, ypmatch, ypset, \
+ypwhich, yppasswd, domainname, nisdomainname \
+and ypdomainname. \
+\
+This is the final IPv4-only version of yp-tools. \
+"
+
+SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \
+ file://domainname.service \
+"
+SRC_URI[md5sum] = "ba1f121c17e3ad65368be173b977cd13"
+SRC_URI[sha256sum] = "d01f70fadc643a55107a0edc47c6be99d0306bcc4f66df56f65e74238b0124c9"
+
+inherit systemd
+SYSTEMD_SERVICE_${PN} = "domainname.service"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+
+CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true"
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_4.2.3.bb b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_4.2.3.bb
new file mode 100644
index 000000000..4e27e32d4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/yp-tools_4.2.3.bb
@@ -0,0 +1,47 @@
+# This package builds tools to manage NIS
+# The source package is utils/net/NIS/yp-tools
+#
+require nis.inc
+
+SUMMARY = "NIS client programs"
+DESCRIPTION = " \
+Network Information Service tools. \
+This package contains ypcat, ypmatch, ypset, \
+ypwhich, yppasswd, domainname, nisdomainname \
+and ypdomainname. \
+"
+
+# v4.2.3
+SRCREV = "1bfda29c342a81b97cb1995ffd9e8da5de63e7ab"
+
+SRC_URI = "git://github.com/thkukuk/yp-tools \
+ file://domainname.service \
+ "
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "libtirpc libnsl2"
+
+inherit autotools systemd
+SYSTEMD_SERVICE_${PN} = "domainname.service"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+
+CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true"
+
+EXTRA_OECONF = " \
+ --disable-rpath --disable-domainname \
+ "
+CFLAGS_append_libc-musl = " -Wno-error=cpp"
+
+FILES_${PN} += " ${libdir}/yp-nis/*.so.*.* ${libdir}/yp-nis/pkgconfig/"
+FILES_${PN}-dbg += " ${libdir}/yp-nis/.debug"
+FILES_${PN}-dev += " ${libdir}/yp-nis/*.so ${libdir}/yp-nis/*.so.[12] ${libdir}/yp-nis/*.la"
+FILES_${PN}-staticdev += " ${libdir}/yp-nis/*.a"
+
+do_install_append() {
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch
new file mode 100644
index 000000000..643b0a940
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/0001-dns_hosts-Fix-build-with-musl.patch
@@ -0,0 +1,67 @@
+From 5452961750275b1e3f7c95e9528338f0ee0357ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 14 Sep 2017 09:17:35 -0700
+Subject: [PATCH] dns_hosts: Fix build with musl
+
+Add NETDB_* defines which are not available in musl
+remove need for sys/cdefs.h by remove __P
+Add _GNU_SOURCE for missing u_char definition
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ lib/Makefile.am | 2 +-
+ lib/dns_hosts.c | 9 ++++++++-
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index 977a8db..35cb5b3 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -8,7 +8,7 @@
+ noinst_LIBRARIES = libcompat.a
+ noinst_HEADERS = ypbind3_binding.h
+
+-AM_CFLAGS = -D_REENTRANT=1 @WARNFLAGS@
++AM_CFLAGS = -D_GNU_SOURCE -D_REENTRANT=1 @WARNFLAGS@
+ AM_CPPFLAGS = -I$(srcdir) @TIRPC_CFLAGS@ @NSL_CFLAGS@ -DLOCALEDIR=\"$(localedir)\"
+
+ libcompat_a_SOURCES = dns_hosts.c res_options.h ypbind3_binding_dup.c \
+diff --git a/lib/dns_hosts.c b/lib/dns_hosts.c
+index fd421fd..6067879 100644
+--- a/lib/dns_hosts.c
++++ b/lib/dns_hosts.c
+@@ -64,6 +64,7 @@
+
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <arpa/nameser.h>
+@@ -84,6 +85,12 @@ extern struct hostent *_gethtbyaddr(const char *, int, int);
+ #ifndef LOG_AUTH
+ # define LOG_AUTH 0
+ #endif
++#ifndef NETDB_SUCCESS
++# define NETDB_SUCCESS 0
++#endif
++#ifndef NETDB_INTERNAL
++# define NETDB_INTERNAL -1
++#endif
+
+ #define MULTI_PTRS_ARE_ALIASES 1 /* XXX - experimental */
+
+@@ -101,7 +108,7 @@ static char hostbuf[8*1024];
+ static struct in_addr host_addr;
+
+ #ifdef RESOLVSORT
+-static void addrsort __P((char **, int));
++static void addrsort (char **, int);
+ #endif
+
+ #if PACKETSZ > 1024
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service
new file mode 100644
index 000000000..1f8df42af
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=YP Bind
+Requires=domainname.service
+After=domainname.service network.target
+Before=systemd-user-sessions.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/ypbind.pid
+ExecStart=/usr/sbin/ypbind
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb
new file mode 100644
index 000000000..9822f455e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nis/ypbind-mt_2.4.bb
@@ -0,0 +1,62 @@
+# This package builds the NIS ypbind daemon
+# The source package is utils/net/NIS/ypbind-mt
+#
+require nis.inc
+
+DESCRIPTION = " \
+Multithreaded NIS bind service (ypbind-mt). \
+ypbind-mt is a complete new implementation of a NIS \
+binding daemon for Linux. It has the following \
+features. Supports ypbind protocol V1 and V2. \
+Uses threads for better response. Supports multiple \
+domain bindings. Supports /var/yp/binding/* file \
+for Linux libc 4/5 and glibc 2.x. Supports a list \
+of known secure NIS server (/etc/yp.conf) Binds to \
+the server which answered as first. \
+\
+This is the final IPv4-only version of ypbind-mt. \
+"
+HOMEPAGE = "http://www.linux-nis.org/nis/ypbind-mt/index.html"
+DEPENDS = " \
+ yp-tools \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+ "
+DEPENDS_append_libc-musl = " bsd-headers nss"
+RDEPENDS_${PN} += "yp-tools"
+
+# ypbind-mt now provides all the functionality of ypbind
+# and is used in place of it.
+PROVIDES += "ypbind"
+
+SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \
+ file://ypbind.init \
+ file://ypbind.service \
+ file://0001-dns_hosts-Fix-build-with-musl.patch \
+ "
+SRC_URI[md5sum] = "1aeccd0d11c064d5d59c56941bca682b"
+SRC_URI[sha256sum] = "a2e1fa8fc992a12b289c229e00e38c20d59070c3bcf08babf40c692515c340e0"
+
+inherit systemd update-rc.d
+
+SYSTEMD_SERVICE_${PN} = "ypbind.service"
+INITSCRIPT_NAME = "ypbind"
+INITSCRIPT_PARAMS = "start 44 3 5 . stop 70 0 1 2 6 ."
+
+CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true"
+
+CFLAGS_append_libc-musl = " -I${STAGING_INCDIR}/nss3"
+
+do_install_append () {
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/rcS.d
+
+ install -m 0755 ${WORKDIR}/ypbind.init ${D}${sysconfdir}/init.d/ypbind
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system
+}
+
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
diff --git a/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed/use-ldflags.patch b/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed/use-ldflags.patch
new file mode 100644
index 000000000..87a7778d9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed/use-ldflags.patch
@@ -0,0 +1,16 @@
+Obey LDFLAGS.
+
+Signed-off-by: Christopher Larson <kergoth@gmail.com>
+Upstream-Status: Pending
+
+--- Ntimed.orig/configure 2015-05-30 11:57:59.927796993 -0700
++++ Ntimed/configure 2015-05-30 11:58:26.143948894 -0700
+@@ -142,7 +142,7 @@
+
+ echo
+ echo "ntimed-client: ${l}"
+- echo " \${CC} \${CFLAGS} -o ntimed-client ${l} -lm"
++ echo " \${CC} \${CFLAGS} -o ntimed-client ${l} \${LDFLAGS} -lm"
+ echo
+ echo "clean:"
+ echo " rm -f ${l} ntimed-client"
diff --git a/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb b/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb
new file mode 100644
index 000000000..a749b1659
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntimed/ntimed_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Network time synchronization software, NTPD replacement"
+DESCRIPTION = "This is a preview/early-access/alpha/buzzword-of-the-times \
+release of a new FOSS project written to gradually take over the world of \
+networked timekeeping."
+HOMEPAGE = "https://github.com/bsdphk/Ntimed"
+SECTION = "net"
+
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://main.c;beginline=2;endline=24;md5=89db8e76f2951f3fad167e7aa9718a44"
+
+SRC_URI = "git://github.com/bsdphk/Ntimed \
+ file://use-ldflags.patch"
+
+PV = "0.0+git${SRCPV}"
+SRCREV = "db0abbb4c80f2ecef6bc5d9639bca5bea28532a2"
+
+S = "${WORKDIR}/git"
+
+# use adjtimex on musl
+CFLAGS_append_libc-musl = " -Dntp_adjtime=adjtimex"
+
+EXTRA_OEMAKE = "\
+ 'CC=${CC}' \
+ 'CFLAGS=${CFLAGS}' \
+ 'LDFLAGS=${LDFLAGS}' \
+"
+
+do_configure () {
+ sh ${S}/configure
+}
+
+do_install () {
+ install -D -m 0755 ntimed-client ${D}${sbindir}/ntimed-client
+}
+
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN} += "ntimed-client"
+
+PACKAGE_BEFORE_PN += "ntimed-client"
+FILES_ntimed-client = "${sbindir}/ntimed-client"
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch
new file mode 100644
index 000000000..81ffeec21
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/0001-nDPI-Include-sys-types.h.patch
@@ -0,0 +1,26 @@
+From 6543f3e2d5fe214e2fc6c050289bf1ae73b18724 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 30 Aug 2017 13:56:24 -0700
+Subject: [PATCH] nDPI: Include sys/types.h
+
+Needed for uint_t types
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ nDPI/src/include/ipq_api.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: ntop-5.0.1/nDPI/src/include/ipq_api.h
+===================================================================
+--- ntop-5.0.1.orig/nDPI/src/include/ipq_api.h
++++ ntop-5.0.1/nDPI/src/include/ipq_api.h
+@@ -24,6 +24,7 @@
+ #ifndef __IPOQUE_API_INCLUDE_FILE__
+ #define __IPOQUE_API_INCLUDE_FILE__
+
++#include <sys/types.h>
+
+ #if defined(HAVE_NTOP) && defined(WIN32)
+ #include <winsock2.h>
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop.service b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop.service
new file mode 100644
index 000000000..1ead2a0c5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=A network traffic probe similar to the UNIX top command
+Requires=network.target
+
+ConditionPathExists=@SYSCONFDIR@/ntop.conf
+After=syslog.target network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/ntop-helper start
+ExecStop=@LIBEXECDIR@/ntop-helper stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch
new file mode 100644
index 000000000..392cb082b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in.patch
@@ -0,0 +1,164 @@
+1)add --with-pcap-config option to use libpcap's pcap-config
+2)add AC_CHECK_LIB if user didn't specify PCAP_ROOT and pcap-config
+ put it before host check to make cross-compiling easier.
+ pcap doesn't need extra include and libs so it is fine.
+3)remove old rrd configure code but use pkg-config to config rrd
+ rrdtool should have the pkg-config file installed.
+4)fix python-config
+5)change AC_TRY_RUN to AC_COMPILE_IFELSE for pthread_rwlock_t checking
+6)fix a net-snmp-config bug
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+diff --git a/configure.in b/configure.in
+index 0c7c0a5..cad40be 100644
+--- a/configure.in
++++ b/configure.in
+@@ -230,14 +230,14 @@ dnl>
+ AC_ARG_WITH(void,
+ [ +-External-source-locations:-------------------------------------------------+])
+
+-AC_ARG_WITH( rrd-home,
+- [ --with-rrd-home=DIR Usually /usr/local/rrdtool-1.2.x],
+- RRD_HOME="$withval",
+- RRD_HOME=/usr/local/rrdtool-1.2.19)
+ AC_ARG_WITH( pcap-root,
+ [ --with-pcap-root=DIR LBNL pcap located in DIR],
+ PCAP_ROOT="$withval",
+ PCAP_ROOT=)
++AC_ARG_WITH( pcap-config,
++ [ --with-pcap-config=path/pcap-config where to find pcap-config],
++ PCAP_CONFIG="$withval",
++ PCAP_CONFIG=)
+ AC_ARG_WITH( gdbm-root,
+ [ --with-gdbm-root=DIR gdbm located in DIR],
+ GDBM_DIRECTORY="$withval",
+@@ -556,6 +556,7 @@ if test ".${PCAPRING_DIR}" != .; then
+ else
+
+ TMP_ROOT=${HOME}/PF_RING/userland/libpcap/
++FOUND_PCAP=1
+ if test ".${PCAP_ROOT}" == . &&
+ test -d ${TMP_ROOT} &&
+ test -r ${TMP_ROOT}/libpcap.a; then
+@@ -563,6 +564,18 @@ if test ".${PCAP_ROOT}" == . &&
+ CORELIBS="${CORELIBS} -L${TMP_ROOT} -L${HOME}/PF_RING/userland/lib -lpfring -lpcap "
+ INCS="${INCS} -I ${PCAP_ROOT}"
+ AC_MSG_RESULT([found in $PCAP_ROOT])
++elif test -n "${PCAP_CONFIG}" && test -x "${PCAP_CONFIG}"; then
++ CORELIBS="${CORELIBS} $(${PCAP_CONFIG} --libs)"
++ INCS="${INCS} $(${PCAP_CONFIG} --cflags)"
++ AC_DEFINE_UNQUOTED(HAVE_LIBPCAP, 1, [have libpcap ])
++ AC_MSG_RESULT([found pcap-config: $PCAP_CONFIG, libs:$(${PCAP_CONFIG} --libs) cflags:$(${PCAP_CONFIG} --cflags)])
++else
++ AC_CHECK_LIB(pcap, pcap_lookupdev, ,
++ [FOUND_PCAP=])
++fi
++
++if test -n "$FOUND_PCAP"; then
++ :
+ elif test ".${PCAP_ROOT}" != .; then
+ if test -d $PCAP_ROOT &&
+ test -r $PCAP_ROOT/lib/libpcap.a &&
+@@ -880,44 +893,11 @@ AC_CHECK_LIB([z], [zlibVersion], [], [
+ exit -1
+ ])
+
+-# RRD
+-if test -d "$RRD_HOME"; then
+- AC_MSG_RESULT(checking for RRD home... yes)
+-else
+- RRD_HOME=/usr/local/rrdtool
+- if test -d "$RRD_HOME"; then
+- AC_MSG_RESULT(Checking rrdtool in $RRD_HOME)
+- else
+- RRD_HOME=/usr/local
+- fi
+-fi
+-
+-RRD_LIB="-L${RRD_HOME}/lib -lrrd_th"
+-
+-if test -f "$RRD_HOME/lib/librrd_th.so"; then
+- AC_MSG_RESULT(checking for rrdtool... yes)
+-else
+- if test -f "$RRD_HOME/lib/librrd_th.dylib"; then # OSX
+- AC_MSG_RESULT(checking for rrdtool... yes)
+- else
+- if test -f "$RRD_HOME/lib/librrd_th.a"; then
+- AC_MSG_RESULT(checking for rrdtool... yes)
+- else
+- AC_CHECK_LIB([rrd_th], [main])
+- if test ".${ac_cv_lib_rrd_th_main}" != ".yes"; then
+- AC_MSG_ERROR(Unable to find RRD at $RRD_HOME: please use --with-rrd-home=DIR);
+- AC_MSG_ERROR(RRD source can be downloaded from http://www.rrdtool.org/);
+- else
+- RRD_LIB=
+- fi
+- fi
+- fi
+-fi
+-
+-RRD_INC=
+-if test -d "${RRD_HOME}/include"; then
+- RRD_INC="-I${RRD_HOME}/include"
+-fi
++PKG_CHECK_MODULES( [RRD], [librrd] )
++AC_SUBST(RRD_CFLAGS)
++AC_SUBST(RRD_LIBS)
++RRD_INC=$RRD_FLAGS
++RRD_LIB=$RRD_LIBS
+
+ dnl> The failed recheck stuff below is courtesy of Chris Turbeville [turbo@verio.net]
+ dnl> Chris developed this for Solaris 9, confirming work I had done earlier for FreeBSD
+@@ -1041,7 +1021,7 @@ AC_CHECK_HEADERS([sched.h sys/sched.h])
+ AC_CHECK_HEADERS([pthread.h])
+
+ AC_MSG_CHECKING([if r/w locks are supported])
+-AC_TRY_RUN([
++AC_COMPILE_IFELSE([
+ #include <pthread.h>
+
+ int main()
+@@ -1443,15 +1423,15 @@ dnl> NET-SNMP
+ dnl>
+ if test ".${ac_disable_snmp}" != ".yes"; then
+ AC_CHECK_TOOL(NETSNMP, net-snmp-config)
+- if test "x$ac_cv_prog_ac_ct_NETSNMP" = "xnet-snmp-config"; then
++ if test -n "$NETSNMP"; then
+ AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
+- SNMPLIBS="`net-snmp-config --libs`"
++ SNMPLIBS="`$NETSNMP --libs`"
+ SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
+ echo "net-snmp libs: ${SNMPLIBS}"
+ LIBS="${LIBS} ${SNMPLIBS}"
+ dnl remove unecessary path
+ LIBS=`echo ${LIBS}|sed -e s,'-R../lib',,g`
+- INCS="${INCS} `net-snmp-config --cflags`"
++ INCS="${INCS} `$NETSNMP --cflags`"
+ else
+ AC_MSG_RESULT(NETSNMP is not present: SNMP support is disabled)
+ fi
+@@ -1464,10 +1444,9 @@ SAVED_LIBS=$LIBS
+ dnl>
+ dnl> PYTHON
+ dnl>
+- AC_CHECK_TOOL(PYTHON, python-config)
+- PYTHON_CONFIG=""
++ AC_CHECK_TOOL(PYTHON_CONFIG, python-config)
+
+- if test "x$ac_cv_prog_ac_ct_PYTHON" != "xpython-config"; then
++ if test -z "$PYTHON_CONFIG"; then
+ if test -f "/etc/debian_version"; then
+ AC_MSG_RESULT(Please install python-dev and rerun configure)
+ exit 1
+@@ -1481,8 +1460,6 @@ dnl>
+ PYTHON_CONFIG="python-config"
+ fi
+ fi
+- else
+- PYTHON_CONFIG="python-config"
+ fi
+
+ if test "x$PYTHON_CONFIG" != "x"; then
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch
new file mode 100644
index 000000000..269138df9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_configure_in_net_snmp_config_exist.patch
@@ -0,0 +1,21 @@
+Check net-snmp-config's existence in case user specified the
+ac_cv_prog_NETSNMP to avoid HAVE_SNMP defined if the specified
+net-snmp-config doesn't exist.
+
+Upstream-Status: Inappropriate [Embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+diff --git a/configure.in b/configure.in
+index 6f3e88f..8ddf017 100755
+--- a/configure.in
++++ b/configure.in
+@@ -1423,7 +1423,7 @@ dnl> NET-SNMP
+ dnl>
+ if test ".${ac_disable_snmp}" != ".yes"; then
+ AC_CHECK_TOOL(NETSNMP, net-snmp-config)
+- if test -n "$NETSNMP"; then
++ if test -n "$NETSNMP" -a -e "$NETSNMP"; then
+ AC_DEFINE_UNQUOTED(HAVE_SNMP, 1, [SNMP is supported])
+ SNMPLIBS="`$NETSNMP --libs`"
+ SNMPLIBS="`echo ${SNMPLIBS}|sed -e s,'-R../lib',,g`"
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_init.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_init.patch
new file mode 100644
index 000000000..e7684c1b4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_init.patch
@@ -0,0 +1,228 @@
+Modify ntop.init to WRLinux 5.0 style.
+
+Fix a small problem that when ntop not running,
+/etc/init.d/ntop stop will return 1
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+ packages/RedHat/ntop.init | 102 +++++++++-----------------------------------
+ 1 files changed, 21 insertions(+), 81 deletions(-)
+
+diff --git a/packages/RedHat/ntop.init b/packages/RedHat/ntop.init
+index 40d49f1..a189c59 100755
+--- a/packages/RedHat/ntop.init
++++ b/packages/RedHat/ntop.init
+@@ -10,19 +10,9 @@
+ # You have set the admin password - read docs/1STRUN.txt
+ # You have created /etc/ntop.conf with appropriate parameters.
+
+-# To identify an interface to ntop, use the following flags
+-# in /etc/sysconfig/network-scripts/ifcfg-ethx
+-
+-# NTOP="yes" <--- means for ntop to use this interface
+-# NTOPCONFIG="yes" <--- means for ntop to configure this interface
+-
+ # Note that if you give a -i parameter in either /etc/ntop.conf or
+ # the command line, the scan is NOT performed.
+
+-# However, when it comes to the configuration step, with NTOPCONFIG="yes"
+-# the interface is configured regardless of how the interface list was
+-# specified.
+-
+ #
+ # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ #
+@@ -107,11 +97,7 @@ ntopusesyslog="local3"
+ invoked=$0
+
+ # Source function library.
+-. /etc/rc.d/init.d/functions
+-
+-# Source networking configuration.
+-. /etc/sysconfig/network
+-
++. /etc/init.d/functions
+
+ # Basic sanity checks...
+ if ! [ -x $prog ]; then
+@@ -124,16 +110,6 @@ if ! [ -x $prog ]; then
+ exit 1
+ fi
+
+-if [ ${NETWORKING} = "no" ]; then
+- echo ""
+- echo "ERROR -"
+- echo " Networking is not up!"
+- echo ""
+- echo "Aborting..."
+- echo ""
+- exit 1
+-fi
+-
+ if ! [ -f ${conf} ]; then
+ echo ""
+ echo "ERROR -"
+@@ -180,8 +156,8 @@ fi
+ if [ "${debug}" = "y" ]; then echo "DEBUG: parm file temp is ${parmfile}"; fi
+
+ cmd=`echo \
+- @${conf} \
+ -i tbd \
++ @${conf} \
+ $extra $@`
+
+ echo ${cmd} | awk ' \
+@@ -305,42 +281,6 @@ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Configuration
+
+ # Build list of interfaces, e.g eth0 eth1 eth1:1
+ # (Yeah, we'll have to convert that to eth0,eth1,eth1:1 later
+-if [ ".${ntopinterface}" = ".tbd" ]; then
+-
+- ntopinterface=""
+- iflist=`ip link show | \
+- awk '/^[0-9]*:\ eth/ { printf("%s ", substr($2, 1, length($2)-1)) }'`
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Scanning all interfaces $iflist"
+- if [ "${debug}" = "y" ]; then echo "DEBUG: Interface candidates are ${iflist}"; fi
+-
+- for eth in $iflist; do
+-
+- if ! LANG=C egrep -L "^[Nn][Tt][Oo][Pp]=['\"]?[Yy][Ee][Ss]['\"]?" \
+- /etc/sysconfig/network-scripts/ifcfg-$eth > /dev/null ; then
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - $eth is not ntop=yes, skipping"
+- if [ "${debug}" = "y" ]; then echo "DEBUG: $eth not ntop=yes"; fi
+- continue
+- fi
+-
+- ntopinterface="${ntopinterface} $eth"
+-
+- ip=`ip addr show $eth | \
+- awk '/inet/ { printf("%s", substr($2, 1, index($2, "/")-1)) }'`
+-
+- if [ ".$ip" = "." ]; then
+- is="is unnumbered interface"
+- else
+- is="has IP address $ip"
+- fi
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - $eth is ntop=yes, ${is}"
+- if [ "${debug}" = "y" ]; then echo "DEBUG: $eth ntop=yes, ${is}"; fi
+-
+- done
+-
+-else
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Skipping interface scan - list in parms"
+-fi
+-
+ if [ "x${ntopinterface}" = "x" ]; then
+ ntopinterface="none"
+ fi
+@@ -462,12 +402,6 @@ config_interfaces () {
+ if="${if},${eth}"
+ fi
+
+- if ! LANG=C egrep -L "^[Nn][Tt][Oo][Pp][Cc].*=['\"]?[Yy][Ee][Ss]['\"]?" \
+- /etc/sysconfig/network-scripts/ifcfg-$eth > /dev/null ; then
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - $eth is not ntopconfigure=yes, skipping"
+- continue
+- fi
+-
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Configuring $eth"
+ if [ "${debug}" = "y" ]; then echo "DEBUG: Configuring $eth"; fi
+
+@@ -527,7 +461,7 @@ start () {
+ show_extra
+ config_interfaces
+
+- cmd=`echo $prog \
++ cmd=`echo \
+ @${conf} \
+ -i $if \
+ $extra $@`
+@@ -541,7 +475,7 @@ start () {
+ if [ ".${ldlibpath}" != "." ]; then
+ export LD_LIBRARY_PATH="${ldlibpath}"
+ fi
+- daemon ${cmd}
++ start-stop-daemon --start --quiet --exec $prog -- ${cmd}
+ RETVAL=$?
+
+ [ $RETVAL = 0 ] && touch /var/lock/subsys/${name}${instance}
+@@ -551,6 +485,7 @@ start () {
+ stop () {
+ # stop daemon
+
++ NOT_RUNNING=1
+ RETVAL=1
+ echo -n $"Stopping ${name}${instance}: "
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Stopping: ${name}${instance}"
+@@ -563,13 +498,14 @@ stop () {
+ if [ $rc = 0 ]; then
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Sending SIGTERM to ${pid}"
+ if [ "${debug}" = "y" ]; then echo "Sending SIGTERM to ${pid}"; fi
+- kill -s SIGTERM ${pid}
++ kill -TERM ${pid} 2>&1 > /dev/null
+ RETVAL=$?
+ rm -f ${ntopdbfilepath}/ntop.pid
+ else
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Unable to find process ${pid} ... will kill by name"
+ if [ "${debug}" = "y" ]; then echo "Unable to find process ${pid} ... will kill by name"; fi
+ fi
++ NOT_RUNNING=0
+ else
+
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Unable to find ${ntopdbfilepath}/ntop.pid file ... will kill by name"
+@@ -577,15 +513,16 @@ stop () {
+
+ fi
+
+- echo
+-
+ if [ $RETVAL != 0 ]; then
+ pids=`ps axf | grep '\/usr\/bin\/ntop' | awk '{ printf(" %s", $1) }; END { print "" }'`
+- if [ "${pids}" != " " ]; then
++ if [ "${pids}" != "" ]; then
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Sending SIGTERM to ${prog}...${pids}"
+ if [ "${debug}" = "y" ]; then echo "Sending SIGTERM to ${prog}...${pids}"; fi
+- kill -INT ${pids}
++ kill -TERM ${pids} > /dev/null 2>&1
+ RETVAL=$?
++ NOT_RUNNING=0
++ else
++ NOT_RUNNING=1
+ fi
+ fi
+
+@@ -597,13 +534,9 @@ stop () {
+ if [ "${debug}" = "y" ]; then echo "DEBUG: Unconfiguring interfaces"; fi
+
+ for eth in ${ntopinterface}; do
+- if ! LANG=C egrep -L "^[Nn][Tt][Oo][Pp][Cc].*=['\"]?[Yy][Ee][Ss]['\"]?" \
+- /etc/sysconfig/network-scripts/ifcfg-$eth > /dev/null ; then
+- logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - $eth is not ntopconfigure=yes, skipping"
+- if [ "${debug}" = "y" ]; then echo "DEBUG: $eth is not ntopconfigure=yes"; fi
+- continue
++ if [ "$eth" = "none" ]; then
++ continue
+ fi
+-
+ logger -p ${ntopusesyslog} -t ${name}${instance} -- "INITD - Unconfiguring $eth"
+ if [ "${debug}" = "y" ]; then echo "DEBUG: Unconfiguring $eth"; fi
+
+@@ -623,6 +556,13 @@ stop () {
+ if [ "${debug}" = "y" ]; then echo "DEBUG: Interfaces are unconfigured"; fi
+ fi
+
++ if [ $NOT_RUNNING -eq 1 -o $RETVAL -eq 0 ]; then
++ echo " [ OK ]"
++ RETVAL=0
++ else
++ echo " [ FAILED ]"
++ fi
++
+ return $RETVAL
+ }
+
+--
+1.7.5.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch
new file mode 100644
index 000000000..9f57ca425
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/ntop_webInterface.patch
@@ -0,0 +1,19 @@
+change osName to version as it prints out "ntop Version".
+
+Upstream-Status: Pending
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+---
+diff --git a/webInterface.c b/webInterface.c
+index 5622e69..8cb7a67 100644
+--- a/webInterface.c
++++ b/webInterface.c
+@@ -5816,7 +5816,7 @@ static void printNtopConfigInfoData(int textPrintFlag, UserPref *pref) {
+ printInfoSectionTitle(textPrintFlag, "Basic Information");
+
+ safe_snprintf(__FILE__, __LINE__, formatBuf, sizeof(formatBuf), "%s (%d bit)",
+- osName, sizeof(long) == 8 ? 64 : 32);
++ version, sizeof(long) == 8 ? 64 : 32);
+ printFeatureConfigInfo(textPrintFlag, "ntop Version", formatBuf);
+
+ #ifndef WIN32
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop/use-static-inline.patch b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/use-static-inline.patch
new file mode 100644
index 000000000..2b001c13e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop/use-static-inline.patch
@@ -0,0 +1,32 @@
+[PATCH] replace 'inline' with 'static inline' for gcc 5.x
+
+gcc 5.x defaults to -std=gnu11 instead of -std=gnu89 which change
+the semantics for inline functions and the standalone 'inline'
+causes error with "gcc5 -g -o0"
+
+Replace inline with static inline to be compatible with both gcc 4
+and 5.
+
+Upstream-status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ nDPI/src/lib/protocols/ssl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/nDPI/src/lib/protocols/ssl.c b/nDPI/src/lib/protocols/ssl.c
+index 245b8c3..72beda9 100644
+--- a/nDPI/src/lib/protocols/ssl.c
++++ b/nDPI/src/lib/protocols/ssl.c
+@@ -39,7 +39,7 @@ static void ipoque_int_ssl_add_connection(struct ipoque_detection_module_struct
+
+ #ifdef HAVE_NTOP
+ #ifndef WIN32
+-inline int min(int a, int b) { return(a < b ? a : b); }
++static inline int min(int a, int b) { return(a < b ? a : b); }
+ #endif
+
+ static void stripCertificateTrailer(char *buffer, int buffer_len) {
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ntop/ntop_5.0.1.bb b/meta-openembedded/meta-networking/recipes-support/ntop/ntop_5.0.1.bb
new file mode 100644
index 000000000..298fbec61
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntop/ntop_5.0.1.bb
@@ -0,0 +1,137 @@
+SUMMARY = "ntop is network top"
+DESCRIPTION = "ntop is a network traffic probe that shows the network usage, \
+similar to what the popular top Unix command does."
+
+SECTION = "console/network"
+
+LICENSE = "GPLv2+ & GPLv3 & OpenSSL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+ file://LICENSE-OpenSSL.txt;md5=a409f902e447ddd889cffa0c70e7c7c2 \
+ "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/ntop/ntop-${PV}.tar.gz \
+ file://ntop_configure_in.patch \
+ file://ntop_init.patch \
+ file://ntop_webInterface.patch \
+ file://ntop_configure_in_net_snmp_config_exist.patch \
+ file://ntop.service \
+ file://use-static-inline.patch \
+ file://0001-nDPI-Include-sys-types.h.patch \
+ "
+SRC_URI[md5sum] = "01710b6925a8a5ffe1a41b8b512ebd69"
+SRC_URI[sha256sum] = "7e8e84cb14d2173beaca4d4cb991a14d84a4bef84ec37b2276bc363f45c52ef8"
+
+inherit autotools-brokensep useradd pythonnative pkgconfig systemd
+
+DEPENDS = "geoip rrdtool python zlib libpcap gdbm"
+
+PACKAGECONFIG ??= "openssl snmp plugins"
+PACKAGECONFIG[openssl] = "--with-ssl, --without-ssl, openssl, openssl"
+PACKAGECONFIG[snmp] = "--enable-snmp=yes NETSNMP=${STAGING_BINDIR_CROSS}/net-snmp-config, \
+--disable-snmp,net-snmp,"
+PACKAGECONFIG[plugins] = "--enable-plugins=yes, --disable-plugins, ,"
+
+EXTRA_OECONF += "ac_cv_file_aclocal_m4=yes ac_cv_file_depcomp=no"
+
+do_configure() {
+ cp ${STAGING_DATADIR_NATIVE}/aclocal/libtool.m4 libtool.m4.in
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/nDPI
+ install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/nDPI
+ cat acinclude.m4.in acinclude.m4.ntop libtool.m4.in > acinclude.m4
+ cp 3rd_party/* ./
+
+ # config nDPI
+ cd nDPI
+ ./configure ${CONFIGUREOPTS} --with-pic
+ cd ..
+
+ sed -i -e 's:^CFG_DBFILE_DIR=$localstatedir/ntop:CFG_DBFILE_DIR=$localstatedir/lib/ntop:' ${S}/configure.in
+
+ # fix the CFLAGS, CPPFLAGS, LDFLAGS, remove the host include
+ sed -i \
+ -e 's:\(^CFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
+ -e 's:\(^CPPFLAGS="\$.*\) -I/usr/local/include -I/opt/local/include":\1":' \
+ -e 's:\(^LDFLAGS="\$.*\) -L/usr/local/lib -L/opt/local/lib":\1":' \
+ ${S}/configure.in
+
+ # replace the DISTRO RELEASE in configure.in which are host's
+ # with our release, although those doesn't affect functionality
+ sed -i -e \
+ '/DEFINEOS="LINUX"/{N;s/DISTRO=.*/DISTRO="${DISTRO}"/;N;s/RELEASE=.*/RELEASE="${DISTRO_VERSION}"/;}' \
+ ${S}/configure.in
+
+ # osName in original configure.in should be ${TARGET_SYS}
+ # which will show in ntop's "show configuration"
+ sed -i -e \
+ 's:^osName=.*:osName=${TARGET_SYS}:' \
+ ${S}/configure.in
+
+ # rename configureextra to configureextra_rename to avoid
+ # configure.in to guess host OS and pull in more configure, non needed
+ # which will cause some cross-compiling failure on specific host
+ # e.g. SUSE(SLED...)
+ test ! -f configureextra || mv -f configureextra configureextra_rename
+
+ # make sure configure finds python includdirs/libs with these envs
+ export BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+ STAGING_INCDIR=${STAGING_INCDIR} \
+ STAGING_LIBDIR=${STAGING_LIBDIR}
+
+ autotools_do_configure
+}
+
+do_compile_prepend() {
+ cd nDPI
+ oe_runmake
+ cd ..
+}
+
+do_install_append() {
+ # remove the empty dirs
+ rm -rf ${D}${libdir}/plugins
+
+ install -D -m 0755 ${S}/packages/RedHat/ntop.init \
+ ${D}${sysconfdir}/init.d/ntop
+ install -D -m 0644 ${S}/packages/RedHat/ntop.conf.sample \
+ ${D}${sysconfdir}/ntop.conf
+
+ # change ntop dir in ntop.conf
+ # don't use the -P as the ntop.init didn't support it
+ sed -i -e "s:^--db-file-path /usr/share/ntop:--db-file-path /var/lib/ntop:" \
+ -e "s:^#? -P /var/ntop:#? -P /var/lib/ntop:" \
+ ${D}${sysconfdir}/ntop.conf
+
+ # For systemd
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${S}/packages/RedHat/ntop.init ${D}${libexecdir}/ntop-helper
+ install -D -m 0644 ${WORKDIR}/ntop.service ${D}${systemd_system_unitdir}/ntop.service
+ sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
+ -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_system_unitdir}/ntop.service
+ fi
+
+ # Fix host-user-contaminated issue
+ chown -R root:root ${D}
+
+ chown -R ntop.ntop ${D}${datadir}/ntop
+ chown -R ntop:ntop ${D}${localstatedir}/lib/ntop
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "-M -g ntop -r -d ${localstatedir}/lib/ntop \
+-s /usr/sbin/nologin -c 'ntop' ntop"
+GROUPADD_PARAM_${PN} = "-r ntop"
+
+SYSTEMD_SERVICE_${PN} = "ntop.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+FILES_${PN}_append = "${libdir}/ntop/plugins ${libdir}/libntop-*.so \
+ ${libdir}/libntopreport-*.so ${libdir}/lib*-${PV}.so"
+FILES_${PN}-dev = "${includedir} ${libdir}/libntop.so \
+ ${libdir}/libntopreport.so \
+ ${libdir}/libnetflowPlugin.so ${libdir}/libsflowPlugin.so \
+ ${libdir}/librrdPlugin.so \
+ ${libdir}/*.a ${libdir}/libntopreport.a ${libdir}/*.la"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch
new file mode 100644
index 000000000..d45b7e38b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp-4.2.4_p6-nano.patch
@@ -0,0 +1,27 @@
+From 2310898533f059d875dcffd26ab6cf1b280292fd Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 12 Jan 2011 21:38:46 +0100
+
+---
+ include/ntp_syscall.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/include/ntp_syscall.h b/include/ntp_syscall.h
+index d1ce03e..9e18432 100644
+--- a/include/ntp_syscall.h
++++ b/include/ntp_syscall.h
+@@ -10,6 +10,14 @@
+ # include <sys/timex.h>
+ #endif
+
++#if defined(ADJ_NANO) && !defined(MOD_NANO)
++#define MOD_NANO ADJ_NANO
++#endif
++
++#if defined(ADJ_TAI) && !defined(MOD_TAI)
++#define MOD_TAI ADJ_TAI
++#endif
++
+ #ifndef NTP_SYSCALLS_LIBC
+ # ifdef NTP_SYSCALLS_STD
+ # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t))
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf
new file mode 100644
index 000000000..676e18645
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntp.conf
@@ -0,0 +1,17 @@
+# This is the most basic ntp configuration file
+# The driftfile must remain in a place specific to this
+# machine - it records the machine specific clock error
+driftfile /var/lib/ntp/drift
+# This should be a server that is close (in IP terms)
+# to the machine. Add other servers as required.
+# Unless you un-comment the line below ntpd will sync
+# only against the local system clock.
+#
+# server time.server.example.com
+#
+# Using local hardware clock as fallback
+# Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself
+server 127.127.1.0
+fudge 127.127.1.0 stratum 14
+# Defining a default security setting
+restrict default
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd
new file mode 100755
index 000000000..d1b9c4907
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd
@@ -0,0 +1,84 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: ntp
+# Required-Start: $network $remote_fs $syslog
+# Required-Stop: $network $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop:
+# Short-Description: Start NTP daemon
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+DAEMON=/usr/sbin/ntpd
+PIDFILE=/var/run/ntpd.pid
+
+# ntpd init.d script for ntpdc from ntp.isc.org
+test -x $DAEMON -a -r /etc/ntp.conf || exit 0
+
+# rcS contains TICKADJ
+test -r /etc/default/rcS && . /etc/default/rcS
+
+# Source function library.
+. /etc/init.d/functions
+
+# Functions to do individual actions
+settick(){
+ # If TICKADJ is set we *must* adjust it before we start, because the
+ # driftfile relies on the correct setting
+ test -n "$TICKADJ" -a -x /usr/sbin/tickadj && {
+ echo -n "Setting tick to $TICKADJ: "
+ /usr/sbin/tickadj "$TICKADJ"
+ echo "done"
+ }
+}
+startdaemon(){
+ # The -g option allows ntpd to step the time to correct it just
+ # once. The daemon will exit if the clock drifts too much after
+ # this. If ntpd seems to disappear after a while assume TICKADJ
+ # above is set to a totally incorrect value.
+ echo -n "Starting ntpd: "
+ start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -u ntp:ntp -p $PIDFILE "$@"
+ echo "done"
+}
+stopdaemon(){
+ echo -n "Stopping ntpd: "
+ start-stop-daemon --stop --quiet --oknodo -p $PIDFILE
+ echo "done"
+}
+
+case "$1" in
+ start)
+ settick
+ startdaemon -g
+ ;;
+ stop)
+ stopdaemon
+ ;;
+ force-reload)
+ stopdaemon
+ settick
+ startdaemon -g
+ ;;
+ restart)
+ # Don't reset the tick here
+ stopdaemon
+ startdaemon -g
+ ;;
+ reload)
+ # Must do this by hand, but don't do -g
+ stopdaemon
+ startdaemon
+ ;;
+ status)
+ status /usr/sbin/ntpd;
+ exit $?
+ ;;
+ *)
+ echo "Usage: ntpd { start | stop | status | restart | reload }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list
new file mode 100644
index 000000000..d1fe6b7e2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.list
@@ -0,0 +1 @@
+ntpd.service
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service
new file mode 100644
index 000000000..0e3d7cd37
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Network Time Service
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/ntpd.pid
+ExecStart=/usr/sbin/ntpd -u ntp:ntp -p /run/ntpd.pid -g
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate
new file mode 100755
index 000000000..17b64d133
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/bin:/usr/sbin
+
+test -x /usr/sbin/ntpdate || exit 0
+
+if test -f /etc/default/ntpdate ; then
+. /etc/default/ntpdate
+fi
+
+if [ "$NTPSERVERS" = "" ] ; then
+ if [ "$METHOD" = "" -a "$1" != "silent" ] ; then
+ echo "Please set NTPSERVERS in /etc/default/ntpdate"
+ exit 1
+ else
+ exit 0
+ fi
+fi
+
+# This is a heuristic: The idea is that if a static interface is brought
+# up, that is a major event, and we can put in some extra effort to fix
+# the system time. Feel free to change this, especially if you regularly
+# bring up new network interfaces.
+if [ "$METHOD" = static ]; then
+ OPTS="-b"
+fi
+
+if [ "$METHOD" = loopback ]; then
+ exit 0
+fi
+
+(
+
+LOCKFILE=/var/lock/ntpdate
+
+# Avoid running more than one at a time
+if [ -x /usr/bin/lockfile-create ]; then
+ lockfile-create $LOCKFILE
+ lockfile-touch $LOCKFILE &
+ LOCKTOUCHPID="$!"
+fi
+
+if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
+ if [ "$UPDATE_HWCLOCK" = "yes" ]; then
+ hwclock --systohc || :
+ fi
+fi
+
+if [ -x /usr/bin/lockfile-create ] ; then
+ kill $LOCKTOUCHPID
+ lockfile-remove $LOCKFILE
+fi
+
+) &
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default
new file mode 100644
index 000000000..486b6e07d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.default
@@ -0,0 +1,7 @@
+# Configuration script used by ntpdate-sync script
+
+NTPSERVERS=""
+
+# Set to "yes" to write time to hardware clock on success
+UPDATE_HWCLOCK="no"
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service
new file mode 100644
index 000000000..10cbd70f9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/ntpdate.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Network Time Service (one-shot ntpdate mode)
+Before=ntpd.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/ntpdate-sync silent
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp
new file mode 100644
index 000000000..f8c5895b7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp
@@ -0,0 +1 @@
+NTPSERVER="ntpserver.example.org"
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service
new file mode 100644
index 000000000..4898b8a70
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp/sntp.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Simple Network Time Service Client
+After=network.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-/etc/default/sntp
+ExecStart=/usr/sbin/sntp -s $NTPSERVER
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p11.bb b/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p11.bb
new file mode 100644
index 000000000..c698fa049
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ntp/ntp_4.2.8p11.bb
@@ -0,0 +1,172 @@
+SUMMARY = "Network Time Protocol daemon and utilities"
+DESCRIPTION = "The Network Time Protocol (NTP) is used to \
+synchronize the time of a computer client or server to \
+another server or reference time source, such as a radio \
+or satellite receiver or modem."
+HOMEPAGE = "http://support.ntp.org"
+SECTION = "net"
+LICENSE = "NTP"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=e877a1d567a6a58996d2b66e3e387003"
+
+DEPENDS = "libevent"
+
+SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
+ file://ntp-4.2.4_p6-nano.patch \
+ file://ntpd \
+ file://ntp.conf \
+ file://ntpdate \
+ file://ntpdate.default \
+ file://ntpdate.service \
+ file://ntpd.service \
+ file://sntp.service \
+ file://sntp \
+ file://ntpd.list \
+"
+
+SRC_URI[md5sum] = "00950ca2855579541896513e78295361"
+SRC_URI[sha256sum] = "f14a39f753688252d683ff907035ffff106ba8d3db21309b742e09b5c3cd278e"
+
+inherit autotools update-rc.d useradd systemd pkgconfig
+
+# The ac_cv_header_readline_history is to stop ntpdc depending on either
+# readline or curses
+EXTRA_OECONF += "--with-net-snmp-config=no \
+ --without-ntpsnmpd \
+ ac_cv_header_readline_history_h=no \
+ --with-yielding_select=yes \
+ --with-locfile=redhat \
+ --without-rpath \
+ "
+CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
+
+USERADD_PACKAGES = "${PN}"
+NTP_USER_HOME ?= "/var/lib/ntp"
+USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \
+ --no-create-home \
+ --shell /bin/false --user-group ntp"
+
+# NB: debug is default-enabled by NTP; keep it default-enabled here.
+PACKAGECONFIG ??= "cap debug refclocks openssl \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
+ --with-openssl-incdir=${STAGING_INCDIR} \
+ --with-crypto, \
+ --without-openssl --without-crypto, \
+ openssl"
+PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
+PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
+PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools"
+PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
+PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir}
+ install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d
+ install -d ${D}${bindir}
+ install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync
+
+ install -m 755 -d ${D}${NTP_USER_HOME}
+ chown ntp:ntp ${D}${NTP_USER_HOME}
+
+ # Fix hardcoded paths in scripts
+ sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+ sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+ sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+ sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync
+ sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync
+ sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace
+ sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace
+ sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait
+ sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait
+ sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj
+ sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj
+
+ install -d ${D}/${sysconfdir}/default
+ install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate
+ install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/
+
+ install -d ${D}/${sysconfdir}/network/if-up.d
+ ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d
+
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
+ install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/
+
+ install -d ${D}${systemd_unitdir}/ntp-units.d
+ install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list
+
+ # Remove an empty libexecdir.
+ rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
+}
+
+PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils"
+# NOTE: you don't need ntpdate, use "ntpd -q -g -x"
+
+# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
+# with wonky clocks (e.g. OpenSlug)
+RDEPENDS_${PN} = "${PN}-tickadj"
+# ntpd require libgcc for execution
+RDEPENDS_${PN} += "libgcc"
+# Handle move from bin to utils package
+RPROVIDES_${PN}-utils = "${PN}-bin"
+RREPLACES_${PN}-utils = "${PN}-bin"
+RCONFLICTS_${PN}-utils = "${PN}-bin"
+
+SYSTEMD_PACKAGES = "${PN} ntpdate sntp"
+SYSTEMD_SERVICE_${PN} = "ntpd.service"
+SYSTEMD_SERVICE_ntpdate = "ntpdate.service"
+SYSTEMD_SERVICE_sntp = "sntp.service"
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+
+RPROVIDES_ntpdate += "ntpdate-systemd"
+RREPLACES_ntpdate += "ntpdate-systemd"
+RCONFLICTS_ntpdate += "ntpdate-systemd"
+
+RSUGGESTS_${PN} = "iana-etc"
+
+FILES_${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \
+ ${NTP_USER_HOME} \
+ ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\
+"
+FILES_${PN}-tickadj = "${sbindir}/tickadj"
+FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib"
+RDEPENDS_${PN}-utils += "perl"
+FILES_ntpdate = "${sbindir}/ntpdate \
+ ${sysconfdir}/network/if-up.d/ntpdate-sync \
+ ${bindir}/ntpdate-sync \
+ ${sysconfdir}/default/ntpdate \
+ ${systemd_unitdir}/system/ntpdate.service \
+"
+FILES_sntp = "${sbindir}/sntp \
+ ${sysconfdir}/default/sntp \
+ ${systemd_unitdir}/system/sntp.service \
+ "
+
+CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
+CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate"
+
+INITSCRIPT_NAME = "ntpd"
+# No dependencies, so just go in at the standard level (20)
+INITSCRIPT_PARAMS = "defaults"
+
+pkg_postinst_ntpdate() {
+ if ! grep -q -s ntpdate $D/var/spool/cron/root; then
+ echo "adding crontab"
+ test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron
+ echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root
+ fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "ntpd"
+ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd"
diff --git a/meta-openembedded/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb b/meta-openembedded/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb
new file mode 100644
index 000000000..9430add48
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb
@@ -0,0 +1,29 @@
+# Copyright (C) 2013 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "network performance measurement tool"
+DESCRIPTION = "nuttcp is a network performance measurement tool intended for use by network \
+and system managers. Its most basic usage is to determine the raw TCP (or UDP) \
+network layer throughput by transferring memory buffers from a source system \
+across an interconnecting network to a destination system, either transferring \
+data for a specified time interval, or alternatively transferring a specified \
+number of bytes."
+HOMEPAGE = "http://www.nuttcp.net/Welcome%20Page.html"
+LICENSE = "GPL-2.0"
+SECTION = "net"
+LIC_FILES_CHKSUM = "file://${BP}.c;beginline=4;endline=30;md5=ae7045c3c3616092e07d87f04ba0d960"
+
+SRC_URI = "http://nuttcp.net/${BPN}/beta/${BP}.c"
+SRC_URI[md5sum] = "1ebf4a08bad2a295a8155f02995e8754"
+SRC_URI[sha256sum] = "c6e33810ccce67260f8d5d627f60e429d44f532365c58ed5673d035e2a59c4db"
+
+S = "${WORKDIR}"
+
+do_compile () {
+ ${CC} ${CFLAGS} ${LDFLAGS} -o nuttcp nuttcp-${PV}.c
+}
+
+do_install () {
+ install -d ${D}${bindir}
+ install -m 0755 nuttcp ${D}${bindir}
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns/0001-util.h-endian.h-is-available-on-musl-on-linux.patch b/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns/0001-util.h-endian.h-is-available-on-musl-on-linux.patch
new file mode 100644
index 000000000..825e2bf6a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns/0001-util.h-endian.h-is-available-on-musl-on-linux.patch
@@ -0,0 +1,38 @@
+From e0d86318227a23f00cf0f6639a6685bb9f5771a1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 12 Dec 2017 09:42:19 -0800
+Subject: [PATCH] util.h: endian.h is available on musl on linux
+
+just checking for glibc alone is not enough since
+it excludes musl, therefore check for platform
+being linux as well
+
+Fixes build issues
+
+include/libisns/util.h:114:12: fatal error: sys/endian.h: No such file or directory
+ # include <sys/endian.h>
+ ^~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ include/libisns/util.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/libisns/util.h b/include/libisns/util.h
+index 9a2bd13..6cc1a1b 100644
+--- a/include/libisns/util.h
++++ b/include/libisns/util.h
+@@ -100,7 +100,7 @@ enum {
+ * There's no htonll yet
+ */
+ #ifndef htonll
+-# ifdef __GLIBC__
++# if defined(__GLIBC__) || defined(__linux__)
+ # include <endian.h>
+ # include <byteswap.h>
+ # if __BYTE_ORDER == __BIG_ENDIAN
+--
+2.15.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb b/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb
new file mode 100644
index 000000000..abfa7510e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/open-isns/open-isns_0.97.bb
@@ -0,0 +1,40 @@
+# Copyright (C) 2016 Joe MacDonald <joe_macdonald@mentor.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "iSNS daemon and utility programs"
+DESCRIPTION = "This is a partial implementation of RFC4171, the Internet \
+Storage Name Service (iSNS). The distribution includes the iSNS server, \
+supporting persisten storage of registrations, isnsadm, a command line \
+utility for managing nodes, and isnsdd, a corresponding discovery daemon."
+HOMEPAGE = "http://github.com/gonzoleeman/open-isns/"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=321bf41f280cf805086dd5a720b37785"
+SECTION = "net"
+
+DEPENDS = "openssl"
+
+SRC_URI = "git://github.com/open-iscsi/open-isns \
+ file://0001-util.h-endian.h-is-available-on-musl-on-linux.patch \
+ "
+
+SRCREV ?= "09954404e948e41eb0fce8e28836018b4ce3d20d"
+
+S = "${WORKDIR}/git"
+
+inherit systemd autotools-brokensep update-rc.d
+
+EXTRA_OECONF = " --prefix=${prefix} --enable-shared"
+EXTRA_OEMAKE += "SYSTEMDDIR=${D}${systemd_unitdir}/system"
+
+do_install_append () {
+ oe_runmake INCDIR=${D}${includedir}/libisns/ install_hdrs
+ oe_runmake LIBDIR=${D}${libdir} install_lib
+
+ install -D -m 755 ${S}/etc/openisns.init ${D}${sysconfdir}/init.d/openisns
+ sed -i 's|daemon isnsd|start-stop-daemon --start --quiet --oknodo --exec ${sbindir}/isnsd --|' \
+ ${D}${sysconfdir}/init.d/openisns
+}
+
+FILES_${PN} += "${libdir} ${systemd_unitdir}"
+
+INITSCRIPT_NAME = "openisns"
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/0001-lanserv-Rename-struct-parameter-printf-for-namespace.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/0001-lanserv-Rename-struct-parameter-printf-for-namespace.patch
new file mode 100644
index 000000000..25057fbce
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/0001-lanserv-Rename-struct-parameter-printf-for-namespace.patch
@@ -0,0 +1,618 @@
+From 8b51a6bf5a4829d8add535a098c0c06a049a9958 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 26 Aug 2017 22:50:57 -0700
+Subject: [PATCH] lanserv: Rename struct parameter printf for namespace
+ collision
+
+This comes to fore when we use hardening flags where printf
+is treated as macro and gets replaced with printf_chk
+
+Fixes errors like
+
+error: no member named '__printf_chk' in 'struct emu_out_s'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lanserv/OpenIPMI/serv.h | 2 +-
+ lanserv/emu_cmd.c | 132 ++++++++++++++++++++++++------------------------
+ lanserv/ipmi_sim.c | 10 ++--
+ 3 files changed, 72 insertions(+), 72 deletions(-)
+
+diff --git a/lanserv/OpenIPMI/serv.h b/lanserv/OpenIPMI/serv.h
+index d12d63a..8555c85 100644
+--- a/lanserv/OpenIPMI/serv.h
++++ b/lanserv/OpenIPMI/serv.h
+@@ -522,7 +522,7 @@ uint8_t ipmb_checksum(uint8_t *data, int size, uint8_t start);
+ typedef struct emu_data_s emu_data_t;
+ typedef struct emu_out_s
+ {
+- void (*printf)(struct emu_out_s *out, char *format, ...);
++ void (*eprintf)(struct emu_out_s *out, char *format, ...);
+ void *data;
+ } emu_out_t;
+
+diff --git a/lanserv/emu_cmd.c b/lanserv/emu_cmd.c
+index ca44032..54b6f7b 100644
+--- a/lanserv/emu_cmd.c
++++ b/lanserv/emu_cmd.c
+@@ -76,7 +76,7 @@ emu_get_uchar(emu_out_t *out, char **toks, unsigned char *val, char *errstr,
+ if (empty_ok)
+ return ENOSPC;
+ if (errstr)
+- out->printf(out, "**No %s given\n", errstr);
++ out->eprintf(out, "**No %s given\n", errstr);
+ return EINVAL;
+ }
+ if (str[0] == '\'') {
+@@ -86,7 +86,7 @@ emu_get_uchar(emu_out_t *out, char **toks, unsigned char *val, char *errstr,
+ *val = strtoul(str, &tmpstr, 0);
+ if (*tmpstr != '\0') {
+ if (errstr)
+- out->printf(out, "**Invalid %s given\n", errstr);
++ out->eprintf(out, "**Invalid %s given\n", errstr);
+ return EINVAL;
+ }
+
+@@ -108,7 +108,7 @@ emu_get_uchar_with_vals(emu_out_t *out, char **toks,
+ if (empty_ok)
+ return ENOSPC;
+ if (errstr)
+- out->printf(out, "**No %s given\n", errstr);
++ out->eprintf(out, "**No %s given\n", errstr);
+ return EINVAL;
+ }
+ if (str[0] == '\'') {
+@@ -131,7 +131,7 @@ emu_get_uchar_with_vals(emu_out_t *out, char **toks,
+ *val = strtoul(str, &tmpstr, 0);
+ if (*tmpstr != '\0') {
+ if (errstr)
+- out->printf(out, "**Invalid %s given\n", errstr);
++ out->eprintf(out, "**Invalid %s given\n", errstr);
+ return EINVAL;
+ }
+ out:
+@@ -150,12 +150,12 @@ emu_get_bitmask(emu_out_t *out, char **toks, uint16_t *val, char *errstr,
+ if (empty_ok)
+ return ENOSPC;
+ if (errstr)
+- out->printf(out, "**No %s given\n", errstr);
++ out->eprintf(out, "**No %s given\n", errstr);
+ return EINVAL;
+ }
+ if (strlen(str) != size) {
+ if (errstr)
+- out->printf(out, "**invalid number of bits in %s\n", errstr);
++ out->eprintf(out, "**invalid number of bits in %s\n", errstr);
+ return EINVAL;
+ }
+ *val = 0;
+@@ -166,7 +166,7 @@ emu_get_bitmask(emu_out_t *out, char **toks, uint16_t *val, char *errstr,
+ *val |= 1 << i;
+ } else {
+ if (errstr)
+- out->printf(out, "**Invalid bit value '%c' in %s\n", str[j],
++ out->eprintf(out, "**Invalid bit value '%c' in %s\n", str[j],
+ errstr);
+ return EINVAL;
+ }
+@@ -184,13 +184,13 @@ emu_get_uint(emu_out_t *out, char **toks, unsigned int *val, char *errstr)
+ str = mystrtok(NULL, " \t\n", toks);
+ if (!str) {
+ if (errstr)
+- out->printf(out, "**No %s given\n", errstr);
++ out->eprintf(out, "**No %s given\n", errstr);
+ return EINVAL;
+ }
+ *val = strtoul(str, &tmpstr, 0);
+ if (*tmpstr != '\0') {
+ if (errstr)
+- out->printf(out, "**Invalid %s given\n", errstr);
++ out->eprintf(out, "**Invalid %s given\n", errstr);
+ return EINVAL;
+ }
+
+@@ -206,7 +206,7 @@ emu_get_bytes(emu_out_t *out, char **tokptr, unsigned char *data, char *errstr,
+
+ if (!tok) {
+ if (errstr)
+- out->printf(out, "**No %s given\n", errstr);
++ out->eprintf(out, "**No %s given\n", errstr);
+ return EINVAL;
+ }
+ if (*tok == '"') {
+@@ -215,7 +215,7 @@ emu_get_bytes(emu_out_t *out, char **tokptr, unsigned char *data, char *errstr,
+ tok++;
+ end = strlen(tok) - 1;
+ if (tok[end] != '"') {
+- out->printf(out, "**ASCII %s doesn't end in '\"'", errstr);
++ out->eprintf(out, "**ASCII %s doesn't end in '\"'", errstr);
+ return EINVAL;
+ }
+ if (end > (len - 1))
+@@ -228,7 +228,7 @@ emu_get_bytes(emu_out_t *out, char **tokptr, unsigned char *data, char *errstr,
+ char c[3];
+ /* HEX pw */
+ if (strlen(tok) != 32) {
+- out->printf(out, "**HEX %s not 32 HEX characters long", errstr);
++ out->eprintf(out, "**HEX %s not 32 HEX characters long", errstr);
+ return EINVAL;
+ }
+ c[2] = '\0';
+@@ -239,7 +239,7 @@ emu_get_bytes(emu_out_t *out, char **tokptr, unsigned char *data, char *errstr,
+ tok++;
+ data[i] = strtoul(c, &end, 16);
+ if (*end != '\0') {
+- out->printf(out, "**Invalid HEX character in %s", errstr);
++ out->eprintf(out, "**Invalid HEX character in %s", errstr);
+ return -1;
+ }
+ }
+@@ -263,12 +263,12 @@ read_command_file(emu_out_t *out, emu_data_t *emu, const char *command_file)
+
+ buffer = malloc(INPUT_BUFFER_SIZE);
+ if (!buffer) {
+- out->printf(out, "Could not allocate buffer memory\n");
++ out->eprintf(out, "Could not allocate buffer memory\n");
+ rv = ENOMEM;
+ goto out;
+ }
+ while (fgets(buffer+pos, INPUT_BUFFER_SIZE-pos, f)) {
+- out->printf(out, "%s", buffer+pos);
++ out->eprintf(out, "%s", buffer+pos);
+ if (buffer[pos] == '#')
+ continue;
+ pos = strlen(buffer);
+@@ -318,7 +318,7 @@ sel_enable(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_enable_sel(mc, max_records, flags);
+ if (rv)
+- out->printf(out, "**Unable to enable sel, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to enable sel, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -343,9 +343,9 @@ sel_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_add_to_sel(mc, record_type, data, &r);
+ if (rv)
+- out->printf(out, "**Unable to add to sel, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add to sel, error 0x%x\n", rv);
+ else
+- out->printf(out, "Added record %d\n", r);
++ out->eprintf(out, "Added record %d\n", r);
+ return rv;
+ }
+
+@@ -361,14 +361,14 @@ main_sdr_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ if (rv == ENOSPC)
+ break;
+ if (rv) {
+- out->printf(out, "**Error 0x%x in data byte %d\n", rv, i);
++ out->eprintf(out, "**Error 0x%x in data byte %d\n", rv, i);
+ return rv;
+ }
+ }
+
+ rv = ipmi_mc_add_main_sdr(mc, data, i);
+ if (rv)
+- out->printf(out, "**Unable to add to sdr, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add to sdr, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -389,14 +389,14 @@ device_sdr_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ if (rv == ENOSPC)
+ break;
+ if (rv) {
+- out->printf(out, "**Error 0x%x in data byte %d\n", rv, i);
++ out->eprintf(out, "**Error 0x%x in data byte %d\n", rv, i);
+ return rv;
+ }
+ }
+
+ rv = ipmi_mc_add_device_sdr(mc, lun, data, i);
+ if (rv)
+- out->printf(out, "**Unable to add to sdr, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add to sdr, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -439,7 +439,7 @@ sensor_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ while (tok) {
+ if (strcmp(tok, "poll") == 0) {
+ if (handler) {
+- out->printf(out, "**poll given twice in sensor\n", tok);
++ out->eprintf(out, "**poll given twice in sensor\n", tok);
+ return -1;
+ }
+
+@@ -449,27 +449,27 @@ sensor_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ tok = mystrtok(NULL, " \t\n", toks);
+ if (!tok) {
+- out->printf(out, "**No polled sensor handler given\n", tok);
++ out->eprintf(out, "**No polled sensor handler given\n", tok);
+ return -1;
+ }
+
+ handler = ipmi_sensor_find_handler(tok);
+ if (!handler) {
+- out->printf(out, "**Invalid sensor handler: %s\n", tok);
++ out->eprintf(out, "**Invalid sensor handler: %s\n", tok);
+ return -1;
+ }
+
+ rv = handler->init(mc, lun, num, toks, handler->cb_data, &rcb_data,
+ &errstr);
+ if (rv) {
+- out->printf(out, "**Error initializing sensor handler: %s\n",
++ out->eprintf(out, "**Error initializing sensor handler: %s\n",
+ errstr);
+ return rv;
+ }
+ } else if (strcmp(tok, "event-only") == 0) {
+ event_only = 1;
+ } else {
+- out->printf(out, "**Unknown sensor option: %s\n", tok);
++ out->eprintf(out, "**Unknown sensor option: %s\n", tok);
+ return -1;
+ }
+
+@@ -477,7 +477,7 @@ sensor_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ }
+
+ if (handler && event_only) {
+- out->printf(out, "**An event-only sensor cannot be polled\n");
++ out->eprintf(out, "**An event-only sensor cannot be polled\n");
+ return -1;
+ }
+
+@@ -488,7 +488,7 @@ sensor_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ if (!rv && handler->postinit) {
+ rv = handler->postinit(rcb_data, &errstr);
+ if (rv) {
+- out->printf(out, "**Error in sensor handler postinit: %s\n",
++ out->eprintf(out, "**Error in sensor handler postinit: %s\n",
+ errstr);
+ }
+ }
+@@ -496,7 +496,7 @@ sensor_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ rv = ipmi_mc_add_sensor(mc, lun, num, type, code, event_only);
+ }
+ if (rv)
+- out->printf(out, "**Unable to add to sensor, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add to sensor, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -532,7 +532,7 @@ sensor_set_bit(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_sensor_set_bit(mc, lun, num, bit, value, gen_event);
+ if (rv)
+- out->printf(out, "**Unable to set sensor bit, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor bit, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -563,7 +563,7 @@ sensor_set_bit_clr_rest(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **
+
+ rv = ipmi_mc_sensor_set_bit_clr_rest(mc, lun, num, bit, gen_event);
+ if (rv)
+- out->printf(out, "**Unable to set sensor bit, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor bit, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -594,7 +594,7 @@ sensor_set_value(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_sensor_set_value(mc, lun, num, value, gen_event);
+ if (rv)
+- out->printf(out, "**Unable to set sensor value, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor value, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -637,7 +637,7 @@ sensor_set_hysteresis(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **to
+ rv = ipmi_mc_sensor_set_hysteresis(mc, lun, num, support, positive,
+ negative);
+ if (rv)
+- out->printf(out, "**Unable to set sensor hysteresis, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor hysteresis, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -682,7 +682,7 @@ sensor_set_threshold(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **tok
+ rv = ipmi_mc_sensor_set_threshold(mc, lun, num, support,
+ enabled, 1, thresholds);
+ if (rv)
+- out->printf(out, "**Unable to set sensor thresholds, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor thresholds, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -759,7 +759,7 @@ sensor_set_event_support(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char *
+ assert_support, deassert_support,
+ assert_enabled, deassert_enabled);
+ if (rv)
+- out->printf(out, "**Unable to set sensor thresholds, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set sensor thresholds, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -819,7 +819,7 @@ mc_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ else if (strcmp("persist_sdr", tok) == 0)
+ flags |= IPMI_MC_PERSIST_SDR;
+ else {
+- out->printf(out, "**Invalid MC flag: %s\n", tok);
++ out->eprintf(out, "**Invalid MC flag: %s\n", tok);
+ return -1;
+ }
+ }
+@@ -833,7 +833,7 @@ mc_add(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ device_revision, major_fw_rev, minor_fw_rev,
+ device_support, mfg_id, product_id, flags);
+ if (rv)
+- out->printf(out, "**Unable to add the MC, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add the MC, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -890,7 +890,7 @@ mc_set_power(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_set_power(mc, power, gen_int);
+ if (rv)
+- out->printf(out, "**Unable to set power, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set power, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -916,7 +916,7 @@ mc_add_fru_data(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ tok = mystrtok(NULL, " \t\n", toks);
+ if (!tok) {
+- out->printf(out, "**No FRU data type given");
++ out->eprintf(out, "**No FRU data type given");
+ return -1;
+ }
+ if (strcmp(tok, "file") == 0) {
+@@ -929,13 +929,13 @@ mc_add_fru_data(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = get_delim_str(toks, &frufn, &errstr);
+ if (rv) {
+- out->printf(out, "**Error with FRU filename: %d", strerror(rv));
++ out->eprintf(out, "**Error with FRU filename: %d", strerror(rv));
+ return rv;
+ }
+ rv = ipmi_mc_add_fru_file(mc, devid, length, file_offset,
+ (void *) frufn);
+ if (rv)
+- out->printf(out, "**Unable to add FRU file, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add FRU file, error 0x%x\n", rv);
+
+ } else if (strcmp(tok, "data") == 0) {
+ for (i=0; i<length; i++) {
+@@ -943,14 +943,14 @@ mc_add_fru_data(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ if (rv == ENOSPC)
+ break;
+ if (rv) {
+- out->printf(out, "**Error 0x%x in data byte %d\n", rv, i);
++ out->eprintf(out, "**Error 0x%x in data byte %d\n", rv, i);
+ return rv;
+ }
+ }
+
+ rv = emu_get_uchar(out, toks, &data[i], "data byte", 1);
+ if (rv != ENOSPC) {
+- out->printf(out, "**Error: input data too long for FRU\n", rv, i);
++ out->eprintf(out, "**Error: input data too long for FRU\n", rv, i);
+ return EINVAL;
+ }
+
+@@ -958,9 +958,9 @@ mc_add_fru_data(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_add_fru_data(mc, devid, length, NULL, data);
+ if (rv)
+- out->printf(out, "**Unable to add FRU data, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to add FRU data, error 0x%x\n", rv);
+ } else {
+- out->printf(out, "**FRU type not given, need file or data\n");
++ out->eprintf(out, "**FRU type not given, need file or data\n");
+ rv = EINVAL;
+ }
+ return rv;
+@@ -981,28 +981,28 @@ mc_dump_fru_data(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_get_fru_data_len(mc, devid, &length);
+ if (rv) {
+- out->printf(out, "**Unable to dump FRU data, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to dump FRU data, error 0x%x\n", rv);
+ goto out;
+ }
+
+ data = malloc(length);
+ if (!data) {
+- out->printf(out, "**Unable to dump FRU data, out of memory\n", rv);
++ out->eprintf(out, "**Unable to dump FRU data, out of memory\n", rv);
+ goto out;
+ }
+
+ rv = ipmi_mc_get_fru_data(mc, devid, length, data);
+ if (rv) {
+- out->printf(out, "**Unable to dump FRU data, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to dump FRU data, error 0x%x\n", rv);
+ goto out;
+ }
+
+ for (i=0; i<length; i++) {
+ if ((i > 0) && ((i % 8) == 0))
+- out->printf(out, "\n");
+- out->printf(out, " 0x%2.2x", data[i]);
++ out->eprintf(out, "\n");
++ out->eprintf(out, " 0x%2.2x", data[i]);
+ }
+- out->printf(out, "\n");
++ out->eprintf(out, "\n");
+
+ out:
+ if (data)
+@@ -1021,7 +1021,7 @@ mc_setbmc(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ return rv;
+ rv = ipmi_emu_set_bmc_mc(emu, ipmb);
+ if (rv)
+- out->printf(out, "**Invalid IPMB address\n");
++ out->eprintf(out, "**Invalid IPMB address\n");
+ return rv;
+ }
+
+@@ -1032,7 +1032,7 @@ atca_enable(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_emu_atca_enable(emu);
+ if (rv)
+- out->printf(out, "**Unable to enable ATCA mode, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to enable ATCA mode, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -1056,7 +1056,7 @@ atca_set_site(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_emu_atca_set_site(emu, hw_address, site_type, site_number);
+ if (rv)
+- out->printf(out, "**Unable to set site type, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set site type, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -1072,7 +1072,7 @@ mc_set_num_leds(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ rv = ipmi_mc_set_num_leds(mc, count);
+ if (rv)
+- out->printf(out, "**Unable to set number of LEDs, error 0x%x\n", rv);
++ out->eprintf(out, "**Unable to set number of LEDs, error 0x%x\n", rv);
+ return rv;
+ }
+
+@@ -1085,7 +1085,7 @@ read_cmds(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ err = get_delim_str(toks, &filename, &errstr);
+ if (err) {
+- out->printf(out, "Could not get include filename: %s\n", errstr);
++ out->eprintf(out, "Could not get include filename: %s\n", errstr);
+ return err;
+ }
+
+@@ -1097,7 +1097,7 @@ read_cmds(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ {
+ char *nf = malloc(strlen(BASE_CONF_STR) + strlen(filename) + 2);
+ if (!nf) {
+- out->printf(out, "Out of memory in include\n", errstr);
++ out->eprintf(out, "Out of memory in include\n", errstr);
+ goto out_err;
+ }
+ strcpy(nf, BASE_CONF_STR);
+@@ -1107,7 +1107,7 @@ read_cmds(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ filename = nf;
+ err = read_command_file(out, emu, filename);
+ if (err) {
+- out->printf(out, "Could not read include file %s\n", filename);
++ out->eprintf(out, "Could not read include file %s\n", filename);
+ }
+ }
+
+@@ -1147,7 +1147,7 @@ debug_cmd(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ } else if (strcmp(tok, "sol") == 0) {
+ level |= DEBUG_SOL;
+ } else {
+- out->printf(out, "Invalid debug level '%s', options are 'raw' and 'msg'\n",
++ out->eprintf(out, "Invalid debug level '%s', options are 'raw' and 'msg'\n",
+ tok);
+ return EINVAL;
+ }
+@@ -1168,7 +1168,7 @@ persist_cmd(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+ } else if (strcmp(tok, "off") == 0) {
+ persist_enable = 0;
+ } else {
+- out->printf(out, "Invalid persist vale '%s', options are 'on' and 'off'\n",
++ out->eprintf(out, "Invalid persist vale '%s', options are 'on' and 'off'\n",
+ tok);
+ return EINVAL;
+ }
+@@ -1194,18 +1194,18 @@ do_define(emu_out_t *out, emu_data_t *emu, lmc_data_t *mc, char **toks)
+
+ name = mystrtok(NULL, " \t\n", toks);
+ if (!name) {
+- out->printf(out, "No variable name given for define\n");
++ out->eprintf(out, "No variable name given for define\n");
+ return EINVAL;
+ }
+ err = get_delim_str(toks, &value, &errstr);
+ if (err) {
+- out->printf(out, "Could not get variable %s value: %s\n", name, errstr);
++ out->eprintf(out, "Could not get variable %s value: %s\n", name, errstr);
+ return err;
+ }
+ err = add_variable(name, value);
+ if (err) {
+ free(value);
+- out->printf(out, "Out of memory setting variable %s\n", name);
++ out->eprintf(out, "Out of memory setting variable %s\n", name);
+ return err;
+ }
+ return 0;
+@@ -1301,7 +1301,7 @@ ipmi_emu_cmd(emu_out_t *out, emu_data_t *emu, char *cmd_str)
+ return rv;
+ rv = ipmi_emu_get_mc_by_addr(emu, ipmb, &mc);
+ if (rv) {
+- out->printf(out, "**Invalid MC address\n");
++ out->eprintf(out, "**Invalid MC address\n");
+ return rv;
+ }
+ }
+@@ -1312,7 +1312,7 @@ ipmi_emu_cmd(emu_out_t *out, emu_data_t *emu, char *cmd_str)
+ }
+ }
+
+- out->printf(out, "**Unknown command: %s\n", cmd);
++ out->eprintf(out, "**Unknown command: %s\n", cmd);
+
+ out:
+ return rv;
+diff --git a/lanserv/ipmi_sim.c b/lanserv/ipmi_sim.c
+index 9472cce..30c4f27 100644
+--- a/lanserv/ipmi_sim.c
++++ b/lanserv/ipmi_sim.c
+@@ -607,8 +607,8 @@ isim_log(sys_data_t *sys, int logtype, msg_t *msg, const char *format,
+
+ con = data->consoles;
+ while (con) {
+- con->out.printf(&con->out, "%s", str);
+- con->out.printf(&con->out, "\n");
++ con->out.eprintf(&con->out, "%s", str);
++ con->out.eprintf(&con->out, "\n");
+ con = con->next;
+ }
+ #if HAVE_SYSLOG
+@@ -956,7 +956,7 @@ console_bind_ready(int fd, void *cb_data, os_hnd_fd_id_t *id)
+ newcon->shutdown_on_close = 0;
+ newcon->telnet = 1;
+ newcon->tn_pos = 0;
+- newcon->out.printf = emu_printf;
++ newcon->out.eprintf = emu_printf;
+ newcon->out.data = newcon;
+
+ setsockopt(rv, IPPROTO_TCP, TCP_NODELAY, (char *)&val, sizeof(val));
+@@ -1463,10 +1463,10 @@ main(int argc, const char *argv[])
+ stdio_console.telnet = 0;
+ stdio_console.tn_pos = 0;
+ if (nostdio) {
+- stdio_console.out.printf = dummy_printf;
++ stdio_console.out.eprintf = dummy_printf;
+ stdio_console.out.data = &stdio_console;
+ } else {
+- stdio_console.out.printf = emu_printf;
++ stdio_console.out.eprintf = emu_printf;
+ stdio_console.out.data = &stdio_console;
+ }
+ stdio_console.next = NULL;
+--
+2.14.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
new file mode 100644
index 000000000..d4e02be45
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/do-not-install-pyc-and-pyo.patch
@@ -0,0 +1,25 @@
+Do not install pyc and pyo for python module
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ swig/python/Makefile.am | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/swig/python/Makefile.am b/swig/python/Makefile.am
+index da95a81..97a62bf 100644
+--- a/swig/python/Makefile.am
++++ b/swig/python/Makefile.am
+@@ -33,8 +33,6 @@ CLEANFILES = OpenIPMI_wrap.c OpenIPMI.py OpenIPMI.pyo OpenIPMI.pyc
+ install-exec-local: _OpenIPMI.la OpenIPMI.py OpenIPMI.pyc OpenIPMI.pyo
+ $(INSTALL) -d $(DESTDIR)$(PYTHON_INSTALL_DIR)
+ $(INSTALL_DATA) OpenIPMI.py "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+- $(INSTALL_DATA) OpenIPMI.pyc "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+- $(INSTALL_DATA) OpenIPMI.pyo "$(DESTDIR)$(PYTHON_INSTALL_DIR)"
+ if test "x$(PYTHON_GUI_DIR)" = "xopenipmigui"; then \
+ $(INSTALL) -d $(DESTDIR)$(bindir); \
+ $(INSTALL_SCRIPT) $(srcdir)/openipmigui.py "$(DESTDIR)$(bindir)/openipmigui";\
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
new file mode 100644
index 000000000..449142fcf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/fix-symlink-install-error-in-cmdlang.patch
@@ -0,0 +1,22 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Thu Jun 7 16:00:13 2012 -0400
+
+ This patch fixes the error during the install stage when
+ creating a symbolic link for opeipmish in openipmi/cmdlang
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+
+Index: OpenIPMI-2.0.24/cmdlang/Makefile.am
+===================================================================
+--- OpenIPMI-2.0.24.orig/cmdlang/Makefile.am
++++ OpenIPMI-2.0.24/cmdlang/Makefile.am
+@@ -35,6 +35,7 @@ openipmish_LDADD = libOpenIPMIcmdlang.l
+ # compatability.
+ install-data-local:
+ rm -f $(DESTDIR)$(bindir)/ipmish
++ mkdir -p $(DESTDIR)$(bindir)/
+ $(LN_S) openipmish $(DESTDIR)$(bindir)/ipmish
+
+ uninstall-local:
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/include_sys_types.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/include_sys_types.patch
new file mode 100644
index 000000000..082511a67
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/include_sys_types.patch
@@ -0,0 +1,17 @@
+include sys/types.h for u_int32_t
+
+ui.c:340:5: error: unknown type name 'u_int32_t'; did you mean 'uint32_t'?
+ u_int32_t addr;
+ ^~~~~~~~~
+Index: OpenIPMI-2.0.24/ui/ui.c
+===================================================================
+--- OpenIPMI-2.0.24.orig/ui/ui.c
++++ OpenIPMI-2.0.24/ui/ui.c
+@@ -42,6 +42,7 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <sys/time.h>
++#include <sys/types.h>
+ #include <ctype.h>
+
+ #include <OpenIPMI/ipmi_err.h>
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
new file mode 100644
index 000000000..51a398ba5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi-init-fix-the-arguments.patch
@@ -0,0 +1,41 @@
+Subject: [PATCH] ipmi-init: fix the arguments
+
+The functions success/failure/warning defined in /etc/init.d/functions
+(provided by initscripts) only accepts numeric argument as return code,
+not a string.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ ipmi.init | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/ipmi.init b/ipmi.init
+index 2ebcd94..d8161c5 100644
+--- a/ipmi.init
++++ b/ipmi.init
+@@ -45,17 +45,17 @@ elif [ -r /etc/init.d/functions ]; then
+ case "$ACTION" in
+ success)
+ echo -n $*
+- success "$*"
++ success 0
+ echo
+ ;;
+ failure)
+ echo -n $*
+- failure "$*"
++ failure 1
+ echo
+ ;;
+ warning)
+ echo -n $*
+- warning "$*"
++ warning 0
+ echo
+ ;;
+ *)
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi.service b/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi.service
new file mode 100644
index 000000000..6fe137819
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/ipmi.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=IPMI Driver
+After=network.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@LIBEXECDIR@/openipmi-helper start
+ExecStop=@LIBEXECDIR@/openipmi-helper stop-all
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-helper b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-helper
new file mode 100755
index 000000000..4cebfb9c6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-helper
@@ -0,0 +1,512 @@
+#!/bin/sh
+#############################################################################
+#
+# ipmi: OpenIPMI Driver helper script
+#
+# Authors: Jan Safranek <jsafrane@redhat.com>
+#
+# Based on IPMI init script by:
+# Matt Domsch <Matt_Domsch@dell.com>
+# Chris Poblete <Chris_Poblete@dell.com>
+#
+# Status return code bits
+# no bits set = no errors
+# bit 0 set = minimum modules aren't loaded
+# bit 1 set = requested feature module isn't loaded
+# bit 2 set = /dev/ipmi0 (or /dev/imb if using that instead) doesn't exist
+# bit 3 set = /dev/watchdog doesn't exist
+# bit 4 set = lockfile doesn't exist
+# bit 5 set = modules are loaded even when asked to be unloaded
+
+CONFIGFILE=/etc/sysconfig/ipmi
+# source config info
+[ -r ${CONFIGFILE} ] && . ${CONFIGFILE}
+
+#############################################################################
+# GLOBALS
+#############################################################################
+MODULE_NAME="ipmi"
+INTF_NUM=0
+
+IPMI_SMB_MODULE_NAME="ipmi_smb"
+IPMI_SI_MODULE_NAME="ipmi_si"
+kernel=`uname -r | cut -d. -f1-2`
+if [ "${kernel}" == "2.4" ]; then
+ IPMI_SMB_MODULE_NAME="ipmi_smb_intf"
+ IPMI_SI_MODULE_NAME="ipmi_si_drv"
+fi
+
+MODULES_INTERFACES=""
+[ "${DEV_IPMI}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_devintf"
+[ "${IPMI_IMB}" = "yes" ] && MODULES_INTERFACES="${MODULES_INTERFACES} ipmi_imb"
+
+MODULES_FEATURES=""
+[ "${IPMI_WATCHDOG}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_watchdog"
+[ "${IPMI_POWEROFF}" = "yes" ] && MODULES_FEATURES="${MODULES_FEATURES} ipmi_poweroff"
+
+MODULES_HW=""
+[ "${IPMI_SI}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SI_MODULE_NAME}"
+[ "${IPMI_SMB}" = "yes" ] && MODULES_HW="${MODULES_HW} ${IPMI_SMB_MODULE_NAME}"
+
+MODULES_BASE="ipmi_msghandler"
+MODULES="${MODULES_INTERFACES} ${MODULES_FEATURES} ${MODULES_HW} ${MODULES_BASE}"
+
+RETVAL=0
+LOCKFILE=/var/lock/subsys/ipmi
+DEV_IPMI_TIMEOUT=150
+
+UDEV_EXISTS=0
+if [ -e /sbin/udev -o -e /sbin/udevd ]; then
+ UDEV_EXISTS=1
+fi
+
+#############################################################################
+# NOTES:
+# * /dev/ipmi0 is unconditionally deleted here on ipmi_devintf unload,
+# because SLES9 and RHEL4 kernels don't send a message for udev to delete
+# it for us.
+#
+#############################################################################
+
+modules_loaded_verbose()
+{
+ OnePlusLoaded=0
+ OnePlusUnloaded=0
+ for m in $@; do
+ if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+ echo "$m module loaded."
+ OnePlusLoaded=1
+ else
+ echo "$m module not loaded."
+ OnePlusUnloaded=1
+ fi
+ done
+}
+
+modules_loaded()
+{
+ OnePlusLoaded=0
+ OnePlusUnloaded=0
+ for m in $@; do
+ if /sbin/lsmod | grep $m >/dev/null 2>&1 ; then
+ OnePlusLoaded=1
+ else
+ OnePlusUnloaded=1
+ fi
+ done
+}
+
+device_node_exists ()
+{
+ if [ -e "$1" ]; then
+ echo "$1 exists."
+ return 1
+ fi
+ echo "$1 does not exist."
+ return 0
+}
+
+minimum_modules_loaded()
+{
+ rc_base=1
+ rc_hw=1
+ modules_loaded_verbose "${MODULES_BASE}"
+ [ ${OnePlusLoaded} -eq 0 ] && rc_base=0
+
+ modules_loaded_verbose "${MODULES_HW}"
+ [ ${OnePlusLoaded} -eq 0 ] && rc_hw=0
+
+ return $((rc_base && rc_hw))
+}
+
+#############################################################################
+
+load_si()
+{
+ if [ "${IPMI_SI}" = "yes" ]; then
+ modprobe ${IPMI_SI_MODULE_NAME} > /dev/null 2>&1
+ modules_loaded ${IPMI_SI_MODULE_NAME}
+ [ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+ fi
+}
+
+load_smb()
+{
+ if [ "${IPMI_SMB}" = "yes" ]; then
+ modprobe ${IPMI_SMB_MODULE_NAME} > /dev/null 2>&1
+ modules_loaded ${IPMI_SMB_MODULE_NAME}
+ [ ${OnePlusLoaded} -ne 1 ] && RETVAL=$((RETVAL | 1))
+ fi
+}
+
+load_hw_modules()
+{
+ load_si
+ load_smb
+}
+
+start_watchdog_common()
+{
+ load_hw_modules
+ modprobe ipmi_watchdog ${IPMI_WATCHDOG_OPTIONS} > /dev/null 2>&1
+ modules_loaded ipmi_watchdog
+ [ ${OnePlusUnloaded} -ne 0 ] &&
+ RETVAL=$((RETVAL | 2)) &&
+ echo "Watchdog startup failed: cannot load ipmi_watchdog module" &&
+ return
+ if [ ${UDEV_EXISTS} -eq 0 -a ! -e /dev/watchdog ]; then
+ mknod -m 0600 /dev/watchdog c 10 130
+ [ $? -ne 0 ] &&
+ RETVAL=$((RETVAL | 8)) &&
+ echo "Watchdog startup failed: cannot create /dev/watchdog" &&
+ return
+ fi
+}
+
+start_watchdog_quiet()
+{
+ [ "${IPMI_WATCHDOG}" != "yes" ] &&
+ return
+ start_watchdog_common
+}
+
+start_watchdog()
+{
+ [ "${IPMI_WATCHDOG}" != "yes" ] &&
+ RETVAL=$((RETVAL | 2)) &&
+ echo "Watchdog not configured" &&
+ return
+ start_watchdog_common
+}
+
+stop_watchdog()
+{
+ modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+ modules_loaded ipmi_watchdog
+ if [ ${OnePlusLoaded} -ne 0 ]; then
+ RETVAL=$((RETVAL | 32))
+ echo "Watchog shutdown failed: cannot unload ipmi_watchdog module"
+ else
+ if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+ [ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+ fi
+ fi
+}
+
+stop_watchdog_quiet()
+{
+ modprobe -q -r ipmi_watchdog > /dev/null 2>&1
+ modules_loaded ipmi_watchdog
+ if [ ${OnePlusLoaded} -ne 0 ]; then
+ RETVAL=$((RETVAL | 32))
+ else
+ if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+ [ ${UDEV_EXISTS} -eq 0 ] && rm -f /dev/watchdog
+ fi
+ fi
+}
+
+start_powercontrol_common()
+{
+ local poweroff_opts=""
+ load_hw_modules
+ if [ "${IPMI_POWERCYCLE}" == "yes" ]; then
+ modinfo ipmi_poweroff 2>/dev/null | grep poweroff_control > /dev/null 2>&1 && \
+ poweroff_opts="poweroff_control=2"
+ modinfo ipmi_poweroff 2>/dev/null | grep poweroff_powercycle > /dev/null 2>&1 && \
+ poweroff_opts="poweroff_powercycle=1"
+ fi
+ modprobe ipmi_poweroff "${poweroff_opts}" > /dev/null 2>&1
+ modules_loaded ipmi_poweroff
+ [ ${OnePlusUnloaded} -ne 0 ] &&
+ RETVAL=$((RETVAL | 2)) &&
+ echo "Powercontroll startup failed: cannot load ipmi_poweroff module" &&
+ return
+}
+
+start_powercontrol_quiet()
+{
+ [ "${IPMI_POWEROFF}" != "yes" ] &&
+ return
+ start_powercontrol_common
+}
+
+start_powercontrol()
+{
+ [ "${IPMI_POWEROFF}" != "yes" ] &&
+ RETVAL=$((RETVAL | 2)) &&
+ echo "Powercontroll not configured" &&
+ return
+ start_powercontrol_common
+}
+
+stop_powercontrol()
+{
+ modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+ modules_loaded ipmi_poweroff
+ if [ ${OnePlusLoaded} -ne 0 ]; then
+ RETVAL=$((RETVAL | 32))
+ echo "Powercontroll shutdown failed: cannot unload ipmi_poweroff module"
+ fi
+}
+
+stop_powercontrol_quiet()
+{
+ modprobe -q -r ipmi_poweroff > /dev/null 2>&1
+ modules_loaded ipmi_poweroff
+ [ ${OnePlusLoaded} -ne 0 ] && RETVAL=$((RETVAL | 32))
+}
+
+#############################################################################
+unload_all_ipmi_modules()
+{
+ stop_watchdog_quiet
+ stop_powercontrol_quiet
+ for m in ${MODULES}; do
+ modprobe -q -r ${m} > /dev/null 2>&1
+ done
+ # delete interface node ONLY if ipmi_devintf is unloaded
+ [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+ rm -f "/dev/ipmi${INTF_NUM}"
+}
+
+unload_ipmi_modules_leave_features()
+{
+ for m in ${MODULES_INTERFACES}; do
+ modprobe -q -r ${m} > /dev/null 2>&1
+ done
+ # delete interface node ONLY if ipmi_devintf is unloaded
+ [ `lsmod | grep -c "ipmi_devintf"` -eq 0 ] &&
+ rm -f "/dev/ipmi${INTF_NUM}"
+ lsmod | egrep -q "ipmi_(poweroff|watchdog)" > /dev/null 2>&1
+ if [ "$?" -ne "0" ]; then
+ stop_watchdog_quiet
+ stop_powercontrol_quiet
+ for m in ${MODULES}; do
+ modprobe -q -r ${m} > /dev/null 2>&1
+ done
+ fi
+}
+
+#############################################################################
+load_ipmi_modules ()
+{
+ local locdelay
+ modprobe ipmi_msghandler > /dev/null 2>&1
+ modules_loaded ipmi_msghandler
+ [ ${OnePlusLoaded} -ne 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+ load_hw_modules
+ [ $((RETVAL & 1)) -eq 1 ] && unload_all_ipmi_modules && RETVAL=$((RETVAL | 1)) && return
+
+ if [ "${DEV_IPMI}" = "yes" ]; then
+ modprobe ipmi_devintf > /dev/null 2>&1
+ modules_loaded ipmi_devintf
+ RETVAL=$((RETVAL & ~2))
+ [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+ if [ ${OnePlusLoaded} -eq 1 ]; then
+ if [ ${UDEV_EXISTS} -eq 0 ]; then
+ DEVMAJOR=`cat /proc/devices | awk '/ipmidev/{print $1}'`
+ rm -f /dev/ipmi${INTF_NUM}
+ mknod -m 0600 /dev/ipmi${INTF_NUM} c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+ fi
+
+ # udev can take several seconds to create /dev/ipmi0,
+ # but it happens asynchronously, so delay here
+ locdelay=${DEV_IPMI_TIMEOUT}
+ while [ ! -e /dev/ipmi${INTF_NUM} -a ${locdelay} -gt 0 ]; do
+ locdelay=$((locdelay - 1))
+ sleep 0.1
+ done
+ fi
+ fi
+
+ if [ "${IPMI_IMB}" = "yes" ]; then
+ modprobe ipmi_imb > /dev/null 2>&1
+ modules_loaded ipmi_imb
+ RETVAL=$((RETVAL & ~2))
+ [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+ if [ ${OnePlusLoaded} -eq 1 ]; then
+ DEVMAJOR=`cat /proc/devices | awk '/imb/{print $1}'`
+ rm -f /dev/imb
+ mknod -m 0600 /dev/imb c ${DEVMAJOR} 0 || RETVAL=$((RETVAL | 4))
+ fi
+ fi
+
+ # Per Corey Minyard, essentially no one uses ipmi_radisys
+ # and we don't want to encourage its further use
+ # so it won't be handled here.
+ return
+}
+
+#############################################################################
+start()
+{
+ load_ipmi_modules
+ if [ ${RETVAL} -eq 0 ]; then
+ touch ${LOCKFILE}
+ else
+ if [ $((RETVAL & 1)) -eq 1 ]; then
+ echo "Startup failed."
+ else
+ touch ${LOCKFILE} && echo "Warning!?"
+ fi
+ fi
+ start_watchdog_quiet
+ start_powercontrol_quiet
+}
+
+#############################################################################
+stop()
+{
+ unload_ipmi_modules_leave_features
+ modules_loaded ${MODULES_INTERFACES}
+ if [ ${OnePlusLoaded} -ne 0 ]; then
+ RETVAL=$((RETVAL | 32))
+ echo "Shutdown failed, something may be in use"
+ else
+ rm -f ${LOCKFILE}
+ fi
+}
+
+stop_all()
+{
+ unload_all_ipmi_modules
+ modules_loaded ${MODULES}
+ if [ ${OnePlusLoaded} -ne 0 ]; then
+ RETVAL=$((RETVAL | 32))
+ echo "Shutdown failed, something may be in use"
+ else
+ rm -f ${LOCKFILE}
+ fi
+}
+
+#############################################################################
+restart()
+{
+ stop_all
+ RETVAL=0
+ start
+}
+
+#############################################################################
+
+reload()
+{
+ stop_all
+ RETVAL=0
+ start
+}
+
+#############################################################################
+
+status_all()
+{
+ minimum_modules_loaded
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+ modules_loaded_verbose ${MODULES_FEATURES} ${MODULES_INTERFACES}
+ [ ${OnePlusUnloaded} -ne 0 ] && RETVAL=$((RETVAL | 2))
+
+ if [ "${DEV_IPMI}" = "yes" ]; then
+ device_node_exists /dev/ipmi${INTF_NUM}
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+ fi
+
+ if [ "${IPMI_IMB}" = "yes" ]; then
+ device_node_exists /dev/imb
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+ fi
+
+ if [ "${IPMI_WATCHDOG}" = "yes" ]; then
+ device_node_exists /dev/watchdog
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+ fi
+
+ [ ! -e ${LOCKFILE} ] && RETVAL=$((RETVAL | 16))
+}
+
+status()
+{
+ minimum_modules_loaded
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+ if [ "${DEV_IPMI}" = "yes" ]; then
+ modules_loaded_verbose ipmi_devintf
+ [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+ device_node_exists /dev/ipmi${INTF_NUM}
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+ fi
+
+ if [ "${IPMI_IMB}" = "yes" ]; then
+ device_node_exists /dev/imb
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 4))
+ fi
+}
+
+status_watchdog()
+{
+ minimum_modules_loaded
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+ modules_loaded_verbose ipmi_watchdog
+ [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+
+ device_node_exists /dev/watchdog
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 8))
+}
+
+status_powercontrol()
+{
+ minimum_modules_loaded
+ [ $? -eq 0 ] && RETVAL=$((RETVAL | 1))
+
+ modules_loaded_verbose ipmi_powercontrol
+ [ ${OnePlusLoaded} -eq 0 ] && RETVAL=$((RETVAL | 2))
+}
+
+#############################################################################
+usage ()
+{
+ echo $"Usage: $0 {start|stop|status" 1>&2
+ echo $" restart|condrestart|try-restart|reload|force-reload" 1>&2
+ echo $" start-watchdog|stop-watchdog|status-watchdog" 1>&2
+ echo $" start-powercontrol|stop-powercontrol|status-powercontrol" 1>&2
+ echo $" stop-all|status-all}" 1>&2
+ RETVAL=2
+}
+
+condrestart ()
+{
+ [ -e ${LOCKFILE} ] && restart
+}
+
+#############################################################################
+# MAIN
+#############################################################################
+case "$1" in
+ start) start ;;
+ stop) stop ;;
+ restart) restart ;;
+ force-reload) reload ;;
+ reload) reload ;;
+ status) status ;;
+ status-all) status_all ;;
+ condrestart) condrestart ;;
+ try-restart) condrestart ;;
+ start-watchdog) start_watchdog ;;
+ stop-watchdog) stop_watchdog ;;
+ status-watchdog) status_watchdog ;;
+ start-powercontrol) start_powercontrol ;;
+ stop-powercontrol) stop_powercontrol ;;
+ status-powercontrol) status_powercontrol ;;
+ stop-all) stop_all ;;
+ *) usage ;;
+esac
+
+exit ${RETVAL}
+
+#############################################################################
+# end of file
+#############################################################################
+
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
new file mode 100644
index 000000000..1fa68f9ba
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-no-openipmigui-man.patch
@@ -0,0 +1,26 @@
+Author: Aws Ismail <aws.ismail@windriver.com>
+Date: Thu Jun 7 12:28:34 2012 -0400
+
+ This patch was carried over from WRL4.3 (openipmi v2.0.16)
+
+ It was updated for openipmi v2.0.19
+
+ Disable making openipmigui man page since we don't need it
+
+ Upstream-Status: Pending
+
+ Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
+ Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 632f55b..5ce79f5 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -1,6 +1,6 @@
+
+ man_MANS = ipmi_ui.1 openipmicmd.1 openipmish.1 ipmi_cmdlang.7 \
+- openipmigui.1 openipmi_conparms.7 solterm.1 rmcp_ping.1 \
++ openipmi_conparms.7 solterm.1 rmcp_ping.1 \
+ openipmi_eventd.1
+
+ EXTRA_DIST = $(man_MANS)
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
new file mode 100644
index 000000000..83485a9e6
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/files/openipmi-remove-host-path-from-la_LDFLAGS.patch
@@ -0,0 +1,50 @@
+From aa0dc0783a6ff5fb56c914b640836223e3c192bb Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 29 Dec 2014 18:16:04 +0800
+Subject: [PATCH] remove host path from la_LDFLAGS
+
+Upstream-Status: Inappropriate [ cross compile specific ]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ cmdlang/Makefile.am | 2 +-
+ glib/Makefile.am | 4 ++--
+ tcl/Makefile.am | 2 +-
+ unix/Makefile.am | 4 ++--
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+Index: OpenIPMI-2.0.24/cmdlang/Makefile.am
+===================================================================
+--- OpenIPMI-2.0.24.orig/cmdlang/Makefile.am
++++ OpenIPMI-2.0.24/cmdlang/Makefile.am
+@@ -15,8 +15,7 @@ libOpenIPMIcmdlang_la_SOURCES = cmdlang.
+ libOpenIPMIcmdlang_la_LIBADD = -lm \
+ $(top_builddir)/utils/libOpenIPMIutils.la \
+ $(top_builddir)/lib/libOpenIPMI.la
+-libOpenIPMIcmdlang_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+- -L$(libdir)
++libOpenIPMIcmdlang_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION)
+
+ bin_PROGRAMS = openipmish
+
+Index: OpenIPMI-2.0.24/unix/Makefile.am
+===================================================================
+--- OpenIPMI-2.0.24.orig/unix/Makefile.am
++++ OpenIPMI-2.0.24/unix/Makefile.am
+@@ -10,14 +10,12 @@ lib_LTLIBRARIES = libOpenIPMIposix.la li
+ libOpenIPMIpthread_la_SOURCES = posix_thread_os_hnd.c selector.c
+ libOpenIPMIpthread_la_LIBADD = -lpthread $(GDBM_LIB) \
+ $(top_builddir)/utils/libOpenIPMIutils.la $(RT_LIB)
+-libOpenIPMIpthread_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+- -L$(libdir)
++libOpenIPMIpthread_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION)
+
+ libOpenIPMIposix_la_SOURCES = posix_os_hnd.c selector.c
+ libOpenIPMIposix_la_LIBADD = $(top_builddir)/utils/libOpenIPMIutils.la \
+ $(GDBM_LIB) $(RT_LIB)
+-libOpenIPMIposix_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION) \
+- -L$(libdir)
++libOpenIPMIposix_la_LDFLAGS = -rdynamic -version-info $(LD_VERSION)
+
+ noinst_HEADERS = heap.h
+
diff --git a/meta-openembedded/meta-networking/recipes-support/openipmi/openipmi_2.0.24.bb b/meta-openembedded/meta-networking/recipes-support/openipmi/openipmi_2.0.24.bb
new file mode 100644
index 000000000..a4f63c5f4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openipmi/openipmi_2.0.24.bb
@@ -0,0 +1,110 @@
+SUMMARY = "IPMI (Intelligent Platform Management Interface) library and tools"
+DESCRIPTION = "OpenIPMI is an effort to create a full-function IPMI system, \
+to allow full access to all IPMI information on a server \
+and to abstract it to a level that will make it easy to use"
+
+HOMEPAGE = "http://openipmi.sourceforge.net"
+
+DEPENDS = " \
+ glib-2.0 \
+ ncurses \
+ net-snmp \
+ openssl \
+ popt \
+ python \
+ swig-native \
+ "
+
+LICENSE = "GPLv2 & LGPLv2.1 & BSD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+ file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+ file://COPYING.BSD;md5=4b318d4160eb69c8ee53452feb1b4cdf \
+ "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openipmi/OpenIPMI-${PV}.tar.gz \
+ file://fix-symlink-install-error-in-cmdlang.patch \
+ file://openipmi-no-openipmigui-man.patch \
+ file://openipmi-remove-host-path-from-la_LDFLAGS.patch \
+ file://ipmi-init-fix-the-arguments.patch \
+ file://do-not-install-pyc-and-pyo.patch \
+ file://include_sys_types.patch \
+ file://openipmi-helper \
+ file://ipmi.service \
+ file://0001-lanserv-Rename-struct-parameter-printf-for-namespace.patch \
+ "
+
+S = "${WORKDIR}/OpenIPMI-${PV}"
+SRC_URI[md5sum] = "58f9542cbfcb5fe250b77cf88345e1ec"
+SRC_URI[sha256sum] = "bca39a27071278a8b74610181ede8df51e155e5e9031bc8eaa3699d1720292b4"
+
+inherit autotools-brokensep pkgconfig pythonnative perlnative update-rc.d systemd
+
+EXTRA_OECONF = "--disable-static \
+ --with-perl='${STAGING_BINDIR_NATIVE}/perl-native/perl' \
+ --with-python='${STAGING_BINDIR_NATIVE}/python-native/python' \
+ --with-pythoninstall='${PYTHON_SITEPACKAGES_DIR}' \
+ --with-glibver=2.0"
+
+PACKAGECONFIG ??= "gdbm"
+PACKAGECONFIG[gdbm] = "ac_cv_header_gdbm_h=yes,ac_cv_header_gdbm_h=no,gdbm,"
+
+PACKAGES += "${PN}-perl ${PN}-python"
+
+FILES_${PN}-perl = " \
+ ${libdir}/perl/vendor_perl/*/OpenIPMI.pm \
+ ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/OpenIPMI.so \
+ "
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
+FILES_${PN}-dbg += " \
+ ${libdir}/perl/vendor_perl/*/auto/OpenIPMI/.debug \
+ ${PYTHON_SITEPACKAGES_DIR}/.debug \
+ "
+
+do_configure () {
+
+ # Let's perform regular configuration first then handle perl issues.
+ autotools_do_configure
+
+ perl_ver=`perl -V:version | cut -d\' -f 2`
+
+ # Force openipmi perl bindings to be compiled using perl-native instead of
+ # the host's perl. Set the proper install directory for the resulting
+ # openipmi.pm and openipmi.so
+ for i in ${S}/swig/Makefile ${S}/swig/perl/Makefile; do
+ echo "SAL: i = $i"
+ echo "SAL: STAGING_INCDIR_NATIVE = $STAGING_INCDIR_NATIVE"
+ echo "SAL: libdir = $libdir"
+ sed -i -e "/^PERL_CFLAGS/s:-I/usr/local/include:-I${STAGING_INCDIR_NATIVE}:g" $i
+ sed -i -e "/^PERL_INSTALL_DIR/s:^PERL_INSTALL_DIR = .*:PERL_INSTALL_DIR = ${libdir}/perl/vendor_perl/$perl_ver:g" $i
+ done
+}
+
+do_install_append () {
+ echo "SAL: D = $D"
+ echo "SAL: libdir = $libdir"
+ install -m 0755 -d ${D}${sysconfdir}/sysconfig ${D}${sysconfdir}/init.d
+ install -m 0755 ${S}/ipmi.init ${D}${sysconfdir}/init.d/ipmi
+ install -m 0644 ${S}/ipmi.sysconf ${D}${sysconfdir}/sysconfig/ipmi
+ # SAL: mv: cannot stat `/localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/openipmi-2.0.19-r4/image/usr/lib64/perl5': No such file or directory
+ # SAL: real path to perl is /localdisk/loadbuild/slittle1/workspace/cgts_test_build/bitbake_build/tmp/work/x86_64-wrs-linux/perl-5.14.2-r8.3/package/usr/lib64/perl5 and it is a symlink to perl so no need to mv.
+ if [ -d ${D}${libdir}/perl5 ]
+ then
+ mv ${D}${libdir}/perl5 ${D}${libdir}/perl
+ fi
+
+ # for systemd
+ install -d ${D}${systemd_unitdir}/system
+ install -m 0664 ${WORKDIR}/ipmi.service ${D}${systemd_unitdir}/system
+ sed -i -e "s,@LIBEXECDIR@,${libexecdir},g" ${D}${systemd_unitdir}/system/ipmi.service
+ install -d ${D}${libexecdir}
+ install -m 0755 ${WORKDIR}/openipmi-helper ${D}${libexecdir}
+}
+
+INITSCRIPT_NAME = "ipmi"
+INITSCRIPT_PARAMS = "start 30 . stop 70 0 1 2 3 4 5 6 ."
+
+SYSTEMD_SERVICE_${PN} = "ipmi.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn
new file mode 100755
index 000000000..a3cd6a2f4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn
@@ -0,0 +1,104 @@
+#!/bin/sh -e
+#
+# Original version by Robert Leslie
+# <rob@mars.org>, edited by iwj and cs
+# Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as>
+# Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net>
+
+test $DEBIAN_SCRIPT_DEBUG && set -v -x
+
+DAEMON=/usr/sbin/openvpn
+CONFIG_DIR=/etc/openvpn
+test -x $DAEMON || exit 0
+test -d $CONFIG_DIR || exit 0
+
+start_vpn () {
+ modprobe tun >/dev/null 2>&1 || true
+ $DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \
+ --config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->"
+ echo -n " $NAME"
+}
+stop_vpn () {
+ kill `cat $PIDFILE` || true
+ rm $PIDFILE
+}
+
+case "$1" in
+start)
+ echo -n "Starting openvpn:"
+
+ if test -z $2 ; then
+ for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
+ NAME=${CONFIG%%.conf}
+ start_vpn
+ done
+ else
+ if test -e $CONFIG_DIR/$2.conf ; then
+ NAME=$2
+ start_vpn
+ else
+ echo -n " No such VPN: $2"
+ fi
+ fi
+ echo "."
+
+ ;;
+stop)
+ echo -n "Stopping openvpn:"
+
+ if test -z $2 ; then
+ for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c18-`
+ NAME=${NAME%%.pid}
+ stop_vpn
+ echo -n " $NAME"
+ done
+ else
+ if test -e /var/run/openvpn.$2.pid ; then
+ PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null`
+ NAME=`echo $PIDFILE | cut -c18-`
+ NAME=${NAME%%.pid}
+ stop_vpn
+ echo -n " $NAME"
+ else
+ echo -n " No such VPN: $2"
+ fi
+ fi
+ echo "."
+ ;;
+# We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'.
+reload|force-reload)
+ echo -n "Reloading openvpn:"
+ for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
+ NAME=`echo $PIDFILE | cut -c18-`
+ NAME=${NAME%%.pid}
+# If openvpn if running under a different user than root we'll need to restart
+ if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then
+ stop_vpn
+ sleep 1
+ start_vpn
+ echo -n "(restarted)"
+ else
+ kill -HUP `cat $PIDFILE` || true
+# start-stop-daemon --stop --signal HUP --quiet --oknodo \
+# --exec $DAEMON --pidfile $PIDFILE
+ echo -n " $NAME"
+ fi
+ done
+ echo "."
+ ;;
+
+restart)
+ $0 stop $2
+ sleep 1
+ $0 start $2
+ ;;
+*)
+ echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# vim:set ai et sts=2 sw=2 tw=0:
diff --git a/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf
new file mode 100644
index 000000000..1205806d5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn-volatile.conf
@@ -0,0 +1 @@
+d @LOCALSTATEDIR@/run/openvpn 0755 root root -
diff --git a/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn@.service b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn@.service
new file mode 100644
index 000000000..358dcb791
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn/openvpn@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenVPN Robust And Highly Flexible Tunneling Application On %I
+After=syslog.target network.target
+
+[Service]
+PrivateTmp=true
+Type=forking
+PIDFile=/var/run/openvpn/%i.pid
+ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.4.4.bb b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.4.4.bb
new file mode 100644
index 000000000..4cad99869
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/openvpn/openvpn_2.4.4.bb
@@ -0,0 +1,67 @@
+SUMMARY = "A full-featured SSL VPN solution via tun device."
+HOMEPAGE = "http://openvpn.sourceforge.net"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9b64491ec98eb6c6493ac5e4118f107"
+DEPENDS = "lzo openssl iproute2 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+inherit autotools systemd
+
+SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \
+ file://openvpn \
+ file://openvpn@.service \
+ file://openvpn-volatile.conf"
+
+SRC_URI[md5sum] = "705a79d005558d94fa1e2b74e4413e97"
+SRC_URI[sha256sum] = "1ae883d9522c9fa6d189e5e4aaa058a93edd3d0b897e3c2664107c4785099fc3"
+
+SYSTEMD_SERVICE_${PN} += "openvpn@loopback-server.service openvpn@loopback-client.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+CFLAGS += "-fno-inline"
+
+# I want openvpn to be able to read password from file (hrw)
+EXTRA_OECONF += "--enable-iproute2"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
+
+# Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
+EXTRA_OECONF += "IPROUTE=${base_sbindir}/ip"
+
+do_install_append() {
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d
+
+ install -d ${D}/${sysconfdir}/openvpn
+ install -d ${D}/${sysconfdir}/openvpn/sample
+ install -m 755 ${S}/sample/sample-config-files/loopback-server ${D}${sysconfdir}/openvpn/sample/loopback-server.conf
+ install -m 755 ${S}/sample/sample-config-files/loopback-client ${D}${sysconfdir}/openvpn/sample/loopback-client.conf
+ install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-keys
+ install -m 644 ${S}/sample/sample-keys/* ${D}${sysconfdir}/openvpn/sample/sample-keys
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}/${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system
+ install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system/openvpn@loopback-server.service
+ install -m 644 ${WORKDIR}/openvpn@.service ${D}/${systemd_unitdir}/system/openvpn@loopback-client.service
+
+ install -d ${D}/${localstatedir}
+ install -d ${D}/${localstatedir}/lib
+ install -d -m 710 ${D}/${localstatedir}/lib/openvpn
+
+ install -d ${D}${sysconfdir}/tmpfiles.d
+ install -m 0644 ${WORKDIR}/openvpn-volatile.conf ${D}${sysconfdir}/tmpfiles.d/openvpn.conf
+ sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/tmpfiles.d/openvpn.conf
+ fi
+}
+
+PACKAGES =+ " ${PN}-sample "
+
+RRECOMMENDS_${PN} = "kernel-module-tun"
+
+FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
+FILES_${PN} += "${systemd_unitdir}/system/openvpn@.service \
+ ${sysconfdir}/tmpfiles.d \
+ "
+FILES_${PN}-sample += "${systemd_unitdir}/system/openvpn@loopback-server.service \
+ ${systemd_unitdir}/system/openvpn@loopback-client.service \
+ ${sysconfdir}/openvpn/sample/"
diff --git a/meta-openembedded/meta-networking/recipes-support/phytool/phytool.bb b/meta-openembedded/meta-networking/recipes-support/phytool/phytool.bb
new file mode 100644
index 000000000..4ed3ed1e4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/phytool/phytool.bb
@@ -0,0 +1,15 @@
+SUMMARY = "PHY interface tool for Linux"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=39bba7d2cf0ba1036f2a6e2be52fe3f0"
+
+PV = "1.0.1+git${SRCPV}"
+SRCREV = "3149bfdb4f513e2f0da0a7d0bc5d0873578696f2"
+SRC_URI = "git://github.com/wkz/phytool.git"
+
+S = "${WORKDIR}/git"
+
+# The Makefile has "$PREFIX/bin" hardcoded into it, hence not using $bindir here
+do_install() {
+ install -d ${D}${prefix}/bin
+ oe_runmake 'DESTDIR=${D}' 'PREFIX=${prefix}' install
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/pimd/pimd/0001-configure-Dont-use-uname-to-determine-target-OS.patch b/meta-openembedded/meta-networking/recipes-support/pimd/pimd/0001-configure-Dont-use-uname-to-determine-target-OS.patch
new file mode 100644
index 000000000..eb549ded9
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/pimd/pimd/0001-configure-Dont-use-uname-to-determine-target-OS.patch
@@ -0,0 +1,28 @@
+From f3e04281bad361249a8dad0cde150a801d720f67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 14 Jul 2017 18:46:52 -0700
+Subject: [PATCH] configure: Dont use uname to determine target OS
+
+Helps with cross-compiling
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 6c35a72..f9714e2 100755
+--- a/configure
++++ b/configure
+@@ -31,7 +31,7 @@
+ #DEFS += -DSCOPED_ACL
+ #
+
+-OS=`uname`
++OS="Linux"
+ CFG=config.mk
+ TMP=`mktemp /tmp/XXXXXX`
+ BUGREPORT_URL="https://github.com/troglobit/pimd/issues"
+--
+2.13.3
+
diff --git a/meta-openembedded/meta-networking/recipes-support/pimd/pimd_2.3.2.bb b/meta-openembedded/meta-networking/recipes-support/pimd/pimd_2.3.2.bb
new file mode 100644
index 000000000..2faa7cb1c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/pimd/pimd_2.3.2.bb
@@ -0,0 +1,20 @@
+SUMMARY = "pimd is a lightweight stand-alone PIM-SM v2 multicast routing daemon."
+HOMEPAGE = "http://troglobit.com/pimd.html"
+SECTION = "net"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94f108f91fab720d62425770b70dd790"
+
+SRC_URI = "ftp://ftp.troglobit.com/pimd/${BP}.tar.gz \
+ file://0001-configure-Dont-use-uname-to-determine-target-OS.patch \
+ "
+SRC_URI[md5sum] = "a3c03e40540980b2c06e265a17988e60"
+SRC_URI[sha256sum] = "c77a9812751f114490a28a6839b16aac8b020c8d9fd6aa22bf3880c054e19f1d"
+
+EXTRA_OECONF_append_libc-musl = " --embedded-libc"
+
+inherit autotools-brokensep
+
+do_configure() {
+ oe_runconf
+}
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch b/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch
new file mode 100644
index 000000000..f8eb3ae67
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-Fix-build-with-format-string-checks.patch
@@ -0,0 +1,33 @@
+From 40848547abf592c8d29b85ef1346001514944435 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 17 Jun 2017 10:14:20 -0700
+Subject: [PATCH] Fix build with format string checks
+
+Fixes
+| ruli_addr.c:418:5: error: format not a string literal and no format arguments [-Werror=format-security]
+| return fprintf(out, inet_ntoa(addr->ipv4));
+| ^~~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ruli_addr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ruli_addr.c b/src/ruli_addr.c
+index 00d5d0d..f1eabae 100644
+--- a/src/ruli_addr.c
++++ b/src/ruli_addr.c
+@@ -415,7 +415,7 @@ int ruli_in_print(FILE *out, const _ruli_addr *addr, int family)
+ {
+ switch (family) {
+ case PF_INET:
+- return fprintf(out, inet_ntoa(addr->ipv4));
++ return fprintf(out, "%s", inet_ntoa(addr->ipv4));
+
+ case PF_INET6:
+ return ruli_inet6_print(out, &addr->ipv6);
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch b/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
new file mode 100644
index 000000000..9044415ff
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ruli/files/0001-src-ruli_addr.c-Add-missing-format-string.patch
@@ -0,0 +1,35 @@
+From d3fb471f53712e710fb5777b1b0851c46b7be64c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 25 Jun 2017 01:23:03 -0700
+Subject: [PATCH] src/ruli_addr.c: Add missing format string
+
+fixes
+
+| ruli_addr.c: In function 'ruli_in_snprint':
+| ruli_addr.c:491:5: error: format not a string literal and no format arguments [-Werror=format-security]
+| return snprintf(buf, size, inet_ntoa(addr->ipv4));
+| ^~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/ruli_addr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ruli_addr.c b/src/ruli_addr.c
+index f1eabae..5f1fd4f 100644
+--- a/src/ruli_addr.c
++++ b/src/ruli_addr.c
+@@ -488,7 +488,7 @@ int ruli_in_snprint(char *buf, size_t size, const _ruli_addr *addr, int family)
+ {
+ switch (family) {
+ case PF_INET:
+- return snprintf(buf, size, inet_ntoa(addr->ipv4));
++ return snprintf(buf, size, "%s", inet_ntoa(addr->ipv4));
+
+ case PF_INET6:
+ return ruli_inet6_snprint(buf, size, &addr->ipv6);
+--
+2.13.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch b/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch
new file mode 100644
index 000000000..60789a3d5
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ruli/files/Makefile.patch
@@ -0,0 +1,122 @@
+diff -Naur patch.org/ruli-0.36/Makefile patch.new/ruli-0.36/Makefile
+--- ruli-0.36/Makefile 2015-09-10 15:14:13.952262350 -0400
++++ ruli-0.36/Makefile 2015-09-10 15:14:38.628261620 -0400
+@@ -7,17 +7,17 @@
+ .PHONY: default
+ default:
+ $(MAKE) -C src
+- $(MAKE) -C sample
++# $(MAKE) -C sample
+
+ .PHONY: clean
+ clean:
+ $(MAKE) -C src clean
+- $(MAKE) -C sample clean
++# $(MAKE) -C sample clean
+
+ .PHONY: install
+ install:
+ $(MAKE) -C src install
+- $(MAKE) -C sample install
++# $(MAKE) -C sample install
+
+ .PHONY: dpkg
+ dpkg:
+
+=====================================================================
+
+diff -Naur patch.org/git/src/Makefile patch.new/git/src/Makefile
+--- ruli-0.36/src/Makefile 2005-06-13 12:34:53.000000000 -0400
++++ ruli-0.36/src/Makefile 2015-09-11 09:46:06.290287347 -0400
+@@ -18,9 +18,9 @@
+ #
+ # Debian packaging likes this: OOP_BASE_DIR = /usr
+ #
+-OOP_BASE_DIR = /usr/local/oop
+-OOP_INCLUDE_DIR = $(OOP_BASE_DIR)/include
+-OOP_LIB_DIR = $(OOP_BASE_DIR)/lib
++#OOP_BASE_DIR = /usr/local/oop
++OOP_INCLUDE_DIR = ${PKG_CONFIG_SYSROOT_DIR}/$(includedir)/
++#OOP_LIB_DIR = $(OOP_BASE_DIR)/lib
+
+ #
+ # INSTALL_BASE_DIR indicates where RULI
+@@ -30,11 +30,11 @@
+ #
+ # Debian packaging likes this: INSTALL_BASE_DIR = $(DESTDIR)/usr
+ #
+-INSTALL_BASE_DIR = ../install/ruli
+-INSTALL_INCLUDE_DIR = $(INSTALL_BASE_DIR)/include
+-INSTALL_LIB_DIR = $(INSTALL_BASE_DIR)/lib
+-INSTALL_MAN_DIR = $(INSTALL_BASE_DIR)/share/man
+-INSTALL_MAN3_DIR = $(INSTALL_MAN_DIR)/man3
++#INSTALL_BASE_DIR = ../install/ruli
++#INSTALL_INCLUDE_DIR = $(INSTALL_BASE_DIR)/include
++#INSTALL_LIB_DIR = $(INSTALL_BASE_DIR)/lib
++#INSTALL_MAN_DIR = $(INSTALL_BASE_DIR)/share/man
++#INSTALL_MAN3_DIR = $(INSTALL_MAN_DIR)/man3
+
+ # SunOS, Linux
+ PLATFORM=$(shell uname)
+@@ -45,7 +45,7 @@
+
+ WARN = -pedantic -ansi -Wshadow -Wpointer-arith -Wcast-qual \
+ -Wcast-align -Wwrite-strings -Wredundant-decls
+-CC = gcc
++#CC = gcc
+
+ # gcc-specific options (not valid for g++)
+ ifeq ($(CC),gcc)
+@@ -58,7 +58,7 @@
+ FLAGS = $(DEBUG) -O2 -pipe -Wall -g -shared -D_REENTRANT \
+ $(DEFINE_SOLARIS) -I. -I$(OOP_INCLUDE_DIR)
+ SOFT_CFLAGS = $(WARN) $(FLAGS)
+-CFLAGS = $(WARN) -Werror $(FLAGS)
++CFLAGS = $(WARN) $(FLAGS)
+ LIBOBJ = ruli_isaac.o ruli_mem.o ruli_rand.o ruli_util.o ruli_list.o \
+ ruli_addr.o ruli_sock.o ruli_txt.o ruli_msg.o ruli_fsm.o \
+ ruli_res.o ruli_parse.o ruli_host.o ruli_srv.o ruli_conf.o \
+@@ -66,7 +66,7 @@
+ ruli_getaddrinfo.o
+ SHAREDOBJ = $(LIBOBJ:%.o=%.os)
+ SONAME = libruli.so.4
+-LDFLAGS = -L$(OOP_LIB_DIR)
++#LDFLAGS = -L$(OOP_LIB_DIR)
+
+ COMPILE = $(CC) $(ARCH) $(CPPFLAGS) $(CFLAGS) -c
+ SHARED_COMPILE = $(CC) $(ARCH) $(CPPFLAGS) $(SHARED) $(CFLAGS) -o $@ -c
+@@ -89,19 +89,19 @@
+ strip: ruli
+ strip $(SONAME) libruli.a
+
+-.PHONY: install
+-install: ruli
+- mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_MAN3_DIR)
+- cp $(SONAME) libruli.a $(INSTALL_LIB_DIR)
+- cp *.h $(INSTALL_INCLUDE_DIR)
+- cp ../doc/man/*.3 $(INSTALL_MAN3_DIR)
+- cd $(INSTALL_LIB_DIR) && ln -s $(SONAME) libruli.so
+- @echo
+- @echo "REMINDER:"
+- @echo "Add $(INSTALL_LIB_DIR) to your dynamic loader path:"
+- @echo "# echo $(INSTALL_LIB_DIR) >> /etc/ld.so.conf"
+- @echo "# ldconfig"
+- @echo
++#.PHONY: install
++#install: ruli
++# mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_MAN3_DIR)
++# cp $(SONAME) libruli.a $(INSTALL_LIB_DIR)
++# cp *.h $(INSTALL_INCLUDE_DIR)
++# cp ../doc/man/*.3 $(INSTALL_MAN3_DIR)
++# cd $(INSTALL_LIB_DIR) && ln -s $(SONAME) libruli.so
++# @echo
++# @echo "REMINDER:"
++# @echo "Add $(INSTALL_LIB_DIR) to your dynamic loader path:"
++# @echo "# echo $(INSTALL_LIB_DIR) >> /etc/ld.so.conf"
++# @echo "# ldconfig"
++# @echo
+
+ .PHONY: ruli
+ ruli: $(SONAME) libruli.a
+
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb b/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb
new file mode 100644
index 000000000..885796d2a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ruli/ruli_0.36.bb
@@ -0,0 +1,25 @@
+SUMMARY = "RULI stands for Resolver User Layer Interface It's a library built on top of an asynchronous DNS stub resolver"
+
+HOMEPAGE = "http://www.nongnu.org/ruli/"
+
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+DEPENDS = "liboop"
+
+SRC_URI = "http://download.savannah.gnu.org/releases/ruli/ruli_${PV}.orig.tar.gz \
+ file://Makefile.patch \
+ file://0001-Fix-build-with-format-string-checks.patch \
+ file://0001-src-ruli_addr.c-Add-missing-format-string.patch \
+ "
+
+SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468"
+SRC_URI[sha256sum] = "11d32def5b514748fbd9ea8c88049ae99e1bb358efc74eb91a4d268a3999dbfa"
+
+do_install1() {
+ install -d ${D}${includedir}/ruli
+ install -d ${D}${libdir}
+ install -m 0644 ${S}/src/ruli*.h ${D}${includedir}/ruli
+ install -m 0644 ${S}/src/libruli.so ${D}${libdir}
+ install -m 0644 ${S}/src/libruli.so.4 ${D}${libdir}
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/smcroute/smcroute_2.0.0.bb b/meta-openembedded/meta-networking/recipes-support/smcroute/smcroute_2.0.0.bb
new file mode 100644
index 000000000..9b6fc2f38
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/smcroute/smcroute_2.0.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Static Multicast Routing Daemon"
+DESCRIPTION = "SMCRoute is a daemon and command line tool to manipulate the multicast routing table in the UNIX kernel."
+HOMEPAGE = "http://troglobit.github.io/smcroute.html"
+SECTION = "net"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
+
+SRCREV = "d6280e64b27d5a4bd7f37dac36b455f4ae5f9ab3"
+SRC_URI = "git://github.com/troglobit/smcroute.git;branch=master;protocol=git"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmping/files/0001-Makefile-tweak-install-dir.patch b/meta-openembedded/meta-networking/recipes-support/ssmping/files/0001-Makefile-tweak-install-dir.patch
new file mode 100644
index 000000000..0cb981cf7
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmping/files/0001-Makefile-tweak-install-dir.patch
@@ -0,0 +1,35 @@
+From 693cfce5431e191a3955fd56fa822927d92c9e43 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 7 Nov 2014 14:27:00 +0800
+Subject: [PATCH] Makefile: tweak install dir
+
+For oe-core, the man doc should be installed to /usr/share/man
+rather than /usr/locale/man.
+
+Upstream-Status: inappropriate (oe specific)
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b5d12f8..9b2663c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,9 +14,9 @@ install: ssmping asmping ssmpingd mcfirst
+ install -D asmping $(DESTDIR)$(PREFIX)/bin/asmping
+ install -D ssmpingd $(DESTDIR)$(PREFIX)/bin/ssmpingd
+ install -D mcfirst $(DESTDIR)$(PREFIX)/bin/mcfirst
+- install -D ssmping.1 $(DESTDIR)$(PREFIX)/man/man1/ssmping.1
+- install -D asmping.1 $(DESTDIR)$(PREFIX)/man/man1/asmping.1
+- install -D mcfirst.1 $(DESTDIR)$(PREFIX)/man/man1/mcfirst.1
++ install -D ssmping.1 $(DESTDIR)$(PREFIX)/share/man/man1/ssmping.1
++ install -D asmping.1 $(DESTDIR)$(PREFIX)/share/man/man1/asmping.1
++ install -D mcfirst.1 $(DESTDIR)$(PREFIX)/share/man/man1/mcfirst.1
+
+ clean:
+ rm -f $(OBJ) joinch.o joingrp.o ssmping asmping ssmpingd mcfirst
+--
+1.9.1
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb b/meta-openembedded/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb
new file mode 100644
index 000000000..0531ffe64
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmping/ssmping_0.9.1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "ssmping is a tool for checking whether one can receive SSM from a given host"
+HOMEPAGE = "http://www.venaas.no/multicast/ssmping/"
+SECTION = "net"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://asmping.c;beginline=2;endline=11;md5=1ca8d1a1ca931e5cfe604ebf20a78b71"
+
+SRC_URI = "http://www.venaas.no/multicast/ssmping/${BP}.tar.gz \
+ file://0001-Makefile-tweak-install-dir.patch \
+"
+SRC_URI[md5sum] = "ad8e3d13f6d72918f73be7e7975d7fad"
+SRC_URI[sha256sum] = "22103a37eaa28489169a0927bc01e0596c3485fc4d29fc8456c07fd2c70fca6d"
+
+CFLAGS += "-D_GNU_SOURCE "
+
+do_install() {
+ oe_runmake 'DESTDIR=${D}' 'PREFIX=${prefix}' install
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
new file mode 100644
index 000000000..d53cff249
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/build-ouside_srcdir.patch
@@ -0,0 +1,17 @@
+help compile when S != B
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -24,7 +24,7 @@ INSTALLED_REVALIASES_FILE=$(REVALIASES_F
+ # Programs
+ GEN_CONFIG=$(srcdir)/generate_config
+
+-SRCS=ssmtp.c arpadate.c base64.c xgethostname.c @SRCS@
++SRCS=$(srcdir)/ssmtp.c $(srcdir)/arpadate.c $(srcdir)/base64.c $(srcdir)/xgethostname.c @SRCS@
+
+ OBJS=$(SRCS:.c=.o)
+
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/ssmtp-bug584162-fix.patch b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/ssmtp-bug584162-fix.patch
new file mode 100644
index 000000000..e087bc752
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/ssmtp-bug584162-fix.patch
@@ -0,0 +1,126 @@
+Bug-Debian: http://bugs.debian.org/584162
+Reported-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Forwarded: not-needed
+Reviewed-By: Anibal Monsalve Salazar <anibal@debian.org>
+Last-Update: 2014-08-15
+
+From: "Daniel Richard G." <skunk@iSKUNK.ORG>
+Subject: Re: ssmtp: Partial loss of message body, sending message to wrong recipicients
+Date: Thu, 19 Jun 2014 14:44:30 -0400
+
+Attached is a patch against the original 2.64 source that should address
+this bug, and hopefully not break anything. An overview of my changes:
+
+* Added code to standarise() to drop the trailing '\r' if the line
+ originally ended with "\r\n".
+
+* Added a check to header_parse() that effectively converts an "\r\n" in
+ the input into '\n'.
+
+* Added a conditional so that header_parse() doesn't pass the empty
+ string to header_save()---a behavior I observed in testing, at the end
+ of a header block with "\r\n" line endings.
+
+* Simplified the last if(in_header) conditional in header_parse(),
+ because it erroneously assumes that if in_header == True, then c could
+ have some value other than EOF. (See the condition on the previous
+ "while" loop, and the lack of any other way to exit said loop.)
+
+ header_parse() will now properly grab a header if fed a message
+ without a body (i.e. no "\n\n" ending the header block), although this
+ code will still drop a header if there is no newline at the end.
+
+Christoph, thank you for your excellent analysis, and the test cases. I
+made use of them, and with my changes sSMTP appears to do the right
+thing.
+
+Debian patch from: https://sources.debian.net/patches/ssmtp/2.64-8/
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+Index: ssmtp-2.64/ssmtp.c
+===================================================================
+--- ssmtp-2.64.orig/ssmtp.c
++++ ssmtp-2.64/ssmtp.c
+@@ -375,6 +375,12 @@ bool_t standardise(char *str, bool_t *li
+ if((p = strchr(str, '\n'))) {
+ *p = (char)NULL;
+ *linestart = True;
++
++ /* If the line ended in "\r\n", then drop the '\r' too */
++ sl = strlen(str);
++ if(sl >= 1 && str[sl - 1] == '\r') {
++ str[sl - 1] = (char)NULL;
++ }
+ }
+ return(leadingdot);
+ }
+@@ -768,6 +774,14 @@ void header_parse(FILE *stream)
+ }
+ len++;
+
++ if(l == '\r' && c == '\n') {
++ /* Properly handle input that already has "\r\n"
++ line endings; see https://bugs.debian.org/584162 */
++ l = (len >= 2 ? *(q - 2) : '\n');
++ q--;
++ len--;
++ }
++
+ if(l == '\n') {
+ switch(c) {
+ case ' ':
+@@ -790,7 +804,9 @@ void header_parse(FILE *stream)
+ if((q = strrchr(p, '\n'))) {
+ *q = (char)NULL;
+ }
+- header_save(p);
++ if(len > 0) {
++ header_save(p);
++ }
+
+ q = p;
+ len = 0;
+@@ -800,35 +816,12 @@ void header_parse(FILE *stream)
+
+ l = c;
+ }
+- if(in_header) {
+- if(l == '\n') {
+- switch(c) {
+- case ' ':
+- case '\t':
+- /* Must insert '\r' before '\n's embedded in header
+- fields otherwise qmail won't accept our mail
+- because a bare '\n' violates some RFC */
+-
+- *(q - 1) = '\r'; /* Replace previous \n with \r */
+- *q++ = '\n'; /* Insert \n */
+- len++;
+-
+- break;
+-
+- case '\n':
+- in_header = False;
+-
+- default:
+- *q = (char)NULL;
+- if((q = strrchr(p, '\n'))) {
+- *q = (char)NULL;
+- }
+- header_save(p);
+-
+- q = p;
+- len = 0;
+- }
++ if(in_header && l == '\n') {
++ /* Got EOF while reading the header */
++ if((q = strrchr(p, '\n'))) {
++ *q = (char)NULL;
+ }
++ header_save(p);
+ }
+ (void)free(p);
+ }
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
new file mode 100644
index 000000000..26d852761
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp/use-DESTDIR.patch
@@ -0,0 +1,74 @@
+Use DESTDIR during install/uninstall, this helps
+with cross or staged builds. Additionally pass LDFLAGS
+during linking.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+Index: ssmtp-2.64/Makefile.in
+===================================================================
+--- ssmtp-2.64.orig/Makefile.in
++++ ssmtp-2.64/Makefile.in
+@@ -46,40 +46,40 @@ all: ssmtp
+
+ .PHONY: install
+ install: ssmtp $(GEN_CONFIG)
+- $(INSTALL) -d -m 755 $(bindir)
+- $(INSTALL) -s -m 755 ssmtp $(bindir)/ssmtp
+- $(INSTALL) -d -m 755 $(mandir)
+- $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(mandir)/ssmtp.8
+- $(INSTALL) -d -m 755 $(SSMTPCONFDIR)
+- $(INSTALL) -m 644 $(srcdir)/revaliases $(INSTALLED_REVALIASES_FILE)
+- $(GEN_CONFIG) $(INSTALLED_CONFIGURATION_FILE)
++ $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
++ $(INSTALL) -m 755 ssmtp $(DESTDIR)$(bindir)/ssmtp
++ $(INSTALL) -d -m 755 $(DESTDIR)$(mandir)
++ $(INSTALL) -m 644 $(srcdir)/ssmtp.8 $(DESTDIR)$(mandir)/ssmtp.8
++ $(INSTALL) -d -m 755 $(DESTDIR)$(SSMTPCONFDIR)
++ $(INSTALL) -m 644 $(srcdir)/revaliases $(DESTDIR)$(INSTALLED_REVALIASES_FILE)
++ $(GEN_CONFIG) $(DESTDIR)$(INSTALLED_CONFIGURATION_FILE)
+
+
+ .PHONY: install-sendmail
+ install-sendmail: install
+- $(RM) $(bindir)/sendmail
+- $(LN_S) ssmtp $(bindir)/sendmail
+- $(INSTALL) -d -m 755 $(libexecdir)
+- $(RM) $(libexecdir)/sendmail
+- $(LN_S) sendmail /lib/sendmail
+- $(RM) $(mandir)/sendmail.8
+- $(LN_S) ssmtp.8 $(mandir)/sendmail.8
++ $(RM) $(DESTDIR)$(bindir)/sendmail
++ $(LN_S) ssmtp $(DESTDIR)$(bindir)/sendmail
++ $(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
++ $(RM) $(DESTDIR)$(libexecdir)/sendmail
++ $(LN_S) sendmail $(DESTDIR)/lib/sendmail
++ $(RM) $(DESTDIR)$(mandir)/sendmail.8
++ $(LN_S) ssmtp.8 $(DESTDIR)$(mandir)/sendmail.8
+
+ .PHONY: uninstall
+ uninstall:
+- $(RM) $(bindir)/ssmtp
+- $(RM) $(mandir)/ssmtp.8
+- $(RM) $(CONFIGURATION_FILE) $(REVALIASES_FILE)
+- $(RM) -r $(SSMTPCONFDIR)
++ $(RM) $(DESTDIR)$(bindir)/ssmtp
++ $(RM) $(DESTDIR)$(mandir)/ssmtp.8
++ $(RM) $(DESTDIR)$(CONFIGURATION_FILE) $(DESTDIR)$(REVALIASES_FILE)
++ $(RM) -r $(DESTDIR)$(SSMTPCONFDIR)
+
+ .PHONY: uninstall-sendmail
+ uninstall-sendmail: uninstall
+- $(RM) $(bindir)/sendmail /lib/sendmail
+- $(RM) $(mandir)/sendmail.8
++ $(RM) $(DESTDIR)$(bindir)/sendmail $(DESTDIR)/lib/sendmail
++ $(RM) $(DESTDIR)$(mandir)/sendmail.8
+
+ # Binaries:
+ ssmtp: $(OBJS)
+- $(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS)
++ $(CC) -o ssmtp $(OBJS) @LIBS@ $(CFLAGS) $(LDFLAGS)
+
+ .PHONY: clean
+ clean:
diff --git a/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
new file mode 100644
index 000000000..07e3ffed4
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
@@ -0,0 +1,35 @@
+SUMMARY = "extremely simple MTA to get mail off the system to a mail hub"
+HOMEPAGE = "http://packages.qa.debian.org/s/ssmtp.html"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.bz2 \
+ file://ssmtp-bug584162-fix.patch \
+ file://build-ouside_srcdir.patch \
+ file://use-DESTDIR.patch \
+"
+
+SRC_URI[md5sum] = "65b4e0df4934a6cd08c506cabcbe584f"
+SRC_URI[sha256sum] = "22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36"
+
+inherit autotools
+
+PACKAGECONFIG ?= "ssl ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
+
+PACKAGECONFIG[ssl] = "--enable-ssl,--disable-ssl,openssl"
+PACKAGECONFIG[ipv6] = "--enable-inet6,--disable-inet6"
+
+EXTRA_OECONF += "--mandir=${mandir}"
+
+EXTRA_OEMAKE = "GEN_CONFIG='/bin/true'"
+
+LDFLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'ssl', '-lssl -lcrypto', '', d)}"
+
+do_install_append () {
+ install -d ${D}${mandir}/
+ mv ${D}${exec_prefix}/man/* ${D}${mandir}/
+ rmdir ${D}${exec_prefix}/man
+ ln -s ssmtp ${D}${sbindir}/sendmail
+ ln -s ssmtp ${D}${sbindir}/newaliases
+ ln -s ssmtp ${D}${sbindir}/mailq
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/strongswan/files/0001-memory.h-Include-stdint.h-for-uintptr_t.patch b/meta-openembedded/meta-networking/recipes-support/strongswan/files/0001-memory.h-Include-stdint.h-for-uintptr_t.patch
new file mode 100644
index 000000000..00178c84a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/strongswan/files/0001-memory.h-Include-stdint.h-for-uintptr_t.patch
@@ -0,0 +1,24 @@
+From 33a53dc13fd924949a582109b45fedd8d0bed59b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:42:11 -0700
+Subject: [PATCH] memory.h: Include stdint.h for uintptr_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+---
+ src/libstrongswan/utils/utils/memory.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/libstrongswan/utils/utils/memory.h b/src/libstrongswan/utils/utils/memory.h
+index e840330..8a356a8 100644
+--- a/src/libstrongswan/utils/utils/memory.h
++++ b/src/libstrongswan/utils/utils/memory.h
+@@ -22,6 +22,8 @@
+ #ifndef MEMORY_H_
+ #define MEMORY_H_
+
++#include <stdint.h>
++
+ /**
+ * Helper function that compares two binary blobs for equality
+ */
diff --git a/meta-openembedded/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch b/meta-openembedded/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch
new file mode 100644
index 000000000..be660d1fd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch
@@ -0,0 +1,99 @@
+From 9f97479373f3fceedc471074b81486d77a49618d Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Tue, 4 Mar 2014 14:38:42 +0800
+Subject: [PATCH] fix the function parameter
+
+Upstream-Status: pending
+
+Original openssl_diffie_hellman_create has three parameters, but
+it is reassigned a function pointer which has one parameter, and
+is called with one parameter, which will lead to segment fault
+on PPC, Now we simply correct the number of parameters.
+
+ #0 0x484d4aa0 in __GI_raise (sig=6)
+ at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
+ #1 0x484d9930 in __GI_abort () at abort.c:91
+ #2 0x10002064 in segv_handler (signal=11) at charon.c:224
+ #3 <signal handler called>
+ #4 0x48d89630 in openssl_diffie_hellman_create (group=MODP_1024_BIT, g=...,
+ p=<error reading variable: Cannot access memory at address 0x0>)
+ at openssl_diffie_hellman.c:143
+ #5 0x482c54f8 in create_dh (this=0x11ac6e68, group=MODP_1024_BIT)
+ at crypto/crypto_factory.c:358
+ #6 0x48375884 in create_dh (this=<optimized out>, group=<optimized out>)
+ at sa/keymat.c:132
+ #7 0x483843b8 in process_payloads (this=0x51400a78, message=<optimized
+ out>)
+ at sa/tasks/ike_init.c:200
+ #8 0x483844d0 in process_r (this=0x51400a78, message=0x51500778)
+ at sa/tasks/ike_init.c:319
+ #9 0x48374c9c in process_request (message=0x51500778, this=0x51400d20)
+ at sa/task_manager.c:870
+ #10 process_message (this=0x51400d20, msg=0x51500778) at
+ sa/task_manager.c:925
+ #11 0x4836c378 in process_message (this=0x514005f0, message=0x51500778)
+ at sa/ike_sa.c:1317
+ #12 0x48362270 in execute (this=0x515008d0)
+ at processing/jobs/process_message_job.c:74
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+
+---
+ src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | 8 +++++++-
+ src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | 4 +++-
+ src/libstrongswan/plugins/openssl/openssl_plugin.c | 1 +
+ 3 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
+index 8e9c118..a73b038 100644
+--- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
++++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c
+@@ -192,7 +192,7 @@ METHOD(diffie_hellman_t, destroy, void,
+ /*
+ * Described in header.
+ */
+-openssl_diffie_hellman_t *openssl_diffie_hellman_create(
++openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom(
+ diffie_hellman_group_t group, ...)
+ {
+ private_openssl_diffie_hellman_t *this;
+@@ -255,5 +255,11 @@ openssl_diffie_hellman_t *openssl_diffie_hellman_create(
+ DBG2(DBG_LIB, "size of DH secret exponent: %d bits", BN_num_bits(privkey));
+ return &this->public;
+ }
++openssl_diffie_hellman_t *openssl_diffie_hellman_create( diffie_hellman_group_t group)
++{
++ chunk_t g;
++ chunk_t p;
++ openssl_diffie_hellman_create_custom(group, g, p);
++}
+
+ #endif /* OPENSSL_NO_DH */
+diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h
+index 5de5520..22586e0 100644
+--- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h
++++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h
+@@ -43,8 +43,10 @@ struct openssl_diffie_hellman_t {
+ * @param ... expects generator and prime as chunk_t if MODP_CUSTOM
+ * @return openssl_diffie_hellman_t object, NULL if not supported
+ */
+-openssl_diffie_hellman_t *openssl_diffie_hellman_create(
++openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom(
+ diffie_hellman_group_t group, ...);
++openssl_diffie_hellman_t *openssl_diffie_hellman_create(
++ diffie_hellman_group_t group);
+
+ #endif /** OPENSSL_DIFFIE_HELLMAN_H_ @}*/
+
+diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c
+index 8b0a7c5..114d575 100644
+--- a/src/libstrongswan/plugins/openssl/openssl_plugin.c
++++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c
+@@ -609,6 +609,7 @@ METHOD(plugin_t, get_features, int,
+ PLUGIN_PROVIDE(DH, MODP_1024_BIT),
+ PLUGIN_PROVIDE(DH, MODP_1024_160),
+ PLUGIN_PROVIDE(DH, MODP_768_BIT),
++ PLUGIN_REGISTER(DH, openssl_diffie_hellman_create_custom),
+ PLUGIN_PROVIDE(DH, MODP_CUSTOM),
+ #endif
+ #ifndef OPENSSL_NO_RSA
diff --git a/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.6.2.bb b/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.6.2.bb
new file mode 100644
index 000000000..f2fe1f1cb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/strongswan/strongswan_5.6.2.bb
@@ -0,0 +1,132 @@
+DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \
+Linux operating system."
+SUMMARY = "strongSwan is an OpenSource IPsec implementation"
+HOMEPAGE = "http://www.strongswan.org"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "gmp openssl flex-native flex bison-native"
+
+SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \
+ file://fix-funtion-parameter.patch \
+ file://0001-memory.h-Include-stdint.h-for-uintptr_t.patch \
+ "
+
+SRC_URI[md5sum] = "46aa3aa18fbc4bd528f9a0345ce79913"
+SRC_URI[sha256sum] = "e0a60a30ebf3c534c223559e1686497a21ded709a5d605c5123c2f52bcc22e92"
+
+EXTRA_OECONF = " \
+ --without-lib-prefix \
+"
+
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
+
+
+PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
+"
+PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
+PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
+PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
+PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap,${PN}-plugin-ldap"
+PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5,${PN}-plugin-mysql"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl,${PN}-plugin-openssl"
+PACKAGECONFIG[scep] = "--enable-scepclient,--disable-scepclient,"
+PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4,${PN}-plugin-soup"
+PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3,${PN}-plugin-sqlite"
+PACKAGECONFIG[stroke] = "--enable-stroke,--disable-stroke,,${PN}-plugin-stroke"
+PACKAGECONFIG[swanctl] = "--enable-swanctl,--disable-swanctl,,libgcc"
+
+# requires swanctl
+PACKAGECONFIG[systemd-charon] = "--enable-systemd,--disable-systemd,systemd,"
+
+inherit autotools systemd pkgconfig
+
+RRECOMMENDS_${PN} = "kernel-module-ipsec"
+
+FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${bindir}/.debug ${libdir}/ipsec/.debug ${libexecdir}/ipsec/.debug"
+FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la"
+FILES_${PN}-staticdev += "${libdir}/ipsec/*.a"
+
+CONFFILES_${PN} = "${sysconfdir}/*.conf ${sysconfdir}/ipsec.d/*.conf ${sysconfdir}/strongswan.d/*.conf"
+
+PACKAGES += "${PN}-plugins"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
+NOAUTOPACKAGEDEBUG = "1"
+
+python split_strongswan_plugins () {
+ sysconfdir = d.expand('${sysconfdir}/strongswan.d/charon')
+ libdir = d.expand('${libdir}/ipsec/plugins')
+ dbglibdir = os.path.join(libdir, '.debug')
+
+ def add_plugin_conf(f, pkg, file_regex, output_pattern, modulename):
+ dvar = d.getVar('PKGD', True)
+ oldfiles = d.getVar('CONFFILES_' + pkg, True)
+ newfile = '/' + os.path.relpath(f, dvar)
+
+ if not oldfiles:
+ d.setVar('CONFFILES_' + pkg, newfile)
+ else:
+ d.setVar('CONFFILES_' + pkg, oldfiles + " " + newfile)
+
+ split_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True)
+ do_split_packages(d, sysconfdir, '(.*)\.conf', '${PN}-plugin-%s', 'strongSwan %s plugin', prepend=True, hook=add_plugin_conf)
+
+ split_dbg_packages = do_split_packages(d, dbglibdir, 'libstrongswan-(.*)\.so', '${PN}-plugin-%s-dbg', 'strongSwan %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
+ split_dev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.la', '${PN}-plugin-%s-dev', 'strongSwan %s plugin - Development files', prepend=True, extra_depends='${PN}-dev')
+ split_staticdev_packages = do_split_packages(d, libdir, 'libstrongswan-(.*)\.a', '${PN}-plugin-%s-staticdev', 'strongSwan %s plugin - Development files (Static Libraries)', prepend=True, extra_depends='${PN}-staticdev')
+
+ if split_packages:
+ pn = d.getVar('PN', True)
+ d.setVar('RRECOMMENDS_' + pn + '-plugins', ' '.join(split_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-dev', ' ' + ' '.join(split_dev_packages))
+ d.appendVar('RRECOMMENDS_' + pn + '-staticdev', ' ' + ' '.join(split_staticdev_packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "split_strongswan_plugins "
+
+# Install some default plugins based on default strongSwan ./configure options
+# See https://wiki.strongswan.org/projects/strongswan/wiki/Pluginlist
+RDEPENDS_${PN} += "\
+ ${PN}-plugin-aes \
+ ${PN}-plugin-attr \
+ ${PN}-plugin-cmac \
+ ${PN}-plugin-constraints \
+ ${PN}-plugin-des \
+ ${PN}-plugin-dnskey \
+ ${PN}-plugin-hmac \
+ ${PN}-plugin-kernel-netlink \
+ ${PN}-plugin-md5 \
+ ${PN}-plugin-nonce \
+ ${PN}-plugin-pem \
+ ${PN}-plugin-pgp \
+ ${PN}-plugin-pkcs1 \
+ ${PN}-plugin-pkcs7 \
+ ${PN}-plugin-pkcs8 \
+ ${PN}-plugin-pkcs12 \
+ ${PN}-plugin-pubkey \
+ ${PN}-plugin-random \
+ ${PN}-plugin-rc2 \
+ ${PN}-plugin-resolve \
+ ${PN}-plugin-revocation \
+ ${PN}-plugin-sha1 \
+ ${PN}-plugin-sha2 \
+ ${PN}-plugin-socket-default \
+ ${PN}-plugin-sshkey \
+ ${PN}-plugin-updown \
+ ${PN}-plugin-vici \
+ ${PN}-plugin-x509 \
+ ${PN}-plugin-xauth-generic \
+ ${PN}-plugin-xcbc \
+ ${PN}-plugin-curve25519 \
+ "
+
+RPROVIDES_${PN} += "${PN}-systemd"
+RREPLACES_${PN} += "${PN}-systemd"
+RCONFLICTS_${PN} += "${PN}-systemd"
+SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'swanctl', '${BPN}-swanctl.service', '${BPN}.service', d)}"
diff --git a/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch b/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
new file mode 100644
index 000000000..209b0dd40
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel/fix-openssl-no-des.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Pending
+
+When openssl disable des support with configure option 'no-des', it doesn't
+provide des related header file and functions. That causes stunnel compile
+failed. Fix it by checking macro OPENSSL_NO_DES to use openssl des related
+library conditionaly.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff --git a/src/common.h b/src/common.h
+index f7d38b0..bf485af 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -471,7 +471,9 @@ extern char *sys_errlist[];
+ #ifndef OPENSSL_NO_MD4
+ #include <openssl/md4.h>
+ #endif /* !defined(OPENSSL_NO_MD4) */
++#ifndef OPENSSL_NO_DES
+ #include <openssl/des.h>
++#endif
+ #ifndef OPENSSL_NO_DH
+ #include <openssl/dh.h>
+ #if OPENSSL_VERSION_NUMBER<0x10100000L
+diff --git a/src/protocol.c b/src/protocol.c
+index 587df09..8198eb6 100644
+--- a/src/protocol.c
++++ b/src/protocol.c
+@@ -66,7 +66,7 @@ NOEXPORT char *imap_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *nntp_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_server(CLI *, SERVICE_OPTIONS *, const PHASE);
+ NOEXPORT char *connect_client(CLI *, SERVICE_OPTIONS *, const PHASE);
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ NOEXPORT void ntlm(CLI *, SERVICE_OPTIONS *);
+ NOEXPORT char *ntlm1();
+ NOEXPORT char *ntlm3(char *, char *, char *, char *);
+@@ -1175,7 +1175,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+ fd_printf(c, c->remote_fd.fd, "Host: %s", opt->protocol_host);
+ if(opt->protocol_username && opt->protocol_password) {
+ if(!strcasecmp(opt->protocol_authentication, "ntlm")) {
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+ ntlm(c, opt);
+ #else
+ s_log(LOG_ERR, "NTLM authentication is not available");
+@@ -1216,7 +1216,7 @@ NOEXPORT char *connect_client(CLI *c, SERVICE_OPTIONS *opt, const PHASE phase) {
+ return NULL;
+ }
+
+-#ifndef OPENSSL_NO_MD4
++#if !defined(OPENSSL_NO_MD4) && !defined(OPENSSL_NO_DES)
+
+ /*
+ * NTLM code is based on the following documentation:
diff --git a/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb b/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
new file mode 100644
index 000000000..ec8478d6b
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/stunnel/stunnel_5.35.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Program for providing universal TLS/SSL tunneling service"
+HOMEPAGE = "http://www.stunnel.org/"
+DESCRIPTION = "SSL encryption wrapper between remote client and local (inetd-startable) or remote server."
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=866cdc7459d91e092b174388fab8d283"
+DEPENDS = "openssl zlib tcp-wrappers"
+
+RDEPENDS_${PN} += "perl"
+
+SRC_URI = "ftp://ftp.stunnel.org/stunnel/archive/5.x/${BP}.tar.gz \
+ file://fix-openssl-no-des.patch \
+"
+
+SRC_URI[md5sum] = "9079f5fafbccaf88b7d92b227d78249a"
+SRC_URI[sha256sum] = "ffa386ae4c825f35f35157c285e7402a6d58779ad8c3822f74a9d355b54aba1d"
+
+inherit autotools
+
+EXTRA_OECONF += "--with-ssl='${STAGING_EXECPREFIXDIR}' --disable-fips"
+
+PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)}"
+PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch
new file mode 100644
index 000000000..b71435a04
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/add-ptest.patch
@@ -0,0 +1,36 @@
+From 8ee1ab1ac89557d48ac1ab7ddcc3c51be9b734ad Mon Sep 17 00:00:00 2001
+From: "Hongjun.Yang" <hongjun.yang@windriver.com>
+Date: Wed, 22 Oct 2014 10:02:48 +0800
+Subject: [PATCH] Add ptest for tcpdump
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongjun.Yang <hongjun.yang@windriver.com>
+
+---
+ Makefile.in | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 0941f0e..3ce40c6 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -437,9 +437,17 @@ distclean:
+ tests/failure-outputs.txt
+ rm -rf autom4te.cache tests/DIFF tests/NEW
+
+-check: tcpdump
++buildtest-TESTS: tcpdump
++
++runtest-PTEST:
+ (cd tests && ./TESTrun.sh)
+
++install-ptest:
++ cp -r tests $(DESTDIR)
++ cp -r config.h $(DESTDIR)
++ install -m 0755 Makefile $(DESTDIR)
++ ln -sf /usr/sbin/tcpdump $(DESTDIR)/tcpdump
++
+ extags: $(TAGFILES)
+ ctags $(TAGFILES)
+
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest
new file mode 100755
index 000000000..c03a8b8ef
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+make -k runtest-PTEST | sed -e '/: passed/ s/^/PASS: /g' \
+ -e '/: failed/ s/^/FAIL: /g' \
+ -e 's/: passed//g' \
+ -e 's/: failed//g'
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch
new file mode 100644
index 000000000..8cefadf28
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump/unnecessary-to-check-libpcap.patch
@@ -0,0 +1,34 @@
+From 741d77e42fc4af49804f7ee43b7237e01633cbcd Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 8 Jul 2014 13:20:47 +0800
+Subject: [PATCH] unnecessary to check libpcap
+
+Upstream-Status: Pending
+
+since the check of libpcap did not consider the cross-compile, lead to the
+below error:
+ This autoconf log indicates errors, it looked at host include and/or
+ library paths while determining system capabilities.
+
+In fact, the libpcap has been added into the tcpdump's DEPENDS, not need to
+check if libpcap existed.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index b2305a5..b3b5dbf 100644
+--- a/configure.in
++++ b/configure.in
+@@ -418,7 +418,7 @@ dnl Some platforms may need -lnsl for getrpcbynumber.
+ AC_SEARCH_LIBS(getrpcbynumber, nsl,
+ AC_DEFINE(HAVE_GETRPCBYNUMBER, 1, [define if you have getrpcbynumber()]))
+
+-AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
++#AC_LBL_LIBPCAP(V_PCAPDEP, V_INCLS)
+
+ #
+ # Check for these after AC_LBL_LIBPCAP, so we link with the appropriate
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb
new file mode 100644
index 000000000..d38540e34
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpdump_4.9.2.bb
@@ -0,0 +1,51 @@
+SUMMARY = "A sophisticated network protocol analyzer"
+HOMEPAGE = "http://www.tcpdump.org/"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867"
+SECTION = "net"
+DEPENDS = "libpcap"
+
+SRC_URI = " \
+ http://www.tcpdump.org/release/${BP}.tar.gz \
+ file://unnecessary-to-check-libpcap.patch \
+ file://add-ptest.patch \
+ file://run-ptest \
+"
+
+SRC_URI[md5sum] = "9bbc1ee33dab61302411b02dd0515576"
+SRC_URI[sha256sum] = "798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79"
+
+export LIBS=" -lpcap"
+
+inherit autotools-brokensep ptest
+CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-crypto=yes, --without-openssl --without-crypto, openssl"
+PACKAGECONFIG[smi] = "--with-smi, --without-smi,libsmi"
+PACKAGECONFIG[libcap-ng] = "--with-cap-ng=yes,--with-cap-ng=no,libcap-ng"
+
+EXTRA_AUTORECONF += " -I m4"
+
+do_configure_prepend() {
+ mkdir -p ${S}/m4
+ if [ -f aclocal.m4 ]; then
+ mv aclocal.m4 ${S}/m4
+ fi
+ # AC_CHECK_LIB(dlpi.. was looking to host /lib
+ sed -i 's:-L/lib::g' ./configure.in
+}
+do_configure_append() {
+ sed -i 's:-L/usr/lib::' ./Makefile
+ sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile
+ sed -i 's:-I/usr/include::' ./Makefile
+}
+
+do_install_append() {
+ # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0
+ rm -f ${D}${sbindir}/tcpdump.${PV}
+}
+
+do_compile_ptest() {
+ oe_runmake buildtest-TESTS
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch
new file mode 100644
index 000000000..386b7f83a
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-1.2a3-time.patch
@@ -0,0 +1,75 @@
+Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- tcpslice-1.2a3.orig/search.c 2000-09-10 10:52:40.000000000 +0200
++++ tcpslice-1.2a3/search.c 2006-07-28 14:56:55.000000000 +0200
+@@ -53,7 +53,7 @@
+ /* Size of a packet header in bytes; easier than typing the sizeof() all
+ * the time ...
+ */
+-#define PACKET_HDR_LEN (sizeof( struct pcap_pkthdr ))
++#define PACKET_HDR_LEN (sizeof( struct pcap_sf_pkthdr ))
+
+ extern int snaplen;
+
+@@ -111,16 +111,24 @@
+ static void
+ extract_header( pcap_t *p, u_char *buf, struct pcap_pkthdr *hdr )
+ {
+- memcpy((char *) hdr, (char *) buf, sizeof(struct pcap_pkthdr));
++ struct pcap_sf_pkthdr hdri;
++
++ memcpy((char *) &hdri, (char *) buf, sizeof(struct pcap_sf_pkthdr));
+
+ if ( pcap_is_swapped( p ) )
+ {
+- hdr->ts.tv_sec = SWAPLONG(hdr->ts.tv_sec);
+- hdr->ts.tv_usec = SWAPLONG(hdr->ts.tv_usec);
+- hdr->len = SWAPLONG(hdr->len);
+- hdr->caplen = SWAPLONG(hdr->caplen);
++ hdr->ts.tv_sec = SWAPLONG(hdri.ts.tv_sec);
++ hdr->ts.tv_usec = SWAPLONG(hdri.ts.tv_usec);
++ hdr->len = SWAPLONG(hdri.len);
++ hdr->caplen = SWAPLONG(hdri.caplen);
++ }
++ else
++ {
++ hdr->ts.tv_sec = hdri.ts.tv_sec;
++ hdr->ts.tv_usec = hdri.ts.tv_usec;
++ hdr->len = hdri.len;
++ hdr->caplen = hdri.caplen;
+ }
+-
+ /*
+ * From bpf/libpcap/savefile.c:
+ *
+--- tcpslice-1.2a3.orig/tcpslice.h 1995-11-02 00:40:53.000000000 +0100
++++ tcpslice-1.2a3/tcpslice.h 2006-07-28 14:56:55.000000000 +0200
+@@ -20,6 +20,26 @@
+ */
+
+
++#include <time.h>
++/* #include <net/bpf.h> */
++
++/*
++ * This is a timeval as stored in disk in a dumpfile.
++ * It has to use the same types everywhere, independent of the actual
++ * `struct timeval'
++ */
++
++struct pcap_timeval {
++ bpf_int32 tv_sec; /* seconds */
++ bpf_int32 tv_usec; /* microseconds */
++};
++
++struct pcap_sf_pkthdr {
++ struct pcap_timeval ts; /* time stamp */
++ bpf_u_int32 caplen; /* length of portion present */
++ bpf_u_int32 len; /* length this packet (off wire) */
++};
++
+ time_t gwtm2secs( struct tm *tm );
+
+ int sf_find_end( struct pcap *p, struct timeval *first_timestamp,
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch
new file mode 100644
index 000000000..0a7359311
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice/tcpslice-CVS.20010207-bpf.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending [from tcpdump-4.1.1-1.fc14.src.rpm]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+diff -ur tcpdump-3.8.1/tcpslice/tcpslice.c tcpdump-3.8.1.new/tcpslice/tcpslice.c
+--- tcpslice/tcpslice.c 2004-01-15 17:35:53.000000000 +0100
++++ tcpslice/tcpslice.c 2004-01-15 16:12:57.000000000 +0100
+@@ -35,7 +35,7 @@
+ #include <sys/file.h>
+ #include <sys/stat.h>
+
+-#include <net/bpf.h>
++/* #include <net/bpf.h> */
+
+ #include <ctype.h>
+ #ifdef HAVE_FCNTL_H
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb
new file mode 100644
index 000000000..e65739a5c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpdump/tcpslice_1.2a3.bb
@@ -0,0 +1,36 @@
+SUMMARY = "tcpslice"
+DESCRIPTION = "A tool for extracting parts of a tcpdump packet trace."
+HOMEPAGE = "http://www.tcpdump.org/related.html"
+SECTION = "net"
+
+LICENSE = "BSD-4-Clause"
+LIC_FILES_CHKSUM = "file://tcpslice.c;endline=20;md5=99519e2e5234d1662a4ce16baa62c64e"
+
+SRC_URI = "ftp://ftp.ee.lbl.gov/${BP}.tar.gz \
+ file://tcpslice-1.2a3-time.patch \
+ file://tcpslice-CVS.20010207-bpf.patch \
+ "
+SRC_URI[md5sum] = "e329cbeb7e589f132d92c3447c477190"
+SRC_URI[sha256sum] = "4096e8debc898cfaa16b5306f1c42f8d18b19e30e60da8d4deb781c8f684c840"
+
+inherit autotools-brokensep
+
+DEPENDS += "libpcap"
+
+# We do not want to autoreconf. We must specify srcdir as ".".
+# We have to set the ac_cv_* cache variables as well as pass the normal
+# cross-compilation options to configure!
+#
+do_configure () {
+ oe_runconf \
+ --srcdir="." \
+ ac_cv_build=${BUILD_SYS} \
+ ac_cv_host=${HOST_SYS} \
+ ac_cv_target=${HOST_SYS}
+}
+
+do_install () {
+ mkdir -p ${D}/usr/sbin
+ install -c -m 555 tcpslice ${D}/usr/sbin
+}
+
diff --git a/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.2.6.bb b/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.2.6.bb
new file mode 100644
index 000000000..681ef02bb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tcpreplay/tcpreplay_4.2.6.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Use previously captured traffic to test network devices"
+
+HOMEPAGE = "http://tcpreplay.synfin.net/"
+SECTION = "net"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=890b830b22fd632e9ffd996df20338f8"
+
+SRC_URI = "https://github.com/appneta/tcpreplay/releases/download/v${PV}/tcpreplay-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3e65d5b872e441c6a0038191a3dc7ce9"
+SRC_URI[sha256sum] = "043756c532dab93e2be33a517ef46b1341f7239278a1045ae670041dd8a4531d"
+
+DEPENDS = "libpcap"
+
+EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr"
+
+inherit siteinfo autotools-brokensep
+
diff --git a/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch
new file mode 100644
index 000000000..01d0236be
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/disable-documentation.patch
@@ -0,0 +1,37 @@
+--- a/configure.ac 2016-01-01 17:42:27.000000000 +0100
++++ b/configure.ac 2017-04-20 14:03:37.238254471 +0200
+@@ -284,24 +284,12 @@
+ AC_SUBST(LIBS)
+ AC_SUBST(ADDITIONAL_OBJECTS)
+
+-# Check for asciidoc
+-AC_PATH_PROG(A2X, a2x, no)
+-AM_CONDITIONAL(HAVE_A2X, test "x$A2X" != "xno")
+-if test x"$A2X" = x"no"; then
+- AC_MSG_ERROR([Test for asciidoc failed. See the file 'INSTALL' for help.])
+-fi
+-
+ AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ data/Makefile
+ data/templates/Makefile
+ etc/Makefile
+-docs/Makefile
+-docs/man5/Makefile
+-docs/man5/tinyproxy.conf.txt
+-docs/man8/Makefile
+-docs/man8/tinyproxy.txt
+ m4macros/Makefile
+ tests/Makefile
+ tests/scripts/Makefile
+--- a/Makefile.am 2016-01-01 17:42:27.000000000 +0100
++++ b/Makefile.am 2017-04-20 14:03:53.842822997 +0200
+@@ -2,7 +2,6 @@
+ src \
+ data \
+ etc \
+- docs \
+ m4macros \
+ tests
+
diff --git a/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service
new file mode 100644
index 000000000..ea079f955
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy/tinyproxy.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Tinyproxy, Lightweight http(s) proxy daemon
+RequiresMountsFor=/var
+
+[Service]
+Group=tinyproxy
+ExecStartPre=/bin/mkdir -p /var/log/tinyproxy
+ExecStartPre=/bin/chown -R nobody.tinyproxy /var/log/tinyproxy
+ExecStartPre=/bin/mkdir -p /var/run/tinyproxy
+ExecStartPre=/bin/chown -R nobody.tinyproxy /var/run/tinyproxy
+ExecStart=/usr/sbin/tinyproxy -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb
new file mode 100644
index 000000000..98192dc99
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tinyproxy/tinyproxy_1.8.4.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Lightweight http(s) proxy daemon"
+HOMEPAGE = "https://tinyproxy.github.io/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.gz \
+ file://disable-documentation.patch \
+ file://tinyproxy.service"
+
+SRC_URI[md5sum] = "3b60f7d08e0821ed1a3e2cf1e5778cac"
+SRC_URI[sha256sum] = "8234c879a129feee61efa98bac14a1a3e46e5cf08f01696a216940872aa70faf"
+
+EXTRA_OECONF += " \
+ --enable-filter \
+ --enable-transparent \
+ --disable-regexcheck \
+ --enable-reverse \
+ --enable-upstream \
+ --enable-xtinyproxy \
+ "
+
+inherit autotools systemd useradd
+
+#User specific
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /dev/null \
+ --no-user-group --gid nogroup tinypoxy"
+
+SYSTEMD_PACKAGES += "${BPN}"
+SYSTEMD_SERVICE_${PN} = "tinyproxy.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
+
+do_install_append() {
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/tinyproxy.service ${D}${systemd_system_unitdir}
+ fi
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch b/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch
new file mode 100644
index 000000000..1bda576bc
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp/tnftp-autotools.patch
@@ -0,0 +1,42 @@
+[PATCH] Update configure.ac and Makefile.am to resolve warnings/errors
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ configure.ac | 2 ++
+ libnetbsd/Makefile.am | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a96d2ab..b3b3069 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -71,9 +71,11 @@ AH_TEMPLATE([WITH_SSL],
+ #
+ # Checks for programs.
+ #
++AM_PROG_AR()
+ AC_PROG_CC()
+ AC_PROG_AWK()
+ AC_PROG_LIBTOOL()
++AM_PROG_CC_C_O()
+
+ #
+ # Checks for tool features.
+diff --git a/libnetbsd/Makefile.am b/libnetbsd/Makefile.am
+index 3e5c3ce..39bb12d 100644
+--- a/libnetbsd/Makefile.am
++++ b/libnetbsd/Makefile.am
+@@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libnetbsd.la
+ libnetbsd_la_SOURCES =
+
+
+-CPPFLAGS = \
++AM_CPPFLAGS = \
+ -I$(srcdir) \
+ -I$(top_srcdir) \
+ -I$(top_builddir)
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb b/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb
new file mode 100644
index 000000000..83ad11b0e
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tnftp/tnftp_20151004.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Enhanced NetBSD ftp client"
+DESCRIPTION = "tnftp (formerly known as lukemftp) is a port of the NetBSD FTP client \
+to other systems. It offers many enhancements over the traditional \
+BSD FTP client, including command-line editing, command-line fetches \
+of FTP and HTTP URLs (including via proxies), command-line uploads of \
+FTP URLs, context-sensitive word completion, dynamic progress bar, \
+IPv6 support, modification time preservation, paging of local and \
+remote files, passive mode support (with fallback to active mode), \
+SOCKS support, TIS FWTK gate-ftp server support, and transfer rate \
+throttling."
+
+SECTION = "net"
+LICENSE = "BSD-4-Clause"
+
+DEPENDS = "ncurses"
+
+SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/tnftp/${BPN}-${PV}.tar.gz \
+ file://tnftp-autotools.patch \
+"
+
+inherit autotools update-alternatives pkgconfig
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "ftp"
+ALTERNATIVE_LINK_NAME_${PN} = "${bindir}/ftp"
+ALTERNATIVE_TARGET_${PN} = "${bindir}/tnftp"
+
+FILES_${PN} = "${bindir}/tnftp"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6d6796cb166a9bb050958241dad9479e"
+SRC_URI[md5sum] = "a49fbe752318d5a7893f900046ea00d5"
+SRC_URI[sha256sum] = "c94a8a49d3f4aec1965feea831d4d5bf6f90c65fd8381ee0863d11a5029a43a0"
+
+PACKAGECONFIG ?= "openssl \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
+"
+PACKAGECONFIG[openssl] = "--enable-ssl, --disable-ssl --with-ssl=no, openssl"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
diff --git a/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch b/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch
new file mode 100644
index 000000000..2c030b55d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch
@@ -0,0 +1,47 @@
+From e273e0ebc753645555909bcc4874c72458b17891 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 17 Jan 2014 03:17:44 -0500
+Subject: [PATCH] Make.rules: filter-out the patches from subdirs
+
+The $(subdirs) contains all the dirs under the ${B}, and this one:
+
+do_unpack[cleandirs] = "${S}/patches"
+
+will create a "patches" dir, then there will be compile errors, filter
+out the patches will fix the problem.
+
+Note: poky doesn't have this problem since it separates the ${S} and
+${B}
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Make.rules | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Make.rules b/Make.rules
+index b077cd5..0bfce2d 100644
+--- a/Make.rules
++++ b/Make.rules
+@@ -97,7 +97,7 @@ endif
+ subdirs := $(filter-out $(SKIPDIRS), $(subdirs))
+ endif
+
+-install install-%: subdirs := $(filter-out $(SKIPINSTALL), $(subdirs))
++install install-%: subdirs := $(filter-out $(SKIPINSTALL) patches, $(subdirs))
+
+
+ override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared)
+@@ -106,7 +106,7 @@ override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared)
+ INCLUDEDIRS := $(filter $(INCLUDEDIRS), $(subdirs))
+ LIBDIRS := $(filter $(LIBDIRS), $(subdirs))
+ MODDIRS := $(filter $(MODDIRS), $(subdirs))
+-EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS), $(subdirs))
++EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS) patches, $(subdirs))
+ MODUSERS := $(filter $(MODUSERS), $(subdirs))
+ SBINUSERS := $(filter $(SBINUSERS), $(subdirs))
+
+--
+1.7.10.4
+
diff --git a/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb b/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb
new file mode 100644
index 000000000..8f17d3fdb
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/traceroute/traceroute_2.1.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "A new modern implementation of traceroute(8) utility for Linux systems"
+DESCRIPTION = "The traceroute utility displays the route used by IP packets on \
+their way to a specified network (or Internet) host. Traceroute displays \
+the IP number and host name (if possible) of the machines along the \
+route taken by the packets. Traceroute is used as a network debugging \
+tool. If you're having network connectivity problems, traceroute will \
+show you where the trouble is coming from along the route."
+SECTION = "net"
+HOMEPAGE = "http://traceroute.sourceforge.net/"
+LICENSE = "GPL-2.0+ & LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+ file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+inherit update-alternatives
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/traceroute/traceroute/${BP}/${BP}.tar.gz \
+ file://filter-out-the-patches-from-subdirs.patch \
+"
+
+SRC_URI[md5sum] = "84d329d67abc3fb83fc8cb12aeaddaba"
+SRC_URI[sha256sum] = "3669d22a34d3f38ed50caba18cd525ba55c5c00d5465f2d20d7472e5d81603b6"
+
+EXTRA_OEMAKE = "VPATH=${STAGING_LIBDIR}"
+
+do_compile() {
+ export LDFLAGS="${TARGET_LDFLAGS} -L${S}/libsupp"
+ oe_runmake "env=yes"
+}
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m755 ${BPN}/${BPN} ${D}${bindir}
+
+ install -m755 wrappers/tcptraceroute ${D}${bindir}
+
+ install -d ${D}${mandir}/man8
+ install -p -m644 ${BPN}/${BPN}.8 ${D}${mandir}/man8
+ ln -s ${BPN}.8 ${D}${mandir}/man8/${BPN}6.8
+ ln -s ${BPN}.8 ${D}${mandir}/man8/tcptraceroute.8
+
+}
+
+ALTERNATIVE_PRIORITY = "60"
+ALTERNATIVE_${PN} = "traceroute"
+ALTERNATIVE_LINK_NAME[traceroute] = "${bindir}/traceroute"
diff --git a/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl.inc b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl.inc
new file mode 100644
index 000000000..1c11823dd
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl.inc
@@ -0,0 +1,17 @@
+SUMMARY = "Tool for controlling the Linux TUN/TAP driver"
+SECTION = "net"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://tunctl.c;beginline=1;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/tunctl/tunctl-${PV}.tar.gz \
+ file://makefile-add-ldflags.patch \
+ "
+
+do_compile() {
+ oe_runmake tunctl
+}
+
+do_install() {
+ install -d ${D}/${sbindir}
+ install -m 755 tunctl ${D}/${sbindir}
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl/makefile-add-ldflags.patch b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl/makefile-add-ldflags.patch
new file mode 100644
index 000000000..c96f538d2
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl/makefile-add-ldflags.patch
@@ -0,0 +1,19 @@
+Add LDFLAGS variable to Makefile, make sure the extra linker flags can be passed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index a0aa7f6..d6ce2c7 100644
+--- a/Makefile
++++ b/Makefile
+@@ -14,7 +14,7 @@ MAN_DIR ?= /usr/share/man/man$(MANS)
+ all : $(BIN) $(MAN)
+
+ $(BIN) : $(BIN).c
+- $(CC) $(CFLAGS) -o $(BIN) $(BIN).c
++ $(CC) $(CFLAGS) ${LDFLAGS} -o $(BIN) $(BIN).c
+
+ $(MAN) : $(PACKAGE).sgml
+ docbook2man $(PACKAGE).sgml
diff --git a/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl_1.5.bb b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl_1.5.bb
new file mode 100644
index 000000000..dd265612f
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/tunctl/tunctl_1.5.bb
@@ -0,0 +1,4 @@
+require tunctl.inc
+
+SRC_URI[md5sum] = "fdbedc263b3e85bb0e087cd567414607"
+SRC_URI[sha256sum] = "aa2a6c4cc6bfacb11e0d9f62334a6638a0d435475c61230116f00b6af8b14fff"
diff --git a/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb b/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb
new file mode 100644
index 000000000..1166f9a8d
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/uftp/uftp_4.9.3.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "Encrypted UDP based FTP with multicast"
+HOMEPAGE = "https://sourceforge.net/projects/uftp-multicast"
+SECTION = "libs/network"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/uftp-multicast/source-tar/uftp-${PV}.tar.gz"
+SRC_URI[md5sum] = "231d6ba7820d89a712fe7d727ab0f8e6"
+SRC_URI[sha256sum] = "9e9215af0315257c6cc4f40fbc6161057e861be1fff10a38a5564f699e99c78f"
+
+DEPENDS = "openssl"
+
+do_install () {
+ oe_runmake install DESTDIR=${D}
+}
diff --git a/meta-openembedded/meta-networking/recipes-support/wireshark/README b/meta-openembedded/meta-networking/recipes-support/wireshark/README
new file mode 100644
index 000000000..63b5b7263
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/wireshark/README
@@ -0,0 +1,45 @@
+#
+Wireshark - Notes
+
+URL: http://www.wireshark.org/
+User Guide: http://www.wireshark.org/docs/wsug_html_chunked/
+Secruity advisories: http://www.wireshark.org/security/
+
+Wireshark is slowly moving away from gtk and towards QT as their graphical stack.
+Currently gtk is supported with this release and I plan on integrating QT.
+
+
+
+Adding the wireshark to your build
+========================================
+
+via local.conf
+IMAGE_INSTALL_append = " wireshark"
+
+Adding the wireshark to your graphical build
+========================================
+via local.conf
+IMAGE_INSTALL_append = " wireshark"
+
+and one of:
+
+EXTRA_IMAGE_FEATURES += "x11-base"
+
+or use the "core-image-x11"
+
+
+Maintenance
+-----------
+
+Send patches, comments or questions to openembedded-devel@lists.openembedded.org
+
+When sending single patches, please use something like:
+
+ git send-email -1 -M \
+ --to openembedded-devel@lists.openembedded.org \
+ --cc akuster@mvista.com \
+ --subject-prefix=meta-networking][PATCH
+
+Maintainer: Armin Kuster <akuster@mvista.com>
+
+
diff --git a/meta-openembedded/meta-networking/recipes-support/wireshark/files/libgcrypt.patch b/meta-openembedded/meta-networking/recipes-support/wireshark/files/libgcrypt.patch
new file mode 100644
index 000000000..2aa58f73c
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/wireshark/files/libgcrypt.patch
@@ -0,0 +1,53 @@
+use OR PKG_CONFIG scheme for libgcrypt
+
+Upstream-Status: Inappropriate OE specific
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: wireshark-2.4.4/m4/libgcrypt.m4
+===================================================================
+--- wireshark-2.4.4.orig/m4/libgcrypt.m4
++++ wireshark-2.4.4/m4/libgcrypt.m4
+@@ -27,11 +27,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
+ if test x$libgcrypt_config_prefix != x ; then
+ if test x${LIBGCRYPT_CONFIG+set} != xset ; then
+- LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
++ LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/libgcrypt.pc
+ fi
+ fi
+
+- AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
++ AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt.pc, no)
+ tmp=ifelse([$1], ,1:1.2.0,$1)
+ if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+ req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -50,7 +50,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+ req_micro=`echo $min_libgcrypt_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+- libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
++ libgcrypt_config_version=`$PKG_CONFIG --modversion libgcrypt`
+ major=`echo $libgcrypt_config_version | \
+ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+ minor=`echo $libgcrypt_config_version | \
+@@ -82,7 +82,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ # If we have a recent libgcrypt, we should also check that the
+ # API is compatible
+ if test "$req_libgcrypt_api" -gt 0 ; then
+- tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
++ tmp=`$PKG_CONFIG --api-version libgcrypt 2>/dev/null || echo 0`
+ if test "$tmp" -gt 0 ; then
+ AC_MSG_CHECKING([LIBGCRYPT API version])
+ if test "$req_libgcrypt_api" -eq "$tmp" ; then
+@@ -95,8 +95,8 @@ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ fi
+ fi
+ if test $ok = yes; then
+- LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+- LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
++ LIBGCRYPT_CFLAGS=`$PKG_CONFIG --cflags libgcrypt`
++ LIBGCRYPT_LIBS=`$PKG_CONFIG --libs libgcrypt`
+ ifelse([$2], , :, [$2])
+ else
+ LIBGCRYPT_CFLAGS=""
diff --git a/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.4.6.bb b/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.4.6.bb
new file mode 100644
index 000000000..3da0a7baf
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/wireshark/wireshark_2.4.6.bb
@@ -0,0 +1,73 @@
+DESCRIPTION = "wireshark - a popular network protocol analyzer"
+HOMEPAGE = "http://www.wireshark.org"
+SECTION = "net"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e271234ba1a13c6e512e76b94ac2f77"
+
+DEPENDS = "pcre expat glib-2.0 glib-2.0-native libgcrypt libgpg-error"
+
+SRC_URI = "https://1.as.dl.wireshark.org/src/${BP}.tar.xz"
+SRC_URI += "file://libgcrypt.patch"
+
+UPSTREAM_CHECK_URI = "https://1.as.dl.wireshark.org/src"
+
+SRC_URI[md5sum] = "8cfb73e286dd6427ca4405e6e802d13e"
+SRC_URI[sha256sum] = "8e965fd282bc0c09e7c4eba5f08a555d0ccf40a7d1544b939e01b90bc893d5fe"
+
+PE = "1"
+
+inherit autotools pkgconfig perlnative upstream-version-is-even
+
+ARM_INSTRUCTION_SET = "arm"
+
+PACKAGECONFIG ?= "libpcap gnutls libnl libcap sbc"
+PACKAGECONFIG += " ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gtk2 graphics", "", d)}"
+
+PACKAGECONFIG[libcap] = "--with-libcap=${STAGING_DIR_HOST}/usr, --with-libcap=no --enable-pcap-ng-default , libcap"
+PACKAGECONFIG[libpcap] = "--with-pcap=${STAGING_DIR_HOST}/usr --with-pcap-remote, --with-pcap=no --enable-pcap-ng-default , libpcap"
+PACKAGECONFIG[libsmi] = "--with-libsmi=yes, --with-libsmi=no, libsmi"
+PACKAGECONFIG[libnl] = "--with-libnl=yes, --with-libnl=no, libnl"
+PACKAGECONFIG[portaudio] = "--with-portaudio=yes, --with-portaudio=no, portaudio-v19"
+PACKAGECONFIG[gtk2] = "--with-gtk=2, , gtk+"
+PACKAGECONFIG[gtk3] = "--with-gtk=3, , gtk+3"
+PACKAGECONFIG[graphics] = "--enable-wireshark, --with-gtk=no --disable-wireshark,"
+PACKAGECONFIG[gnutls] = "--with-gnutls=yes, --with-gnutls=no, gnutls"
+PACKAGECONFIG[ssl] = "--with-ssl=yes, --with-ssl=no, openssl"
+PACKAGECONFIG[krb5] = "--with-krb5=yes, --with-krb5=no, krb5"
+PACKAGECONFIG[lua] = "--with-lua=yes, --with-lua=no, lua"
+PACKAGECONFIG[zlib] = "--with-zlib=yes, --with-zlib=no, zlib"
+PACKAGECONFIG[geoip] = "--with-geoip=yes, --with-geoip=no, geoip"
+PACKAGECONFIG[plugins] = "--with-plugins=yes, --with-plugins=no"
+PACKAGECONFIG[sbc] = "--with-sbc=yes, --with-sbc=no, sbc"
+PACKAGECONFIG[libssh] = "--with-libssh=${STAGING_DIR_HOST}/usr, --with-libssh=no, libssh2"
+PACKAGECONFIG[lz4] = "--with-lz4=${STAGING_DIR_HOST}/usr, --with-lz4=no, lz4"
+
+# these next two options require addional layers
+PACKAGECONFIG[c-ares] = "--with-c-ares=yes, --with-c-ares=no, c-ares"
+
+EXTRA_OECONF += "--with-libgcrypt-prefix=${PKG_CONFIG_DIR} --with-qt=no --enable-tshark --enable-rawshark"
+
+LDFLAGS_append = " -lgpg-error"
+
+# Currently wireshark does not install header files
+do_install_append () {
+
+ install -d ${D}/${includedir}/${BPN}
+ install -d ${D}/${includedir}/${BPN}/epan
+ install -d ${D}/${includedir}/${BPN}/epan/crypt
+ install -d ${D}/${includedir}/${BPN}/epan/dfilter
+ install -d ${D}/${includedir}/${BPN}/epan/dissectors
+ install -d ${D}/${includedir}/${BPN}/epan/ftypes
+ install -d ${D}/${includedir}/${BPN}/epan/wmem
+
+ install config.h ${D}/${includedir}/${BPN}
+ install ${S}/register.h ${D}/${includedir}/${BPN}
+ install -D ${S}/epan/*.h ${D}/${includedir}/${BPN}/epan
+ install -D ${S}/epan/crypt/*.h ${D}/${includedir}/${BPN}/epan/crypt
+ install -D ${S}/epan/dfilter/*.h ${D}/${includedir}/${BPN}/epan/dfilter
+ install -D ${S}/epan/dissectors/*.h ${D}/${includedir}/${BPN}/epan/dissectors
+ install -D ${S}/epan/ftypes/*.h ${D}/${includedir}/${BPN}/epan/ftypes
+ install -D ${S}/epan/wmem/*.h ${D}/${includedir}/${BPN}/epan/wmem
+}
+
+FILES_${PN} += "${datadir}*"
diff --git a/meta-openembedded/meta-networking/recipes-support/wpan-tools/wpan-tools_git.bb b/meta-openembedded/meta-networking/recipes-support/wpan-tools/wpan-tools_git.bb
new file mode 100644
index 000000000..b6d2f6923
--- /dev/null
+++ b/meta-openembedded/meta-networking/recipes-support/wpan-tools/wpan-tools_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Userspace tools for Linux IEEE 802.15.4 stack"
+HOMEPAGE = "http://wpan.cakelab.org/releases/"
+DESCRIPTION = "This is a set of utils to manage the Linux WPAN stack via \
+netlink interface. This requires recent kernel with nl802154 interface."
+
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4cfd939b1d7e6aba9fcefb7f6e2fd45d"
+
+DEPENDS = "libnl"
+
+PV = "0.8+git${SRCPV}"
+SRC_URI = "git://github.com/linux-wpan/wpan-tools \
+ "
+SRCREV = "3f473f5136f89773997cb4fff2d8ed647734e2f5"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta-openembedded/meta-networking/site/endian-big b/meta-openembedded/meta-networking/site/endian-big
new file mode 100644
index 000000000..3a968e326
--- /dev/null
+++ b/meta-openembedded/meta-networking/site/endian-big
@@ -0,0 +1,2 @@
+# rp-pppoe
+rpppoe_cv_pack_bitfields=${rpppoe_cv_pack_bitfields=normal}
diff --git a/meta-openembedded/meta-networking/site/endian-little b/meta-openembedded/meta-networking/site/endian-little
new file mode 100644
index 000000000..0bcd966ea
--- /dev/null
+++ b/meta-openembedded/meta-networking/site/endian-little
@@ -0,0 +1,2 @@
+# rp-pppoe
+rpppoe_cv_pack_bitfields=${rpppoe_cv_pack_bitfields=rev}
OpenPOWER on IntegriCloud