Commit Graph

27267 Commits

Author SHA1 Message Date
Thomas Haller
62411390e2 build: rename "tools/check-settings-docs.sh" to "check-compare-generated.sh"
It's a better name, because the script merely compiles files and
is not specific to "settings-docs.h".
2020-11-03 15:41:39 +01:00
Thomas Haller
82ebd73bec build: cleanup "tools/check-settings-docs.sh" script 2020-11-03 15:41:39 +01:00
Thomas Haller
ab8fdb73e6 build: commit pre-generated "generate-docs-nm-settings-nmcli.xml" to git
We can generate "generate-docs-nm-settings-nmcli.xml" by running "clients/cli/generate-docs-nm-settings-nmcli".
However, during cross compilation, that binary gets build in the target architecture,
it can thus not run to generate the XML.
2020-11-03 15:41:39 +01:00
Thomas Haller
a208da4139 build: only generate "settings-docs.h" with "--enable-gtk-doc"
Note that "--enable-gtk-doc" requires "--enable-introspection".

For generating "settings-docs.h" we (only) need introspection/pygobject.
We also have a pre-generated .in file that we can use if introspection
is not available. Since we have a pre-generated variant, it would be fine
to always use that one. However, we want to use generate the file if we
have the necessary dependencies, because thereby we can check whether
the pre-generated file is identical to what would be generated.

We have a similar problem with "generate-docs-nm-settings-nmcli.xml".
However there we don't need introspection, but merely being able to
execute a binary that we build. That does not work during cross
compilation, so we will honor "--enable-gtk-doc" flag to decide when
to generate the file.

For consistency, also adjust the condition for "settings-docs.h" to only
generate the file if we have "--enable-gtk-doc" (but not it we build
with "--enable-introspection" alone).
2020-11-03 15:41:38 +01:00
Thomas Haller
6968c4141c build/meson: move enable_docs variable
It will be used in subdirectories. Move it.
2020-11-03 15:41:38 +01:00
Thomas Haller
b57198a7bc build: merge branch 'th/workaround-glib-atomic-pointer-get'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/667
2020-11-03 15:40:15 +01:00
Thomas Haller
fd57e9665c libnm: with meson include "nm-default.h" for glib-mkenums sources
We also do that for the autotools implementation.
2020-11-03 15:39:01 +01:00
Thomas Haller
755d97d38c libnm/tests: include "nm-default.h" for "libnm-core/tests/nm-core-tests-enum-types.c"
With glib2-2.67.0-1.fc34.x86_64.rpm, clang-11.0.0-2.fc34.x86_64.rpm, the
generated code emits a compiler warning:

    libnm-core/tests/nm-core-tests-enum-types.c:17:7: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
      if (g_once_init_enter (&g_define_type_id__volatile))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    libnm-core/tests/nm-core-tests-enum-types.c:40:7: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
      if (g_once_init_enter (&g_define_type_id__volatile))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    libnm-core/tests/nm-core-tests-enum-types.c:63:7: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
      if (g_once_init_enter (&g_define_type_id__volatile))
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~

We could pass "-Wincompatible-pointer-types-discards-qualifiers" as CFLAGS
when building this file. However, we have a workaround in our "nm-glib-aux/nm-glib.h",
so we can instead include "nm-default.h". At first glance, that might look like
the less preferable solution. However, this file is only there for unit tests,
and we also include "nm-default.h" for other sources that are generated with
"glib-mkenums". So, doing it also for our tests becomes the preferable solution.
2020-11-03 15:39:01 +01:00
Thomas Haller
42fa8f3d27 shared: don't enforce unset G_LOG_DOMAIN in "nm-default.h"
When including <glib.h>, it will always define G_LOG_DOMAIN if it
is not yet defined.

Usually we want to include "nm-default.h" as very first header. In that
case, <glib.h> is not yet included. Then the previous check #error works
well.

However, if we include "nm-default.h" in sources generated by
glib-mkenums, then the generator first already includes <glib.h>,
and thus defines G_LOG_DOMAIN. It does so for "libnm-core/nm-core-enum-types.c"
and "libnm/nm-enum-types.c", where the #error would not trigger.
But we will also include "nm-default.h" for "libnm-core/tests/nm-core-tests-enum-types.c".
That will start triggering this #error.

While in general we want to include "nm-default.h" first, we also need
to support cases where <glib.h> gets included first. Thus this error is
not useful. Remove it.
2020-11-03 15:39:01 +01:00
Thomas Haller
7c60e984b6 shared: also reimplement g_atomic_pointer_set() macro
It's not strictly necessary, because contrary to g_atomic_pointer_get()
and g_atomic_pointer_compare_and_exchange(), glib's variant for the
setter is mostly fine.

Still, reimplement it, because we use typeof() eagerly and can thus add
more static checks than glib.
2020-11-03 15:39:00 +01:00
Thomas Haller
5e57ea37f0 shared: add a compat implementation for g_atomic_pointer_get()
With glib2-2.67.0-1.fc34.x86_64.rpm, clang-11.0.0-2.fc34.x86_64.rpm, we
get a failure for g_atomic_pointer_get():

    ../shared/nm-glib-aux/nm-hash-utils.c:38:9: error: passing 'typeof (*(&global_seed)) *' (aka 'const unsigned char *volatile *') to parameter of type 'const guint8 **' (aka 'const unsigned char **') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        g = g_atomic_pointer_get(&global_seed);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    ../shared/nm-glib-aux/nm-hash-utils.c:109:32: error: passing 'typeof (*(&global_seed)) *' (aka 'const unsigned char *volatile *') to parameter of type 'const guint8 **' (aka 'const unsigned char **') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        return ((*((const guint *) _get_hash_key())) ^ static_seed) ?: 3679500967u;
                                   ^~~~~~~~~~~~~~~
    ../shared/nm-glib-aux/nm-hash-utils.c:84:14: note: expanded from macro '_get_hash_key'
            _g = g_atomic_pointer_get(&global_seed); \
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    ../shared/nm-glib-aux/nm-hash-utils.c:123:9: error: passing 'typeof (*(&global_seed)) *' (aka 'const unsigned char *volatile *') to parameter of type 'const guint8 **' (aka 'const unsigned char **') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        g = _get_hash_key();
            ^~~~~~~~~~~~~~~
    ../shared/nm-glib-aux/nm-hash-utils.c:84:14: note: expanded from macro '_get_hash_key'
            _g = g_atomic_pointer_get(&global_seed); \
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
2020-11-03 15:39:00 +01:00
Thomas Haller
03d9ec27fa introspection: avoid compiler warning in generated introspection files
Disable "-Wincompatible-pointer-types-discards-qualifiers" warning, as
this breaks build of the gdbus-codegen files.

With glib2-2.67.0-1.fc34.x86_64.rpm, clang-11.0.0-2.fc34.x86_64.rpm, we
get a failure to build generated code:

    introspection/org.freedesktop.NetworkManager.AccessPoint.c:438:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_INTERFACE (NMDBusAccessPoint, nmdbus_access_point, G_TYPE_OBJECT)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1784:47: note: expanded from macro 'G_DEFINE_INTERFACE'
    #define G_DEFINE_INTERFACE(TN, t_n, T_P)                    G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, ;)
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1803:61: note: expanded from macro 'G_DEFINE_INTERFACE_WITH_CODE'
    #define G_DEFINE_INTERFACE_WITH_CODE(TN, t_n, T_P, _C_)     _G_DEFINE_INTERFACE_EXTENDED_BEGIN(TN, t_n, T_P) {_C_;} _G_DEFINE_INTERFACE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2042:7: note: expanded from macro '_G_DEFINE_INTERFACE_EXTENDED_BEGIN'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    introspection/org.freedesktop.NetworkManager.AccessPoint.c:944:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointProxy, nmdbus_access_point_proxy, G_TYPE_DBUS_PROXY,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
    #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
      _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
    introspection/org.freedesktop.NetworkManager.AccessPoint.c:1729:1: error: passing 'typeof (*(&g_define_type_id__volatile)) *' (aka 'volatile unsigned long *') to parameter of type 'gsize *' (aka 'unsigned long *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
    G_DEFINE_TYPE_WITH_CODE (NMDBusAccessPointSkeleton, nmdbus_access_point_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:1615:56: note: expanded from macro 'G_DEFINE_TYPE_WITH_CODE'
    #define G_DEFINE_TYPE_WITH_CODE(TN, t_n, T_P, _C_)          _G_DEFINE_TYPE_EXTENDED_BEGIN (TN, t_n, T_P, 0) {_C_;} _G_DEFINE_TYPE_EXTENDED_END()
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2032:3: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN'
      _G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER(TypeName, type_name, TYPE_PARENT, flags) \
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/gobject/gtype.h:2000:7: note: expanded from macro '_G_DEFINE_TYPE_EXTENDED_BEGIN_REGISTER'
      if (g_once_init_enter (&g_define_type_id__volatile))  \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gthread.h:260:7: note: expanded from macro 'g_once_init_enter'
        (!g_atomic_pointer_get (location) &&                             \
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/glib-2.0/glib/gatomic.h:112:38: note: expanded from macro 'g_atomic_pointer_get'
        __atomic_load (gapg_temp_atomic, &gapg_temp_newval, __ATOMIC_SEQ_CST); \
                                         ^~~~~~~~~~~~~~~~~
2020-11-03 15:39:00 +01:00
Thomas Haller
e0a3a5e2f8 build: don't depend dispatcher code on introspection sources
The dispatcher code does not use the generated introspection sources
(anymore). Don't add a dependency.
2020-11-03 15:38:25 +01:00
Thomas Haller
1b8ccacc5d tests: avoid race condition in nmtstc_service_cleanup()
It seems it can happen that the service is not yet unregistered from the
D-Bus broker, even if we already reaped the PID.

    /builds/NetworkManager/NetworkManager/tools/run-nm-test.sh --called-from-make /builds/NetworkManager/NetworkManager/build    --launch-dbus=auto /builds/NetworkManager/NetworkManager/build/libnm/tests/test-nm-client
    --- stdout ---
    /libnm/device-added:
    nmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=0
    --- stderr ---
    **
    test:ERROR:../shared/nm-test-utils-impl.c:216:nmtstc_service_cleanup: assertion failed: (!name_exists(info->bus, "org.freedesktop.NetworkManager"))

Workaround by waiting a bit.

We now iterate the main GMainContext, unlike before. But that
should not cause any problems for the test.
2020-11-03 14:31:20 +01:00
Thomas Haller
230250e629 shared/tests: add nmtst_main_context_iterate_until_full() helper 2020-11-03 14:31:20 +01:00
Thomas Haller
ca2b79d9aa shared/tests: add nmtst_g_source_nop() helper 2020-11-03 14:31:19 +01:00
Thomas Haller
11068cf936 device: fix crash in nm_device_reactivate_ip_config()
Fixes: 87f69f0050 ('device: merge nm_device_reactivate_ip_config() implementations for IPv4/IPv6')
2020-11-03 12:32:54 +01:00
Thomas Haller
affff881e2 contrib/release: check whether access to master.gnome.org works before publishing release 2020-11-02 18:51:45 +01:00
Antonio Cardace
1df683587a release: bump version to 1.29.1 (development) 2020-11-02 18:16:45 +01:00
Antonio Cardace
c4b6962ed2 merge branch 'ac/bridge_mtu_autoadjust' into master
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/656
2020-11-02 17:28:19 +01:00
Antonio Cardace
e23798a5e5 bridge: force (hack)-set of the MTU when explicitly set in the profile
Kernel does a auto-mtu adjusting process whenever a port is added/removed from
the bridge, this can cause issues when NM wants to explicitly set an MTU which is
equal to the bridge default one (1500) because if later a port is added with a
different MTU the kernel will assign the bridge that port's MTU resulting in the bridge
runtime configuration differing from the bridge's NM connection profile.

What we can do is to always apply the MTU manually for the bridge (if explicitly
set by the profile), after doing so the kernel won't modify the MTU anymore,
which is what we want, problem is that kernel won't actually apply the MTU
to the netdev if it's not actually changing so we first apply it to
MTU-1 and then to the desired value.

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

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-11-02 17:23:22 +01:00
Antonio Cardace
516c623618 bridge: set MTU at link creation time
https://bugzilla.redhat.com/show_bug.cgi?id=1778590

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-11-02 17:23:16 +01:00
Antonio Cardace
ba2ee46254 platform: allow setting the MTU at link creation time
Add a parameter to the 'link_add()' virtual function so that
the MTU will be configured (via netlink) by the kernel when
creating the link.

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

Signed-off-by: Antonio Cardace <acardace@redhat.com>
2020-11-02 17:23:05 +01:00
Thomas Haller
0829dbcd3d device: merge branch 'th/device-cleanup-addr-family'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/665
2020-11-01 16:47:14 +01:00
Thomas Haller
6c9a289451 core: cleanup IPv4/IPv6 checks using NM_IS_IPv4()
- we commonly use "int addr_family" as parameters to functions.
  But then inside the function, we often need to do something for
  IPv4 or IPv6 specifically. Instead of having lots of redundant
  "if (addr_family == AF_INET)" checks, prefer to have a variable
  IS_IPv4 and/or use NM_IS_IPv4() macro.

- don't make the "IS_IPv4" variable a gboolean but an int. gboolean
  is a typedef for int, so it's in practice exactly the same. However,
  we use "IS_IPv4" as index to arrays of length 2, where at position
  "1" we have the value related to IPv4. Using a gboolean to index
  an array is a bit odd. Maybe a "int" is preferable here.
  This is more about doing consistently one or the other. There are
  no strong reasons to prefer gboolean or int.
2020-10-30 16:52:59 +01:00
Thomas Haller
6767ba1205 device: allow AF_UNSPEC for nm_device_get_connectivity_state()
Apparently it is not actually used, but the function implements
a return value for AF_UNSPEC, while also asserting that the addr_family
is AF_INET/AF_INET6. Drop the assertions.
2020-10-30 16:52:58 +01:00
Thomas Haller
f20d0d6984 device: merge activate_stage5_ip_config_result_[46]() 2020-10-30 16:52:57 +01:00
Thomas Haller
399684538b device: abort on failure in activate_stage5_ip_config_result_6()
This is analog to what the IPv4 code does at this place. Abort.
2020-10-30 16:52:57 +01:00
Thomas Haller
15e287a351 device: merge activate_stage4_ip_config_timeout_[46]() 2020-10-30 16:52:56 +01:00
Thomas Haller
101b031807 device: merge nm_device_activate_stage3_ip[46]_start() 2020-10-30 16:52:55 +01:00
Thomas Haller
85a60f9d53 tools: fix "check-config-options.sh" for detecting multiple NM_CON_DEFAULT() on one line
If there are multiple NM_CON_DEFAULT() mentionings on the same line,
previously the script would not parse them all. Adjust, by first wrapping
the line.
2020-10-30 16:52:55 +01:00
Thomas Haller
2898daa518 shared,all: introduce and use LOGD_IPX()/LOGD_DHCPX() macros
These macros are consistent with NMP_OBJECT_TYPE_IP_ADDRESS()
and NMP_OBJECT_TYPE_IP_ROUTE(), in name and usage.

Replace the previous functions that had inconsistent and a verbose
naming.
2020-10-30 12:38:31 +01:00
Thomas Haller
2ebe34a5da l3cfg: merge branch 'th/l3cfg-15'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/663
2020-10-30 12:00:06 +01:00
Thomas Haller
87f69f0050 device: merge nm_device_reactivate_ip_config() implementations for IPv4/IPv6 2020-10-30 11:58:46 +01:00
Thomas Haller
c8cc86368c core/dispatcher: merge dump[46]_ip_to_props() for IPv4/IPv6 2020-10-30 11:58:46 +01:00
Thomas Haller
6c835a2908 l3cfg: during nm_l3_config_data_merge() collect the maximum of the metered flag 2020-10-30 11:58:46 +01:00
Thomas Haller
3af02e8fcf core: use nm_g_variant_new_ay_in6addr() helper in "NetworkManagerUtils.c" 2020-10-30 11:58:46 +01:00
Thomas Haller
b2780ffa72 libnm: cleanup constructing GVariants for IP addresses 2020-10-30 11:58:45 +01:00
Thomas Haller
11fc851741 libnm: cleanup signedness and range of intergers in "nm-utils.c" 2020-10-30 11:58:45 +01:00
Thomas Haller
a7e1fa48fd shared: add nm_g_variant_new_ay_inaddr() helper 2020-10-30 11:58:44 +01:00
Beniamino Galvani
f70ee67058 dns: sd-resolved: reset interface configuration on deactivation
If an update doesn't contain an interface but the previous update did,
the systemd-resolved DNS plugin must send a request to clear the
previous configuration. Otherwise the previous DNS configuration would
persist even after interface deactivation.

https://bugzilla.redhat.com/show_bug.cgi?id=1888229
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/662
2020-10-29 17:23:28 +01:00
Thomas Haller
545d5a4e70 python,tests: merge branch 'fmartinsons:master' (#661)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/661
2020-10-29 09:36:46 +01:00
Frederic Martinsons
1f5c7f7d81 Correct python black rules
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:10 +01:00
Frederic Martinsons
c8b13dc92f Manage deactivation of active connection
Like what was done for activating an active connection, so
some state change are simulated and a dbus test method is added

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:10 +01:00
Frederic Martinsons
51dd9ed89a Enhance device state and active connection management
Add reason for device state change.
Add dbus test method to force failure of activation, set the
device state and the active connection state.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:10 +01:00
Frederic Martinsons
a3f596e273 Add basic modem device support
The modem device will have hardcoded capability which make it
compatible with GSM connection settings.
It will be seen with hardcoded ModemManager manager dbus object path
for the UDI property.
Add also a dbus test method to add the modem device.

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Frederic Martinsons
f225148754 Initialize correctly _dbus_error_name in BusErr classes
To be consistent with dbus.DbusException classes which do the
following in __init__:

    def __init__(self, *args, **kwargs):
        name = kwargs.pop('name', None)
        if name is not None or getattr(self, '_dbus_error_name', None) is None:
            self._dbus_error_name = name
        if kwargs:
            raise TypeError('DBusException does not take keyword arguments: %s'
                            % ', '.join(kwargs.keys()))
        Exception.__init__(self, *args)

Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Frederic Martinsons
7bc01ea14c Add dbus.Int32 support for variant parsing
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
2020-10-29 09:35:06 +01:00
Thomas Haller
7616469df8 libnm/keyfile: merge branch 'th/keyfile-public-api'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/517
2020-10-29 09:28:27 +01:00
Thomas Haller
a9e6774670 example: add python gi example for keyfile handling 2020-10-28 14:30:49 +01:00