Commit graph

16695 commits

Author SHA1 Message Date
Thomas Haller 1b38632d5d exported-object: fix adding get_property() function for "path" property
Fixes: e4e0daeed4
(cherry picked from commit aba850609b)
2017-01-25 17:19:16 +01:00
Thomas Haller 183d49f759 exported-object: add "path" GObject property to have notify signal
(cherry picked from commit e4e0daeed4)
2017-01-25 17:19:11 +01:00
Lubomir Rintel cd8e8ab1ca manager: don't let a master device go unmanaged on a slave activation
If a slave device activates, we should keep the master up even though it
was taken over before.

This fixes an issue, where a single slave to a master would be
reactivated after a daemon restart. The daemon restart would cause the
master to be treated externally created (would go unmanaged when all the
slaves are gone) while the reactivation would leave the master without
slaves for a while.

(cherry picked from commit b605fb2712)
2017-01-25 17:18:24 +01:00
Lubomir Rintel 8b9f3055bf active-connection: unhook the settings connection removed signal on dispose
Fixes: f0e3dfdace
(cherry picked from commit f541cef958)
2017-01-25 17:17:45 +01:00
Thomas Haller 63d4764acf core: refactor parsing in match_device_s390_subchannels_parse()
Changes:

  - match_device_s390_subchannels_parse() should accept un-initialized
    arguments a,b,c, as they are striclty output arguments (without
    transfering ownership).
  - the output arguments should be set if (and only if) the function
    succeeds. That is, move assigning the output arguments to the end.
  - increase the BUFSIZE. It's unclear why choosing 10. Probably that
    was already sufficient as a subchannel looks like
    "0.0.f5f0,0.0.f5f1,0.0.f5f2". Still, increase it to be ample.
    If we want to restrict the parsing based on the lenght of the input,
    that should be done explicitly (but that seems not desirable).
  - use _nm_utils_ascii_str_to_int64() which checks that the range
    of the values fits in guint32.

It seems wrong that match_device_s390_subchannels_eval() only compares
the first of up to three subchannels. But leave it as is for now.

(cherry picked from commit 419151a19e)
2017-01-25 17:15:37 +01:00
Thomas Haller 78272be2ff core/tests: add test matching s390-subchannels device spec
(cherry picked from commit 0f7098b71b)
2017-01-25 17:15:37 +01:00
Lubomir Rintel aa9e908c6a core: add missing initializers to match_data_s390_subchannels_eval()
match_device_s390_subchannels_parse() asserts that arguments point to
zeroes.

  1299     static gboolean
  1300     match_data_s390_subchannels_eval (const char *spec_str,
  1301                                       MatchDeviceData *match_data)
  1302     {
  >>>     CID 160923:  Uninitialized variables  (UNINIT)
  >>>     Declaring variable "c" without initializer.
  1303            guint32 a, b, c;

Fixes: b0aaff86b6
(cherry picked from commit 20328eaddf)
2017-01-25 17:15:36 +01:00
Thomas Haller 105d8a2447 device: fix setting minimal MTU to 1280 for IPv6
Fixes: 665e398022
(cherry picked from commit ec66135a40)
2017-01-24 16:38:21 +01:00
Thomas Haller e56d308ba5 core: avoid unexporting active-connection that is not exported
For better or worse, nm_exported_object_unexport() asserts that the
object is currently exported.

It's not clear that an active connection at this place is always
exported.

Fixes: f0e3dfdace
(cherry picked from commit c8a649b3de)
2017-01-24 16:19:41 +01:00
Lubomir Rintel db6e8b21e4 active-connection: drop off the bus when the settings connection disappears
The active connection has an immutable connection property, but is
cleaned asynchronously by the manager after its settings connection is
done. Fine, let's remove it from the bus first though, so that we don't
hang there with a dangling object path.

(cherry picked from commit f0e3dfdace)
2017-01-24 16:19:40 +01:00
Lubomir Rintel 701f79280f release: bump version to 1.5.91 (1.6-rc2) 2017-01-23 18:43:19 +01:00
Lubomir Rintel 57c084a611 NEWS: move the more important entries upwards 2017-01-23 18:42:55 +01:00
Thomas Haller 383d81e813 core: drop duplicate code searching for match in nm_match_spec_device()
When searching for "*", we still need to check for higher priority
"except:" matches. But don't duplicate the search loop and just
proceed with the regular searched.

It already has the "if (!except && match == NM_MATCH_SPEC_MATCH)" which
short-cuts the search.

(cherry picked from commit 9fff9f501a)
2017-01-23 09:44:14 +01:00
Thomas Haller 05d35647ec core: refactor nm_match_spec_device() to use match-data structure
Instead of passing on invdividual arguments for the match, create
a MatchDeviceData structure and pass it on.

This reduces the number of arguments and extending it later should
be easier. Also, lazily parse the hardware address as needed.

(cherry picked from commit b0aaff86b6)
2017-01-23 09:44:14 +01:00
Jiří Klimeš 283758dab3 cli: fix some TAB completions for nmcli -a con add
(cherry picked from commit 1cee85f556)
2017-01-21 21:32:31 +01:00
Jiří Klimeš e29add5f81 cli: move code around to group related functions - no functional change
* all getter/setter/describe, ... functions grouped according to properties
* sort the settings groups alphabetically

(cherry picked from commit 418733f2c1)
2017-01-21 19:56:40 +01:00
Jiří Klimeš 1298a998a1 cli: simplify property functions for allowed values with a macro
DEFINE_ALLOWED_FOR_ENUMS

(cherry picked from commit 5f90f48467)
2017-01-21 19:56:35 +01:00
Jiří Klimeš 49702826b7 cli: TAB-completion for macsec.mode in interactive editor
(cherry picked from commit 6573c2d860)
2017-01-21 19:56:29 +01:00
Jiří Klimeš 344e48da75 cli: TAB-completion for ipv6.addr-gen-mode in interactive editor
(cherry picked from commit 4d8800c876)
2017-01-21 19:56:23 +01:00
Thomas Haller 14708a510d core: merge branch 'th/match-spec-device-refactor'
(cherry picked from commit 38bb499140)
2017-01-20 21:18:55 +01:00
Thomas Haller 26d047bf0b src/tests: randomize device spec list for test
(cherry picked from commit b0e58a9823)
2017-01-20 21:18:32 +01:00
Thomas Haller 641eb7fd12 shared/tests: add nmtst_rand_perm_gslist() helper
(cherry picked from commit 7b84c73331)
2017-01-20 21:18:31 +01:00
Thomas Haller ba1cc6a288 core: refactor evaluation of device's match-spec
Previously, we would have different functions like
  - nm_match_spec_device_type()
  - nm_match_spec_hwaddr()
  - nm_match_spec_s390_subchannels()
  - nm_match_spec_interface_name()
which all would handle one type of match-spec.

So, to get the overall result whether the arguments
match or not, nm_device_spec_match_list() had to stich
them together and iterate the list multiple times.

Refactor the code to have one nm_match_spec_device()
function that gets all relevant paramters.

The upside is:

  - the logic how to evaluate the match-spec is all at one place
    (match_device_eval()) instead of spread over multiple
    functions.

  - It requires iterating the list at most twice. Twice, because
    we do a fast pre-search for "*".

One downside could be, that we have to pass all 4 arguments
for the evaluation, even if the might no be needed. That is,
because "nm-core-utils.c" shall be independend from NMDevice, it
cannot receive a device instance to get the parameters as needed.
As we would add new match-types, the argument list would grow.
However, all arguments are cached and fetching them from the
device's private data is very cheap.

(cherry picked from commit b957403efd)
2017-01-20 21:18:30 +01:00
Beniamino Galvani 2e8af781c5 device: don't call _commit_mtu() when ipv4.method=disabled
After commit 553717bb1c ("device: don't set ip4_state=IP_FAIL for
ipv4.method=disabled"), we commit an empty IPv4 configuration when
IPv4 is disabled. This means that it's not necessary anymore to call
_commit_mtu() because the MTU will be set in
ip4_config_merge_and_apply().

(cherry picked from commit 714b18dcf7)
2017-01-20 18:43:48 +01:00
Beniamino Galvani 303a65b4dd vlan: use parent interface mtu as default
After commit 22e8af6242 ("device: set a per-device default MTU on
activation") we explicitly set the VLAN MTU to 1500 if not overridden
by user settings. This has the advantage that the MTU is set to a
predictable value, while before it could have different values
depending on when the interface was created (for example, the
interface would get a 1500 MTU if created during boot, or would
inherit the parent's MTU if activated manually).

However, a better default value is the MTU of the parent interface
which is in most cases what the user wants. This value was the default
before commit 22e8af6242 for manually activated connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1414186
(cherry picked from commit 7dde8d8106)
2017-01-20 18:43:48 +01:00
Thomas Haller 29a8116fd0 device: mark properties in set_property() as construct-only
(cherry picked from commit ba47744997)
2017-01-20 17:41:09 +01:00
Thomas Haller 3b69a05fa0 device: remove duplicate setting of device's driver property
Fixes: 4dbaac4ba2
(cherry picked from commit 59f37f31d9)
2017-01-20 17:11:56 +01:00
Thomas Haller 0fd3ec81fd contrib/rpm: let NetworkManager-libnm and NetworkManager-glib of differing version conflict
Since commit "c920909 contrib/rpm: put translations in
NetworkManager-libnm and NetworkManager-glib packages", both
subpackages install the same translation files without a direct
dependency between the two packages. Thus, if a user tries
to update only one of the two subpackages, it will fail
during the installation due to conflicting files.

Fix that by having the subpackages conflict (per version).
This way, the conflict is detected before starting the
installation.

https://bugzilla.redhat.com/show_bug.cgi?id=1406454
(cherry picked from commit b85b8ed6fa)
2017-01-20 17:11:55 +01:00
Lubomir Rintel c2b9bb1844 veth: properly chain up the overridden notify method
Fixes: 992beb4f34
(cherry picked from commit af16cd5a92)
2017-01-20 16:29:53 +01:00
Lubomir Rintel 0822cbb032 libnm/object: lower the severity of the dangling object warning
The user can't do much about it and we can recover. This is a temporary
measure to avoid unnecessarily bothering the user.

(cherry picked from commit 7fec0755c9)
2017-01-19 16:15:42 +01:00
Lubomir Rintel 1afbf948a0 build: use different defaults for snapshot builds
Enable stricter compiler checks only for snapshot builds and default to more
tracing and asserting there.

(cherry picked from commit c1bb45c361)
2017-01-19 16:15:35 +01:00
Lubomir Rintel fd47a9a762 build: move the --enable-more-warning option from m4/ to configure.ac
It will make it easier to policy the default.

(cherry picked from commit 8647be3717)
2017-01-19 16:15:30 +01:00
Lubomir Rintel 9d431169c3 device: fix build with old glib & more asserts
src/devices/nm-device.c:8319:4: error: invalid use of void expression

(cherry picked from commit a4d61bf299)
2017-01-19 14:24:29 +01:00
Beniamino Galvani 99110ce529 act-request: return empty properties when not activated
We start to track changes to the device's properties only after the
active connection gets activated. It's wrong to return properties
while we don't track their changes as this causes stale objects
references on D-Bus. Let's return DHCP and IP configurations from the
device only when the connection is activated.

(cherry picked from commit 4215c2640a)
2017-01-19 14:23:38 +01:00
Lubomir Rintel b916d9dfe0 build: fix build with older gi
Fixes: 6c96aafaa9
(cherry picked from commit 22722b7732)
2017-01-19 14:18:26 +01:00
Lubomir Rintel 2ee8462774 build: make the doc generator find the right libnm.so
At some point gobject-introspection added an API to add a library path
and stopped honoring the LD_LIBRARY_PATH (a bug, according to GI
documentation?).

(cherry picked from commit 6c96aafaa9)
2017-01-19 11:21:38 +01:00
Thomas Haller ec805a6ce6 supplicant: update capabilities before marking manager as running
(cherry picked from commit 19ceaa1dc9)
2017-01-18 18:58:38 +01:00
Thomas Haller 6b6db3124a supplicant: update whether EAP-FAST is supported for existing supplicant-interface
As the fast-supported flag changes, update the existing supplicant
interfaces with the new information.

Also, by default assume it is supported.

(cherry picked from commit 872b9ec5ea)
2017-01-18 18:58:38 +01:00
Thomas Haller 1caae3743d supplicant: fix detection of EAP-FAST
At least with my supplicant, the capability is called
all-upper-case "FAST".

The check used case-insensitive, but that was broken
by a previous change.

Fixes: 9f5f141100
(cherry picked from commit 66ff601ecf)
2017-01-18 18:58:36 +01:00
Thomas Haller 90f097b9f5 build: don't install /etc/dbus-1/system.d/nm-ifcfg-rh.conf when building without ifcfg-rh plugin
(cherry picked from commit cca0ba01e4)
2017-01-18 00:11:21 +01:00
Thomas Haller c218fd44bc tests: fix tests without libjansson support (--enable-json-validation=no)
(cherry picked from commit a5acd0bdc6)
2017-01-17 23:52:18 +01:00
Piotr Drąg e1d3759712 po: update Polish (pl) translation (bgo #777402)
https://bugzilla.gnome.org/show_bug.cgi?id=777402
(cherry picked from commit 39455bb99f)
2017-01-17 23:04:14 +01:00
Lubomir Rintel de0df39646 device: add an initializer
Basically to silence gcc that is not smart enough to understand how does
.initialized and .value relate.

  src/devices/nm-device.c: In function '_commit_mtu':
  src/devices/nm-device.c:6754:15: error: 'ip6_mtu_sysctl.value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ()) {
                 ^

(cherry picked from commit 7ce805d49d)
2017-01-17 22:54:17 +01:00
Lubomir Rintel ba414491b7 release: bump version to 1.5.3 (1.6-rc1) 2017-01-17 14:50:22 +01:00
Thomas Haller 4100fc1d4d proxy: merge branch 'jk/proxy-fixes'
https://bugzilla.gnome.org/show_bug.cgi?id=777385
2017-01-17 14:27:42 +01:00
Jiří Klimeš 49e1fefc35 ifcfg-rh: add a basic test for Proxy setting 2017-01-17 14:27:31 +01:00
Jiří Klimeš 6397ce1fac cli: enable TAB-completion for proxy properties in interactive editor 2017-01-17 14:27:31 +01:00
Jiří Klimeš 1abee2e0d5 pacrunner: fix a few typos, uniforms spelling of various forms to "pacrunner" 2017-01-17 14:27:31 +01:00
Jiří Klimeš 8ac33b02b3 libnm-core: add ifcfg-rh documentation for proxy settings
PROXY_METHOD
BROWSER_ONLY
PAC_URL
PAC_SCRIPT
2017-01-17 14:27:31 +01:00
Jiří Klimeš addac21270 libnm-core: adjust the documentation of proxy setting
* fix capitalization of abbreviations and normal words
 * use % for Gtk-Doc values
 * and other adjustmens
2017-01-17 14:27:31 +01:00