core: fuzzier matching of generated connections to persistent ones

When generating a connection, if the device has no non-link-local IPv6
address, then it's unclear whether (a) the connection was link-local
originally, or (b) the connection was 'auto' but IPv6 failed or timed
out.

In this case, if there is a persistent connection that is 'auto' but
the generated connection is 'link-local', the persistent connection
should be used.

Add a more-testable framework for doing the connection matching to
handle this.
This commit is contained in:
Dan Williams
2013-11-15 13:09:12 -06:00
parent 75d694db9b
commit befa9083e8
5 changed files with 124 additions and 24 deletions

View File

@@ -31,6 +31,7 @@
#include "nm-ip6-config.h"
#include "nm-setting-ip6-config.h"
#include "nm-connection.h"
#include "nm-setting-private.h"
gboolean nm_ethernet_address_is_valid (const struct ether_addr *test_addr);
@@ -86,4 +87,11 @@ char *nm_utils_new_vlan_name (const char *parent_iface, guint32 vlan_id);
GPtrArray *nm_utils_read_resolv_conf_nameservers (const char *rc_contents);
typedef gboolean (NMUtilsMatchFilterFunc) (NMConnection *connection, gpointer user_data);
NMConnection *nm_utils_match_connection (GSList *connections,
NMConnection *original,
NMUtilsMatchFilterFunc match_filter_func,
gpointer match_filter_data);
#endif /* NETWORK_MANAGER_UTILS_H */