Commit a544aa37 authored by Dan Williams's avatar Dan Williams

merge: make Wi-Fi/OLPC Mesh support a plugin and misc cleanups (bgo #728432)

parents b5ffcf46 9e542fae
......@@ -186,6 +186,7 @@ valgrind-*.log
/src/tests/test-ip6-config
/src/tests/test-wifi-ap-utils
/src/tests/test-resolvconf-capture
/src/devices/wifi/tests/test-wifi-ap-utils
/src/dnsmasq-manager/tests/test-dnsmasq-utils
/src/dhcp-manager/tests/test-dhcp-dhclient
/src/dhcp-manager/tests/test-dnsmasq-utils
......
......@@ -800,6 +800,8 @@ src/rdisc/tests/Makefile
src/devices/adsl/Makefile
src/devices/wimax/Makefile
src/devices/bluetooth/Makefile
src/devices/wifi/Makefile
src/devices/wifi/tests/Makefile
src/devices/wwan/Makefile
libnm-util/libnm-util.pc
libnm-util/Makefile
......
......@@ -53,9 +53,9 @@ src/devices/nm-device-bond.c
src/devices/nm-device-bridge.c
src/devices/nm-device-ethernet.c
src/devices/nm-device-infiniband.c
src/devices/nm-device-olpc-mesh.c
src/devices/nm-device-team.c
src/devices/nm-device-vlan.c
src/devices/wifi/nm-device-olpc-mesh.c
src/devices/wwan/nm-modem-broadband.c
src/devices/wwan/nm-modem-old.c
src/nm-manager.c
......
......@@ -7,6 +7,7 @@ SUBDIRS = \
devices/adsl \
devices/wwan \
devices/bluetooth \
devices/wifi \
dhcp-manager \
ppp-manager \
settings/plugins
......@@ -78,8 +79,6 @@ nm_sources = \
devices/nm-device-infiniband.h \
devices/nm-device-macvlan.c \
devices/nm-device-macvlan.h \
devices/nm-device-olpc-mesh.c \
devices/nm-device-olpc-mesh.h \
devices/nm-device-private.h \
devices/nm-device-team.c \
devices/nm-device-team.h \
......@@ -91,8 +90,6 @@ nm_sources = \
devices/nm-device-vlan.h \
devices/nm-device-vxlan.c \
devices/nm-device-vxlan.h \
devices/nm-device-wifi.c \
devices/nm-device-wifi.h \
\
dhcp-manager/nm-dhcp-client.c \
dhcp-manager/nm-dhcp-client.h \
......@@ -241,10 +238,6 @@ nm_sources = \
nm-session-utils.h \
nm-sleep-monitor.h \
nm-types.h \
nm-wifi-ap-utils.c \
nm-wifi-ap-utils.h \
nm-wifi-ap.c \
nm-wifi-ap.h \
NetworkManagerUtils.c \
NetworkManagerUtils.h
......@@ -297,13 +290,11 @@ glue_sources = \
nm-device-gre-glue.h \
nm-device-infiniband-glue.h \
nm-device-macvlan-glue.h \
nm-device-olpc-mesh-glue.h \
nm-device-team-glue.h \
nm-device-tun-glue.h \
nm-device-veth-glue.h \
nm-device-vlan-glue.h \
nm-device-vxlan-glue.h \
nm-device-wifi-glue.h \
nm-dhcp4-config-glue.h \
nm-dhcp6-config-glue.h \
nm-ip4-config-glue.h \
......
include $(GLIB_MAKEFILE)
@GNOME_CODE_COVERAGE_RULES@
SUBDIRS=. tests
AM_CPPFLAGS = \
-I${top_srcdir}/src \
-I${top_builddir}/src \
-I${top_srcdir}/src/logging \
-I${top_srcdir}/src/devices \
-I${top_srcdir}/src/settings \
-I${top_srcdir}/src/platform \
-I${top_srcdir}/src/supplicant-manager \
-I${top_builddir}/include \
-I${top_srcdir}/include \
-I${top_builddir}/libnm-util \
-I${top_srcdir}/libnm-util \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(POLKIT_CFLAGS) \
$(LIBNL_CFLAGS) \
$(GUDEV_CFLAGS)
GLIB_GENERATED = nm-wifi-enum-types.h nm-wifi-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
nm_wifi_enum_types_sources = \
$(srcdir)/nm-device-wifi.h \
$(srcdir)/nm-wifi-ap.h \
$(srcdir)/nm-device-olpc-mesh.h
glue_sources = \
nm-device-wifi-glue.h \
nm-device-olpc-mesh-glue.h
%-glue.h: $(top_srcdir)/introspection/%.xml
$(AM_V_GEN) dbus-binding-tool --prefix=$(subst -,_,$(subst -glue.h,,$@)) --mode=glib-server --output=$@ $<
BUILT_SOURCES = $(GLIB_GENERATED) $(glue_sources)
pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la
libnm_device_plugin_wifi_la_SOURCES = \
nm-wifi-factory.c \
nm-device-wifi.c \
nm-device-wifi.h \
nm-wifi-ap.c \
nm-wifi-ap.h \
nm-wifi-ap-utils.c \
nm-wifi-ap-utils.h \
nm-device-olpc-mesh.c \
nm-device-olpc-mesh.h \
\
$(BUILT_SOURCES)
SYMBOL_VIS_FILE=$(srcdir)/exports.ver
libnm_device_plugin_wifi_la_LDFLAGS = \
-module -avoid-version \
-Wl,--version-script=$(SYMBOL_VIS_FILE)
libnm_device_plugin_wifi_la_LIBADD = \
$(DBUS_LIBS) \
$(GUDEV_LIBS)
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = $(SYMBOL_VIS_FILE)
if ENABLE_TESTS
check-local:
$(top_srcdir)/tools/check-exports.sh $(builddir)/.libs/libnm-device-plugin-wifi.so $(SYMBOL_VIS_FILE)
endif
{
global:
nm_device_factory_create;
nm_device_factory_get_device_type;
local:
*;
};
......@@ -26,7 +26,6 @@
#include <dbus/dbus.h>
#include <net/ethernet.h>
#include "nm-rfkill-manager.h"
#include "nm-device.h"
#include "nm-wifi-ap.h"
......@@ -58,7 +57,6 @@ typedef enum {
#define NM_DEVICE_WIFI_ACTIVE_ACCESS_POINT "active-access-point"
#define NM_DEVICE_WIFI_CAPABILITIES "wireless-capabilities"
#define NM_DEVICE_WIFI_SCANNING "scanning"
#define NM_DEVICE_WIFI_IPW_RFKILL_STATE "ipw-rfkill-state"
#ifndef NM_DEVICE_WIFI_DEFINED
#define NM_DEVICE_WIFI_DEFINED
......@@ -83,7 +81,6 @@ struct _NMDeviceWifiClass
/* Signals */
void (*access_point_added) (NMDeviceWifi *device, NMAccessPoint *ap);
void (*access_point_removed) (NMDeviceWifi *device, NMAccessPoint *ap);
void (*hidden_ap_found) (NMDeviceWifi *device, NMAccessPoint *ap);
gboolean (*scanning_allowed) (NMDeviceWifi *device);
};
......@@ -92,8 +89,6 @@ GType nm_device_wifi_get_type (void);
NMDevice *nm_device_wifi_new (NMPlatformLink *platform_device);
RfKillState nm_device_wifi_get_ipw_rfkill_state (NMDeviceWifi *self);
G_END_DECLS
#endif /* NM_DEVICE_WIFI_H */
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/* NetworkManager -- Network link manager
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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) 2011 - 2014 Red Hat, Inc.
*/
#include <gmodule.h>
#include "nm-device-factory.h"
#include "nm-device-wifi.h"
#include "nm-device-olpc-mesh.h"
#include "nm-settings-connection.h"
#define NM_TYPE_WIFI_FACTORY (nm_wifi_factory_get_type ())
#define NM_WIFI_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_WIFI_FACTORY, NMWifiFactory))
typedef struct {
GObject parent;
} NMWifiFactory;
typedef struct {
GObjectClass parent;
} NMWifiFactoryClass;
static GType nm_wifi_factory_get_type (void);
static void device_factory_interface_init (NMDeviceFactory *factory_iface);
G_DEFINE_TYPE_EXTENDED (NMWifiFactory, nm_wifi_factory, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (NM_TYPE_DEVICE_FACTORY, device_factory_interface_init))
enum {
PROP_0,
PROP_DEVICE_TYPE,
};
/**************************************************************************/
#define PLUGIN_TYPE NM_DEVICE_TYPE_WIFI
G_MODULE_EXPORT NMDeviceFactory *
nm_device_factory_create (GError **error)
{
return (NMDeviceFactory *) g_object_new (NM_TYPE_WIFI_FACTORY, NULL);
}
G_MODULE_EXPORT NMDeviceType
nm_device_factory_get_device_type (void)
{
return PLUGIN_TYPE;
}
/**************************************************************************/
static NMDevice *
new_link (NMDeviceFactory *factory, NMPlatformLink *plink, GError **error)
{
if (plink->type == NM_LINK_TYPE_WIFI)
return nm_device_wifi_new (plink);
else if (plink->type == NM_LINK_TYPE_OLPC_MESH)
return nm_device_olpc_mesh_new (plink);
return NULL;
}
static void
get_property (GObject *object, guint prop, GValue *value, GParamSpec *pspec)
{
switch (prop) {
case PROP_DEVICE_TYPE:
g_value_set_uint (value, PLUGIN_TYPE);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop, pspec);
break;
}
}
static void
device_factory_interface_init (NMDeviceFactory *factory_iface)
{
factory_iface->new_link = new_link;
}
static void
nm_wifi_factory_init (NMWifiFactory *self)
{
}
static void
nm_wifi_factory_class_init (NMWifiFactoryClass *wf_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (wf_class);
object_class->get_property = get_property;
g_object_class_override_property (object_class,
PROP_DEVICE_TYPE,
NM_DEVICE_FACTORY_DEVICE_TYPE);
}
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/logging \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/devices/wifi \
-I$(top_builddir)/src \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)
noinst_PROGRAMS = test-wifi-ap-utils
test_wifi_ap_utils_SOURCES = \
test-wifi-ap-utils.c \
$(srcdir)/../nm-wifi-ap.c \
$(srcdir)/../nm-wifi-ap.h \
$(srcdir)/../nm-wifi-ap-utils.c \
$(srcdir)/../nm-wifi-ap-utils.h
test_wifi_ap_utils_LDADD = $(top_builddir)/src/libNetworkManager.la
TESTS = test-wifi-ap-utils
......@@ -41,8 +41,6 @@
#include "nm-vpn-manager.h"
#include "nm-device.h"
#include "nm-device-ethernet.h"
#include "nm-device-wifi.h"
#include "nm-device-olpc-mesh.h"
#include "nm-device-infiniband.h"
#include "nm-device-bond.h"
#include "nm-device-team.h"
......@@ -168,7 +166,6 @@ typedef struct {
const char *key;
const char *prop;
const char *hw_prop;
RfKillState (*other_enabled_func) (NMManager *);
} RadioState;
typedef struct {
......@@ -1311,72 +1308,24 @@ manager_update_radio_enabled (NMManager *self,
}
static void
manager_hidden_ap_found (NMDevice *device,
NMAccessPoint *ap,
gpointer user_data)
{
NMManager *manager = NM_MANAGER (user_data);
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
const struct ether_addr *bssid;
GSList *iter;
GSList *connections;
gboolean done = FALSE;
g_return_if_fail (nm_ap_get_ssid (ap) == NULL);
bssid = nm_ap_get_address (ap);
g_assert (bssid);
/* Look for this AP's BSSID in the seen-bssids list of a connection,
* and if a match is found, copy over the SSID */
connections = nm_settings_get_connections (priv->settings);
for (iter = connections; iter && !done; iter = g_slist_next (iter)) {
NMConnection *connection = NM_CONNECTION (iter->data);
NMSettingWireless *s_wifi;
s_wifi = nm_connection_get_setting_wireless (connection);
if (s_wifi) {
if (nm_settings_connection_has_seen_bssid (NM_SETTINGS_CONNECTION (connection), bssid))
nm_ap_set_ssid (ap, nm_setting_wireless_get_ssid (s_wifi));
}
}
g_slist_free (connections);
}
static RfKillState
nm_manager_get_ipw_rfkill_state (NMManager *self)
update_rstate_from_rfkill (NMRfkillManager *rfkill_mgr, RadioState *rstate)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
GSList *iter;
RfKillState ipw_state = RFKILL_UNBLOCKED;
for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
NMDevice *candidate = NM_DEVICE (iter->data);
RfKillState candidate_state;
if (nm_device_get_device_type (candidate) == NM_DEVICE_TYPE_WIFI) {
candidate_state = nm_device_wifi_get_ipw_rfkill_state (NM_DEVICE_WIFI (candidate));
if (candidate_state > ipw_state)
ipw_state = candidate_state;
}
}
return ipw_state;
}
static void
update_rstate_from_rfkill (RadioState *rstate, RfKillState rfkill)
{
if (rfkill == RFKILL_UNBLOCKED) {
switch (nm_rfkill_manager_get_rfkill_state (rfkill_mgr, rstate->rtype)) {
case RFKILL_UNBLOCKED:
rstate->sw_enabled = TRUE;
rstate->hw_enabled = TRUE;
} else if (rfkill == RFKILL_SOFT_BLOCKED) {
break;
case RFKILL_SOFT_BLOCKED:
rstate->sw_enabled = FALSE;
rstate->hw_enabled = TRUE;
} else if (rfkill == RFKILL_HARD_BLOCKED) {
break;
case RFKILL_HARD_BLOCKED:
rstate->sw_enabled = FALSE;
rstate->hw_enabled = FALSE;
break;
default:
g_warn_if_reached ();
break;
}
}
......@@ -1386,29 +1335,14 @@ manager_rfkill_update_one_type (NMManager *self,
RfKillType rtype)
{
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
RfKillState udev_state = RFKILL_UNBLOCKED;
RfKillState other_state = RFKILL_UNBLOCKED;
RfKillState composite;
gboolean old_enabled, new_enabled, old_rfkilled, new_rfkilled, old_hwe;
old_enabled = radio_enabled_for_rstate (rstate, TRUE);
old_rfkilled = rstate->hw_enabled && rstate->sw_enabled;
old_hwe = rstate->hw_enabled;
udev_state = nm_rfkill_manager_get_rfkill_state (priv->rfkill_mgr, rtype);
if (rstate->other_enabled_func)
other_state = rstate->other_enabled_func (self);
/* The composite state is the "worst" of either udev or other states */
if (udev_state == RFKILL_HARD_BLOCKED || other_state == RFKILL_HARD_BLOCKED)
composite = RFKILL_HARD_BLOCKED;
else if (udev_state == RFKILL_SOFT_BLOCKED || other_state == RFKILL_SOFT_BLOCKED)
composite = RFKILL_SOFT_BLOCKED;
else
composite = RFKILL_UNBLOCKED;
update_rstate_from_rfkill (rstate, composite);
/* recheck kernel rfkill state */
update_rstate_from_rfkill (priv->rfkill_mgr, rstate);
/* Print out all states affecting device enablement */
if (rstate->desc) {
......@@ -1455,14 +1389,6 @@ nm_manager_rfkill_update (NMManager *self, RfKillType rtype)
}
}
static void
manager_ipw_rfkill_state_changed (NMDeviceWifi *device,
GParamSpec *pspec,
gpointer user_data)
{
nm_manager_rfkill_update (NM_MANAGER (user_data), RFKILL_TYPE_WLAN);
}
static void
device_auth_done_cb (NMAuthChain *chain,
GError *auth_error,
......@@ -1683,11 +1609,8 @@ add_device (NMManager *self, NMDevice *device, gboolean generate_con)
NMConnection *connection = NULL;
gboolean enabled = FALSE;
RfKillType rtype;
NMDeviceType devtype;
GSList *iter, *remove = NULL;
devtype = nm_device_get_device_type (device);
/* No duplicates */
if (nm_manager_get_device_by_udi (self, nm_device_get_udi (device)))
return;
......@@ -1728,22 +1651,6 @@ add_device (NMManager *self, NMDevice *device, gboolean generate_con)
self);
}
if (devtype == NM_DEVICE_TYPE_WIFI) {
/* Attach to the access-point-added signal so that the manager can fill
* non-SSID-broadcasting APs with an SSID.
*/
g_signal_connect (device, "hidden-ap-found",
G_CALLBACK (manager_hidden_ap_found),
self);
/* Hook up rfkill handling for ipw-based cards until they get converted
* to use the kernel's rfkill subsystem in 2.6.33.
*/
g_signal_connect (device, "notify::" NM_DEVICE_WIFI_IPW_RFKILL_STATE,
G_CALLBACK (manager_ipw_rfkill_state_changed),
self);
}
/* Update global rfkill state for this device type with the device's
* rfkill state, and then set this device's rfkill state based on the
* global state.
......@@ -2053,12 +1960,6 @@ platform_link_added (NMManager *self,
case NM_LINK_TYPE_INFINIBAND:
device = nm_device_infiniband_new (plink);
break;
case NM_LINK_TYPE_OLPC_MESH:
device = nm_device_olpc_mesh_new (plink);
break;
case NM_LINK_TYPE_WIFI:
device = nm_device_wifi_new (plink);
break;
case NM_LINK_TYPE_BOND:
device = nm_device_bond_new (plink);
break;
......@@ -4100,14 +4001,13 @@ nm_manager_start (NMManager *self)
/* Set initial radio enabled/disabled state */
for (i = 0; i < RFKILL_TYPE_MAX; i++) {
RadioState *rstate = &priv->radio_states[i];
RfKillState udev_state;
gboolean enabled;
if (!rstate->desc)
continue;
udev_state = nm_rfkill_manager_get_rfkill_state (priv->rfkill_mgr, i);
update_rstate_from_rfkill (rstate, udev_state);
/* recheck kernel rfkill state */
update_rstate_from_rfkill (priv->rfkill_mgr, rstate);
if (rstate->desc) {
nm_log_info (LOGD_RFKILL, "%s %s by radio killswitch; %s by state file",
......@@ -4730,7 +4630,6 @@ nm_manager_init (NMManager *manager)
priv->radio_states[RFKILL_TYPE_WLAN].prop = NM_MANAGER_WIRELESS_ENABLED;
priv->radio_states[RFKILL_TYPE_WLAN].hw_prop = NM_MANAGER_WIRELESS_HARDWARE_ENABLED;
priv->radio_states[RFKILL_TYPE_WLAN].desc = "WiFi";
priv->radio_states[RFKILL_TYPE_WLAN].other_enabled_func = nm_manager_get_ipw_rfkill_state;
priv->radio_states[RFKILL_TYPE_WLAN].rtype = RFKILL_TYPE_WLAN;
priv->radio_states[RFKILL_TYPE_WWAN].user_enabled = TRUE;
......@@ -4745,7 +4644,6 @@ nm_manager_init (NMManager *manager)
priv->radio_states[RFKILL_TYPE_WIMAX].prop = NM_MANAGER_WIMAX_ENABLED;
priv->radio_states[RFKILL_TYPE_WIMAX].hw_prop = NM_MANAGER_WIMAX_HARDWARE_ENABLED;
priv->radio_states[RFKILL_TYPE_WIMAX].desc = "WiMAX";
priv->radio_states[RFKILL_TYPE_WIMAX].other_enabled_func = NULL;
priv->radio_states[RFKILL_TYPE_WIMAX].rtype = RFKILL_TYPE_WIMAX;
for (i = 0; i < RFKILL_TYPE_MAX; i++)
......
......@@ -29,7 +29,6 @@
#include "nm-policy.h"
#include "NetworkManagerUtils.h"
#include "nm-wifi-ap.h"
#include "nm-activation-request.h"
#include "nm-logging.h"
#include "nm-device.h"
......
......@@ -564,8 +564,8 @@ link_type_from_udev (NMPlatform *platform, int ifindex, const char *ifname, int
if (!udev_device)
return_type (NM_LINK_TYPE_UNKNOWN, "unknown");
prop = g_udev_device_get_property (udev_device, "ID_NM_OLPC_MESH");
if (prop)
if ( g_udev_device_get_property (udev_device, "ID_NM_OLPC_MESH")
|| g_udev_device_get_sysfs_attr (udev_device, "anycast_mask"))
return_type (NM_LINK_TYPE_OLPC_MESH, "olpc-mesh");
prop = g_udev_device_get_property (udev_device, "DEVTYPE");
......@@ -623,6 +623,8 @@ ethtool_get_driver (const char *ifname)
{
struct ethtool_drvinfo drvinfo = { 0 };
g_return_val_if_fail (ifname != NULL, NULL);
drvinfo.cmd = ETHTOOL_GDRVINFO;
if (!ethtool_get (ifname, &drvinfo))
return NULL;
......@@ -665,13 +667,15 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, const char
const char *driver;
const char *ifname;
if (arptype == ARPHRD_LOOPBACK)
return_type (NM_LINK_TYPE_LOOPBACK, "loopback");
else if (arptype == ARPHRD_INFINIBAND)
return_type (NM_LINK_TYPE_INFINIBAND, "infiniband");
ifname = rtnl_link_get_name (rtnllink);
if (!ifname)
return_type (NM_LINK_TYPE_UNKNOWN, type);
if (arptype == 256) {
/* Some s390 CTC-type devices report 256 for the encapsulation type
* for some reason, but we need to call them Ethernet. FIXME: use
......@@ -1818,6 +1822,7 @@ link_change (NMPlatform *platform, int ifindex, struct rtnl_link *change)
if (!rtnllink)
return FALSE;
g_return_val_if_fail (rtnl_link_get_ifindex (change) > 0, FALSE);
nle = rtnl_link_change (priv->nlh, rtnllink, change, 0);
......@@ -1943,6 +1948,7 @@ link_change_flags (NMPlatform *platform, int ifindex, unsigned int flags, gboole
auto_nl_object struct rtnl_link *change = rtnl_link_alloc ();
g_return_val_if_fail (change != NULL, FALSE);
rtnl_link_set_ifindex (change, ifindex);
if (value)
rtnl_link_set_flags (change, flags);
......@@ -2093,6 +2099,7 @@ link_set_address (NMPlatform *platform, int ifindex, gconstpointer address, size
change = rtnl_link_alloc ();
g_return_val_if_fail (change, FALSE);
rtnl_link_set_ifindex (change, ifindex);
nladdr = nl_addr_build (AF_LLC, address, length);
g_return_val_if_fail (nladdr, FALSE);
......@@ -2129,6 +2136,7 @@ link_set_mtu (NMPlatform *platform, int ifindex, guint32 mtu)
auto_nl_object struct rtnl_link *change = rtnl_link_alloc ();
g_return_val_if_fail (change != NULL, FALSE);
rtnl_link_set_ifindex (change, ifindex);
rtnl_link_set_mtu (change, mtu);
debug ("link: change %d: mtu %lu", ifindex, (unsigned long)mtu);
......@@ -2240,6 +2248,7 @@ link_enslave (NMPlatform *platform, int master, int slave)
g_return_val_if_fail (change != NULL, FALSE);
rtnl_link_set_ifindex (change, slave);
rtnl_link_set_master (change, master);
debug ("link: change %d: enslave to master %d", slave, master);
......
......@@ -16,7 +16,6 @@ AM_CPPFLAGS = \
noinst_PROGRAMS = \
test-dhcp-options \
test-general \
test-wifi-ap-utils \
test-ip4-config \
test-ip6-config \
test-dcb \
......@@ -35,14 +34,6 @@ test_dhcp_options_CPPFLAGS = \
test_dhcp_options_LDADD = \
$(top_builddir)/src/libNetworkManager.la
####### wifi ap utils test #######
test_wifi_ap_utils_SOURCES = \
test-wifi-ap-utils.c
test_wifi_ap_utils_LDADD = \
$(top_builddir)/src/libNetworkManager.la
####### ip4 config test #######
test_ip4_config_SOURCES = \
......@@ -89,5 +80,5 @@ EXTRA_DIST = test-secret-agent.py
###########################################
TESTS = test-dhcp-options test-wifi-ap-utils test-ip4-config test-ip6-config test-dcb test-resolvconf-capture test-general
TESTS = test-dhcp-options test-ip4-config test-ip6-config test-dcb test-resolvconf-capture test-general
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment