core: fix compat VLAN interface addition when interface already exists

If the interface already exists, the compat code would fail.  Fix that
and clean up the function.  Also double-check that an existing VLAN
interface that has the name we expect also has the master and VLAN
ID we expect.
This commit is contained in:
Dan Williams
2012-08-06 13:05:05 -05:00
parent 82f4fd6545
commit f3b7e71b34
2 changed files with 82 additions and 52 deletions

View File

@@ -1038,6 +1038,7 @@ nm_utils_is_uuid (const char *str)
char *
nm_utils_new_vlan_name (const char *parent_iface, guint32 vlan_id)
{
/* Basically VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD */
return g_strdup_printf ("%s.%d", parent_iface, vlan_id);
}