Commit graph

11446 commits

Author SHA1 Message Date
Thomas Haller
273576b01c ifcfg-rh: fix memleaks in reader
(cherry picked from commit 53796f0beb)
2015-03-13 11:50:04 +01:00
Thomas Haller
856962cea8 ifcfg-rh: fix memleak due to make_wpa_setting() returning both wsec and error
==10501== 353 (32 direct, 321 indirect) bytes in 1 blocks are definitely lost in loss record 1,579 of 1,641
    ==10501==    at 0x7EE3728: g_type_create_instance (gtype.c:1847)
    ==10501==    by 0x7EC75B4: g_object_new_internal (gobject.c:1746)
    ==10501==    by 0x7EC945C: g_object_newv (gobject.c:1890)
    ==10501==    by 0x7EC9C23: g_object_new (gobject.c:1556)
    ==10501==    by 0x1CD87C: nm_setting_wireless_security_new (nm-setting-wireless-security.c:122)
    ==10501==    by 0x16F70B: make_wpa_setting (reader.c:3010)
    ==10501==    by 0x16F33F: make_wireless_security_setting (reader.c:3188)
    ==10501==    by 0x161F4C: wireless_connection_from_ifcfg (reader.c:3464)
    ==10501==    by 0x16109A: connection_from_file_full (reader.c:4763)
    ==10501==    by 0x1614EE: connection_from_file_test (reader.c:4862)
    ==10501==    by 0x13D1D6: test_read_wifi_wpa_psk_unquoted2 (test-ifcfg-rh.c:4316)
    ==10501==    by 0x1281FD: main (test-ifcfg-rh.c:12513)
    ==10501==

(cherry picked from commit fcfd8f487a)
2015-03-13 11:50:04 +01:00
Thomas Haller
2ceea73dc3 ifcfg-rh: fix memleak in svSetValue()
(cherry picked from commit 98a0299265)
2015-03-13 11:50:04 +01:00
Thomas Haller
3e1055d141 ibft: fix memleak in read_ibft_blocks()
(cherry picked from commit 494c5c395d)
2015-03-13 11:50:04 +01:00
Thomas Haller
410a22b28f keyfile: fix memleak in parity_parser()
(cherry picked from commit 9d8f93384a)
2015-03-13 11:50:03 +01:00
Thomas Haller
74d44dd563 config: fix memleak in read_config()
(cherry picked from commit b49fdae59e)

Conflicts:
	src/nm-config.c
2015-03-13 11:50:03 +01:00
Thomas Haller
63a23439ee libnm-util: only unref and don't destroy hash in nm_connection_to_hash()
The returned hash from nm_connection_to_hash() used to destroy the
nested hashes, instead of only unrefing them.

(cherry picked from commit 027ab3efaa)
2015-03-13 11:50:03 +01:00
Thomas Haller
5ab76d006e libnm: fix memleak in _nm_dbus_bind_properties()
(cherry picked from commit 1567a9f712)
2015-03-13 11:50:03 +01:00
Thomas Haller
590334754d libnm: fix memleaks in nm_setting_802_1x
(cherry picked from commit 137e496ef1)
2015-03-13 11:50:03 +01:00
Thomas Haller
44df4f213f libnm: fix memleak in nm_setting_wired_get_s390_option() and refactor
@keys was leaked. Also refactor the function to iterate the hash only
once.

(cherry picked from commit 7a82d64e47)
2015-03-13 11:50:03 +01:00
Thomas Haller
1784de7b35 libnm: fix memleak in find_virtual_interface_name()
(cherry picked from commit f1bfe459ee)
2015-03-13 11:50:03 +01:00
Thomas Haller
727edf43f6 libnm: fix memleak in nm_connection_replace_settings()
(cherry picked from commit fffd93b5c4)
2015-03-13 11:50:03 +01:00
Thomas Haller
ec07ac40aa libnm: fix memleak in nm_utils_ip_addresses_from_variant()
(cherry picked from commit 66be46309a)
2015-03-13 11:50:03 +01:00
Thomas Haller
88855bbbeb libnm: fix memleak for config in NMSettingTeamPort
(cherry picked from commit 8cb6d70e5b)
2015-03-13 11:50:03 +01:00
Thomas Haller
f5f3ac6537 libnm: fix memleak for app_fcoe_mode in NMSettingDcb
(cherry picked from commit 052198f4b9)
2015-03-13 11:50:03 +01:00
Thomas Haller
ce7bdc0ac5 cli: fix memleak in nmc_setting_get_valid_properties()
(cherry picked from commit fdd09340ce)
2015-03-13 11:50:03 +01:00
Dan Williams
6e77c1ba2f device: don't assume valid ip4/ip6 config in nm_device_get_ipX_route_metric()
These functions will sometimes get called on updates to the device's IP
config due to external changes, or when addresses get flushed from the
device when activating it.  If the device is a slave device, then at
this point its NMConnection won't have an IP settings.  Suppress the
warning that gets printed when s_ip == NULL, because it's expected.

(cherry picked from commit d2de83e0f7)
2015-03-12 15:06:40 -05:00
Dan Williams
a8833a4dbd device: fix handling if DHCP hostname for configure-and-quit
Fixes: 5149fd120d
(cherry picked from commit 1dae47e9cc)
2015-03-12 14:38:58 -05:00
Jiří Klimeš
2da6daea17 cli: fix memory leaks when asking for arguments
(cherry picked from commit ae3f452994)

Conflicts:
	clients/cli/connections.c
2015-03-12 16:59:46 +01:00
Thomas Haller
4da3c8e1fa settings: merge branch 'th/uuid-duplicate-rh1171751'
https://bugzilla.redhat.com/show_bug.cgi?id=1171751

(cherry picked from commit 29eb46b126)
2015-03-11 17:08:15 +01:00
Thomas Haller
06b3e3ae6b settings: update year in copyright text of plugin-info for keyfile and ifcfg-rh
(cherry picked from commit 4475f59bce)
2015-03-11 17:07:56 +01:00
Thomas Haller
76ee139107 ifcfg-rh: don't reload connection in connection_ifcfg_changed() if monitoring is not enabled
This was not really an error, because NMIfcfgConnection would not
watch the files if monitoring is not enabled. Still do it, because
it feels more correct.

(cherry picked from commit 236226a590)
2015-03-11 17:07:56 +01:00
Thomas Haller
581caca9f2 ifcfg-rh: refactor update_connection()
Make update_connection() analogous to keyfiles implementation.
Effectively merge _internal_new_connection() and update_connection()
-- previously connection_new_or_changed().

https://bugzilla.redhat.com/show_bug.cgi?id=1171751
(cherry picked from commit 0c6349c627)
2015-03-11 17:07:56 +01:00
Thomas Haller
4b5d3f160d ifcfg-rh: sort paths in read_connections()
Presort the files in read_connections() as we do it
for keyfile.

This alone has not much consequences. Do this patch first, to
keep the next patches more self-contained.

(cherry picked from commit 0cf00ff3aa)
2015-03-11 17:07:56 +01:00
Thomas Haller
d6bd8cc496 ifcfg-rh/trivial: rename connection_new_or_changed() and variable
The ifcfg-rh implementation should be similar to the one from keyfile.
Rename the variables and function that have the same meaning.
Do this trivial commit first, before starting refactoring.

(cherry picked from commit a609dd12d3)
2015-03-11 17:07:56 +01:00
Thomas Haller
0516b55de2 ifcfg-rh: add logging macros _LOGX() to plugin.c
(cherry picked from commit bbaa243e31)
2015-03-11 17:07:55 +01:00
Thomas Haller
7510e67f0a settings: avoid duplicate UUID in settings
When adding a connection to NMSettings we did not check for
duplicate connection UUIDs (which could for example happen
if two different plugins report a conflicting UUID).
Also, we would not check that an already added connection
changes it's UUID.

Both could lead to have duplicate connections (by UUID).

Avoid that two ways:
- when adding a connection to NMSettings, ensure that we don't add
  a conflicting UUID. Otherwise just bail out and do nothing.
- when modifying a connection that is already added to NMSettings,
  enforce that the UUID cannot change. Otherwise fail with error.

For ifcfg-rh plugin this situation still can happen during reload.
In this case error out and refuse to update the connection. After
all, the user configured invalid UUIDs.

https://bugzilla.redhat.com/show_bug.cgi?id=1171751
(cherry picked from commit 7b807b11cc)
2015-03-11 17:07:55 +01:00
Thomas Haller
6cd264b0d5 keyfile: ignore GFileMonitor change flags in dir_changed()
When writing a file (for example with `sed -i`) a temporary file
might be created and removed quickly. This causes spurious events
in dir_changed().

(cherry picked from commit 8ba8a55cfa)
2015-03-11 17:07:55 +01:00
Thomas Haller
8c97626918 keyfile: reuse duplicate check from update_connection() in add_connection()
Also during add_connection() we must take special care of not "adding" a
connection with a conflicting UUID. In that case we want to fallback to
"update".

update_connection() already does all the checks, so call
update_connection() from add_connection().

(cherry picked from commit db5c4ce64f)
2015-03-11 17:07:55 +01:00
Thomas Haller
84353078c1 keyfile: cleanup logging
Log lines with a "keyfile:" prefix and show more information about
the loaded connection. Especially printing the UUID is interesting.

(cherry picked from commit 5c2fa92099)
2015-03-11 17:07:55 +01:00
Thomas Haller
1b0fd9fae0 keyfile: read_connections() must skip duplicate connections
If there are keyfiles with duplicate UUIDs, read_connections()
would iterate over the files, loading them as they appear and
overwriting duplicate connections that were just loaded.

For example, have keyfiles 'A' and 'B' with the same UUID.
On start, NM might first load 'A', then 'B'. 'B' would replace the
content of 'A' which was just loaded.
On reload, NM would first overwrite 'B' with 'A', and then again
overwriting 'A' with 'B'.

Fix that by accept the first found connection and don't overwrite
it during the same read_connections() run.

Also sort the files by file modification timestamp so that we
get a reproducible and sensible behavior.

(cherry picked from commit 8a4e64c6aa)
2015-03-11 17:07:55 +01:00
Thomas Haller
b21d0b68fe keyfile: merge update_connection() and new_connection()
new_connection() and update_connection() are very similar as both
must anticipate collisions of UUIDs.

When reloading a connection (update_connection(), previously), the loaded
connection for a certain path might actually replace another existing
connection. In this case, the old connection must be removed, and
the existing one updated instead.
If reloading a connection changes the UUID to a new value, the old
connection must be removed likewise and a new connection added.

Merge both functions into update_connection().

(cherry picked from commit c2fcb680f8)
2015-03-11 17:07:55 +01:00
Thomas Haller
09e88d1d45 keyfile/trival: move code
(cherry picked from commit f41586f00c)
2015-03-11 17:07:55 +01:00
Thomas Haller
6f5c18f8fa keyfile: simplify g_return() checks for _internal_write_connection()
(cherry picked from commit fbd30c7dd2)
2015-03-11 17:07:55 +01:00
Thomas Haller
2e0293cc81 settings: log connection diffs in replace_settings only where appropriate
Only log connection diffs when we update a connection that we actually
care about.

Note that most plugin specific connections use
nm_settings_connection_replace_settings() in their constructor
to initialize themselves. These occurrences are not interesting
and spam the logfile.

(cherry picked from commit e14ea6818a)
2015-03-11 17:07:55 +01:00
Thomas Haller
857b5bc345 settings: no need to check nm_connection_compare() before nm_settings_connection_replace_settings()
nm_settings_connection_replace_settings() does nothing, if there are no changes.

(cherry picked from commit 750f01dfcb)
2015-03-11 17:07:55 +01:00
Thomas Haller
d0283bc9e6 settings: fix wrong assertions for calling nm_settings_connection_replace_settings()
(cherry picked from commit c2dc5d3b0f)
2015-03-11 17:07:55 +01:00
Thomas Haller
46e2e11a69 core: log object type in nm_utils_log_connection_diff()
(cherry picked from commit 73703c4d19)
2015-03-11 17:07:55 +01:00
Thomas Haller
fdacbe8ddd core: log ignored property notification with level TRACE
Avoids for example:
  notify(): ignoring notification for prop visible on type NMKeyfileConnection

(cherry picked from commit 45094c71d8)
2015-03-11 17:07:55 +01:00
Dan Williams
ad7ea00c81 core: quit if manager startup completed before starting the mainloop
(cherry picked from commit a5891299b9)
2015-03-11 09:29:32 -05:00
Dan Williams
9eba2b0e7d man: note that dhcp=internal is required for configure-and-quit=true
(cherry picked from commit cb17be1e12)
2015-03-10 15:30:33 -05:00
Lubomir Rintel
fe9dada57a route-manager: refactor: a readability improvement
(cherry picked from commit 6c5d93b847)

Conflicts:
	src/nm-route-manager.c
2015-03-09 14:27:44 +01:00
Lubomir Rintel
435632a757 platform: fix route addition ordering
(cherry picked from commit 47167cab4f)
2015-03-09 14:26:13 +01:00
Dan Williams
0bb7623580 release: belatedly bump version to 1.0.1 (development) 2015-03-05 11:12:19 -06:00
Jiří Klimeš
2a72527c44 tui: fix a crash when connection list for activation is empty (rh #1119663)
When there are no connections for a device, do not add the header.

https://bugzilla.redhat.com/show_bug.cgi?id=1119663
(cherry picked from commit 5aa204edec)
2015-03-05 07:44:08 -06:00
Stas Solovey
785dd7c21a po: updated Russian (ru) translation (bgo #745262)
https://bugzilla.gnome.org/show_bug.cgi?id=745262
(cherry picked from commit f610ae7265)
2015-03-05 07:43:56 -06:00
Thomas Haller
ae500e4ee0 wwan: refactor nm_modem_ip_type_to_string() and fix return type
The statement
    g_return_val_if_reached (NM_MODEM_IP_TYPE_UNKNOWN);
was wrong, because the return type is 'const char *'.

But just refactor nm_modem_ip_type_to_string() to get rid of
the static table and make it a switch statement.

Fixes: 02beeeeb12

(cherry picked from commit 5599a82d0d)
2015-03-05 12:55:04 +01:00
Dan Williams
a7323ab2cc dhclient: use fqdn.fqdn for server DDNS updates
dhclient only supports fqdn.fqdn for server DDNS updates with
DHCPv6.  And even though the underlying DHCP options that fqdn.fqdn
controls allow non-qualified hostnames on the wire, dhclient does
not.  So we must require a fully-qualified name for DHCPv6.

Second, while no-client-updates seems like it should be "off", doing
that apparently makes dhclient set the "O" flag to 1 which appears to
be a bug, and results in the server not doing the DDNS update.  So
we must stop setting that option too.

Found by: Alexander Groß

(cherry picked from commit 677cee0f23)
2015-02-27 10:06:25 -06:00
Aleksander Morgado
2a4b785925 wwan: indentation & alignment fixes 2015-02-24 16:15:27 -06:00
Aleksander Morgado
02beeeeb12 wwan: new retry logic when ipv4=auto and ipv6=auto
When ipv4=auto and ipv6=auto, we'll first try with the IPv4v6 PDP type, and if
that fails (e.g. if either the modem or the operator doesn't support it), we'll
fallback to trying with IPv4 or IPv6 PDP types (only if may-fail configuration
allows it).

Patch based on a previous implementation by Dan Williams <dcbw@redhat.com>

https://bugzilla.gnome.org/show_bug.cgi?id=733696
2015-02-24 16:15:27 -06:00