Commit Graph

15047 Commits

Author SHA1 Message Date
Michael Biebl
a9bd5dce1c tests: use dbus-run-session instead of dbus-launch
The dbus-run-session utility was designed to run a process within a
D-Bus session, specifically for running regressions tests and is much
better suited then dbus-launch. As an additional benefit, this avoids
any X dependencies.

https://mail.gnome.org/archives/networkmanager-list/2016-January/msg00023.html
2016-01-22 16:52:41 +01:00
Dan Williams
08bc51095c ifcfg-rh: convert more testcases to g_assert() 2016-01-22 09:47:16 -06:00
Thomas Haller
8715d61437 libnm-core: fail verify() for NMSettingVlan for invalid vlan id
Point in case:

    # ip link add link dummy0 name dummy0.vlan type vlan id 4095
    RTNETLINK answers: Numerical result out of range

This potentially causes existing (invalid) connections to disappear
as they now fail verification.

Instead of adjusting the range of the GObject property
NM_SETTING_VLAN_ID, reject it during vlan. This is a bit more
forgiving to an older client that isn't aware of this new restriction,
so he can first set the value without raising a critical warning.
2016-01-22 12:02:39 +01:00
Thomas Haller
bd74a9348f tui: disallow reserved vlan id 4095 2016-01-22 11:53:12 +01:00
Thomas Haller
7d67c533d1 cli: disallow reserved vlan id 4095 2016-01-22 11:50:52 +01:00
Beniamino Galvani
9a56fa0b3f core: allow VLAN ids between 1 and 4095
nm_utils_new_vlan_name() should reject the reserved VLAN id 4095, and
the test case should not test reserved values 0 and 4095.

Fixes: 778207f23e
2016-01-22 11:17:44 +01:00
Thomas Haller
34050e9c0b travis: move build script to a separate script and improve debugging for failed tests 2016-01-22 11:06:09 +01:00
Thomas Haller
0c7fa89439 libnm: assert against valid dest in NMIPRoute 2016-01-22 10:14:02 +01:00
Dan Williams
356b4ce29c platform: fix leak when netlink dump is too large 2016-01-21 12:28:13 -06:00
Thomas Haller
778207f23e core: truncate parent ifname when constructing virtual ifname for VLAN
https://bugzilla.redhat.com/show_bug.cgi?id=1300755
2016-01-21 18:49:02 +01:00
Thomas Haller
944065c115 core: check generated virtual interfaceplatform name
https://bugzilla.redhat.com/show_bug.cgi?id=1300755
2016-01-21 18:38:52 +01:00
Dan Williams
f2399a6976 libnm-glib: fix leak in get_permissions_reply() 2016-01-21 11:35:00 -06:00
Dan Williams
3254965067 libnm,tests: fix error leak 2016-01-21 11:31:31 -06:00
Beniamino Galvani
a4492f4145 manager: fix a couple of memory leaks
Fixes: 4dbaac4ba2
Fixes: d8e1590c50
2016-01-21 18:23:53 +01:00
Thomas Haller
e1f395834a wifi/supplicant: refactor logging to use _LOG() macros 2016-01-21 17:41:32 +01:00
Thomas Haller
e59c4117c4 wifi/supplicant: implement _LOG() macros 2016-01-21 17:41:32 +01:00
Lubomir Rintel
e80346fff7 utils: fix error open() handling
CID 59376 (#2-1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: urandom is passed to a parameter that cannot be negative.
2016-01-21 16:56:19 +01:00
Lubomir Rintel
88da21caa1 linux-platform: fix accidental Python
Coverity: CID 59378 (#1 of 1): Nesting level does not match indentation
(NESTING_INDENT_MISMATCH) This statement is indented to column 41, as if
it were nested within the preceding parent statement, but it is not.
2016-01-21 16:53:56 +01:00
Lubomir Rintel
d03322b2a5 linux-platform: fix a file descriptor leak
Coverity: CID 59384 (#3-1 of 3): Resource leak (RESOURCE_LEAK)26.
leaked_handle: Handle variable fd going out of scope leaks the handle
2016-01-21 16:32:23 +01:00
Thomas Haller
de19bc20d0 wifi: merge branch 'th/supplicant-manager-fix-ref-count-rh1298007'
https://bugzilla.redhat.com/show_bug.cgi?id=1298007
2016-01-21 14:59:18 +01:00
Thomas Haller
1264fc2108 supplicant: cleanup GObject property implementation in NMSupplicantInterface
nm_supplicant_interface_new() should be merely a convenient interface
for creating the object directly.
2016-01-21 14:58:55 +01:00
Thomas Haller
f1fba3eb02 wifi: fix crash due to wrong ownership handling in nm_supplicant_manager_iface_release()
nm_supplicant_manager_iface_get() would cache and reuse the supplicant
interface. But no ref-counting was in place so that the first user returning
the interface via nm_supplicant_manager_iface_release() would destroy the
instance for others.

This is broken for a very long time. Which shows that we hardly ever
have a cache-hit and usually create a new instance. So, instead of
letting nm_supplicant_manager_create_interface() check for existing
supplicant interface, always create a new instance. This also makes
sense, because we would expect that per ifname only one instance is
requested at a time. Also add an assertion that we don't return
multiple supplicant interface instances for the same ifname.

Drop nm_supplicant_manager_iface_release() in favor of requiring users
to unref the returned instance.

Also, use a GSList instead of a GHashTable for the cache.

Also, previously callers would pass @is_wireless to nm_supplicant_manager_iface_get(),
but the cache lookup did not consider that value. That doesn't matter
now as we always create a new instance.

https://bugzilla.redhat.com/show_bug.cgi?id=1298007
2016-01-21 14:58:55 +01:00
Thomas Haller
063f9185b9 supplicant: don't pass start_now argument to nm_supplicant_interface_new()
Also, don't only consider the @die_count whether to start the supplicant,
but check for is_available() -- which already considers @die_count and
@running.
2016-01-21 14:58:55 +01:00
Thomas Haller
5d64da1da2 supplicant: drop is_wireless argument from NMSupplicantInterface's interface_add() 2016-01-21 14:58:55 +01:00
Thomas Haller
a8165611a8 supplicant: remove check for iface instance after nm_supplicant_interface_new()
A plain constructor for a GObject cannot fail.
2016-01-21 14:58:55 +01:00
Thomas Haller
004edecc81 wifi/supplicant: take object reference during availability_changed()
If the list is expected to be modified, it also means that possibly
instances will be unrefed. Probably, not yet visited instances will
not be unrefed so there is no real problem.

Just be extra cautious and take a reference to all instances first.
2016-01-21 14:58:54 +01:00
Thomas Haller
8dcf4d32e9 device/wifi: remove unnecessary call to remove_supplicant_interface_error_handler()
remove_supplicant_interface_error_handler() is not needed as we later disconnect
all handlers for @self.
2016-01-21 14:58:54 +01:00
Thomas Haller
84828960ff device/wifi: replace cancel_pending_scan() with nm_clear_g_source() 2016-01-21 14:58:54 +01:00
Thomas Haller
0a2ff1d16d device/ethernet: cleanup clearing handlers registered to supplicant interface 2016-01-21 14:58:54 +01:00
Thomas Haller
30f72c2753 device/ethernet: use nm_clear_g*() function in remove_supplicant_interface_error_handler() 2016-01-21 14:58:54 +01:00
Thomas Haller
2505911ad5 supplicant: remove unused function nm_supplicant_interface_get_device() 2016-01-21 14:58:54 +01:00
Thomas Haller
8cb78ac38b gitignore: ignore /src/devices/tests/test-arping
Fixes: 83b712aa42
2016-01-21 14:57:08 +01:00
Beniamino Galvani
2446da1564 release: improve NEWS 2016-01-21 11:42:42 +01:00
Lubomir Rintel
c1cf3c25c8 linux-platform: treat gadget devices as ethernet devices
Also, don't manage them by default. Whatver created it should take care of
management.
2016-01-21 11:33:59 +01:00
Thomas Haller
bf54a5bfba systemd: add "After=dbus.service" to NetworkManager.service
Order NetworkManager after dbus. Otherwise during shutdown, both service are killed
together and possibly NetworkManager can no longer use D-Bus during shutdown. It
will need it however to communicate with VPN plugins and wpa-supplicant.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=89847#c14
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1214466
2016-01-21 11:01:36 +01:00
Beniamino Galvani
64ac910131 dns-manager: prevent DNS plugins from respawning too quickly
If dnsmasq (or another DNS plugin) exits immediately (for example due
to an already used port), the DNS manager keeps restarting it forever,
wasting system resources and filling logs.

Add a simple rate-limiting mechanism.

https://bugzilla.gnome.org/show_bug.cgi?id=760691
2016-01-21 10:40:08 +01:00
Dan Williams
ec1185d6dd libnm: remove erroneous nm_manager_get_all_devices()
None of the libnm NMManager functions are exported, as they are only
used internally.

Fixes: 4db851f852
2016-01-20 12:27:05 -06:00
Dan Williams
701c05ad69 build: remove spurious comma from configure.ac 2016-01-20 12:21:40 -06:00
Dan Williams
3b3f108dfd docs, trivial: fix some documentation issues 2016-01-20 11:27:22 -06:00
Dan Williams
0a12a1711c libnm-core,core,cli: fix spelling of NM_IP_TUNNEL_MODE_UNKNOWN
Fixes: b614a5ec61
Fixes: ae8c7a8967
Fixes: 570fdce93f
2016-01-20 11:27:22 -06:00
Dan Williams
b610d2dc0c docs: ignore some private libnm & libnm-core headers 2016-01-20 11:27:21 -06:00
Dan Williams
d59c1d4c8a libnm,vpn: restore export of deprecated NMVpnPluginOld symbols
Deprecated of course, but shouldn't have been removed from the ABI.

Fixes: 867227dd4a
2016-01-20 11:26:49 -06:00
Lubomir Rintel
0f199943de Revert "Set the default powersave value to enabled"
libnm-core & more discussion were missing; backing out for now.

This reverts commit 15ab4bda5b.
2016-01-20 13:53:40 +01:00
Beniamino Galvani
80e8b9cca9 merge: branch 'bg/ipv4-dad-rh1259063'
Add support for detecting IPv4 duplicate addresses.

https://bugzilla.redhat.com/show_bug.cgi?id=1259063
2016-01-20 11:57:13 +01:00
Beniamino Galvani
75068a085a device: detect duplicate IPv4 addresses when method=auto 2016-01-20 11:53:47 +01:00
Beniamino Galvani
28f6e8b4d2 device: detect duplicate IPv4 addresses when method=manual 2016-01-20 11:53:47 +01:00
Beniamino Galvani
83b712aa42 core: add test for NMArpingManager 2016-01-20 11:53:47 +01:00
Beniamino Galvani
7a0fe9b21e core: add NMArpingManager
Add a new object which implements the logic for announcing IP
addresses and detecting duplicates using arping.

Based-on-patch-by: Jiří Klimeš <jklimes@redhat.com>
2016-01-20 11:53:47 +01:00
Jiří Klimeš
df6b0fa99e cli: add support for new ipv4.dad-timeout property 2016-01-20 11:53:47 +01:00
Jiří Klimeš
adbbf3aa5c ifcfg-rh: read/write ipv4.dad-timeout using ARPING_WAIT
ARPING_WAIT is used for DAD by Red Hat initscrips (ifup-eth).
2016-01-20 11:53:47 +01:00