Commit graph

11285 commits

Author SHA1 Message Date
Dan Winship
ee20ebb0fb ifcfg-rh: handle DEVTIMEOUT property (rh #1171917)
If an ifcfg file has a DEVTIMEOUT property (and a DEVICE, and is
ONBOOT=yes), and the device is not present at startup, then wait up to
DEVTIMEOUT seconds for it to appear before declaring the connection
ready.

This allows for a hacky workaround to devices that take a bizarrely
long time to be probed.

(cherry picked from commit 62d870e1a6)
2015-01-14 11:35:17 -05:00
Dan Winship
c5bca2fb90 core: allow connections to participate in NMManager:startup-complete
Add an NMSettingsConnection:ready property, which indicates if the
connection is ready to use. Add NMSettings:startup-complete, which is
TRUE when all connections are ready. Make NMManager:startup-complete
take NMSettings:startup-complete into account.

(cherry picked from commit b067ca7034)
2015-01-14 11:35:17 -05:00
Thomas Haller
33eda353f7 ifcfg-rh: fix wireless_connection_from_ifcfg() to accept missing @error argument
wireless_connection_from_ifcfg() did not support being called without
error argument.

    #0  0x00007fe4fa2204e9 in g_logv (log_domain=0x7fe4f0597060 "NetworkManager-ifcfg-rh", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fff1c7aaf00) at gmessages.c:989
    #1  0x00007fe4fa22063f in g_log (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>) at gmessages.c:1025
    #2  0x00007fe4f057eec3 in wireless_connection_from_ifcfg (file=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", ifcfg=0x7fe4fec6f730, error=0x0) at reader.c:3431
    #3  0x00007fe4f057e2b6 in connection_from_file_full (filename=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", network_file=0x7fe4f05976aa "/etc/sysconfig/network", test_type=0x0, out_unhandled=0x7fff1c7ab1f8,
        error=0x0, out_ignore_error=0x7fff1c7ab174) at reader.c:4750
    #4  0x00007fe4f057db80 in connection_from_file (filename=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", out_unhandled=0x7fff1c7ab1f8, error=0x0) at reader.c:4834
    #5  0x00007fe4f057b4a6 in nm_ifcfg_connection_new (source=0x0, full_path=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", error=0x0) at nm-ifcfg-connection.c:119
    #6  0x00007fe4f0579c1d in _internal_new_connection (self=0x7fe4fec6cd00, path=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", source=0x0, error=0x0) at plugin.c:136
    #7  0x00007fe4f0579256 in connection_new_or_changed (self=0x7fe4fec6cd00, path=0x7fe4fec7c800 "/etc/sysconfig/network-scripts/ifcfg-Wi-Fi-1", existing=0x0, out_old_path=0x7fff1c7ab458) at plugin.c:265
    #8  0x00007fe4f0578f61 in read_connections (plugin=0x7fe4fec6cd00) at plugin.c:462
    #9  0x00007fe4f0578839 in get_connections (config=0x7fe4fec6cd00) at plugin.c:497
    #10 0x00007fe4fdc9affb in nm_system_config_interface_get_connections (config=0x7fe4fec6cd00) at settings/nm-system-config-interface.c:143
    #11 0x00007fe4fdc9764f in load_connections (self=0x7fe4fec6ca40) at settings/nm-settings.c:201
    #12 0x00007fe4fdc96d74 in nm_settings_new (error=0x7fff1c7abb18) at settings/nm-settings.c:1802
    #13 0x00007fe4fdc37146 in main (argc=1, argv=0x7fff1c7abcd8) at main.c:415

Fixes: 356849f70c
Fixes: 12bfaf5a8d
(cherry picked from commit ffe0fde235)
2015-01-14 11:29:15 -05:00
Dan Winship
f5c2665b62 ifcfg-rh: merge branch 'ifcfg-rh-cleanup-nm-1-0' into nm-1-0 (bgo #741659)
Backport of ifcfg-rh-cleanup-bgo741659
2015-01-14 10:52:45 -05:00
Dan Winship
e62bf65c13 ifcfg-rh/tests: drop out_*file args from connection_from_file_test()
The out_keyfile, out_routefile, and out_route6file args were just
based on trivial calls to utils.h functions, and could just as easily
be done by the caller directly. So do that.

(cherry picked from commit 335dbda16b)
2015-01-14 10:52:33 -05:00
Dan Winship
43014cf292 ifcfg-rh/tests: removed unused connection_from_file_test() args
Don't pass &keyfile, &routefile, and &route6file if we aren't going to
use the return value.

Don't pass &unmanaged if we aren't going to check it. (And when we do
check it, don't g_free() it if we've asserted that it's NULL.)

(cherry picked from commit a564dafc35)
2015-01-14 10:52:22 -05:00
Dan Winship
9d0fd2c121 ifcfg-rh/tests: remove gratuituous checks
A bunch of tests appear to have copy-and-pasted the same unnecessary
check for route6file having been created. Remove them.

(cherry picked from commit 1600ed9c68)
2015-01-14 10:51:38 -05:00
Dan Winship
bba1768353 ifcfg-rh: remove "ignore_error" arg from connection_from_file()
Instead of having connection_from_file() return a flag telling its
caller whether to log a warning or not, just have it log the warning
(or not) itself.

(cherry picked from commit 12bfaf5a8d)
2015-01-14 10:51:33 -05:00
Dan Winship
03e1227277 ifcfg-rh: split connection_from_file() / connection_from_file_test()
Rather than having the "real" users of connection_from_file() have to
pass a dozen NULL arguments, add a separate
connection_from_file_test() for use by test-ifcfg-rh. (Likewise, since
no test cases care about ignore_error, remove that argument from
connection_from_file_test().)

(cherry picked from commit 356849f70c)
2015-01-14 10:51:26 -05:00
Jiří Klimeš
06b9ae9a5d ifnet: fix a crash in ifnet settings plugin (bgo #737645)
conn_name can be NULL now as the connections are tracked by UUID
(see commit 689dadaffb)

Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> getting unmanaged specs...
Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> Checking unmanaged: (null)
Sep 29 21:20:38 Jdeapad kernel: NetworkManager[1339]: segfault at 0 ip
00007f1bfffbedd0 sp 00007fff98daa628 error 4 in
libglib-2.0.so.0.4002.0[7f1bfff86000+130000]

https://bugzilla.gnome.org/show_bug.cgi?id=737645
(cherry picked from commit 91fd36e166)
2015-01-13 10:41:00 +01:00
Lubomir Rintel
2eeb7fa8c2 platform: fix draining of the event queue with old libnl (rh #1180773)
It fails doesn't propagate EAGAIN properly. Fixed in 3.2.22's 375a629.

https://bugzilla.redhat.com/show_bug.cgi?id=1180773
(cherry picked from commit 529591d8de)
2015-01-12 22:19:48 +01:00
Thomas Haller
bd488e63f9 platform: merge branch 'th/route-fixes-bgo741871-v2'
https://bugzilla.gnome.org/show_bug.cgi?id=741871
(cherry picked from commit d9f143df8b)
2015-01-12 22:09:41 +01:00
Thomas Haller
0716e6cb3a platform: suppress change event when deleting IPv4 route with metric 0
refresh_object() raised a spurious change event for the route we
are about to delete. Suppress that by adding an internal reason flag.

Fixes: 41e6c4fac1
(cherry picked from commit 96c099de09)
2015-01-12 22:08:42 +01:00
Thomas Haller
3d032e6e9b platform/tests: add test for deleting IPv4 route with metric 0
(cherry picked from commit 4f390e7e4d)
2015-01-12 22:08:42 +01:00
Thomas Haller
1851e6617a platform/tests: use assert_ip4_route_exists() function
(cherry picked from commit a6cd0e7a29)
2015-01-12 22:08:42 +01:00
Thomas Haller
e775e4ab4f platform/tests: add ip4_route_exists() test function
(cherry picked from commit b421af3730)
2015-01-12 22:08:42 +01:00
Thomas Haller
0b36fb4a75 platform/tests: fix errors in fake platform handling route metrics
(cherry picked from commit 0f1fca29db)
2015-01-12 22:08:42 +01:00
Thomas Haller
3a8bf55ef8 core: merge branch 'th/route-fixes-bgo741871'
https://bugzilla.gnome.org/show_bug.cgi?id=741871
(cherry picked from commit 1bb1bfe6e7)
2015-01-12 22:04:30 +01:00
Thomas Haller
59352bd4b0 platform: workaround deletion of IPv4 route with metric 0
Deleting routes with metric 0 might end up deleting other
routes with a different metric.

Workaround this in platform to only delete a route with
metric 0 if such a route can be found prior to deletion.

Don't only look into the cache (which might be out of date).
Instead refetch the route we are about to delete to be sure.

There is still a race that we might end up deleting the wrong
route.

https://bugzilla.gnome.org/show_bug.cgi?id=741871
https://bugzilla.redhat.com/show_bug.cgi?id=1172780
(cherry picked from commit 41e6c4fac1)
2015-01-12 22:03:28 +01:00
Thomas Haller
dd418598d5 platform: route_search_cache() should not treat a metric 0 as "any" route
This match-any behavior ignoring metric is nowhere used. And even if we
would need such a behavior, using 0 is wrong because IPv4 routes can
have a metric of zero.

(cherry picked from commit 2cb3c7e8a0)
2015-01-12 22:03:28 +01:00
Thomas Haller
818150bf6e platform: fix IPv6 route methods for metric 0
Handling a route with metric 0 effectively means
a metric of 1024 (user default). Adjust the add(),
delete() and exist() functions to consider routes
with metric 0 as 1024.

(cherry picked from commit 06e4eee0ce)
2015-01-12 22:03:28 +01:00
Thomas Haller
5103cd944f platform: fix data type for metric argument of refresh_route()
(cherry picked from commit 4ba8df425f)
2015-01-12 22:03:28 +01:00
Thomas Haller
5cf58e6ba5 ifcfg-rh: support ipvx.route-metric property as IPVX_ROUTE_METRIC
Write ipv4.route-metric and ipv6.route-metric property of
NMSettingConnection as IPV4_ROUTE_METRIC and IPV6_ROUTE_METRIC,
respectively.

(cherry picked from commit 3e33a5a6c5)

Conflicts:
	src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
2015-01-12 22:03:04 +01:00
Dan Williams
cd26f835f4 core: ensure manager state is updated on resume with connectivity checking enabled (rh #1162636) (bgo #742675)
On resume configured interfaces are unmanaged to clear their pre-resume
state and then re-managed.  Eventually the interface should end up moving
to the DISCONNECTED state, which should trigger an auto-activate check in
the Policy.  If connectivity checking was enabled, that auto-activate check
would fail because the Manager's state was still NM_STATE_ASLEEP.

This caused bridge slaves not to auto-activate on resume, which left bridges
without connectivity.

The manager never left NM_STATE_ASLEEP when connectivity checking was
enabled due to nm_manager_update_state() returning early when kicking
off a connectivity check.  Instead, the manager's state should always
be updated to accurately reflect the current state.

https://bugzilla.redhat.com/show_bug.cgi?id=1162636
https://bugzilla.gnome.org/show_bug.cgi?id=742675
(cherry picked from commit a687d1f9e0)
2015-01-12 09:58:19 -06:00
Dan Williams
b652ac3cf3 core: force disable_ipv6=0 when turning on userspace IPv6LL (bgo #741773)
If a device assumes a connection without activating a user-requested or
NM-requested connection, then disable_ipv6 is not touched.  When the device
is deactivated, it still isn't touched even though userspace IPv6LL
is enabled.  This could lead to an user-requested activation with
IPv6 configuration, but disable_ipv6=1.

Whenever userspace IPv6LL is turned on, we should also set disable_ipv6=0
to ensure IPv6 can function.  Userspace IPv6LL will ensure that the
interface does not have an address until the user/connection requests
it, which was the only reason that NM touched disable_ipv6 anyway.

fixes:NetworkManager_Test203_testcase_286589
fixes:NetworkManager_Test204_testcase_286590

https://bugzilla.gnome.org/show_bug.cgi?id=741773
(cherry picked from commit 984b0763d9)
2015-01-09 17:17:09 -06:00
Lubomir Rintel
2f669f659e keyfile: another cur at fixing the bridge test
Fixes: 2f82bf537b
(cherry picked from commit c27074bf43)
2015-01-09 15:17:58 +01:00
Lubomir Rintel
5e4155b55c keyfile: fix bridge test
Fixes: 2f82bf537b
(cherry picked from commit 7d58177590)
2015-01-09 14:38:09 +01:00
Lubomir Rintel
375850095b bridge: Properly check range of STP properties (rh #1160815)
If zero is out of range, only allow it when STP is disabled.

https://bugzilla.redhat.com/show_bug.cgi?id=1160815
(cherry picked from commit 2f82bf537b)
2015-01-09 12:17:30 +01:00
Lubomir Rintel
8d647eb2d8 team: get configuration only when teamd appears on bus for externally added interfaces
teamd first adds the link and only then listens on the bus therefore we race
with it. Let's watch for the bus presence even for the teamd devices we didn't
add for all their lifetime and recheck for assumed connections as we see them.

(cherry picked from commit 03a5a85d6c)
2015-01-09 12:16:57 +01:00
Lubomir Rintel
d842a9ece3 Revert "team: start teamd when ensuring team connection else teamdctl_connect() fails"
We don't want to start a teamd instance when there's an externally added team
interface. We just don't want to try to the daemon if it's not there (addressed
by a later commit).

This reverts commit a78386b6d1.

Conflicts:
	src/devices/team/nm-device-team.c

(cherry picked from commit 744e35e1d2)
2015-01-09 12:16:50 +01:00
Rui Matos
01f358ec34 libnm-glib/nm-client: zero the CheckConnectivityData structure
Otherwise, if the caller doesn't provide a cancellable we'll try to
access a bogus ccd->cancellable in check_connectivity_data_free() and
crash.

https://bugzilla.gnome.org/show_bug.cgi?id=740841
(cherry picked from commit 8c32ea916b)
2015-01-08 16:16:18 +01:00
Thomas Haller
da31779f10 libnm: fix documentation for nm_utils_file_search_in_paths()
(cherry picked from commit fc5a66b14b)
2015-01-08 13:09:42 +01:00
Thomas Haller
6f643d2761 core: add /bin to the default search path
https://bugzilla.gnome.org/show_bug.cgi?id=742576
(cherry picked from commit abbca50ca9)
2015-01-08 12:58:43 +01:00
Thomas Haller
cda2802fe9 build: fix --enable-lto configure option to allow disabling option explicitly
When specifying '--enable-lto=anything' or '--disable-lto',
the configure script would always set enable_lto=yes.

The only way to disable lto, was *not* specifying the
configure option.

https://bugzilla.gnome.org/show_bug.cgi?id=742575
(cherry picked from commit 6eccfda0fa)
2015-01-08 12:06:07 +01:00
Jiří Klimeš
1ea95cd374 tui: fix crash when editing DSL connection
Program received signal SIGSEGV, Segmentation fault.
 0x000000000041b3e5 in nmt_page_dsl_constructed (object=0x7fffec0228c0 [NmtPageDsl]) at nmt-page-dsl.c:109
 109		priv->ethernet_page = nmt_page_ethernet_new (conn, nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (dsl)));
 Missing separate debuginfos, use: debuginfo-install libffi-3.0.10-3.fc18.x86_64 newt-0.52.15-1.fc19.x86_64
 (gdb) bt
 #0  0x000000000041b3e5 in nmt_page_dsl_constructed (object=0x7fffec0228c0 [NmtPageDsl]) at nmt-page-dsl.c:109
 #1  0x0000003e9ac161e3 in g_object_newv (object_type=1, object_type@entry=16203872, n_parameters=n_parameters@entry=2, parameters=parameters@entry=0xf74350)
    at gobject.c:1741
 #2  0x0000003e9ac16560 in g_object_new_valist (object_type=object_type@entry=16203872, first_property_name=first_property_name@entry=0x42e524 "connection",
    var_args=var_args@entry=0x7fffffffcef8) at gobject.c:1830
 #3  0x0000003e9ac16894 in g_object_new (object_type=16203872, first_property_name=first_property_name@entry=0x42e524 "connection") at gobject.c:1545
 #4  0x000000000041b504 in nmt_page_dsl_new (conn=<optimized out>, deventry=deventry@entry=0x974690 [NmtDeviceEntry]) at nmt-page-dsl.c:47
 #5  0x000000000041808e in nmt_editor_constructed (object=<optimized out>) at nmt-editor.c:355
 #6  0x0000003e9ac161e3 in g_object_newv (object_type=1, object_type@entry=16174256, n_parameters=n_parameters@entry=4, parameters=parameters@entry=0xf6cec0)
     at gobject.c:1741
 ...
 (gdb) p priv
 $1 = (NmtPageDslPrivate *) 0x0
(cherry picked from commit cf0a87c5e4)
2015-01-07 19:35:22 +01:00
Jiří Klimeš
aee82153fc tui: fix saving "Available to all users" (rh #1176042)
(cherry picked from commit 675d545bcc)
2015-01-07 18:33:00 +01:00
Dan Winship
3d47cf5823 libnm-glib: crash when NMRemoteSettings is quickly destroyed (bgo #742138)
NMRemoteSettings queues a bunch of async NMRemoteConnection creations,
but wasn't doing anything to ensure that it was still alive when they
completed. Pointed out by Cosimo Cecchi.

https://bugzilla.gnome.org/show_bug.cgi?id=742138
2015-01-05 15:38:38 -05:00
Thomas Haller
f6cd8f06f4 libnm/tests: fix GetAccessPoints() in test-networkmanager-service.py for hidden APs
There was a bug checking for "if a.ssid():". Refactor the whole line to
use a list comprehension.

(cherry picked from commit 954c744bc0)
2015-01-05 14:19:55 +01:00
Thomas Haller
cc10ff2f28 libnm/tests: cleanup handling object paths in test-networkmanager-service.py
(cherry picked from commit 66ced4de56)
2015-01-05 14:19:55 +01:00
Thomas Haller
9fabd1e589 libnm/tests: fix handling ByteArray in test-networkmanager-service.py for Python 3
In Python 3, dbus.ByteArray() must be created using a byte string,
while strings obtained via DBUS are unicode strings.

This was wrong in WifiAp.__get_props() which broke the test
test_wifi_ap_added_removed().

    File "/usr/lib/python3.3/site-packages/dbus/service.py", line 707, in _message_cb
      retval = candidate_method(self, *args, **keywords)
    File "./NetworkManager/tools/test-networkmanager-service.py", line 102, in GetAll
      return self._get_dbus_properties(iface)
    File "./NetworkManager/tools/test-networkmanager-service.py", line 96, in _get_dbus_properties
      return self.__dbus_ifaces[iface]()
    File "./NetworkManager/tools/test-networkmanager-service.py", line 315, in __get_props
      props[PP_SSID] = dbus.ByteArray(self.ssid)
    TypeError: string argument without an encoding

https://bugzilla.gnome.org/show_bug.cgi?id=739448
(cherry picked from commit c569fc23bf)
2015-01-05 14:19:55 +01:00
You-Sheng Yang
88566ea3b3 docs: fix out-of-tree build
When compiling NetworkManager with --enable-gtk-doc outside the
source tree, the generated documents are slightly different from
those generated in tree. This patch fixes that missed COPYING file in
$(top_builddir) and adds $(top_builddir)/libnm-util to DOC_SOURCE_DIR.

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

Signed-off-by: You-Sheng Yang <vicamo@gmail.com>
(cherry picked from commit 738649c1d5)
2015-01-03 13:13:59 +01:00
Lubomir Rintel
f023431aa7 libnm: make NMDhcp6Config inherit from NMDhcpConfig
Otherwise it does not register the "options" property and an assertion fails
when the user prints connection that has DHCPv6 options:

  $ LIBNM_GLIB_DEBUG=properties-changed nmcli c show yolo
  ...
  libnm-Message: Property 'options' unhandled.
  ...
  (process:13522): libnm-CRITICAL **: nm_dhcp_config_get_options: assertion 'NM_IS_DHCP_CONFIG (config)' failed

(cherry picked from commit 4615d74de0)
2015-01-02 20:39:20 +01:00
Thomas Haller
eb7eafd424 nmcli/bash-completion: don't allow specifying connection by apath for 'connection modify'
The following must not be allowed:

  $ nmcli connection modify apath /org/freedesktop/NetworkManager/ActiveConnection/0

(cherry picked from commit 3cbce6994a)
2014-12-22 15:41:49 +01:00
Thomas Haller
4fb85b57b8 nmcli/bash-completion: fix detecting connection for connection modify
Previously we would only complete connections given by ID.
The following would work:
  $ nmcli connection modify id <ID> <TAB>
  $ nmcli connection modify <ID> <TAB>
  $ nmcli connection modify uuid <UUID> <TAB>
but the following would not work:
  $ nmcli connection modify <UUID> <TAB>

(cherry picked from commit 5ef233936a)
2014-12-22 15:41:49 +01:00
Piotr Drąg
bcb35eb6ad po: update Polish (pl) translation (bgo #741839)
https://bugzilla.gnome.org/show_bug.cgi?id=741839
(cherry picked from commit 17017f0831)
2014-12-21 20:17:41 +01:00
Piotr Drąg
b96aa5f4e2 po: fix broken Telugu (te) and Turkish (tr) translations
https://bugzilla.gnome.org/show_bug.cgi?id=741838
(cherry picked from commit ab9c57fd9a)
2014-12-21 20:04:19 +01:00
Dan Williams
acdaf78a06 release: bump version to 1.0.0 2014-12-19 11:14:21 -06:00
Dan Williams
a5508a0965 release: remove "nano" version
Now that NM is >= 1.0 there is no need for a "nano" version.
2014-12-19 11:14:20 -06:00
Dan Williams
bb0b6bcc6f Revert "core: force disable_ipv6=0 when turning on userspace IPv6LL"
This reverts commit 45434c0f2a.

Mistaken push, not committing this yet so close to release.
2014-12-19 11:14:20 -06:00
Dan Williams
45434c0f2a core: force disable_ipv6=0 when turning on userspace IPv6LL
If a device assumes a connection without activating a user-requested or
NM-requested connection, then disable_ipv6 is not touched.  When the device
is deactivated, it still isn't touched even though userspace IPv6LL
is enabled.  This could lead to an user-requested activation with
IPv6 configuration, but disable_ipv6=1.

Whenever userspace IPv6LL is turned on, we should also set disable_ipv6=0
to ensure IPv6 can function.  Userspace IPv6LL will ensure that the
interface does not have an address until the user/connection requests
it, which was the only reason that NM touched disable_ipv6 anyway.

fixes:NetworkManager_Test203_testcase_286589
fixes:NetworkManager_Test204_testcase_286590
2014-12-19 11:05:47 -06:00