Yocto 2.4

Move OpenBMC to Yocto 2.4(rocko)

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I12057b18610d6fb0e6903c60213690301e9b0c67
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
index 47cb163..ec35175 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/daq/daq_2.0.6.bb
@@ -29,3 +29,7 @@
 SRC_URI[sha256sum] = "b40e1d1273e08aaeaa86e69d4f28d535b7e53bdb3898adf539266b63137be7cb"
 
 inherit autotools
+
+DISABLE_STATIC = ""
+
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/0001-rlm_mschap-Use-includedir-instead-of-hardcoding-usr-.patch
new file mode 100644
index 0000000..db8caab
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius
new file mode 100644
index 0000000..fa412e2
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-avoid-searching-host-dirs.patch
new file mode 100644
index 0000000..9c99766
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-add-option-for-libcap.patch
new file mode 100644
index 0000000..71b7809
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-configure.ac-allow-cross-compilation.patch
new file mode 100644
index 0000000..30497a6
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-enble-user-in-conf.patch
new file mode 100644
index 0000000..4a62bf1
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-error-for-expansion-of-macro.patch
new file mode 100644
index 0000000..af1bff0
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-issues-related-to-m4-include-path.patch
new file mode 100644
index 0000000..d29b2ac
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-fix-quoting-for-BUILT_WITH.patch
new file mode 100644
index 0000000..b0929c4
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-detection.patch
new file mode 100644
index 0000000..4eb61ff
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-libtool-do-not-use-jlibtool.patch
new file mode 100644
index 0000000..1954586
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/freeradius-rlm_python-add-PY_INC_DIR.patch
new file mode 100644
index 0000000..675940d
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd-volatiles.conf
new file mode 100644
index 0000000..fa62962
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/radiusd.service
new file mode 100644
index 0000000..899c4e4
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/files/volatiles.58_radiusd
new file mode 100644
index 0000000..8cbdae8
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/freeradius/freeradius_3.0.15.bb
new file mode 100644
index 0000000..4155a40
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
index f48b655..e579de5 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb
@@ -13,3 +13,4 @@
 
 acpaths = "-I ./config/"
 
+BBCLASSEXTEND = "native"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/miniupnpd/miniupnpd_2.0.bb
new file mode 100644
index 0000000..c6f36e1
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager-openvpn_1.2.8.bb
new file mode 100644
index 0000000..cce3f91
--- /dev/null
+++ b/import-layers/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 \
+    ${libdir}/NetworkManager/VPN/nm-openvpn-service.name \
+"
+
+FILES_${PN}-staticdev += " \
+    ${libdir}/NetworkManager/*.a \
+"
+
+RDEPENDS_${PN} = " \
+    networkmanager \
+    openvpn \
+"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
new file mode 100644
index 0000000..ced0c7c
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-adjust-net-headers-for-musl-compatibility.patch
@@ -0,0 +1,82 @@
+From 047d3bf96b510740f64687480333c378e414995f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 15:57:05 -0700
+Subject: [PATCH 1/5] adjust net/ headers for musl compatibility
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libnm-core/nm-utils.c          | 12 +++++++-----
+ libnm-core/nm-utils.h          |  5 ++---
+ src/platform/wifi/wifi-utils.h |  2 +-
+ 3 files changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
+index df75d56..868224e 100644
+--- a/libnm-core/nm-utils.c
++++ b/libnm-core/nm-utils.c
+@@ -19,24 +19,26 @@
+  * Copyright 2005 - 2014 Red Hat, Inc.
+  */
+ 
+-#include "nm-default.h"
+-
+-#include "nm-utils.h"
+-
+ #include <string.h>
+ #include <errno.h>
+ #include <stdlib.h>
+-#include <netinet/ether.h>
+ #include <arpa/inet.h>
+ #include <uuid/uuid.h>
+ #include <libintl.h>
+ #include <gmodule.h>
+ #include <sys/stat.h>
++//#include <net/if_arp.h>
++//#include <net/ethernet.h>
++#include <netinet/ether.h>
++
++#include "nm-default.h"
+ 
++#include "nm-utils.h"
+ #if WITH_JANSSON
+ #include <jansson.h>
+ #endif
+ 
++
+ #include "nm-common-macros.h"
+ #include "nm-utils-private.h"
+ #include "nm-setting-private.h"
+diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
+index 407c14e..156ccae 100644
+--- a/libnm-core/nm-utils.h
++++ b/libnm-core/nm-utils.h
+@@ -27,11 +27,10 @@
+ 
+ #include <glib.h>
+ 
+-#include <netinet/in.h>
+-
+ /* For ETH_ALEN and INFINIBAND_ALEN */
+-#include <linux/if_ether.h>
++//#include <linux/if_ether.h>
+ #include <linux/if_infiniband.h>
++#include <netinet/in.h>
+ 
+ #include "nm-core-enum-types.h"
+ #include "nm-setting-wireless-security.h"
+diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
+index 8e2b93f..84f5ce9 100644
+--- a/src/platform/wifi/wifi-utils.h
++++ b/src/platform/wifi/wifi-utils.h
+@@ -22,7 +22,7 @@
+ #ifndef __WIFI_UTILS_H__
+ #define __WIFI_UTILS_H__
+ 
+-#include <net/ethernet.h>
++//#include <net/ethernet.h>
+ 
+ #include "nm-dbus-interface.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch
new file mode 100644
index 0000000..26f380b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-check-for-strndupa-before-using-it.patch
@@ -0,0 +1,67 @@
+From 05e8bd664d0244cb8ab4376b962830b97860f6bf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 18:37:19 -0700
+Subject: [PATCH] check for strndupa before using it
+
+musl does not have strndupa
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ config.h.in                        |  4 ++++
+ configure.ac                       |  1 +
+ src/systemd/src/basic/alloc-util.h | 12 ++++++++++++
+ 3 files changed, 17 insertions(+)
+
+diff --git a/config.h.in b/config.h.in
+index db8c135..c4229ed 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -41,6 +41,10 @@
+    */
+ #undef HAVE_DCGETTEXT
+ 
++/* Define to 1 if you have the declaration of `strndupa', and to 0 if you
++   don't. */
++#undef HAVE_DECL_STRNDUPA
++
+ /* Define to 1 if you have the <dlfcn.h> header file. */
+ #undef HAVE_DLFCN_H
+ 
+diff --git a/configure.ac b/configure.ac
+index 2630f8d..d0a57fd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -54,6 +54,7 @@ AC_SUBST(NM_VERSION)
+ 
+ GIT_SHA_RECORD(NM_GIT_SHA)
+ 
++AC_CHECK_DECLS([strndupa], [], [], [[#include <string.h>]])
+ dnl
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ dnl
+diff --git a/src/systemd/src/basic/alloc-util.h b/src/systemd/src/basic/alloc-util.h
+index ceeee51..924b59c 100644
+--- a/src/systemd/src/basic/alloc-util.h
++++ b/src/systemd/src/basic/alloc-util.h
+@@ -25,6 +25,18 @@
+ #include <string.h>
+ 
+ #include "macro.h"
++#include "config.h"
++
++#if !HAVE_DECL_STRNDUPA
++#define strndupa(s, n) \
++  ({ \
++    const char *__old = (s); \
++    size_t __len = strnlen(__old, (n)); \
++    char *__new = (char *)alloca(__len + 1); \
++    __new[__len] = '\0'; \
++    (char *)memcpy(__new, __old, __len); \
++  })
++#endif
+ 
+ #define new(t, n) ((t*) malloc_multiply(sizeof(t), (n)))
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-add-systemd-resolved-backend.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-add-systemd-resolved-backend.patch
new file mode 100644
index 0000000..bd194a6
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-add-systemd-resolved-backend.patch
@@ -0,0 +1,621 @@
+From: Sjoerd Simons <sjoerd@luon.net>
+Date: Sun, 21 Aug 2016 21:46:02 +0200
+Subject: [PATCH] dns/resolved: add systemd-resolved backend
+
+Add initial DNS backend that pushes DNS information into
+systemd-resolved. Backend is choosen by default if the systems
+resolv.conv is setup to pointing to one of the standard resolved
+locations.
+
+This doesn't handle global dns configuration.
+
+Signed-off-by: Sjoerd Simons <sjoerd@luon.net>
+
+https://bugzilla.gnome.org/show_bug.cgi?id=762540
+
+Upstream-Status: Backport
+
+---
+ man/NetworkManager.conf.xml               |  10 +-
+ src/Makefile.am                           |   2 +
+ src/dns-manager/nm-dns-manager.c          |  43 ++-
+ src/dns-manager/nm-dns-systemd-resolved.c | 427 ++++++++++++++++++++++++++++++
+ src/dns-manager/nm-dns-systemd-resolved.h |  45 ++++
+ 5 files changed, 523 insertions(+), 4 deletions(-)
+ create mode 100644 src/dns-manager/nm-dns-systemd-resolved.c
+ create mode 100644 src/dns-manager/nm-dns-systemd-resolved.h
+
+diff --git a/man/NetworkManager.conf.xml b/man/NetworkManager.conf.xml
+index 6295b82..0a67ae5 100644
+--- a/man/NetworkManager.conf.xml
++++ b/man/NetworkManager.conf.xml
+@@ -275,10 +275,12 @@ no-auto-default=*
+       <varlistentry>
+         <term><varname>dns</varname></term>
+         <listitem><para>Set the DNS (<filename>resolv.conf</filename>) processing mode.</para>
+-        <para><literal>default</literal>: The default if the key is
+-        not specified. NetworkManager will update
++        <para><literal>default</literal>: NetworkManager will update
+         <filename>resolv.conf</filename> to reflect the nameservers
+-        provided by currently active connections.</para>
++        provided by currently active connections.  This is the default
++        if the key is not specified, unless the system is configured
++        to use systemd-resolved; in this case the default is
++        <literal>systemd-resolved</literal></para>
+         <para><literal>dnsmasq</literal>: NetworkManager will run
+         dnsmasq as a local caching nameserver, using a "split DNS"
+         configuration if you are connected to a VPN, and then update
+@@ -288,6 +290,8 @@ no-auto-default=*
+         to unbound and dnssec-triggerd, providing a "split DNS"
+         configuration with DNSSEC support. The <filename>/etc/resolv.conf</filename>
+         will be managed by dnssec-trigger daemon.</para>
++        <para><literal>systemd-resolved</literal>: NetworkManager will
++        push the DNS configuration to systemd-resolved</para>
+         <para><literal>none</literal>: NetworkManager will not
+         modify resolv.conf. This implies
+         <literal>rc-manager</literal>&nbsp;<literal>unmanaged</literal></para>
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 8d29b19..10f63de 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -345,6 +345,8 @@ libNetworkManager_la_SOURCES = \
+ 	\
+ 	dns-manager/nm-dns-dnsmasq.c \
+ 	dns-manager/nm-dns-dnsmasq.h \
++	dns-manager/nm-dns-systemd-resolved.c \
++	dns-manager/nm-dns-systemd-resolved.h \
+ 	dns-manager/nm-dns-unbound.c \
+ 	dns-manager/nm-dns-unbound.h \
+ 	dns-manager/nm-dns-manager.c \
+diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
+index 5a758a9..38bc786 100644
+--- a/src/dns-manager/nm-dns-manager.c
++++ b/src/dns-manager/nm-dns-manager.c
+@@ -45,6 +45,7 @@
+ 
+ #include "nm-dns-plugin.h"
+ #include "nm-dns-dnsmasq.h"
++#include "nm-dns-systemd-resolved.h"
+ #include "nm-dns-unbound.h"
+ 
+ #if WITH_LIBSOUP
+@@ -1588,6 +1589,37 @@ _check_resconf_immutable (NMDnsManagerResolvConfManager rc_manager)
+ 
+ NM_DEFINE_SINGLETON_GETTER (NMDnsManager, nm_dns_manager_get, NM_TYPE_DNS_MANAGER);
+ 
++static gboolean
++_resolvconf_resolved_managed (void)
++{
++	static const char *const resolved_paths[] = {
++		"/run/systemd/resolve/resolv.conf",
++		"/lib/systemd/resolv.conf",
++		"/usr/lib/systemd/resolv.conf",
++	};
++	GFile *f;
++	GFileInfo *info;
++	gboolean ret = FALSE;
++
++	f = g_file_new_for_path (_PATH_RESCONF);
++	info = g_file_query_info (f,
++	                          G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK","\
++	                          G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET,
++	                          G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
++	                          NULL, NULL);
++
++	if (info && g_file_info_get_is_symlink (info)) {
++		ret = _nm_utils_strv_find_first ((gchar **) resolved_paths,
++		                                 G_N_ELEMENTS (resolved_paths),
++		                                 g_file_info_get_symlink_target (info)) >= 0;
++	}
++
++	g_clear_object(&info);
++	g_clear_object(&f);
++
++	return ret;
++}
++
+ static void
+ init_resolv_conf_mode (NMDnsManager *self, gboolean force_reload_plugin)
+ {
+@@ -1633,7 +1665,16 @@ again:
+ 
+ 	rc_manager = _check_resconf_immutable (rc_manager);
+ 
+-	if (nm_streq0 (mode, "dnsmasq")) {
++	if (   (!mode && _resolvconf_resolved_managed ())
++	    || nm_streq0 (mode, "systemd-resolved")) {
++		if (   force_reload_plugin
++		    || !NM_IS_DNS_SYSTEMD_RESOLVED (priv->plugin)) {
++			_clear_plugin (self);
++			priv->plugin = nm_dns_systemd_resolved_new ();
++			plugin_changed = TRUE;
++		}
++		mode = "systemd-resolved";
++	} else if (nm_streq0 (mode, "dnsmasq")) {
+ 		if (force_reload_plugin || !NM_IS_DNS_DNSMASQ (priv->plugin)) {
+ 			_clear_plugin (self);
+ 			priv->plugin = nm_dns_dnsmasq_new ();
+diff --git a/src/dns-manager/nm-dns-systemd-resolved.c b/src/dns-manager/nm-dns-systemd-resolved.c
+new file mode 100644
+index 0000000..6bdd5f6
+--- /dev/null
++++ b/src/dns-manager/nm-dns-systemd-resolved.c
+@@ -0,0 +1,427 @@
++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
++/*
++ * Copyright (C) 2010 Dan Williams <dcbw@redhat.com>
++ * Copyright (C) 2016 Sjoerd Simons <sjoerd@luon.net>
++ *
++ * 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, 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, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ */
++
++#include "nm-default.h"
++
++#include "nm-dns-systemd-resolved.h"
++
++#include <stdlib.h>
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <arpa/inet.h>
++#include <sys/stat.h>
++#include <linux/if.h>
++
++#include "nm-core-internal.h"
++#include "nm-platform.h"
++#include "nm-utils.h"
++#include "nm-ip4-config.h"
++#include "nm-ip6-config.h"
++#include "nm-bus-manager.h"
++#include "nm-manager.h"
++#include "nm-device.h"
++#include "NetworkManagerUtils.h"
++
++G_DEFINE_TYPE (NMDnsSystemdResolved, nm_dns_systemd_resolved, NM_TYPE_DNS_PLUGIN)
++
++#define NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE(o) \
++  (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DNS_SYSTEMD_RESOLVED, \
++    NMDnsSystemdResolvedPrivate))
++
++#define SYSTEMD_RESOLVED_DBUS_SERVICE "org.freedesktop.resolve1"
++#define SYSTEMD_RESOLVED_DBUS_PATH "/org/freedesktop/resolve1"
++
++typedef struct {
++	int ifindex;
++	GList *configs;
++} InterfaceConfig;
++
++typedef struct {
++	GDBusProxy *resolve;
++	GCancellable *init_cancellable;
++	GCancellable *update_cancellable;
++	GQueue dns_updates;
++	GQueue domain_updates;
++} NMDnsSystemdResolvedPrivate;
++
++/*****************************************************************************/
++
++#define _NMLOG_DOMAIN         LOGD_DNS
++#define _NMLOG_PREFIX_NAME    "systemd-resolved"
++#define _NMLOG(level, ...) \
++    G_STMT_START { \
++        nm_log ((level), _NMLOG_DOMAIN, \
++                "%s[%p]: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
++                _NMLOG_PREFIX_NAME, \
++                (self) \
++                _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
++    } G_STMT_END
++
++/*****************************************************************************/
++
++static void
++call_done (GObject *source, GAsyncResult *r, gpointer user_data)
++{
++	GVariant *v;
++	GError *error = NULL;
++	NMDnsSystemdResolved *self = (NMDnsSystemdResolved *) user_data;
++
++	v = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), r, &error);
++
++	if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
++		return;
++
++	if (error != NULL) {
++		_LOGW ("Failed: %s\n", error->message);
++		g_error_free (error);
++	}
++}
++
++static void
++add_interface_configuration (NMDnsSystemdResolved *self,
++                             GArray *interfaces,
++                             const NMDnsIPConfigData *data)
++{
++	int i;
++	InterfaceConfig *ic = NULL;
++	int ifindex;
++	NMDevice *device;
++
++	if (NM_IS_IP4_CONFIG (data->config))
++		ifindex = nm_ip4_config_get_ifindex (data->config);
++	else if (NM_IS_IP6_CONFIG  (data->config))
++		ifindex = nm_ip6_config_get_ifindex (data->config);
++	else
++		g_return_if_reached ();
++
++	device = nm_manager_get_device_by_ifindex (nm_manager_get (), ifindex);
++
++	if (!nm_device_get_managed (device, FALSE))
++		return;
++
++	for (i = 0; i < interfaces->len; i++) {
++		InterfaceConfig *tic = &g_array_index (interfaces, InterfaceConfig, i);
++		if (ifindex == tic->ifindex) {
++			ic = tic;
++			break;
++		}
++	}
++
++	if (!ic) {
++		g_array_set_size (interfaces, interfaces->len + 1);
++		ic = &g_array_index (interfaces, InterfaceConfig,
++		                     interfaces->len - 1);
++		ic->ifindex = ifindex;
++	}
++
++	ic->configs = g_list_append (ic->configs, data->config);
++}
++
++static void
++add_domain (GVariantBuilder *domains,
++            const char *domain,
++            gboolean never_default)
++{
++	/* If this link is never the default (e.g. only used for resources on this
++	 * network) add a routing domain. */
++	g_variant_builder_add (domains, "(sb)", domain, never_default);
++}
++
++static void
++update_add_ip6_config (NMDnsSystemdResolved *self,
++                       GVariantBuilder *dns,
++                       GVariantBuilder *domains,
++                       const NMIP6Config *config)
++{
++	guint i, n;
++
++	n = nm_ip6_config_get_num_nameservers (config);
++	for (i = 0 ; i < n; i++) {
++		const struct in6_addr *ip;
++
++		g_variant_builder_open (dns, G_VARIANT_TYPE ("(iay)"));
++		g_variant_builder_add (dns, "i", AF_INET6);
++		ip = nm_ip6_config_get_nameserver (config, i),
++
++		g_variant_builder_add_value (dns, g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, ip, 16, 1));
++		g_variant_builder_close (dns);
++	}
++
++	n = nm_ip6_config_get_num_searches (config);
++	if (n > 0) {
++		for (i = 0; i < n; i++) {
++			add_domain (domains, nm_ip6_config_get_search (config, i),
++			            nm_ip6_config_get_never_default (config));
++		}
++	} else {
++		n = nm_ip6_config_get_num_domains (config);
++		for (i = 0; i < n; i++) {
++			add_domain (domains, nm_ip6_config_get_domain (config, i),
++			            nm_ip6_config_get_never_default (config));
++		}
++	}
++}
++
++static void
++update_add_ip4_config (NMDnsSystemdResolved *self,
++                       GVariantBuilder *dns,
++                       GVariantBuilder *domains,
++                       const NMIP4Config *config)
++{
++	guint i, n;
++
++	n = nm_ip4_config_get_num_nameservers (config);
++	for (i = 0 ; i < n; i++) {
++		guint32 ns;
++
++		g_variant_builder_open (dns, G_VARIANT_TYPE ("(iay)"));
++		g_variant_builder_add (dns, "i", AF_INET);
++		ns = nm_ip4_config_get_nameserver (config, i),
++
++		g_variant_builder_add_value (dns, g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE, &ns, 4, 1));
++		g_variant_builder_close (dns);
++	}
++
++	n = nm_ip4_config_get_num_searches (config);
++	if (n  > 0) {
++		for (i = 0; i < n; i++) {
++			add_domain (domains, nm_ip4_config_get_search (config, i),
++			            nm_ip4_config_get_never_default (config));
++		}
++	} else {
++		n = nm_ip4_config_get_num_domains (config);
++		for (i = 0; i < n; i++) {
++			add_domain (domains, nm_ip4_config_get_domain (config, i),
++			            nm_ip4_config_get_never_default (config));
++		}
++	}
++}
++
++static void
++free_pending_updates (NMDnsSystemdResolved *self)
++{
++	NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++	GVariant *v;
++
++	while ((v = g_queue_pop_head (&priv->dns_updates)) != NULL)
++		g_variant_unref (v);
++
++	while ((v = g_queue_pop_head (&priv->domain_updates)) != NULL)
++		g_variant_unref (v);
++}
++
++static void
++prepare_one_interface (NMDnsSystemdResolved *self, InterfaceConfig *ic)
++{
++	NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++	GVariantBuilder dns, domains;
++	GList *l;
++
++	g_variant_builder_init (&dns, G_VARIANT_TYPE ("(ia(iay))"));
++	g_variant_builder_add (&dns, "i", ic->ifindex);
++	g_variant_builder_open (&dns, G_VARIANT_TYPE ("a(iay)"));
++
++	g_variant_builder_init (&domains, G_VARIANT_TYPE ("(ia(sb))"));
++	g_variant_builder_add (&domains, "i", ic->ifindex);
++	g_variant_builder_open (&domains, G_VARIANT_TYPE ("a(sb)"));
++
++	for (l = ic->configs ; l != NULL ; l = g_list_next (l)) {
++		if (NM_IS_IP4_CONFIG (l->data))
++			update_add_ip4_config (self, &dns, &domains, l->data);
++		else if (NM_IS_IP6_CONFIG (l->data))
++			update_add_ip6_config (self, &dns, &domains, l->data);
++		else
++			g_assert_not_reached ();
++	}
++	g_variant_builder_close (&dns);
++	g_variant_builder_close (&domains);
++
++	g_queue_push_tail (&priv->dns_updates,
++	                   g_variant_ref_sink (g_variant_builder_end (&dns)));
++	g_queue_push_tail (&priv->domain_updates,
++	                   g_variant_ref_sink (g_variant_builder_end (&domains)));
++}
++
++static void
++send_updates (NMDnsSystemdResolved *self)
++{
++	NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++	GVariant *v;
++
++	nm_clear_g_cancellable (&priv->update_cancellable);
++
++	if (!priv->resolve)
++		return;
++
++	priv->update_cancellable = g_cancellable_new ();
++
++	while ((v = g_queue_pop_head (&priv->dns_updates)) != NULL) {
++		g_dbus_proxy_call (priv->resolve, "SetLinkDNS", v,
++		                   G_DBUS_CALL_FLAGS_NONE,
++		                   -1, priv->update_cancellable, call_done, self);
++		g_variant_unref (v);
++	}
++
++	while ((v = g_queue_pop_head (&priv->domain_updates)) != NULL) {
++		g_dbus_proxy_call (priv->resolve, "SetLinkDomains", v,
++		                   G_DBUS_CALL_FLAGS_NONE,
++		                   -1, priv->update_cancellable, call_done, self);
++		g_variant_unref (v);
++	}
++}
++
++static gboolean
++update (NMDnsPlugin *plugin,
++        const NMDnsIPConfigData **configs,
++        const NMGlobalDnsConfig *global_config,
++        const char *hostname)
++{
++	NMDnsSystemdResolved *self = NM_DNS_SYSTEMD_RESOLVED (plugin);
++	GArray *interfaces = g_array_new (TRUE, TRUE, sizeof (InterfaceConfig));
++	const NMDnsIPConfigData **c;
++	int i;
++
++	for (c = configs; *c != NULL; c++)
++		add_interface_configuration (self, interfaces, *c);
++
++	free_pending_updates (self);
++
++	for (i = 0; i < interfaces->len; i++) {
++		InterfaceConfig *ic = &g_array_index (interfaces, InterfaceConfig, i);
++
++		prepare_one_interface (self, ic);
++		g_list_free (ic->configs);
++	}
++
++	g_array_free (interfaces, TRUE);
++
++	send_updates (self);
++
++	return TRUE;
++}
++
++/****************************************************************/
++
++static gboolean
++is_caching (NMDnsPlugin *plugin)
++{
++	return TRUE;
++}
++
++static const char *
++get_name (NMDnsPlugin *plugin)
++{
++	return "systemd-resolved";
++}
++
++/****************************************************************/
++
++NMDnsPlugin *
++nm_dns_systemd_resolved_new (void)
++{
++	return g_object_new (NM_TYPE_DNS_SYSTEMD_RESOLVED, NULL);
++}
++
++static void
++resolved_proxy_created (GObject *source, GAsyncResult *r, gpointer user_data)
++{
++	NMDnsSystemdResolved *self = (NMDnsSystemdResolved *) user_data;
++	NMDnsSystemdResolvedPrivate *priv;
++	gs_free_error GError *error = NULL;
++	GDBusProxy *resolve;
++
++	resolve = g_dbus_proxy_new_finish (r, &error);
++	if (   !resolve
++	    && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
++		return;
++
++	priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++	g_clear_object (&priv->init_cancellable);
++	if (!resolve) {
++		_LOGW ("failed to connect to resolved via DBus: %s", error->message);
++		g_signal_emit_by_name (self, NM_DNS_PLUGIN_FAILED);
++		return;
++	}
++
++	priv->resolve = resolve;
++	send_updates (self);
++}
++
++
++static void
++nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self)
++{
++	NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++	NMBusManager *dbus_mgr;
++	GDBusConnection *connection;
++
++	g_queue_init (&priv->dns_updates);
++	g_queue_init (&priv->domain_updates);
++
++	dbus_mgr = nm_bus_manager_get ();
++	g_return_if_fail (dbus_mgr);
++
++	connection = nm_bus_manager_get_connection (dbus_mgr);
++	g_return_if_fail (connection);
++
++	priv->init_cancellable = g_cancellable_new ();
++	g_dbus_proxy_new (connection,
++	                  G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
++	                  G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
++	                  NULL,
++	                  SYSTEMD_RESOLVED_DBUS_SERVICE,
++	                  SYSTEMD_RESOLVED_DBUS_PATH,
++	                  SYSTEMD_RESOLVED_DBUS_SERVICE ".Manager",
++	                  priv->init_cancellable,
++	                  resolved_proxy_created,
++	                  self);
++}
++
++static void
++dispose (GObject *object)
++{
++	NMDnsSystemdResolved *self = NM_DNS_SYSTEMD_RESOLVED (object);
++	NMDnsSystemdResolvedPrivate *priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self);
++
++	free_pending_updates (self);
++	g_clear_object (&priv->resolve);
++	nm_clear_g_cancellable (&priv->init_cancellable);
++	nm_clear_g_cancellable (&priv->update_cancellable);
++
++	G_OBJECT_CLASS (nm_dns_systemd_resolved_parent_class)->dispose (object);
++}
++
++static void
++nm_dns_systemd_resolved_class_init (NMDnsSystemdResolvedClass *dns_class)
++{
++	NMDnsPluginClass *plugin_class = NM_DNS_PLUGIN_CLASS (dns_class);
++	GObjectClass *object_class = G_OBJECT_CLASS (dns_class);
++
++	g_type_class_add_private (dns_class, sizeof (NMDnsSystemdResolvedPrivate));
++
++	object_class->dispose = dispose;
++
++	plugin_class->is_caching = is_caching;
++	plugin_class->update = update;
++	plugin_class->get_name = get_name;
++}
++
+diff --git a/src/dns-manager/nm-dns-systemd-resolved.h b/src/dns-manager/nm-dns-systemd-resolved.h
+new file mode 100644
+index 0000000..45c64b3
+--- /dev/null
++++ b/src/dns-manager/nm-dns-systemd-resolved.h
+@@ -0,0 +1,45 @@
++/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
++/* 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, 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, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ *
++ * Copyright (C) 2010 Red Hat, Inc.
++ * Copyright (C) 2016 Sjoerd Simons <sjoerd@luon.net>
++ */
++
++#ifndef __NETWORKMANAGER_DNS_SYSTEMD_RESOLVED_H__
++#define __NETWORKMANAGER_DNS_SYSTEMD_RESOLVED_H__
++
++#include "nm-dns-plugin.h"
++
++#define NM_TYPE_DNS_SYSTEMD_RESOLVED            (nm_dns_systemd_resolved_get_type ())
++#define NM_DNS_SYSTEMD_RESOLVED(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DNS_SYSTEMD_RESOLVED, NMDnsSystemdResolved))
++#define NM_DNS_SYSTEMD_RESOLVED_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_DNS_SYSTEMD_RESOLVED, NMDnsSystemdResolvedClass))
++#define NM_IS_DNS_SYSTEMD_RESOLVED(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DNS_SYSTEMD_RESOLVED))
++#define NM_IS_DNS_SYSTEMD_RESOLVED_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DNS_SYSTEMD_RESOLVED))
++#define NM_DNS_SYSTEMD_RESOLVED_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DNS_SYSTEMD_RESOLVED, NMDnsSystemdResolvedClass))
++
++typedef struct {
++	NMDnsPlugin parent;
++} NMDnsSystemdResolved;
++
++typedef struct {
++	NMDnsPluginClass parent;
++} NMDnsSystemdResolvedClass;
++
++GType nm_dns_systemd_resolved_get_type (void);
++
++NMDnsPlugin *nm_dns_systemd_resolved_new (void);
++
++#endif /* __NETWORKMANAGER_DNS_SYSTEMD_RESOLVED_H__ */
++
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-also-check-for-etc-resolv-conf.systemd.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-also-check-for-etc-resolv-conf.systemd.patch
new file mode 100644
index 0000000..ca7e4a4
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-dns-resolved-also-check-for-etc-resolv-conf.systemd.patch
@@ -0,0 +1,29 @@
+From 6f799f1f0e68cc7bf89c0a56aec5ecf46937619d Mon Sep 17 00:00:00 2001
+From: Ricardo Salveti <rsalveti@rsalveti.net>
+Date: Thu, 15 Jun 2017 10:02:38 -0300
+Subject: [PATCH] dns/resolved: also check for /etc/resolv-conf.systemd
+
+OE specific resolv.conf path, so it can be enabled by default if available.
+
+Upstream-Status: Inappropriate [OE config specific]
+
+Signed-off-by: Ricardo Salveti <rsalveti@rsalveti.net>
+---
+ src/dns-manager/nm-dns-manager.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/dns-manager/nm-dns-manager.c b/src/dns-manager/nm-dns-manager.c
+index c1d2bf7..d70d4b4 100644
+--- a/src/dns-manager/nm-dns-manager.c
++++ b/src/dns-manager/nm-dns-manager.c
+@@ -1596,6 +1596,7 @@ _resolvconf_resolved_managed (void)
+ 		"/run/systemd/resolve/resolv.conf",
+ 		"/lib/systemd/resolv.conf",
+ 		"/usr/lib/systemd/resolv.conf",
++		"/etc/resolv-conf.systemd",
+ 	};
+ 	GFile *f;
+ 	GFileInfo *info;
+-- 
+2.7.4
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch
new file mode 100644
index 0000000..5c9ed92
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch
@@ -0,0 +1,36 @@
+From 7dd40db6606c3b3559365a03944cb99aee5ceabc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Thu, 4 Apr 2013 12:57:58 +0200
+Subject: [PATCH] don't try to run /sbin/dhclient to get the version number,
+ this break cross-compiling
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Inappropriate [build system specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac |    6 ------
+ 1 files changed, 0 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cc66e9b..7163287 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -488,12 +488,6 @@ AS_IF([test -z "$with_dhcpcd"], with_dhcpcd=yes)
+ # Search and check the executables
+ if test "$with_dhclient" = "yes"; then
+ 	AC_PATH_PROGS(with_dhclient, dhclient, no, /sbin:/usr/sbin:/usr/local/sbin)
+-	if test "$with_dhclient" != "no"; then
+-		if ! $with_dhclient --version 2>&1 | grep -q "^isc-dhclient-4\."; then
+-			AC_MSG_WARN([Cannot use dhclient, version 4.x is required])
+-			with_dhclient=no
+-		fi
+-	fi
+ fi
+ if test "$with_dhcpcd" = "yes"; then
+ 	AC_PATH_PROGS(with_dhcpcd, dhcpcd, no, /sbin:/usr/sbin:/usr/local/sbin)
+-- 
+1.7.6.5
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-systemd-xlocale.h-is-dropped-by-newer-glibc.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-systemd-xlocale.h-is-dropped-by-newer-glibc.patch
new file mode 100644
index 0000000..4234e2b
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0001-systemd-xlocale.h-is-dropped-by-newer-glibc.patch
@@ -0,0 +1,29 @@
+From a9bfe6f2029d75caf28fcdf3e740843cf6359615 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:31:25 -0700
+Subject: [PATCH 1/2] systemd: xlocale.h is dropped by newer glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/basic/parse-util.c | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c
+index 9c21e5a..dd95d1f 100644
+--- a/src/systemd/src/basic/parse-util.c
++++ b/src/systemd/src/basic/parse-util.c
+@@ -25,11 +25,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#ifdef __GLIBC__
+-#include <xlocale.h>
+-#else
+ #include <locale.h>
+-#endif
+ #include "alloc-util.h"
+ #include "extract-word.h"
+ #include "macro.h"
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fix-nm-version-macro-includes.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fix-nm-version-macro-includes.patch
new file mode 100644
index 0000000..aa57c83
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-Fix-nm-version-macro-includes.patch
@@ -0,0 +1,58 @@
+From 7274bbadd398a69b8babf47431f80d35e0228c42 Mon Sep 17 00:00:00 2001
+From: Adrian Freihofer <adrian.freihofer@gmail.com>
+Date: Mon, 18 Jan 2016 08:53:26 +0100
+Subject: [PATCH] Fix nm-version-macro includes
+
+nm-version-macros.h cannot be found since include directive has
+been changed from " to <. This breaks for example gnome-panel
+build:
+/usr/include/NetworkManager/NetworkManager.h:31:31:
+fatal error: nm-version-macros.h: No such file or directory.
+---
+ libnm-core/nm-version.h     | 2 +-
+ libnm-util/NetworkManager.h | 2 +-
+ libnm-util/nm-version.h     | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/libnm-core/nm-version.h b/libnm-core/nm-version.h
+index 730330a..d751bc1 100644
+--- a/libnm-core/nm-version.h
++++ b/libnm-core/nm-version.h
+@@ -23,7 +23,7 @@
+ 
+ #include <glib.h>
+ 
+-#include <nm-version-macros.h>
++#include "nm-version-macros.h"
+ 
+ /* Deprecation / Availability macros */
+ 
+diff --git a/libnm-util/NetworkManager.h b/libnm-util/NetworkManager.h
+index d83e4ab..3a964fc 100644
+--- a/libnm-util/NetworkManager.h
++++ b/libnm-util/NetworkManager.h
+@@ -28,7 +28,7 @@
+ 
+ /* This header must not include glib or libnm. */
+ 
+-#include <nm-version-macros.h>
++#include "nm-version-macros.h"
+ 
+ /*
+  * dbus services details
+diff --git a/libnm-util/nm-version.h b/libnm-util/nm-version.h
+index 63895dd..41101a4 100644
+--- a/libnm-util/nm-version.h
++++ b/libnm-util/nm-version.h
+@@ -23,7 +23,7 @@
+ 
+ #include <glib.h>
+ 
+-#include <nm-version-macros.h>
++#include "nm-version-macros.h"
+ 
+ /* Deprecation / Availability macros */
+ 
+-- 
+2.5.0
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
new file mode 100644
index 0000000..22bc6e8
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-socket-util.h-Include-linux-sockios.h-on-musl.patch
@@ -0,0 +1,30 @@
+From 98d7e3ae5b15e30af1bf5dd1d279e1a774bf2b86 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:05:05 -0700
+Subject: [PATCH 2/5] socket-util.h: Include linux/sockios.h on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/basic/socket-util.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/systemd/src/basic/socket-util.h b/src/systemd/src/basic/socket-util.h
+index 2536b08..76d6107 100644
+--- a/src/systemd/src/basic/socket-util.h
++++ b/src/systemd/src/basic/socket-util.h
+@@ -29,6 +29,12 @@
+ #include <linux/netlink.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 "util.h"
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-user-format-string-in-g_dbus_message_new_method_erro.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-user-format-string-in-g_dbus_message_new_method_erro.patch
new file mode 100644
index 0000000..e32b5c0
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0002-user-format-string-in-g_dbus_message_new_method_erro.patch
@@ -0,0 +1,67 @@
+From adc0668b854289a11cfc29597b5566ba1869d17e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 27 Jun 2017 07:32:09 -0700
+Subject: [PATCH 2/2] user format string in g_dbus_message_new_method_error ()
+
+This fixes format errors with -Werror=format-security
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/nm-manager.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/nm-manager.c b/src/nm-manager.c
+index c3d65cd..e814912 100644
+--- a/src/nm-manager.c
++++ b/src/nm-manager.c
+@@ -4871,6 +4871,7 @@ prop_set_auth_done_cb (NMAuthChain *chain,
+ 	if (error || (result != NM_AUTH_CALL_RESULT_YES)) {
+ 		reply = g_dbus_message_new_method_error (pfd->message,
+ 		                                         NM_PERM_DENIED_ERROR,
++		                                         "%s",
+ 		                                         (error_message = "Not authorized to perform this operation"));
+ 		if (error)
+ 			error_message = error->message;
+@@ -4882,6 +4883,7 @@ prop_set_auth_done_cb (NMAuthChain *chain,
+ 	if (!object) {
+ 		reply = g_dbus_message_new_method_error (pfd->message,
+ 		                                         "org.freedesktop.DBus.Error.UnknownObject",
++		                                         "%s",
+ 		                                         (error_message = "Object doesn't exist."));
+ 		goto done;
+ 	}
+@@ -4890,6 +4892,7 @@ prop_set_auth_done_cb (NMAuthChain *chain,
+ 	if (!nm_exported_object_get_interface_by_type (object, pfd->interface_type)) {
+ 		reply = g_dbus_message_new_method_error (pfd->message,
+ 		                                         "org.freedesktop.DBus.Error.InvalidArgs",
++		                                         "%s",
+ 		                                         (error_message = "Object is of unexpected type."));
+ 		goto done;
+ 	}
+@@ -4905,6 +4908,7 @@ prop_set_auth_done_cb (NMAuthChain *chain,
+ 		if (global_dns && !nm_global_dns_config_is_internal (global_dns)) {
+ 			reply = g_dbus_message_new_method_error (pfd->message,
+ 			                                         NM_PERM_DENIED_ERROR,
++			                                         "%s",
+ 			                                         (error_message = "Global DNS configuration already set via configuration file"));
+ 			goto done;
+ 		}
+@@ -4949,6 +4953,7 @@ do_set_property_check (gpointer user_data)
+ 	if (!pfd->subject) {
+ 		reply = g_dbus_message_new_method_error (pfd->message,
+ 		                                         NM_PERM_DENIED_ERROR,
++		                                         "%s",
+ 		                                         (error_message = "Could not determine request UID."));
+ 		goto out;
+ 	}
+@@ -4958,6 +4963,7 @@ do_set_property_check (gpointer user_data)
+ 	if (!chain) {
+ 		reply = g_dbus_message_new_method_error (pfd->message,
+ 		                                         NM_PERM_DENIED_ERROR,
++		                                         "%s",
+ 		                                         (error_message = "Could not authenticate request."));
+ 		goto out;
+ 	}
+-- 
+2.13.2
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
new file mode 100644
index 0000000..236914f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0003-Define-ETH_ALEN.patch
@@ -0,0 +1,39 @@
+From 16c3dc7a407101243d2056d2c93e61dce1a05350 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:08:45 -0700
+Subject: [PATCH 3/5] Define ETH_ALEN
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libnm-core/nm-utils.h          | 1 +
+ src/platform/wifi/wifi-utils.h | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/libnm-core/nm-utils.h b/libnm-core/nm-utils.h
+index 156ccae..68e222b 100644
+--- a/libnm-core/nm-utils.h
++++ b/libnm-core/nm-utils.h
+@@ -29,6 +29,7 @@
+ 
+ /* For ETH_ALEN and INFINIBAND_ALEN */
+ //#include <linux/if_ether.h>
++#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
+ #include <linux/if_infiniband.h>
+ #include <netinet/in.h>
+ 
+diff --git a/src/platform/wifi/wifi-utils.h b/src/platform/wifi/wifi-utils.h
+index 84f5ce9..33a838d 100644
+--- a/src/platform/wifi/wifi-utils.h
++++ b/src/platform/wifi/wifi-utils.h
+@@ -24,6 +24,8 @@
+ 
+ //#include <net/ethernet.h>
+ 
++#define ETH_ALEN	6		/* Octets in one ethernet addr	 */
++
+ #include "nm-dbus-interface.h"
+ 
+ typedef struct WifiData WifiData;
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
new file mode 100644
index 0000000..27c9ae9
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0004-Define-missing-features-to-cater-for-musl.patch
@@ -0,0 +1,93 @@
+From 2153109e60e362e0d09215d529bf00176f31a3e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 31 Mar 2017 16:09:41 -0700
+Subject: [PATCH 4/5] Define missing features to cater for musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/sd-adapt/nm-sd-adapt.h | 2 +-
+ src/systemd/src/basic/parse-util.c | 5 ++++-
+ src/systemd/src/basic/stdio-util.h | 2 ++
+ src/systemd/src/basic/util.h       | 5 +++++
+ src/systemd/src/systemd/sd-event.h | 4 ----
+ 5 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/src/systemd/sd-adapt/nm-sd-adapt.h b/src/systemd/sd-adapt/nm-sd-adapt.h
+index cf27c1a..72c1b89 100644
+--- a/src/systemd/sd-adapt/nm-sd-adapt.h
++++ b/src/systemd/sd-adapt/nm-sd-adapt.h
+@@ -119,7 +119,7 @@ G_STMT_START { \
+ #  ifdef HAVE___SECURE_GETENV
+ #    define secure_getenv __secure_getenv
+ #  else
+-#    error neither secure_getenv nor __secure_getenv is available
++#    define secure_getenv getenv
+ #  endif
+ #endif
+ 
+diff --git a/src/systemd/src/basic/parse-util.c b/src/systemd/src/basic/parse-util.c
+index 2738663..9c21e5a 100644
+--- a/src/systemd/src/basic/parse-util.c
++++ b/src/systemd/src/basic/parse-util.c
+@@ -25,8 +25,11 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#ifdef __GLIBC__
+ #include <xlocale.h>
+-
++#else
++#include <locale.h>
++#endif
+ #include "alloc-util.h"
+ #include "extract-word.h"
+ #include "macro.h"
+diff --git a/src/systemd/src/basic/stdio-util.h b/src/systemd/src/basic/stdio-util.h
+index bd1144b..c92e935 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/>.
+ ***/
+ 
++#ifdef __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 bb2fc31..fe074a5 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())
+ 
+diff --git a/src/systemd/src/systemd/sd-event.h b/src/systemd/src/systemd/sd-event.h
+index cc26b7d..c7e0004 100644
+--- a/src/systemd/src/systemd/sd-event.h
++++ b/src/systemd/src/systemd/sd-event.h
+@@ -69,11 +69,7 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
+ typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
+ typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
+ typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
+-#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
+ typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
+-#else
+-typedef void* sd_event_child_handler_t;
+-#endif
+ 
+ int sd_event_default(sd_event **e);
+ 
+-- 
+2.12.1
+
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
new file mode 100644
index 0000000..f4a04c7
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager/0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch
@@ -0,0 +1,36 @@
+From 9e9e5814456ec23b9fc669d342bf9d8f7ee49fc2 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/5] sd-lldp.h: Remove net/ethernet.h seems to be over
+ specified
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemd/src/systemd/sd-lldp.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: NetworkManager-1.4.2/src/systemd/src/systemd/sd-lldp.h
+===================================================================
+--- NetworkManager-1.4.2.orig/src/systemd/src/systemd/sd-lldp.h
++++ NetworkManager-1.4.2/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"
+Index: NetworkManager-1.4.2/src/systemd/src/libsystemd-network/sd-lldp.c
+===================================================================
+--- NetworkManager-1.4.2.orig/src/systemd/src/libsystemd-network/sd-lldp.c
++++ NetworkManager-1.4.2/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 "sd-lldp.h"
+ 
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb
new file mode 100644
index 0000000..d5f456f
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/networkmanager/networkmanager_1.4.4.bb
@@ -0,0 +1,136 @@
+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=8eb8e72bab097b9d11763002cb003697 \
+"
+
+DEPENDS = " \
+    intltool-native \
+    libnl \
+    dbus \
+    dbus-glib \
+    dbus-glib-native \
+    libgudev \
+    util-linux \
+    libndp \
+    libnewt \
+    polkit \
+    jansson \
+"
+
+inherit gnomebase gettext systemd bluetooth bash-completion vala gobject-introspection
+
+GI_DATA_ENABLED_libc-musl = "False"
+
+SRC_URI = "${GNOME_MIRROR}/NetworkManager/${@gnome_verdir("${PV}")}/NetworkManager-${PV}.tar.xz \
+           file://0001-don-t-try-to-run-sbin-dhclient-to-get-the-version-nu.patch \
+           file://0002-Fix-nm-version-macro-includes.patch \
+           file://0001-adjust-net-headers-for-musl-compatibility.patch \
+           file://0002-socket-util.h-Include-linux-sockios.h-on-musl.patch \
+           file://0003-Define-ETH_ALEN.patch \
+           file://0004-Define-missing-features-to-cater-for-musl.patch \
+           file://0005-sd-lldp.h-Remove-net-ethernet.h-seems-to-be-over-spe.patch \
+           file://0001-check-for-strndupa-before-using-it.patch \
+           file://0001-dns-resolved-add-systemd-resolved-backend.patch \
+           file://0001-dns-resolved-also-check-for-etc-resolv-conf.systemd.patch \
+           file://0001-systemd-xlocale.h-is-dropped-by-newer-glibc.patch \
+           file://0002-user-format-string-in-g_dbus_message_new_method_erro.patch \
+           "
+SRC_URI[md5sum] = "63f1e0d6d7e9099499d062c84c927a75"
+SRC_URI[sha256sum] = "829378f318cc008d138a23ca6a9191928ce75344e7e47a2f2c35f4ac82133309"
+
+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 \
+"
+
+do_compile_prepend() {
+        export GIR_EXTRA_LIBS_PATH="${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[concheck] = "--with-libsoup=yes,--with-libsoup=no,libsoup-2.4"
+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 \
+    ${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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
index 3a1f0f3..c944144 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/openconnect/openconnect_git.bb
@@ -14,9 +14,9 @@
 # not config defaults
 PACKAGECONFIG[pcsc-lite] = "--with-libpcsclite,--without-libpcsclite,pcsc-lite,"
 
-PV = "7.06"
+PV = "7.08"
 
-SRCREV = "35542d52202672b8c12ecc63867432128244013a"
+SRCREV = "9697bea0e50952cab57063238b43a7099e498cbb"
 SRC_URI = "git://git.infradead.org/users/dwmw2/openconnect.git"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/python-networkmanager/python-networkmanager_2.0.1.bb
new file mode 100644
index 0000000..4e41aa5
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-rdate-define-logwtmp-on-libc-glibc.patch
new file mode 100644
index 0000000..08ba2c3
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch
new file mode 100644
index 0000000..2f65189
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdate/rdate_1.5.bb
new file mode 100644
index 0000000..cd4db12
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bb-build.patch
new file mode 100644
index 0000000..c95eaf8
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-bison.patch
new file mode 100644
index 0000000..4354912
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-cleanup.patch
new file mode 100644
index 0000000..ed3d7f1
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-fix-msgsndnotify-loop.patch
new file mode 100644
index 0000000..d183d91
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-hardlink.patch
new file mode 100644
index 0000000..baf8e30
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-lfs.patch
new file mode 100644
index 0000000..3fa8db8
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-links.patch
new file mode 100644
index 0000000..e9994f2
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-linux.patch
new file mode 100644
index 0000000..b56fd38
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-makefile-add-ldflags.patch
new file mode 100644
index 0000000..cc82e16
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-maxargs.patch
new file mode 100644
index 0000000..e816394
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-mkstemp.patch
new file mode 100644
index 0000000..e49e3e4
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-oldpath.patch
new file mode 100644
index 0000000..493b183
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-ssh.patch
new file mode 100644
index 0000000..d3982cf
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-stat64.patch
new file mode 100644
index 0000000..b20953e
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-svr4.patch
new file mode 100644
index 0000000..bf73b71
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist-6.1.5/rdist-6.1.5-varargs.patch
new file mode 100644
index 0000000..e6edbc4
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/rdist/rdist_6.1.5.bb
new file mode 100644
index 0000000..cea1f08
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd/0001-rtnl_flush-Error-on-failed-write.patch
new file mode 100644
index 0000000..eaaf304
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
index 50297f3..98dc41a 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/relayd/relayd_git.bb
@@ -5,9 +5,11 @@
 
 DEPENDS = "libubox"
 
-SRC_URI = "git://nbd.name/relayd.git"
+SRC_URI = "git://git.openwrt.org/project/relayd.git \
+           file://0001-rtnl_flush-Error-on-failed-write.patch \
+"
 
-SRCREV = "2970ff60bac6b70ecb682779d5c776dc559dc0b9"
+SRCREV = "ad0b25ad74345d367c62311e14b279f5ccb8ef13"
 PV = "0.0.1+git${SRCPV}"
 
 S = "${WORKDIR}/git"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/00-fix-typos-in-man-pages.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/00-fix-typos-in-man-pages.patch
deleted file mode 100644
index c94bc31..0000000
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba/00-fix-typos-in-man-pages.patch
+++ /dev/null
@@ -1,108 +0,0 @@
-From 1573638212a9733a44939a4d38a226f38dca36f1 Mon Sep 17 00:00:00 2001
-From: Michele Baldessari <michele@acksyn.org>
-Date: Tue, 9 Jul 2013 23:23:33 +0200
-Subject: [PATCH] Fix typos in man-pages
-
-Fix some typos in the man-pages.
-
-Signed-off-by: Michele Baldessari <michele@acksyn.org>
-Reviewed-by: Simo Sorce <idra@samba.org>
-
-Autobuild-User(master): Simo Sorce <idra@samba.org>
-Autobuild-Date(master): Wed Jul 10 16:45:07 CEST 2013 on sn-devel-104
----
- docs-xml/manpages/dbwrap_tool.1.xml              | 2 +-
- docs-xml/manpages/idmap_autorid.8.xml            | 2 +-
- docs-xml/manpages/net.8.xml                      | 2 +-
- docs-xml/manpages/pdbedit.8.xml                  | 2 +-
- docs-xml/manpages/samba.7.xml                    | 2 +-
- docs-xml/manpages/smbclient.1.xml                | 2 +-
- docs-xml/manpages/smbpasswd.5.xml                | 2 +-
- docs-xml/manpages/vfs_smb_traffic_analyzer.8.xml | 2 +-
- 8 files changed, 8 insertions(+), 8 deletions(-)
-
-Index: samba-4.1.11/docs-xml/manpages/smbstatus.1.xml
-===================================================================
---- samba-4.1.11.orig/docs-xml/manpages/smbstatus.1.xml
-+++ samba-4.1.11/docs-xml/manpages/smbstatus.1.xml
-@@ -137,6 +137,13 @@
- 		</listitem>
- 		</varlistentry>
- 
-+		<varlistentry>
-+		<term>-n|--numeric</term>
-+		<listitem><para>causes smbstatus to display numeric UIDs and GIDs instead of
-+				resolving them to names.</para>
-+		</listitem>
-+		</varlistentry>
-+
- 	</variablelist>
- </refsect1>
- 
-Index: samba-4.1.11/docs-xml/manpages/sharesec.1.xml
-===================================================================
---- samba-4.1.11.orig/docs-xml/manpages/sharesec.1.xml
-+++ samba-4.1.11/docs-xml/manpages/sharesec.1.xml
-@@ -129,6 +129,13 @@
- 		</para></listitem>
- 		</varlistentry>
- 
-+		<varlistentry>
-+		<term>-S|--setsddl=STRING</term>
-+		<listitem><para>
-+		Set security descriptor by providing ACL in SDDL format.
-+		</para></listitem>
-+		</varlistentry>
-+
- 		&stdarg.help;
- 		&stdarg.server.debug;
- 		&popt.common.samba;
-Index: samba-4.1.11/docs-xml/build/DTD/samba.entities
-===================================================================
---- samba-4.1.11.orig/docs-xml/build/DTD/samba.entities
-+++ samba-4.1.11/docs-xml/build/DTD/samba.entities
-@@ -270,6 +270,44 @@ file.
- &popt.common.samba;
- '>
- 
-+<!ENTITY stdarg.signing '
-+<varlistentry>
-+<term>-S|--signing on|off|required</term>
-+<listitem><para>Set the client signing state.
-+</para></listitem>
-+</varlistentry>
-+'>
-+
-+<!ENTITY stdarg.machinepass '
-+<varlistentry>
-+<term>-P|--machine-pass</term>
-+<listitem><para>Use stored machine account password.
-+</para></listitem>
-+</varlistentry>
-+'>
-+
-+<!ENTITY stdarg.encrypt '
-+<varlistentry>
-+<term>-e|--encrypt</term>
-+<listitem><para>
-+This command line parameter requires the remote
-+server support the UNIX extensions or that the SMB3 protocol has been selected.
-+Requests that the connection be encrypted. Negotiates SMB encryption using either
-+SMB3 or POSIX extensions via GSSAPI. Uses the given credentials for
-+the encryption negotiation (either kerberos or NTLMv1/v2 if given
-+domain/username/password triple. Fails the connection if encryption
-+cannot be negotiated.
-+</para></listitem>
-+</varlistentry>
-+'>
-+
-+<!ENTITY stdarg.pwnthash '
-+<varlistentry>
-+<term>--pw-nt-hash</term>
-+<listitem><para>The supplied password is the NT hash.
-+</para></listitem>
-+</varlistentry>
-+'>
- 
- <!ENTITY stdarg.resolve.order '
- <varlistentry>
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
similarity index 97%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
index 7574aef..2b227c9 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.2.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/samba/samba_4.6.7.bb
@@ -1,3 +1,4 @@
+HOMEPAGE = "https://www.samba.org/"
 SECTION = "console/network"
 
 LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
@@ -12,7 +13,6 @@
 "
 
 SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
-           file://00-fix-typos-in-man-pages.patch \
            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 \
@@ -26,8 +26,9 @@
            file://samba-4.2.7-pam.patch \
            file://samba-4.3.9-remove-getpwent_r.patch \
           "
-SRC_URI[md5sum] = "461def8190ffc651fd8458b24ca2a622"
-SRC_URI[sha256sum] = "927afcc16e444718985e3952de92d34e7b776b9ca0238179d866da18a6441c35"
+
+SRC_URI[md5sum] = "c6ee5c766016d59908c8fb672fbbd445"
+SRC_URI[sha256sum] = "9ef24393de08390f236cabccd6a420b5cea304e959cbf1a99ff317325db3ddfa"
 
 inherit systemd waf-samba cpan-base perlnative update-rc.d
 # remove default added RDEPENDS on perl
@@ -185,7 +186,8 @@
 
 PACKAGESPLITFUNCS_prepend = "samba_populate_packages "
 
-RDEPENDS_${PN} += "${PN}-base"
+RDEPENDS_${PN} += "${PN}-base ${PN}-python ${PN}-dsdb-modules"
+RDEPENDS_${PN}-python += "pytalloc python-tdb"
 
 FILES_${PN}-base = "${sbindir}/nmbd \
                     ${sbindir}/smbd \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch
new file mode 100644
index 0000000..2becc06
--- /dev/null
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort/fix-host-contamination-when-enable-static-daq.patch
@@ -0,0 +1,21 @@
+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>
+---
+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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
index dfd6ba9..2034b85 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/snort/snort_2.9.7.5.bb
@@ -4,7 +4,7 @@
 LICENSE = "GPL-2.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5"
 
-DEPENDS = "xz libpcap libpcre daq libdnet util-linux"
+DEPENDS = "xz libpcap libpcre daq libdnet util-linux daq-native"
 DEPENDS_append_libc-musl = " libtirpc"
 
 SRC_URI = " ${GENTOO_MIRROR}/${BP}.tar.gz;name=tarball \
@@ -15,6 +15,7 @@
     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"
@@ -31,7 +32,7 @@
     --enable-reload \
     --enable-reload-error-restart \
     --enable-targetbased \
-    --disable-static-daq \
+    --enable-static-daq \
     --with-dnet-includes=${STAGING_INCDIR} \
     --with-dnet-libraries=${STAGING_LIBDIR} \
     --with-libpcre-includes=${STAGING_INCDIR} \
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
index 3f688b3..bd55efc 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb
@@ -1,4 +1,5 @@
 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"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc/0009-reduce-lifetime-value.patch
new file mode 100644
index 0000000..2bed550
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
index 6f92acd..ea21799 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb
@@ -20,6 +20,7 @@
            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"
diff --git a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/files/0001-fix-no-rule-to-make-cyassl-options.h.patch
new file mode 100644
index 0000000..f304d93
--- /dev/null
+++ b/import-layers/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/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb
similarity index 69%
rename from import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb
rename to import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb
index afae3c8..5126190 100644
--- a/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.9.0.bb
+++ b/import-layers/meta-openembedded/meta-networking/recipes-connectivity/wolfssl/wolfssl_3.12.0.bb
@@ -12,10 +12,14 @@
 PROVIDES += "cyassl"
 RPROVIDES_${PN} = "cyassl"
 
-SRC_URI = "http://www.wolfssl.com/${BP}.zip"
+SRC_URI = "https://github.com/wolfSSL/wolfssl/archive/v${PV}-stable.zip \
+           file://0001-fix-no-rule-to-make-cyassl-options.h.patch \
+          "
 
-SRC_URI[md5sum] = "f3396726a9befd61443c2cce216e39ba"
-SRC_URI[sha256sum] = "98f50244f7b43f8683bd0cf5c599849d330e75e6cf077e96f14e83bda8b03ca3"
+SRC_URI[md5sum] = "f9caf558169ab650dc8200708799ebeb"
+SRC_URI[sha256sum] = "b6d87d3e2c8757177d69aff373c91cf162f4a3944fae90fa10d086fd5f9542e7"
+
+S = "${WORKDIR}/wolfssl-${PV}-stable"
 
 inherit autotools