Commit Graph

14110 Commits

Author SHA1 Message Date
Thomas Haller
0ce83890bf utils: fix out-of-bound access for negative indexes in _NM_UTILS_STRING_LOOKUP_TABLE_DEFINE() 2016-01-24 11:31:15 +01:00
Thomas Haller
9c3187027c systemd: order NetworkManager.serivce after network-pre.target
https://bugzilla.gnome.org/show_bug.cgi?id=761001
2016-01-23 16:54:33 +01:00
Michael Biebl
b72cdb75d8 build: install nm-settings-ifcfg-rh.5 man page conditionally
Only install nm-settings-ifcfg-rh.5 man page if the ifcfg-rh
configuration plugin has been enabled.

But still add them to EXTRA_DIST so that the source tarball
contains the generated man-file, but it isn't installed.

https://bugzilla.gnome.org/show_bug.cgi?id=759823
2016-01-23 16:47:03 +01:00
Thomas Haller
c94a9372fa travis: fix bug in .travis.yml
Fixes: 1408b8c0a2
2016-01-23 16:26:03 +01:00
Beniamino Galvani
0ba500d131 core: merge branch 'bg/iptables-sharing-rules-bgo692673'
Remove iptables rules for connection sharing upon termination to avoid
the presence of duplicate rules when NM is restarted.

https://bugzilla.gnome.org/show_bug.cgi?id=692673
2016-01-23 10:04:26 +01:00
Beniamino Galvani
e3a6ba6756 manager: cleanup active connections upon exit
When connection sharing is enabled, the removal of iptables rules is
delegated to the NMActRequest destructor; but for this to work it is
required that the object is properly dereferenced upon NM termination.

Clean up the active connections which are in DEACTIVATED state when
quitting, so that they are unexported and destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=692673
2016-01-23 10:01:21 +01:00
Beniamino Galvani
8cba3e046e core: list iptables sharing rules in the right order
The rules were added to the list using g_slist_append() and then
applied one at time using "iptables --insert" which puts them at the
beginning of the chain, reversing the initial order.

Instead, list them in the desired order and use g_slist_prepend() to
achieve the same result. This has no functional changes.
2016-01-23 10:01:21 +01:00
Lubomir Rintel
ba24a12739 systemd: add chroot capability
CAP_SYS_CHROOT is needed for openvpn hardening.
2016-01-22 22:12:43 +01:00
Lubomir Rintel
1408b8c0a2 travis: add coverity submission
Also, decouple the build from the test run; it looks better in the .yml file as
well as in the travis UI.
2016-01-22 22:12:43 +01:00
Thomas Haller
dfee5495e8 build: merge branch 'th/tests-dbus-run-session'
Update build script to prefer dbus-run-session over dbus-launch.
2016-01-22 17:03:33 +01:00
Thomas Haller
f74a9000b1 tests: use dbus-run-session for tools/run-test-valgrind.sh 2016-01-22 16:54:32 +01:00
Thomas Haller
fb1da0eab2 tests: allow fallback to dbus-launch in case dbus-run-session is not available
Like on Ubuntu 12.04 which is currently used by our Travic CI setup.
2016-01-22 16:52:42 +01:00
Thomas Haller
5170d3a760 tests: move common dbus test-runners to tools/ directory 2016-01-22 16:52:41 +01:00
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