diff options
author | Dan Williams <dcbw@redhat.com> | 2014-09-18 12:53:19 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-12-11 09:38:44 -0600 |
commit | e11610c9e6357f3a20125455134f0f6c0ac3f17b (patch) | |
tree | 07e2330d769ff540d35f53b6c15d773bfab44eae | |
parent | 05c780eb349a43ab59b523741e30f14ace3f2438 (diff) | |
download | NetworkManager-e11610c9e6357f3a20125455134f0f6c0ac3f17b.tar.gz |
platform: return link objects from add functions
-rw-r--r-- | src/devices/nm-device-bond.c | 2 | ||||
-rw-r--r-- | src/devices/nm-device-bridge.c | 3 | ||||
-rw-r--r-- | src/devices/nm-device-infiniband.c | 2 | ||||
-rw-r--r-- | src/devices/nm-device-vlan.c | 3 | ||||
-rw-r--r-- | src/devices/team/nm-device-team.c | 2 | ||||
-rw-r--r-- | src/platform/nm-fake-platform.c | 29 | ||||
-rw-r--r-- | src/platform/nm-linux-platform.c | 42 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 45 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 23 | ||||
-rw-r--r-- | src/platform/tests/platform.c | 10 | ||||
-rw-r--r-- | src/platform/tests/test-address.c | 2 | ||||
-rw-r--r-- | src/platform/tests/test-cleanup.c | 2 | ||||
-rw-r--r-- | src/platform/tests/test-link.c | 16 | ||||
-rw-r--r-- | src/platform/tests/test-route.c | 2 |
14 files changed, 124 insertions, 59 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index a4703c7a55..756e40556a 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -559,7 +559,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, iface = nm_connection_get_interface_name (connection); g_return_val_if_fail (iface != NULL, NULL); - if ( !nm_platform_bond_add (iface) + if ( !nm_platform_bond_add (iface, NULL) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { nm_log_warn (LOGD_DEVICE | LOGD_BOND, "(%s): failed to create bonding master interface for '%s': %s", iface, nm_connection_get_id (connection), diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 39b68b2b8d..77e19e8e60 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -520,7 +520,8 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, if ( !nm_platform_bridge_add (iface, mac_address_str ? mac_address : NULL, - mac_address_str ? ETH_ALEN : 0) + mac_address_str ? ETH_ALEN : 0, + NULL) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { nm_log_warn (LOGD_DEVICE | LOGD_BRIDGE, "(%s): failed to create bridge master interface for '%s': %s", iface, nm_connection_get_id (connection), diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c index 6aa4922ee4..5d949b084d 100644 --- a/src/devices/nm-device-infiniband.c +++ b/src/devices/nm-device-infiniband.c @@ -328,7 +328,7 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, parent_ifindex = nm_device_get_ifindex (parent); p_key = nm_setting_infiniband_get_p_key (s_infiniband); - if ( !nm_platform_infiniband_partition_add (parent_ifindex, p_key) + if ( !nm_platform_infiniband_partition_add (parent_ifindex, p_key, NULL) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { nm_log_warn (LOGD_DEVICE | LOGD_INFINIBAND, "(%s): failed to add InfiniBand P_Key interface for '%s': %s", iface, nm_connection_get_id (connection), diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index c2488ed205..9013e495a9 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -665,7 +665,8 @@ create_virtual_device_for_connection (NMDeviceFactory *factory, if ( !nm_platform_vlan_add (iface, nm_device_get_ifindex (parent), nm_setting_vlan_get_id (s_vlan), - nm_setting_vlan_get_flags (s_vlan)) + nm_setting_vlan_get_flags (s_vlan), + NULL) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { nm_log_warn (LOGD_DEVICE | LOGD_VLAN, "(%s) failed to add VLAN interface for '%s'", iface, nm_connection_get_id (connection)); diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 3c949258c0..5d55aad64f 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -663,7 +663,7 @@ nm_device_team_new_for_connection (NMConnection *connection, GError **error) iface = nm_connection_get_interface_name (connection); g_return_val_if_fail (iface != NULL, NULL); - if ( !nm_platform_team_add (iface) + if ( !nm_platform_team_add (iface, NULL) && nm_platform_get_error () != NM_PLATFORM_ERROR_EXISTS) { g_set_error (error, NM_DEVICE_ERROR, diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c index a5eb7d4ed3..9bfad4a8de 100644 --- a/src/platform/nm-fake-platform.c +++ b/src/platform/nm-fake-platform.c @@ -175,7 +175,12 @@ _nm_platform_link_get (NMPlatform *platform, int ifindex, NMPlatformLink *l) } static gboolean -link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *address, size_t address_len) +link_add (NMPlatform *platform, + const char *name, + NMLinkType type, + const void *address, + size_t address_len, + NMPlatformLink *out_link) { NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform); NMFakePlatformLink device; @@ -187,6 +192,8 @@ link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *a if (device.link.ifindex) g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_LINK_CHANGED, device.link.ifindex, &device, NM_PLATFORM_SIGNAL_ADDED, NM_PLATFORM_REASON_INTERNAL); + if (out_link) + *out_link = device.link; return TRUE; } @@ -576,11 +583,11 @@ slave_get_option (NMPlatform *platform, int slave, const char *option) } static gboolean -vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint32 vlan_flags) +vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint32 vlan_flags, NMPlatformLink *out_link) { NMFakePlatformLink *device; - if (!link_add (platform, name, NM_LINK_TYPE_VLAN, NULL, 0)) + if (!link_add (platform, name, NM_LINK_TYPE_VLAN, NULL, 0, NULL)) return FALSE; device = link_get (platform, link_get_ifindex (platform, name)); @@ -590,6 +597,8 @@ vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint device->vlan_id = vlan_id; device->link.parent = parent; + if (out_link) + *out_link = device->link; return TRUE; } @@ -621,7 +630,7 @@ vlan_set_egress_map (NMPlatform *platform, int ifindex, int from, int to) } static gboolean -infiniband_partition_add (NMPlatform *platform, int parent, int p_key) +infiniband_partition_add (NMPlatform *platform, int parent, int p_key, NMPlatformLink *out_link) { NMFakePlatformLink *parent_device; char *name; @@ -631,7 +640,7 @@ infiniband_partition_add (NMPlatform *platform, int parent, int p_key) g_return_val_if_fail (parent_device != NULL, FALSE); name = g_strdup_printf ("%s.%04x", parent_device->link.name, p_key); - success = link_add (platform, name, NM_LINK_TYPE_INFINIBAND, NULL, 0); + success = link_add (platform, name, NM_LINK_TYPE_INFINIBAND, NULL, 0, out_link); g_free (name); return success; @@ -1227,15 +1236,15 @@ static gboolean setup (NMPlatform *platform) { /* skip zero element */ - link_add (platform, NULL, NM_LINK_TYPE_NONE, NULL, 0); + link_add (platform, NULL, NM_LINK_TYPE_NONE, NULL, 0, NULL); /* add loopback interface */ - link_add (platform, "lo", NM_LINK_TYPE_LOOPBACK, NULL, 0); + link_add (platform, "lo", NM_LINK_TYPE_LOOPBACK, NULL, 0, NULL); /* add some ethernets */ - link_add (platform, "eth0", NM_LINK_TYPE_ETHERNET, NULL, 0); - link_add (platform, "eth1", NM_LINK_TYPE_ETHERNET, NULL, 0); - link_add (platform, "eth2", NM_LINK_TYPE_ETHERNET, NULL, 0); + link_add (platform, "eth0", NM_LINK_TYPE_ETHERNET, NULL, 0, NULL); + link_add (platform, "eth1", NM_LINK_TYPE_ETHERNET, NULL, 0, NULL); + link_add (platform, "eth2", NM_LINK_TYPE_ETHERNET, NULL, 0, NULL); return TRUE; } diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 5d1522ce98..b40aa5a336 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -2248,7 +2248,25 @@ build_rtnl_link (int ifindex, const char *name, NMLinkType type) } static gboolean -link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *address, size_t address_len) +link_get_by_name (NMPlatform *platform, const char *name, NMPlatformLink *out_link) +{ + int ifindex; + + if (out_link) { + ifindex = nm_platform_link_get_ifindex (name); + g_return_val_if_fail (ifindex > 0, FALSE); + return _nm_platform_link_get (platform, ifindex, out_link); + } + return TRUE; +} + +static gboolean +link_add (NMPlatform *platform, + const char *name, + NMLinkType type, + const void *address, + size_t address_len, + NMPlatformLink *out_link) { int r; struct nl_object *l; @@ -2277,7 +2295,11 @@ link_add (NMPlatform *platform, const char *name, NMLinkType type, const void *a rtnl_link_set_addr ((struct rtnl_link *) l, nladdr); } - return add_object (platform, l); + + if (!add_object (platform, l)) + return FALSE; + + return link_get_by_name (platform, name, out_link); } static struct rtnl_link * @@ -2691,7 +2713,12 @@ link_get_physical_port_id (NMPlatform *platform, int ifindex) } static int -vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint32 vlan_flags) +vlan_add (NMPlatform *platform, + const char *name, + int parent, + int vlan_id, + guint32 vlan_flags, + NMPlatformLink *out_link) { struct nl_object *object = build_rtnl_link (0, name, NM_LINK_TYPE_VLAN); struct rtnl_link *rtnllink = (struct rtnl_link *) object; @@ -2712,7 +2739,10 @@ vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint debug ("link: add vlan '%s', parent %d, vlan id %d, flags %X (native: %X)", name, parent, vlan_id, (unsigned int) vlan_flags, kernel_flags); - return add_object (platform, object); + if (!add_object (platform, object)) + return FALSE; + + return link_get_by_name (platform, name, out_link); } static gboolean @@ -2873,7 +2903,7 @@ slave_get_option (NMPlatform *platform, int slave, const char *option) } static gboolean -infiniband_partition_add (NMPlatform *platform, int parent, int p_key) +infiniband_partition_add (NMPlatform *platform, int parent, int p_key, NMPlatformLink *out_link) { const char *parent_name; char *path, *id; @@ -2893,6 +2923,8 @@ infiniband_partition_add (NMPlatform *platform, int parent, int p_key) auto_nl_object struct rtnl_link *rtnllink = _nm_rtnl_link_alloc (0, ifname); success = refresh_object (platform, (struct nl_object *) rtnllink, FALSE, NM_PLATFORM_REASON_INTERNAL); + if (success) + success = link_get_by_name (platform, ifname, out_link); } return success; diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 14fc44c5fa..ffcac8a5e1 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -484,13 +484,18 @@ nm_platform_link_get (int ifindex, NMPlatformLink *link) * @type: Interface type * @address: (allow-none): set the mac address of the link * @address_len: the length of the @address + * @out_link: on success, the link object * * Add a software interface. Sets platform->error to NM_PLATFORM_ERROR_EXISTS * if interface is already already exists. Any link-changed ADDED signal will be * emitted directly, before this function finishes. */ static gboolean -nm_platform_link_add (const char *name, NMLinkType type, const void *address, size_t address_len) +nm_platform_link_add (const char *name, + NMLinkType type, + const void *address, + size_t address_len, + NMPlatformLink *out_link) { reset_error (); @@ -504,22 +509,23 @@ nm_platform_link_add (const char *name, NMLinkType type, const void *address, si return FALSE; } - return klass->link_add (platform, name, type, address, address_len); + return klass->link_add (platform, name, type, address, address_len, out_link); } /** * nm_platform_dummy_add: * @name: New interface name + * @out_link: on success, the link object * * Create a software ethernet-like interface */ gboolean -nm_platform_dummy_add (const char *name) +nm_platform_dummy_add (const char *name, NMPlatformLink *out_link) { g_return_val_if_fail (name, FALSE); debug ("link: adding dummy '%s'", name); - return nm_platform_link_add (name, NM_LINK_TYPE_DUMMY, NULL, 0); + return nm_platform_link_add (name, NM_LINK_TYPE_DUMMY, NULL, 0, out_link); } /** @@ -1075,40 +1081,46 @@ nm_platform_link_get_master (int slave) * @name: New interface name * @address: (allow-none): set the mac address of the new bridge * @address_len: the length of the @address + * @out_link: on success, the link object * * Create a software bridge. */ gboolean -nm_platform_bridge_add (const char *name, const void *address, size_t address_len) +nm_platform_bridge_add (const char *name, + const void *address, + size_t address_len, + NMPlatformLink *out_link) { debug ("link: adding bridge '%s'", name); - return nm_platform_link_add (name, NM_LINK_TYPE_BRIDGE, address, address_len); + return nm_platform_link_add (name, NM_LINK_TYPE_BRIDGE, address, address_len, out_link); } /** * nm_platform_bond_add: * @name: New interface name + * @out_link: on success, the link object * * Create a software bonding device. */ gboolean -nm_platform_bond_add (const char *name) +nm_platform_bond_add (const char *name, NMPlatformLink *out_link) { debug ("link: adding bond '%s'", name); - return nm_platform_link_add (name, NM_LINK_TYPE_BOND, NULL, 0); + return nm_platform_link_add (name, NM_LINK_TYPE_BOND, NULL, 0, out_link); } /** * nm_platform_team_add: * @name: New interface name + * @out_link: on success, the link object * * Create a software teaming device. */ gboolean -nm_platform_team_add (const char *name) +nm_platform_team_add (const char *name, NMPlatformLink *out_link) { debug ("link: adding team '%s'", name); - return nm_platform_link_add (name, NM_LINK_TYPE_TEAM, NULL, 0); + return nm_platform_link_add (name, NM_LINK_TYPE_TEAM, NULL, 0, out_link); } /** @@ -1116,11 +1128,16 @@ nm_platform_team_add (const char *name) * @name: New interface name * @vlanid: VLAN identifier * @vlanflags: VLAN flags from libnm + * @out_link: on success, the link object * * Create a software VLAN device. */ gboolean -nm_platform_vlan_add (const char *name, int parent, int vlanid, guint32 vlanflags) +nm_platform_vlan_add (const char *name, + int parent, + int vlanid, + guint32 vlanflags, + NMPlatformLink *out_link) { reset_error (); @@ -1138,7 +1155,7 @@ nm_platform_vlan_add (const char *name, int parent, int vlanid, guint32 vlanflag debug ("link: adding vlan '%s' parent %d vlanid %d vlanflags %x", name, parent, vlanid, vlanflags); - return klass->vlan_add (platform, name, parent, vlanid, vlanflags); + return klass->vlan_add (platform, name, parent, vlanid, vlanflags, out_link); } gboolean @@ -1235,7 +1252,7 @@ nm_platform_vlan_set_egress_map (int ifindex, int from, int to) } gboolean -nm_platform_infiniband_partition_add (int parent, int p_key) +nm_platform_infiniband_partition_add (int parent, int p_key, NMPlatformLink *out_link) { const char *parent_name; char *name; @@ -1261,7 +1278,7 @@ nm_platform_infiniband_partition_add (int parent, int p_key) } g_free (name); - return klass->infiniband_partition_add (platform, parent, p_key); + return klass->infiniband_partition_add (platform, parent, p_key, out_link); } gboolean diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 848f78e428..452525a8b2 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -342,7 +342,12 @@ typedef struct { gboolean (*link_get) (NMPlatform *platform, int ifindex, NMPlatformLink *link); GArray *(*link_get_all) (NMPlatform *); - gboolean (*link_add) (NMPlatform *, const char *name, NMLinkType type, const void *address, size_t address_len); + gboolean (*link_add) (NMPlatform *, + const char *name, + NMLinkType type, + const void *address, + size_t address_len, + NMPlatformLink *out_link); gboolean (*link_delete) (NMPlatform *, int ifindex); int (*link_get_ifindex) (NMPlatform *, const char *name); const char *(*link_get_name) (NMPlatform *, int ifindex); @@ -381,12 +386,12 @@ typedef struct { gboolean (*slave_set_option) (NMPlatform *, int ifindex, const char *option, const char *value); char * (*slave_get_option) (NMPlatform *, int ifindex, const char *option); - gboolean (*vlan_add) (NMPlatform *, const char *name, int parent, int vlanid, guint32 vlanflags); + gboolean (*vlan_add) (NMPlatform *, const char *name, int parent, int vlanid, guint32 vlanflags, NMPlatformLink *out_link); gboolean (*vlan_get_info) (NMPlatform *, int ifindex, int *parent, int *vlan_id); gboolean (*vlan_set_ingress_map) (NMPlatform *, int ifindex, int from, int to); gboolean (*vlan_set_egress_map) (NMPlatform *, int ifindex, int from, int to); - gboolean (*infiniband_partition_add) (NMPlatform *, int parent, int p_key); + gboolean (*infiniband_partition_add) (NMPlatform *, int parent, int p_key, NMPlatformLink *out_link); gboolean (*veth_get_properties) (NMPlatform *, int ifindex, NMPlatformVethProperties *properties); gboolean (*tun_get_properties) (NMPlatform *, int ifindex, NMPlatformTunProperties *properties); @@ -482,10 +487,10 @@ gint64 nm_platform_sysctl_get_int_checked (const char *path, guint base, gint64 gboolean nm_platform_link_get (int ifindex, NMPlatformLink *link); GArray *nm_platform_link_get_all (void); -gboolean nm_platform_dummy_add (const char *name); -gboolean nm_platform_bridge_add (const char *name, const void *address, size_t address_len); -gboolean nm_platform_bond_add (const char *name); -gboolean nm_platform_team_add (const char *name); +gboolean nm_platform_dummy_add (const char *name, NMPlatformLink *out_link); +gboolean nm_platform_bridge_add (const char *name, const void *address, size_t address_len, NMPlatformLink *out_link); +gboolean nm_platform_bond_add (const char *name, NMPlatformLink *out_link); +gboolean nm_platform_team_add (const char *name, NMPlatformLink *out_link); gboolean nm_platform_link_exists (const char *name); gboolean nm_platform_link_delete (int ifindex); int nm_platform_link_get_ifindex (const char *name); @@ -527,12 +532,12 @@ char *nm_platform_master_get_option (int ifindex, const char *option); gboolean nm_platform_slave_set_option (int ifindex, const char *option, const char *value); char *nm_platform_slave_get_option (int ifindex, const char *option); -gboolean nm_platform_vlan_add (const char *name, int parent, int vlanid, guint32 vlanflags); +gboolean nm_platform_vlan_add (const char *name, int parent, int vlanid, guint32 vlanflags, NMPlatformLink *out_link); gboolean nm_platform_vlan_get_info (int ifindex, int *parent, int *vlanid); gboolean nm_platform_vlan_set_ingress_map (int ifindex, int from, int to); gboolean nm_platform_vlan_set_egress_map (int ifindex, int from, int to); -gboolean nm_platform_infiniband_partition_add (int parent, int p_key); +gboolean nm_platform_infiniband_partition_add (int parent, int p_key, NMPlatformLink *out_link); gboolean nm_platform_veth_get_properties (int ifindex, NMPlatformVethProperties *properties); gboolean nm_platform_tun_get_properties (int ifindex, NMPlatformTunProperties *properties); diff --git a/src/platform/tests/platform.c b/src/platform/tests/platform.c index eea6610d37..935e00cd6f 100644 --- a/src/platform/tests/platform.c +++ b/src/platform/tests/platform.c @@ -93,25 +93,25 @@ do_link_get_all (char **argv) static gboolean do_dummy_add (char **argv) { - return nm_platform_dummy_add (argv[0]); + return nm_platform_dummy_add (argv[0], NULL); } static gboolean do_bridge_add (char **argv) { - return nm_platform_bridge_add (argv[0], NULL, 0); + return nm_platform_bridge_add (argv[0], NULL, 0, NULL); } static gboolean do_bond_add (char **argv) { - return nm_platform_bond_add (argv[0]); + return nm_platform_bond_add (argv[0], NULL); } static gboolean do_team_add (char **argv) { - return nm_platform_team_add (argv[0]); + return nm_platform_team_add (argv[0], NULL); } static gboolean @@ -122,7 +122,7 @@ do_vlan_add (char **argv) int vlanid = strtol (*argv++, NULL, 10); guint32 vlan_flags = strtol (*argv++, NULL, 10); - return nm_platform_vlan_add (name, parent, vlanid, vlan_flags); + return nm_platform_vlan_add (name, parent, vlanid, vlan_flags, NULL); } static gboolean diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c index 3ef13b8ec3..b8c6dcc100 100644 --- a/src/platform/tests/test-address.c +++ b/src/platform/tests/test-address.c @@ -253,7 +253,7 @@ setup_tests (void) nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME)); g_assert (!nm_platform_link_exists (DEVICE_NAME)); - g_assert (nm_platform_dummy_add (DEVICE_NAME)); + g_assert (nm_platform_dummy_add (DEVICE_NAME, NULL)); accept_signal (link_added); free_signal (link_added); diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c index afbb438cca..9b974e6c0f 100644 --- a/src/platform/tests/test-cleanup.c +++ b/src/platform/tests/test-cleanup.c @@ -35,7 +35,7 @@ test_cleanup_internal (void) inet_pton (AF_INET6, "2001:db8:e:f:1:2:3:4", &gateway6); /* Create and set up device */ - g_assert (nm_platform_dummy_add (DEVICE_NAME)); + g_assert (nm_platform_dummy_add (DEVICE_NAME, NULL)); accept_signal (link_added); free_signal (link_added); g_assert (nm_platform_link_set_up (nm_platform_link_get_ifindex (DEVICE_NAME))); diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c index 8bd2ef44d4..8ddae35bbd 100644 --- a/src/platform/tests/test-link.c +++ b/src/platform/tests/test-link.c @@ -90,13 +90,13 @@ software_add (NMLinkType link_type, const char *name) { switch (link_type) { case NM_LINK_TYPE_DUMMY: - return nm_platform_dummy_add (name); + return nm_platform_dummy_add (name, NULL); case NM_LINK_TYPE_BRIDGE: - return nm_platform_bridge_add (name, NULL, 0); + return nm_platform_bridge_add (name, NULL, 0, NULL); case NM_LINK_TYPE_BOND: { gboolean bond0_exists = nm_platform_link_exists ("bond0"); - gboolean result = nm_platform_bond_add (name); + gboolean result = nm_platform_bond_add (name, NULL); NMPlatformError error = nm_platform_get_error (); /* Check that bond0 is *not* automatically created. */ @@ -107,14 +107,14 @@ software_add (NMLinkType link_type, const char *name) return result; } case NM_LINK_TYPE_TEAM: - return nm_platform_team_add (name); + return nm_platform_team_add (name, NULL); case NM_LINK_TYPE_VLAN: { SignalData *parent_added; SignalData *parent_changed; /* Don't call link_callback for the bridge interface */ parent_added = add_signal_ifname (NM_PLATFORM_SIGNAL_LINK_CHANGED, NM_PLATFORM_SIGNAL_ADDED, link_callback, PARENT_NAME); - if (nm_platform_bridge_add (PARENT_NAME, NULL, 0)) + if (nm_platform_bridge_add (PARENT_NAME, NULL, 0, NULL)) accept_signal (parent_added); free_signal (parent_added); @@ -126,7 +126,7 @@ software_add (NMLinkType link_type, const char *name) accept_signal (parent_changed); free_signal (parent_changed); - return nm_platform_vlan_add (name, parent_ifindex, VLAN_ID, 0); + return nm_platform_vlan_add (name, parent_ifindex, VLAN_ID, 0, NULL); } } default: @@ -403,12 +403,12 @@ test_internal (void) error (NM_PLATFORM_ERROR_NOT_FOUND); /* Add device */ - g_assert (nm_platform_dummy_add (DEVICE_NAME)); + g_assert (nm_platform_dummy_add (DEVICE_NAME, NULL)); no_error (); accept_signal (link_added); /* Try to add again */ - g_assert (!nm_platform_dummy_add (DEVICE_NAME)); + g_assert (!nm_platform_dummy_add (DEVICE_NAME, NULL)); error (NM_PLATFORM_ERROR_EXISTS); /* Check device index, name and type */ diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index ea238f5d6c..54f084b49d 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -246,7 +246,7 @@ setup_tests (void) nm_platform_link_delete (nm_platform_link_get_ifindex (DEVICE_NAME)); g_assert (!nm_platform_link_exists (DEVICE_NAME)); - g_assert (nm_platform_dummy_add (DEVICE_NAME)); + g_assert (nm_platform_dummy_add (DEVICE_NAME, NULL)); accept_signal (link_added); free_signal (link_added); |