Commit graph

23034 commits

Author SHA1 Message Date
Thomas Haller 911f2dfe56 shared: fix missing space printing "send-always" flag of NMTeamLinkWatcher 2019-04-25 07:47:09 +02:00
Thomas Haller db9fbcee6c cli,shared: move NMTeamLinkWatcher to/from string function to "nm-libnm-core-aux.h"
to/from string functions are useful. We should be able to reuse them.
Move them to their own location.

Also, it moves independent code out of "clients/common/nm-meta-setting-desc.c"
which is already one of the largest source files we have.

Also, it makes the code unit-testable, which is obviously required
as the code has bugs.
2019-04-25 07:46:17 +02:00
Thomas Haller 14b94e6adf shared: add "nm-libnm-core-aux/nm-libnm-core-aux.h" 2019-04-25 07:45:31 +02:00
Beniamino Galvani bb9e3195d2 manager: merge branch 'bg/sw-device-sleep-rh1701585'
https://bugzilla.redhat.com/show_bug.cgi?id=1701585
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/123
2019-04-24 16:20:52 +02:00
Beniamino Galvani 32ee51eee0 manager: unmanage software devices when networking gets disabled
If a user disables networking, we consider that as an indication that
also software devices must be disconnected. OTOH, we don't want to
destroy them for external events as a system suspend.
2019-04-24 16:20:11 +02:00
Beniamino Galvani 656753b708 manager: clear unmanaged-sleeping flag on software devices on resume
When networking is disabled at NM startup we unmanage all devices
(including software ones) due to SLEEPING. After networking gets
enabled again we must clear the unmanaged-sleeping flag on software
devices.
2019-04-24 16:20:11 +02:00
Beniamino Galvani 2d347e7e17 cli: don't wait for connection change on update failure
When saving a connection, we wait the connection-changed signal before
proceeding to ensure that the remote connection is up to date.
However, no signal is emitted if the update fails and so we shouldn't
wait for it.

Fixes: a370faeb59 ('cli: wait for changed signal after updating a connection'):

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/124
https://bugzilla.redhat.com/show_bug.cgi?id=1702203
2019-04-24 16:18:25 +02:00
Till Maas fb9f28a323 README: Update git clone command
https://github.com/NetworkManager/NetworkManager/pull/349
2019-04-24 13:19:34 +02:00
Thomas Haller 17adf58d5d tools: fix out-of-tree build test "tools/check-docs.sh" for duplicate generated sources
When we do an in-tree-build with autotools and an out-of-tree build
with meson (all in the same source directory), then we have the
following files:

  libnm-core/nm-core-enum-types.h
  libnm/nm-enum-types.h
  build/libnm-core/nm-core-enum-types.h
  build/libnm/nm-enum-types.h

This caused "tools/check-docs.sh" for `ninja -C build test` to fail,
because the files are detected twice:

    --- command ---
    /data/src/NetworkManager/tools/check-docs.sh /data/src/NetworkManager /data/src/NetworkManager/build
    --- stderr ---
    8a9
    > nm-core-enum-types
    38a40
    > nm-enum-types
    *** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***
    -------
2019-04-23 11:45:06 +02:00
Thomas Haller a9b4362fc5 tools: cleanup path variable in "tools/check-docs.sh"
- don't append the path separator to the SOURCEDIR variable.
  Instead, use the path separator when we need it.
2019-04-23 11:45:06 +02:00
Thomas Haller b237c4303f release: bump version to 1.19.1-dev after 1.18.0 release
After 1.18.0 is released, merge it back into master so that
1.18.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.18.0 and 1.18-rc*.

Also bump the micro version to 1.19.1-dev to indicate that this is
after 1.18.0 is out.
2019-04-21 12:56:26 +02:00
Thomas Haller cb73953183 release: bump version to 1.18.0 2019-04-21 12:45:54 +02:00
Thomas Haller b86830512e release: update NEWS 2019-04-21 12:45:08 +02:00
Thomas Haller d1484f5f36 libnm: add missing NM_AVAILABLE_IN_1_18 markers to nm_ip_routing_rule_*() API
(cherry picked from commit 32594889bf)
2019-04-21 12:42:57 +02:00
Thomas Haller 32594889bf libnm: add missing NM_AVAILABLE_IN_1_18 markers to nm_ip_routing_rule_*() API 2019-04-21 12:42:38 +02:00
Thomas Haller f43fb59b6d gitlab-ci: install glib2-doc via "contrib/fedora/REQUIRED_PACKAGES"
We also generate a source tarball and artifact it.

Hence, we need proper gtk-doc links. This requires files in
/usr/share/gtk-doc/html for adding cross links. Install glib2-doc
package.

Note that in containers dnf is configured to not install documentation
files. We need to override that.

(cherry picked from commit a0f31e4038)
2019-04-20 21:02:16 +02:00
Thomas Haller a0f31e4038 gitlab-ci: install glib2-doc via "contrib/fedora/REQUIRED_PACKAGES"
We also generate a source tarball and artifact it.

Hence, we need proper gtk-doc links. This requires files in
/usr/share/gtk-doc/html for adding cross links. Install glib2-doc
package.

Note that in containers dnf is configured to not install documentation
files. We need to override that.
2019-04-20 19:36:39 +02:00
A S Alam a7474edcc6 po: updated Panjabi (pa) Translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/120
(cherry picked from commit 0247c06d97)
2019-04-20 18:07:07 +02:00
A S Alam 0247c06d97 po: updated Panjabi (pa) Translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/120
2019-04-20 18:06:28 +02:00
Thomas Haller 69652d40f7 gitlab-ci: don't use "test && cmd" in build step
We don't want stesp to return an error, which is what
"test && cmd" does, if the test evaluates to false.

Instead, use "! test || cmd" which has more the semantics
that we want.

(cherry picked from commit 2a2c58339b)
2019-04-20 08:56:30 +02:00
Thomas Haller 6ea499ac40 libnm: don't return deep-copied strv array from nm_tc_qdisc_get_attribute_names()
Most of the caller won't require a deep-clone of the attribute
names. Likely, the fetch the name, so they can lookup the attributes.
In that common case, there is no need to clone the strings themself.

(cherry picked from commit 01e7cb11bf)
2019-04-20 08:56:29 +02:00
Thomas Haller 70d8f5ddfe libnm-core: avoid cloning attributes of NMTCQdisc/NMTCAction to convert to string
(cherry picked from commit 48316f987a)
2019-04-20 08:56:27 +02:00
Thomas Haller 2a2c58339b gitlab-ci: don't use "test && cmd" in build step
We don't want stesp to return an error, which is what
"test && cmd" does, if the test evaluates to false.

Instead, use "! test || cmd" which has more the semantics
that we want.
2019-04-20 08:53:37 +02:00
Thomas Haller 01e7cb11bf libnm: don't return deep-copied strv array from nm_tc_qdisc_get_attribute_names()
Most of the caller won't require a deep-clone of the attribute
names. Likely, the fetch the name, so they can lookup the attributes.
In that common case, there is no need to clone the strings themself.
2019-04-20 08:09:52 +02:00
Thomas Haller 48316f987a libnm-core: avoid cloning attributes of NMTCQdisc/NMTCAction to convert to string 2019-04-20 08:09:33 +02:00
Thomas Haller 79ecdb589b gitlab-ci: build release tarball and artifact it
(cherry picked from commit 84e19c6ca9)
2019-04-19 11:31:57 +02:00
Thomas Haller 84e19c6ca9 gitlab-ci: build release tarball and artifact it 2019-04-19 09:38:12 +02:00
Thomas Haller 7973680ca2 gitlab-ci: build on Ubuntu 16.04, 18.04 and Debian stretch (9), testing, sid
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/119
(cherry picked from commit 1ca380f69f)
2019-04-19 08:22:14 +02:00
Thomas Haller 1ca380f69f gitlab-ci: build on Ubuntu 16.04, 18.04 and Debian stretch (9), testing, sid
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/119
2019-04-19 08:20:12 +02:00
Thomas Haller fdac4b3bcf build/meson: skip building fake-typelib if gnome.compile_resources() too old
Otherwise, the meson configure step fails with:

  libnm/fake-typelib/meson.build:23:0: ERROR: The "dependencies" argument of gnome.compile_resources() can not
  be used with the current version of glib-compile-resources due to
  <https://bugzilla.gnome.org/show_bug.cgi?id=774368>

The fake-typelib is not really essential. Don't fix it, just print
a warning that we are unable to build it.
2019-04-19 07:34:41 +02:00
Till Maas 51aee380c0 contrib/rpm: Provide list of units to %systemd_postun
%systemd_postun is meant to be run with arguments and Fedora Rawhide
seems to enforce this now. Therefore provide the units there, too.

https://github.com/NetworkManager/NetworkManager/pull/348
(cherry picked from commit 7d62f81e2e)
2019-04-18 21:51:35 +02:00
Till Maas 7d62f81e2e contrib/rpm: Provide list of units to %systemd_postun
%systemd_postun is meant to be run with arguments and Fedora Rawhide
seems to enforce this now. Therefore provide the units there, too.

https://github.com/NetworkManager/NetworkManager/pull/348
2019-04-18 21:51:10 +02:00
Thomas Haller 69b8036f37 build/meson: fix location of introspection files
With glib < 2.51.3, gdbus-codegen does not understand "--output-directory" [1].
Hence, the generated files are like

    "build/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

instead of

    "build/introspection/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

But gnome.gdbus_codegen() returns a path as if it would be inside
"build/introspection". Hack around that, by patching the correct path
otherwise. This is still ugly, because repeated "ninja -C build" calls
will always try to rebuild this target (because the wrong file name
is considered).

See also [2].

[1] ee09bb704f
[2] 2e93ed58c3/mesonbuild/modules/gnome.py (L1170)

(cherry picked from commit ad9e5995e1)
2019-04-18 20:20:46 +02:00
Thomas Haller ed88c71f15 platform: fix nm_platform_lnk_gre_to_string() for tap links
Why didn't we get a compiler warning about this bug?
At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:

    CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
  ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                      lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                      ^

Fixes: 4c2862b958 ('platform: add gretap tunnels support')
(cherry picked from commit dfb899f465)
2019-04-18 20:20:44 +02:00
Thomas Haller ad9e5995e1 build/meson: fix location of introspection files
With glib < 2.51.3, gdbus-codegen does not understand "--output-directory" [1].
Hence, the generated files are like

    "build/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

instead of

    "build/introspection/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml"

But gnome.gdbus_codegen() returns a path as if it would be inside
"build/introspection". Hack around that, by patching the correct path
otherwise. This is still ugly, because repeated "ninja -C build" calls
will always try to rebuild this target (because the wrong file name
is considered).

See also [2].

[1] ee09bb704f
[2] 2e93ed58c3/mesonbuild/modules/gnome.py (L1170)
2019-04-18 20:18:17 +02:00
Thomas Haller dfb899f465 platform: fix nm_platform_lnk_gre_to_string() for tap links
Why didn't we get a compiler warning about this bug?
At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:

    CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
  ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                      lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                      ^

Fixes: 4c2862b958 ('platform: add gretap tunnels support')
2019-04-18 20:18:17 +02:00
Thomas Haller 0e2abc02a1 shared: merge branch 'th/shared-library-refactoring'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/113

(cherry picked from commit 9740bd6d99)
2019-04-18 20:15:16 +02:00
Thomas Haller e7836cd151 build/meson: rename "nm_core_dep" to "libnm_core_dep"
The library is called "libnm_core". So the dependency should be called
"libnm_core_dep", like in all other cases.

(cherry picked from commit c27ad37c27)
2019-04-18 20:13:49 +02:00
Thomas Haller 284ac92eee shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core
"libnm-core" implements common functionality for "NetworkManager" and
"libnm".

Note that clients like "nmcli" cannot access the internal API provided
by "libnm-core". So, if nmcli wants to do something that is also done by
"libnm-core", , "libnm", or "NetworkManager", the code would have to be
duplicated.

Instead, such code can be in "libnm-libnm-core-{intern|aux}.la".
Note that:

  0) "libnm-libnm-core-intern.la" is used by libnm-core itsself.
     On the other hand, "libnm-libnm-core-aux.la" is not used by
     libnm-core, but provides utilities on top of it.

  1) they both extend "libnm-core" with utlities that are not public
     API of libnm itself. Maybe part of the code should one day become
     public API of libnm. On the other hand, this is code for which
     we may not want to commit to a stable interface or which we
     don't want to provide as part of the API.

  2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core"
     and thus directly available to "libnm" and "NetworkManager".
     On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm"
     and "NetworkManager".
     Both libraries may be statically linked by libnm clients (like
     nmcli).

  3) it must only use glib, libnm-glib-aux.la, and the public API
     of libnm-core.
     This is important: it must not use "libnm-core/nm-core-internal.h"
     nor "libnm-core/nm-utils-private.h" so the static library is usable
     by nmcli which couldn't access these.

Note that "shared/nm-meta-setting.c" is an entirely different case,
because it behaves differently depending on whether linking against
"libnm-core" or the client programs. As such, this file must be compiled
twice.

(cherry picked from commit af07ed01c0)
2019-04-18 20:07:44 +02:00
Thomas Haller 87f7e6844d shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h"
(cherry picked from commit 8183335878)
2019-04-18 20:03:54 +02:00
Thomas Haller d984b2ce4a shared: move most of "shared/nm-utils" to "shared/nm-glib-aux"
From the files under "shared/nm-utils" we build an internal library
that provides glib-based helper utilities.

Move the files of that basic library to a new subdirectory
"shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
to "libnm-glib-aux.la".

Reasons:

 - the name "utils" is overused in our code-base. Everything's an
   "utils". Give this thing a more distinct name.

 - there were additional files under "shared/nm-utils", which are not
   part of this internal library "libnm-utils-base.la". All the files
   that are part of this library should be together in the same
   directory, but files that are not, should not be there.

 - the new name should better convey what this library is and what is isn't:
   it's a set of utilities and helper functions that extend glib with
   funcitonality that we commonly need.

There are still some files left under "shared/nm-utils". They have less
a unifying propose to be in their own directory, so I leave them there
for now. But at least they are separate from "shared/nm-glib-aux",
which has a very clear purpose.

(cherry picked from commit 80db06f768)
2019-04-18 19:57:27 +02:00
Thomas Haller 956215868c shared: move udev helper to separate directory "shared/nm-udev-aux"
We built (among others) two libraries from the sources in "shared/nm-utils":
"libnm-utils-base.la" and "libnm-utils-udev.la".

It's confusing. Instead use directories so there is a direct
correspondence between these internal libraries and the source files.

(cherry picked from commit 2973d68253)
2019-04-18 19:46:50 +02:00
Thomas Haller 0a6f21fb8d shared: split C-only helper "shared/nm-std-aux" utils out of "shared/nm-utils"
"shared/nm-utils" contains general purpose utility functions that only
depend on glib (and extend glib with some helper functions).

We will also add code that does not use glib, hence it would be good
if the part of "shared/nm-utils" that does not depend on glib, could be
used by these future projects.

Also, we use the term "utils" everywhere. While that covers the purpose
and content well, having everything called "nm-something-utils" is not
great. Instead, call this "nm-std-aux", inspired by "c-util/c-stdaux".

(cherry picked from commit b434b9ec07)
2019-04-18 19:17:23 +02:00
Thomas Haller 9740bd6d99 shared: merge branch 'th/shared-library-refactoring'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/113
2019-04-18 19:13:26 +02:00
Thomas Haller c27ad37c27 build/meson: rename "nm_core_dep" to "libnm_core_dep"
The library is called "libnm_core". So the dependency should be called
"libnm_core_dep", like in all other cases.
2019-04-18 18:59:09 +02:00
Thomas Haller af07ed01c0 shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core
"libnm-core" implements common functionality for "NetworkManager" and
"libnm".

Note that clients like "nmcli" cannot access the internal API provided
by "libnm-core". So, if nmcli wants to do something that is also done by
"libnm-core", , "libnm", or "NetworkManager", the code would have to be
duplicated.

Instead, such code can be in "libnm-libnm-core-{intern|aux}.la".
Note that:

  0) "libnm-libnm-core-intern.la" is used by libnm-core itsself.
     On the other hand, "libnm-libnm-core-aux.la" is not used by
     libnm-core, but provides utilities on top of it.

  1) they both extend "libnm-core" with utlities that are not public
     API of libnm itself. Maybe part of the code should one day become
     public API of libnm. On the other hand, this is code for which
     we may not want to commit to a stable interface or which we
     don't want to provide as part of the API.

  2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core"
     and thus directly available to "libnm" and "NetworkManager".
     On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm"
     and "NetworkManager".
     Both libraries may be statically linked by libnm clients (like
     nmcli).

  3) it must only use glib, libnm-glib-aux.la, and the public API
     of libnm-core.
     This is important: it must not use "libnm-core/nm-core-internal.h"
     nor "libnm-core/nm-utils-private.h" so the static library is usable
     by nmcli which couldn't access these.

Note that "shared/nm-meta-setting.c" is an entirely different case,
because it behaves differently depending on whether linking against
"libnm-core" or the client programs. As such, this file must be compiled
twice.
2019-04-18 18:59:09 +02:00
Thomas Haller 8183335878 shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h" 2019-04-18 18:59:09 +02:00
Thomas Haller 80db06f768 shared: move most of "shared/nm-utils" to "shared/nm-glib-aux"
From the files under "shared/nm-utils" we build an internal library
that provides glib-based helper utilities.

Move the files of that basic library to a new subdirectory
"shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
to "libnm-glib-aux.la".

Reasons:

 - the name "utils" is overused in our code-base. Everything's an
   "utils". Give this thing a more distinct name.

 - there were additional files under "shared/nm-utils", which are not
   part of this internal library "libnm-utils-base.la". All the files
   that are part of this library should be together in the same
   directory, but files that are not, should not be there.

 - the new name should better convey what this library is and what is isn't:
   it's a set of utilities and helper functions that extend glib with
   funcitonality that we commonly need.

There are still some files left under "shared/nm-utils". They have less
a unifying propose to be in their own directory, so I leave them there
for now. But at least they are separate from "shared/nm-glib-aux",
which has a very clear purpose.
2019-04-18 18:59:09 +02:00
Thomas Haller 2973d68253 shared: move udev helper to separate directory "shared/nm-udev-aux"
We built (among others) two libraries from the sources in "shared/nm-utils":
"libnm-utils-base.la" and "libnm-utils-udev.la".

It's confusing. Instead use directories so there is a direct
correspondence between these internal libraries and the source files.
2019-04-18 18:58:28 +02:00
Thomas Haller b434b9ec07 shared: split C-only helper "shared/nm-std-aux" utils out of "shared/nm-utils"
"shared/nm-utils" contains general purpose utility functions that only
depend on glib (and extend glib with some helper functions).

We will also add code that does not use glib, hence it would be good
if the part of "shared/nm-utils" that does not depend on glib, could be
used by these future projects.

Also, we use the term "utils" everywhere. While that covers the purpose
and content well, having everything called "nm-something-utils" is not
great. Instead, call this "nm-std-aux", inspired by "c-util/c-stdaux".
2019-04-18 18:57:24 +02:00