From: Serge Hallyn <serge.hallyn(a)canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn(a)canonical.com>
---
configure.ac | 15 +++++++++++++++
src/drv_debian.c | 4 ++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index c1060f3..6705a0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,6 +106,21 @@ then
PKG_CHECK_MODULES([LIBNL], [libnl-1])
fi
+if test "x$with_driver" = "xdebian"; then
+ dnl Check for ifup and ifdown in debian
+ AC_PATH_PROG(IFDOWN, ifdown, false, $PATH$PATHSEPARATOR/sbin)
+ if test "$IFDOWN" = "false"; then
+ AC_MSG_ERROR([ifdown not found])
+ fi
+ AC_DEFINE_UNQUOTED([IFDOWN], "$IFDOWN", [path to ifdown binary])
+
+ AC_PATH_PROG(IFUP, ifup, false, $PATH$PATHSEPARATOR/sbin)
+ if test "$IFUP" = "false"; then
+ AC_MSG_ERROR([ifup not found])
+ fi
+ AC_DEFINE_UNQUOTED([IFUP], "$IFUP", [path to ifup binary])
+fi
+
NETCF_LIBDEPS=$(echo $LIBAUGEAS_LIBS $LIBEXSLT_LIBS $LIBXSLT_LIBS $LIBXML_LIBS
$LIBNL_LIBS)
AC_SUBST([NETCF_LIBDEPS])
diff --git a/src/drv_debian.c b/src/drv_debian.c
index d28eda0..23c5551 100644
--- a/src/drv_debian.c
+++ b/src/drv_debian.c
@@ -1042,7 +1042,7 @@ const char *drv_mac_string(struct netcf_if *nif) {
*/
int drv_if_up(struct netcf_if *nif) {
- static const char *const ifup = "ifup";
+ static const char *const ifup = IFUP;
struct netcf *ncf = nif->ncf;
int result = -1;
@@ -1054,7 +1054,7 @@ int drv_if_up(struct netcf_if *nif) {
}
int drv_if_down(struct netcf_if *nif) {
- static const char *const ifdown = "ifdown";
+ static const char *const ifdown = IFDOWN;
struct netcf *ncf = nif->ncf;
int result = -1;
--
1.7.10