Commit Graph

15047 Commits

Author SHA1 Message Date
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
Dan Williams
6fdfb03107 Revert "ppp-manager: don't use kernel pppoe (rh #1034860, rh #1061641)"
We switched to user-mode PPPoE client to work around a bug in kernel
PPPoE code that caused pppd not to be notified when the connection was
terminated with a PADT before the LCP Termination Request.

The kernel bug has now been fixed upstream with commit 287f3a943fef
"pppoe: Use workqueue to die properly when a PADT is received", queued
for v4.1.

Since the issue affected only very particular scenarios and could
somehow be solved with the right configuration (see bugzilla entry),
we can safely revert the patch and restore the use of kernel mode
PPPoE.

This reverts commit 7955806a02.

https://bugzilla.gnome.org/show_bug.cgi?id=742939
2015-05-13 13:29:38 +02:00
Beniamino Galvani
0a04be41d4 device: set MTU on IP interface
Fixes: 7ba2a058f2
2015-05-13 13:29:38 +02:00
Thomas Haller
78c1849b53 core: fix compile error due to missing pointer cast
Fixes: 72baf9fa24
2015-05-13 12:30:37 +02:00
Lubomir Rintel
72baf9fa24 manager: AddAndActivateConnection(): don't save until the connection is activatable
https://bugzilla.redhat.com/show_bug.cgi?id=1174164
2015-05-12 17:26:25 +02:00
Thomas Haller
067202b34e core: use explict NMLogDomain enum instead of int
A while ago (f4f3f4d69b) we added an
enum to represent the logging domain. Use it.
2015-05-12 16:46:48 +02:00
Jiří Klimeš
e07efa836f libnm: add ifcfg-rh description for 802-11-wireless.powersave property
so that it is displayed in nm-settings-ifcfg-rh manual page.
2015-05-12 15:42:51 +02:00
Thomas Haller
0d7012faab platform/test: fix valgrind warning about NULL arguments to mount()
==21573== Syscall param mount(type) points to unaddressable byte(s)
    ==21573==    at 0x854B9BA: mount (syscall-template.S:81)
    ==21573==    by 0x158922: main (test-common.c:295)
    ==21573==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
    ==21573==
    {
       <insert_a_suppression_name_here>
       Memcheck:Param
       mount(type)
       fun:mount
       fun:main
    }

Fixes: d6aef9c188
2015-05-12 14:37:36 +02:00
Piotr Drąg
10d03ed5f5 po: update Polish (pl) translation (bgo #749164)
https://bugzilla.gnome.org/show_bug.cgi?id=749164
2015-05-12 13:05:49 +02:00
Thomas Haller
843205521f device: fix configuring static ip addresses
When a connection had static IP addresses, an early event
from plaform would clear them from priv->con_ip4_config.

Fix that, by don't initializing priv->con_ip4_config
before we commit the first time.

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

Fixes: 557667df12
2015-05-11 21:44:26 +02:00