Commit Graph

15047 Commits

Author SHA1 Message Date
Dan Winship
d040fd18ab introspection: trivial fixes
Add some missing files to libnmdbus.la. Add missing name-fixing
annotations to the XML to make all generated NMDBus types match the
names of their corresponding NM types.
2015-07-24 13:25:47 -04:00
Thomas Haller
8bca864111 core: move NM_DEFINE_SINGLETON macros to src/NetworkManagerUtils.h
NM_DEFINE_SINGLETON is used only by core and makes use of nm-logging.
It does not belong to "include/nm-macros-internal.h". Move it to "src/".
2015-07-24 18:07:16 +02:00
Thomas Haller
981817e998 Revert "core: move NM_DEFINE_SINGLETON macros to src/NetworkManagerUtils.h"
This reverts commit 1bca459865.

I accidentely pushed that commit. Revert.
2015-07-24 16:24:22 +02:00
Thomas Haller
a67c1ec4b5 libnm-core: fix return value in nm_utils_enum_to_str()
Fixes: 8be9814793
2015-07-24 15:48:29 +02:00
Thomas Haller
1bca459865 core: move NM_DEFINE_SINGLETON macros to src/NetworkManagerUtils.h
NM_DEFINE_SINGLETON is used only by core and makes use of nm-logging.
It does not belong to "include/nm-macros-internal.h". Move it to "src/".
2015-07-24 15:45:46 +02:00
Beniamino Galvani
0398ee0f4c merge: ethernet: add Wake-on-LAN support
Add support for configuring Wake-on-LAN options for Ethernet
connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1141417
2015-07-24 14:06:20 +02:00
Beniamino Galvani
996cbcd25c core: configure Wake-on-LAN parameters for Ethernet devices 2015-07-24 14:02:59 +02:00
Beniamino Galvani
de92df6c9f cli: add support for Wake-on-LAN settings 2015-07-24 14:02:59 +02:00
Beniamino Galvani
2e0d0bc050 ifcfg-rh: add support for Wake-on-LAN ethtool options
Based on branch danw/wip/ethtool by Dan Winship <danw@redhat.com>
2015-07-24 14:02:59 +02:00
Beniamino Galvani
5622461c04 libnm-core: add Wake-on-LAN properties to NMSettingWired 2015-07-24 14:02:59 +02:00
Beniamino Galvani
8be9814793 libnm-core: add enum conversion utilities
Add functions nm_utils_enum_to_str() and nm_utils_enum_from_str()
which can be used to perform conversions between enum values and
strings, passing the GType automatically generated for every enum by
glib-mkenums.
2015-07-24 14:02:59 +02:00
Josef Andersson
ea58caef36 po: update Swedish (sv) translation (bgo #752725)
https://bugzilla.gnome.org/show_bug.cgi?id=752725
2015-07-24 11:44:18 +02:00
Thomas Haller
be5f85ff63 keyfile: merge branch 'th/keyfile-write-connection-bgo740738'
https://bugzilla.gnome.org/show_bug.cgi?id=740738
2015-07-24 11:25:52 +02:00
Thomas Haller
6a5657896f keyfile: rename keyfile when user changes connection id
Originally, if you change the ID of a connection,
the existing keyfile will not be renamed. That means
after renaming a connection, it's keyfile name will
mismatch.

Now, when th user modifies a connection via D-Bus and changes
the connection it, rename the file.

https://bugzilla.gnome.org/show_bug.cgi?id=740738
2015-07-24 11:10:18 +02:00
Thomas Haller
238cb02ed6 keyfile: cleanup error messages in _internal_write_connection()
A GError should contain a nice, human readable error message. The
file:line prefix looks ugly. Also, the error messages are already
systemwide unique. So a user can easily grep for them and locate
the origin.
2015-07-24 11:04:01 +02:00
Thomas Haller
d5d34ec107 keyfile: refactor return paths in _internal_write_connection() 2015-07-24 11:04:01 +02:00
Thomas Haller
c0b03debc8 keyfile: add info logging when updating connection 2015-07-24 11:04:01 +02:00
Thomas Haller
c863d2ad0f keyfile: fix memleak of path in commit_changes() 2015-07-24 11:04:01 +02:00
Thomas Haller
47cc91bef6 core: fix handling route-metric for nm_ip4_config_merge()
Fixes: bc75cd53a8
2015-07-22 14:33:01 +02:00
Beniamino Galvani
3a7c641b02 libnm: backport symbols for metered connections support to 1.0.6
Backport to 1.0.6 the following symbols:
 - nm_device_get_metered
 - nm_metered_get_type
 - nm_setting_connection_get_metered
2015-07-22 14:06:31 +02:00
Thomas Haller
e6a8a08a57 default-route: merge branch 'th/default-route-on-unmanaged-device-rh1244483'
Fix wrongly managing the default-route on unmanaged devices. Also,
improve handling for p2p link with an 0.0.0.0 IPv4 gateway.

https://bugzilla.redhat.com/show_bug.cgi?id=1244483
2015-07-22 14:03:45 +02:00
Thomas Haller
7f129b976c libnm-core: don't assert against non-NULL @ip argument to canonicalize_ip()
Remove an assertion in canonicalize_ip() to assert that either a
non-NULL @ip is given, or @null_any is TRUE.

The condition of the assert is not easy to understand without context.
Instead the caller should already handle %NULL properly.

All callers that pass @null_any=FALSE to canonicalize_ip(), already assert
that the argument is not %NULL. With the exception of nm_ip_route_new()
which however checks for a valid @dest early on.
2015-07-22 13:49:17 +02:00
Lubomir Rintel
f14fd048ff libnm-core: 0.0.0.0 is a valid gateway too
It makes sense for point-to point links.

https://bugzilla.redhat.com/show_bug.cgi?id=1244483
2015-07-22 13:49:17 +02:00
Thomas Haller
9342568694 libnm-core: fix nm-setting-ip-config.c:valid_ip() to handle %NULL argument
We call valid_ip() from nm_ip_route_new() to check whether an untrusted string
is a valid ip address. Properly handle %NULL argument.

Fixes: 21c8a6b20e
2015-07-22 13:49:17 +02:00
Thomas Haller
2b55de8560 libnm-core: properly handle %NULL @ip in nm_utils_ipaddr_valid()
A is_valid() function should just accept NULL as input and
return "invalid". It certainly should not crash.

Fixes: 21c8a6b20e
2015-07-22 13:49:17 +02:00
Lubomir Rintel
063677101a ip4-config: 0.0.0.0 is a valid gateway too
It makes sense for point-to point links.

https://bugzilla.redhat.com/show_bug.cgi?id=1244483
2015-07-22 13:49:17 +02:00
Lubomir Rintel
e67b52ed16 default-route-manager: pick up platform changes after NMDevice
If a default route is configured externally, we want the device to pick the
change and register it with the default-route-manager first.

https://bugzilla.redhat.com/show_bug.cgi?id=1244483
2015-07-22 13:46:28 +02:00
Thomas Haller
bebeff69e8 device: always assume default-route for generate-assumed-connections
Commit d51975e changed, that we treat assumed and non-assumed
connections the same with respect to the default route. This is
certainly wrong, if we have an nm-generated-assumed connection
at hand. In this case, NM just generated a connection based on what
was configured on the system. Looking at that result and re-enforcing
the default-route is wrong.

We want to manage the default-route for assumed, persistent connections.
If the connection was assumed and generated, we do not.

This commit reverts d51975ed for nm-generated-assumed connection and
restores the previous behavior.

https://bugzilla.redhat.com/show_bug.cgi?id=1244483

Fixes: d51975ed92
2015-07-22 13:45:28 +02:00
Thomas Haller
cbd246c9b0 device: move setting v4_commit_first_time/v6_commit_first_time to the end of merge_and_apply() 2015-07-22 13:33:01 +02:00
Thomas Haller
ad03cdbc73 device/trivial: rename private field in NMDevicePrivate
Rename "default_route.v4_configure_first_time" to "v4_commit_first_time".

For one, the name "commit" matches better to the @commit variable in ip4_config_merge_and_apply()
and ip6_config_merge_and_apply(). Then, we don't need this information
only for default-routes, so move the variable out of the @default_route
struct.
2015-07-22 13:33:01 +02:00
Tore Anderson
3efb6740fc device: prefer wifi over wwan by default
This makes wifi preferred to wwan (the modem and bluetooth device types
to be specific) by default, so that users that care about being
connected at all times can keep both enabled with auto-connect. As wifi
is usually unmetered and often faster than wwan, it makes sense to
prefer it. This is also how pretty much every smart-phone in the world
behaves, so it aligns better with user expectations too.

https://bugzilla.gnome.org/show_bug.cgi?id=744754
2015-07-22 10:50:23 +02:00
Dan Williams
70f5968e9c libnm: fix nm_access_point_get_last_seen() code doc after 1e85c358
Fixes: 1e85c358
2015-07-17 17:32:28 -05:00
Dan Williams
4e47d36d73 libnm-core: fix GOI annotations after 019943bb
Fixes: 019943bb
2015-07-17 17:31:17 -05:00
Jiří Klimeš
94b1b53a91 cli: fix verifying flag-based properties (rh #1244048)
Some of the properties changed from GParamSpecUInt to GParamSpecFlags, namely
NM_SETTING_VLAN_FLAGS
NM_SETTING_DCB_APP_FCOE_FLAGS
NM_SETTING_DCB_APP_ISCSI_FLAGS
NM_SETTING_DCB_APP_FIP_FLAGS
NM_SETTING_DCB_PRIORITY_FLOW_CONTROL_FLAGS
NM_SETTING_DCB_PRIORITY_GROUP_FLAGS

(commit fcfb4b40ba)

https://bugzilla.redhat.com/show_bug.cgi?id=1244048
2015-07-17 11:36:03 +02:00
Jiří Klimeš
2af10ef444 docs: fix a copy/paste error in description of VLAN flags 2015-07-17 09:20:29 +02:00
Dan Williams
f99d98b56a merge: vpn: delay quitting when a new secrets request comes in (bgo #752237)
https://bugzilla.gnome.org/show_bug.cgi?id=752237
2015-07-16 16:50:32 -05:00
Dan Williams
3272ff6fc5 libnm/libnm-glib: don't quit in the middle of asking for secrets (bgo #752237)
If the VPN plugin terminated and the user started it again, then the
quit timer will still be running and it sometimes happens that the
VPN plugin will quit while the UI is asking the user for secrets.
That's not very nice, so don't do that.

Reproducer: while connect to the VPN, suspend your laptop.  Then
resume it, and immediately re-start the VPN connection.  Watch the
secrets dialog disappear within a very short time.

https://bugzilla.gnome.org/show_bug.cgi?id=752237
2015-07-16 16:50:10 -05:00
Dan Williams
aa7ab4b056 libnm/libnm-glib: clean up VPN plugin timeouts
Use nm_clear_g_source().
2015-07-16 16:46:27 -05:00
Thomas Haller
eab32a5252 connectivity: log warning when using https:// URI
https://bugzilla.gnome.org/show_bug.cgi?id=747866
2015-07-16 17:08:55 +02:00
Dan Williams
6a81daf1cb connectivity: explicitly check for 511/Network Authentication Required (RFC6585) (bgo #670394)
If the response affirmatively indicates you're behind a portal, we might as well
use that information.

https://bugzilla.gnome.org/show_bug.cgi?id=670394
2015-07-16 10:04:44 -05:00
Thomas Haller
2a3a4eb16f config/rpm: use plain HTTP URI for connectivity checking
https://bugzilla.gnome.org/show_bug.cgi?id=747866
2015-07-16 16:44:49 +02:00
David Shea
568b4ad31f libnm: handle illegal characters in nm_utils_ssid_to_utf8() (rh #1243078)
g_convert_with_fallback() will fail if the SSID contains characters that
are not legal in the source encoding, which, if $LANG is not set, will
be ASCII. If this happens, replace all non-ASCII and non-printable
characters with '?'. It is possible that nm_utils_ssid_to_utf8() will
now return an empty string (e.g., the source string is actually
big-endian UTF-16 and g_strcanon() stops on the first byte), but it will
not return NULL.

https://bugzilla.redhat.com/show_bug.cgi?id=1243078
2015-07-16 14:22:03 +02:00
Jiří Klimeš
7b6299d8dd cli: fix a crash adding a slave connection with 'nmcli -a con add'
Valid types: [generic, 802-3-ethernet (ethernet), pppoe, 802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, 802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, bridge-slave]
Connection type: team-slave
Interface name [*]: eth5
Master: nm-team

Program received signal SIGSEGV, Segmentation fault.
0x000000000041ae6d in normalized_master_for_slave (connections=connections@entry=0x7fffec0019a0, master=<optimized out>, master@entry=0x73b470 "nm-team",
    type=type@entry=0x72f7c0 "team", out_type=out_type@entry=0x0) at connections.c:3218
3218					*out_type = con_type;

Fixes: aa12bb353b
2015-07-15 17:16:11 +02:00
Jiří Klimeš
9856ca6058 cli: fix formating of "nmcli con add help" output 2015-07-15 16:08:31 +02:00
Jiří Klimeš
133996acbb cli: add 'slave-type' parameter for "nmcli con add" to bash completion
Fixes: 1375d9c13a
2015-07-15 16:00:18 +02:00
Jiří Klimeš
819d3c3db1 settings: call dispatcher when setting hostname with systemd
Now that we set hostname with systemd, call dispatcher in nm-settings.c.
gethostname() in nm-policy.c already sees the new hostname.

Fixes: 6dc35e66d4
Fixes: 6c3d71c431
Fixes:Beaker:NetworkManager_Test44_dispatcher_hostname
2015-07-15 15:34:56 +02:00
Lubomir Rintel
924117c144 build: fix comment for NM_MORE_LOGGING
Reported-by: Michael Biebl <biebl@debian.org>
2015-07-15 11:03:35 +02:00
Dan Horák
97cf6e47dd contrib/rpm: WEXT depends on enabled wifi 2015-07-14 19:02:35 +02:00
Thomas Haller
59ca132b3a logging: merge branch 'th/logging-sd-journal-bgo752136'
https://bugzilla.gnome.org/show_bug.cgi?id=752136
2015-07-14 15:59:13 +02:00
Thomas Haller
81f3c36f23 logging: refactor level conversion from switch() to @level_desc lookup-array 2015-07-14 15:55:14 +02:00