diff options
| author | Michael Biebl <biebl@debian.org> | 2011-10-16 08:47:38 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-10-16 08:47:38 +0200 |
| commit | dcc310e31af7fa88eb51fabe90de7edd374aecc5 (patch) | |
| tree | a517abb10b0f0be34e511ca0cb2a78a2e0074362 /src/backends | |
| parent | 263bf4c0c89bb88dc995acd9a6a2de9095fbd461 (diff) | |
Imported Upstream version 0.9.1.90 upstream/0.9.1.90
Diffstat (limited to 'src/backends')
| -rw-r--r-- | src/backends/Makefile.in | 6 | ||||
| -rw-r--r-- | src/backends/NetworkManagerGeneric.c | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/src/backends/Makefile.in b/src/backends/Makefile.in index 2f489e75..6776e343 100644 --- a/src/backends/Makefile.in +++ b/src/backends/Makefile.in @@ -232,6 +232,12 @@ LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ +LIBNL1_CFLAGS = @LIBNL1_CFLAGS@ +LIBNL1_LIBS = @LIBNL1_LIBS@ +LIBNL2_CFLAGS = @LIBNL2_CFLAGS@ +LIBNL2_LIBS = @LIBNL2_LIBS@ +LIBNL3_CFLAGS = @LIBNL3_CFLAGS@ +LIBNL3_LIBS = @LIBNL3_LIBS@ LIBNL_CFLAGS = @LIBNL_CFLAGS@ LIBNL_LIBS = @LIBNL_LIBS@ LIBOBJS = @LIBOBJS@ diff --git a/src/backends/NetworkManagerGeneric.c b/src/backends/NetworkManagerGeneric.c index 8f16066f..89b8a46d 100644 --- a/src/backends/NetworkManagerGeneric.c +++ b/src/backends/NetworkManagerGeneric.c @@ -34,7 +34,9 @@ #include "nm-system.h" #include "NetworkManagerUtils.h" #include "nm-logging.h" +#include "nm-netlink-compat.h" #include "nm-netlink-monitor.h" +#include "nm-netlink-utils.h" /* Because of a bug in libnl, rtnl.h should be included before route.h */ #include <netlink/route/rtnl.h> @@ -50,15 +52,13 @@ */ void nm_generic_enable_loopback (void) { - struct nl_handle * nlh = NULL; + struct nl_sock * nlh = NULL; struct rtnl_addr * addr = NULL; struct nl_addr * nl_addr = NULL; guint32 binaddr = 0; int iface_idx = -1; int err; - nm_system_device_set_up_down_with_iface ("lo", TRUE, NULL); - nlh = nm_netlink_get_default_handle (); if (!nlh) return; @@ -67,6 +67,8 @@ void nm_generic_enable_loopback (void) if (iface_idx < 0) return; + nm_system_iface_set_up (iface_idx, TRUE, NULL); + addr = rtnl_addr_alloc (); if (!addr) return; @@ -90,10 +92,10 @@ void nm_generic_enable_loopback (void) rtnl_addr_set_scope (addr, RT_SCOPE_HOST); rtnl_addr_set_label (addr, "lo"); - if ((err = rtnl_addr_add (nlh, addr, 0)) < 0) { - if (err != -EEXIST) { - nm_log_warn (LOGD_CORE, "error %d returned from rtnl_addr_add():\n%s", err, nl_geterror()); - } + err = rtnl_addr_add (nlh, addr, 0); + if (err && (err != -NLE_EXIST)) { + nm_log_warn (LOGD_CORE, "error setting loopback address: (%d) %s", + err, nl_geterror (err)); } out: if (addr) |