Commit Graph

12256 Commits

Author SHA1 Message Date
Dan Williams
e47eca8761 systemd: fix build with toolchains not exporting CLOCK_BOOTTIME
See 123322c6d6 for the NM-side fix.  We
need this too for the systemd code.
2015-05-19 16:02:28 -05:00
Dan Williams
c428935d9f merge: more isolated pieces of dcbw/devices-for-all (bgo #749401) 2015-05-19 09:28:25 -05:00
Dan Williams
2a7a19e767 core: rearrange some VLAN code and clean up dispose()
Move parent-related stuff before its callers and clean up dispose
so that we no longer need priv->disposed.
2015-05-19 09:25:16 -05:00
Dan Williams
5cf226463a platform: move InfiniBand property reading into the platform and prefer netlink
Add a netlink implementation for reading InfiniBand properties, but fall back to
sysfs when that isn't supported by the kernel.
2015-05-19 09:25:16 -05:00
Dan Williams
d4e0a1e8cc core: earlier software capability detection
We need to know whether we can create interfaces of any given
NMDevice subclass or not.  So don't rely on just the NMPlatformLink
for that information, because we won't have a platform link for
software devices before we create them.
2015-05-19 09:25:16 -05:00
Dan Williams
81db512997 core: check duplicate devices by interface name not UDI
We can't have devices with duplicate interface names so we might
as well use that for dupe checking instead of the (mostly useless)
UDI.
2015-05-19 09:25:16 -05:00
Thomas Haller
652853e0d0 connectivity: use default on missing connectivity.interval config
Manual page claims that a missing configuration option for connectivity
interval means "300". That was not the case for a long time (never?).

https://bugzilla.gnome.org/show_bug.cgi?id=723350

Based-on-patch-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>
2015-05-19 15:34:41 +02:00
Thomas Haller
5b04fde302 config: return internal field directly in nm_config_data_get_connectivity_interval()
We already initialize connectivity.interval apprepriately in constructor().
No need to MAX() it again.
2015-05-19 15:29:20 +02:00
Jiří Klimeš
08fbe75edd libnm: fix nm_vpn_plugin_old_set_connection() for connection == NULL 2015-05-19 14:48:37 +02:00
Jiří Klimeš
dbf1794070 libnm: NMVpnPluginOld: return service name as const string in need_secrets() 2015-05-19 14:48:25 +02:00
Jiří Klimeš
4bab4294a6 libnm: fix NMVpnPluginOld registering VPN service
RequestName DBus call takes two agruments:
http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-names

timeout in g_dbus_proxy_call_sync() can't be 0 because it means literally zero
milliseconds and the call times out.
2015-05-19 14:46:27 +02:00
Thomas Haller
ae0608eef5 config: minor fix in read_entire_config()
Calling read_entire_config() without passing a @cli argument would
always have caused an assert due to unset @o_config_main_file.
That is not a real problem as that situation didn't arise. Still
fix it.
2015-05-19 11:59:09 +02:00
Beniamino Galvani
8e46a737db dns: don't update error when writing private resolv.conf
When update_dns() fails, callers expect 'error' argument to point to a
non-NULL error; but we are reusing the same variable when calling
update_resolv_conf() to update the private resolv.conf and thus the
function may return an empty error on failure.

Don't reuse the same error and pass a NULL argument instead, since we
don't care about errors when updating private resolv.conf.

Fixes: 5f9d348c20
2015-05-19 10:38:55 +02:00
Beniamino Galvani
045938074d dns: accept NULL error argument in update_resolv_conf() 2015-05-19 10:38:52 +02:00
Thomas Haller
046115b588 core: merge branch 'th/keyfile-owner-check-bgo701112'
Renable checking owner of keyfile files but disable that
behavior for tests.

For that, add a nm_utils_get_testing() function to core to detect
whether the code is running as part of a test.

https://bugzilla.gnome.org/show_bug.cgi?id=701112
2015-05-19 10:24:37 +02:00
Thomas Haller
9ac4d88ff7 core: replace g_test_initialized() by nm_utils_get_testing() 2015-05-19 09:57:47 +02:00
Thomas Haller
d4dd9ba3cf keyfile: readd owner check of files (bgo #701112)
Commit 5dc4be54e6 dropped the
owner check for keyfiles to allow running `make check` as root.
Re-add it, but disable the check for tests.

https://bugzilla.gnome.org/show_bug.cgi?id=701112
2015-05-19 09:57:46 +02:00
Thomas Haller
b9d8dc050a core/tests: add nm_utils_get_testing() function
Code that is testable often needs special hooks to work
both for unit-tests and production.

Add a function nm_utils_get_testing() that returns whether
the code is run as part of a unit-test.

For non-testing mode, nm_utils_get_testing() will return
zero (NM_UTILS_TEST_NONE). For unit tests, the test should call
_nm_utils_set_testing() to configure tested functions.
By specifing the @flags attribute, the test can enable/disable
specific behaviors.

https://bugzilla.gnome.org/show_bug.cgi?id=701112
2015-05-19 09:57:46 +02:00
Jiří Klimeš
9b11276d75 merge: add scripts for importing VPN configurations for NM (bgo #744260)
contrib/scripts/nm-import-openvpn
contrib/scripts/nm-import-vpnc
contrib/scripts/nm-import-openconnect

https://bugzilla.gnome.org/show_bug.cgi?id=744260
2015-05-19 09:25:58 +02:00
Jiří Klimeš
466515e953 contrib/scripts: fix importing 'remote' and 'remote-random' options for openvpn
see https://bugzilla.redhat.com/show_bug.cgi?id=1194643
2015-05-19 09:21:50 +02:00
Jiří Klimeš
29473f1bc4 contrib/scripts: nm-import-openconnect - script for importing OpenConnect VPN configs to NM 2015-05-19 09:21:50 +02:00
Jiří Klimeš
db0cf1e7f6 contrib/scripts: nm-import-vpnc - script for importing Cisco VPN configs to NM 2015-05-19 09:21:50 +02:00
Jiří Klimeš
1a2798d1a4 contrib/scripts: nm-import-openvpn - script for importing OpenVPN configs to NM
Synopsis:
 $ nm-import-openvpn -i <infile1> <infile2> ...

 $ nm-import-openvpn <infile> <outfile>

Put the file to NetworkManager:
 # cp <outfile> /etc/NetworkManager/system-connections/
 # chmod 600 /etc/NetworkManager/system-connections/<outfile>
 # nmcli con load /etc/NetworkManager/system-connections/<outfile>
2015-05-19 09:21:50 +02:00
Dan Williams
1af8e2f132 examples: add DBus + Python example for starting/stopping a WiFi hotspot 2015-05-18 15:11:12 -05:00
Thomas Haller
eb2efaa228 device: fix wrong assert in NMDeviceFactory
nm_device_factory_manager_find_factory_for_link_type()
easily can see a link-type NM_LINK_TYPE_UNKNOWN because
there are many link types that NetworkManager cannot detect.

Just return NULL early.

Fixes: 71bde20c30
2015-05-18 15:20:22 +02:00
Muhammet Kara
9a49fa7fb1 po: update Turkish (tr) translation (bgo #749503)
https://bugzilla.gnome.org/show_bug.cgi?id=749503
2015-05-18 11:58:00 +02:00
Beniamino Galvani
09e216b8ab ifcfg-rh/tests: add missing file to EXTRA_DIST
'ifcfg-test-dns-options' was not included in the archive for
distribution and 'make distcheck' failed. Add it.
2015-05-14 16:55:15 +02:00
Beniamino Galvani
a3b7bc9cc6 dns: merge branch 'bg/dns-options-rh1200131'
https://bugzilla.redhat.com/show_bug.cgi?id=1200131
2015-05-13 17:17:06 +02:00
Beniamino Galvani
58236b0ab2 ifcfg-rh: use GLib test functions in new testcases for DNS options 2015-05-13 17:15:35 +02:00
Beniamino Galvani
66e63c1632 ifcfg-rh/tests: add tests for RES_OPTIONS parsing 2015-05-13 17:15:35 +02:00
Beniamino Galvani
a1d76a019e core: capture DNS options from resolv.conf 2015-05-13 17:15:35 +02:00
Beniamino Galvani
8d9776997b libnm-core/trivial: rename 'i' function argument to 'idx' 2015-05-13 17:15:34 +02:00
Beniamino Galvani
7467e25593 cli: add support for DNS options 2015-05-13 17:15:34 +02:00
Beniamino Galvani
bb9c7e2c18 ifcfg-rh: support RES_OPTIONS 2015-05-13 17:15:34 +02:00
Beniamino Galvani
e7ff906f91 dns-manager: add support for DNS options 2015-05-13 17:15:34 +02:00
Beniamino Galvani
b02f59d4a4 core: add DNS options property to NMIP4Config and NMIP6Config 2015-05-13 17:15:34 +02:00
Beniamino Galvani
262c27935d libnm-core/test: add tests for DNS option utilities 2015-05-13 17:15:34 +02:00
Beniamino Galvani
019943bb5d libnm-core: add dns-options property to NMSettingIPConfig 2015-05-13 17:15:34 +02:00
Thomas Haller
f628d0ad5a platform: merge branch 'th/platform_refact_caching-bgo747981' (early part)
Merge a first part of th/platform_refact_caching-bgo747981

https://bugzilla.gnome.org/show_bug.cgi?id=747981
2015-05-13 15:12:16 +02:00
Thomas Haller
500cbcba21 platform/test: include call location in signal assertions
Hard to debug failures, if we don't print where the failure
happens.
2015-05-13 14:31:05 +02:00
Thomas Haller
050c644cce platform/test: make asserting signals more flexible
Support accepting more then one signal at a time.
It is to be expected, that one change in platform raises
several signals. Extend the assertion helpers to express
that.
2015-05-13 14:31:05 +02:00
Thomas Haller
4bdd83127d route-manager/test: fix missing initialization of temporary variables on stack
Up to now, this code was correct. Later we will add another field
to NMPlatformIP4Route which causes the test to operate on
uninitialized data.

Instead of explicitly initializing the field, just clear the whole
struct.
2015-05-13 14:31:05 +02:00
Thomas Haller
d8d0c481b8 test: fix wrong use of memcmp() in nmtst_platform_ip4_routes_equal()
And nmtst_platform_ip6_routes_equal().

As already indicated by the comment, using memcmp() doesn't really work
here. It worked up to now, because the NMPlatformIP4Route structure has no
padding at the end.

If we would have a last 'guint8' member (as we will add later),
initializing an arry of routes on the stack would not clear the bytes
from the padding and the comparison using memcmp() would fail.
2015-05-13 14:31:05 +02:00
Thomas Haller
f167346534 platform: fix nm_platform_link_cmp() to consider ifindex 2015-05-13 14:31:05 +02:00
Thomas Haller
bde42e78db valgrind: disable suppression for libnl
Not sure why (and whether!) this is really needed. Disable
it for now, resurrect it later if need be.
2015-05-13 14:24:07 +02:00
Thomas Haller
0c258402c7 platform: fix memleak in link_delete()
Turns out, the valgrind suppression was hiding a memleak
2015-05-13 14:24:06 +02:00
Thomas Haller
8e2ad8a3bd valgrind: add libnl suppression
Add a comment about the upstream bug that fixes
the suppressed memleak in libnl.

Also, add a different backtrace for the same bug.
It currently doesn't hit easily, because we don't
call nl_msg_parse() often. In the future we will
though.
2015-05-13 14:24:06 +02:00
Thomas Haller
815b436c0a trivial: add comment to valgrind suppression file 2015-05-13 14:24:06 +02:00
Beniamino Galvani
d6ac3776f8 ppp: merge branch 'bg/kernel-pppoe-mtu-bgo742939'
https://bugzilla.gnome.org/show_bug.cgi?id=742939
2015-05-13 13:39:45 +02:00
Beniamino Galvani
1d3eff45d2 device: set Ethernet MTU for PPPoE connections in stage2/config
Try to set the MTU of the parent Ethernet interface to match the
requested PPP MTU and MRU. This allows the negotiation of a PPP MTU
and MRU greater than 1492.
2015-05-13 13:29:51 +02:00