Commit Graph

26956 Commits

Author SHA1 Message Date
Thomas Haller
9569b10a8f license: relicense "libnm/nm-types.h" under LGPL-2.1+
>>>

  H0=a3e75f329446a93a61ca4c458a7657bd919f4fe6
  commit_has_file() {
      git ls-tree -r "$1" | grep -q "\\s$2"\$
  }
  print_commit_authors() {
      git --no-pager log --full-history --follow --no-merges --pretty='format:<%ae>' $H0 -- "$1" | sort | uniq
  }
  print_blame_authors() {
      local LAST_H

      if commit_has_file $H0 "$1"; then
          LAST_H=$H0
      else
          LAST_H="$(git log --full-history --no-merges -n1 --pretty='format:%H' $H0 -- "$1")"^1
      fi
      git blame --no-progress -C -C -C20 -M -M10 -e "$LAST_H" -- "$1" | sed 's/.*\(<[^>]\+@[^>]\+>\).*/\1/' | sort | uniq
  }
  print_grep() {
      git --no-pager log -p --full-history --follow $H0 -- "$1" | grep -i '[a-z0-9]@\|author\|copyright' | sort | uniq
  }
  prefix() {
      sed "s/^/>>>$1 /"
  }
  collect_all() {
      for F; do
         print_commit_authors "$F" | prefix 1
         echo
         print_blame_authors "$F" | prefix 2
         echo
         print_grep "$F" | prefix 3
      done |
      sort |
      uniq |
      sed 's/@/(at)/'
  }

  collect_all \
      libnm/nm-types.h \
      libnm-glib/nm-types.h \
      ;

<<<

>>>1 <bberg(at)redhat.com>
>>>1 <bgalvani(at)redhat.com>
>>>1 <danw(at)gnome.org>
>>>1 <danw(at)redhat.com>
>>>1 <dcbw(at)redhat.com>
>>>1 <jarteaga(at)jbeta.is>
>>>1 <jklimes(at)redhat.com>
>>>1 <lkundrak(at)v3.sk>
>>>1 <thaller(at)redhat.com>
>>>2 <bgalvani(at)redhat.com>
>>>2 <clarkbw(at)cvs.gnome.org>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <jarteaga(at)jbeta.is>
>>>2 <lkundrak(at)v3.sk>
>>>2 <pgrzegorczyk(at)gmail.com>
>>>2 <tambet(at)gmail.com>
>>>2 <thaller(at)redhat.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.
2020-10-20 16:05:44 +02:00
Thomas Haller
1ce171af32 license: relicense "shared/nm-udev-aux/nm-udev-utils.[hc]" under LGPL-2.1+
>>>

  H0=a3e75f329446a93a61ca4c458a7657bd919f4fe6
  commit_has_file() {
      git ls-tree -r "$1" | grep -q "\\s$2"\$
  }
  print_commit_authors() {
      git --no-pager log --full-history --follow --no-merges --pretty='format:<%ae>' $H0 -- "$1" | sort | uniq
  }
  print_blame_authors() {
      local LAST_H

      if commit_has_file $H0 "$1"; then
          LAST_H=$H0
      else
          LAST_H="$(git log --full-history --no-merges -n1 --pretty='format:%H' $H0 -- "$1")"^1
      fi
      git blame --no-progress -C -C -C20 -M -M10 -e "$LAST_H" -- "$1" | sed 's/.*\(<[^>]\+@[^>]\+>\).*/\1/' | sort | uniq
  }
  print_grep() {
      git --no-pager log -p --full-history --follow $H0 -- "$1" | grep -i '[a-z0-9]@\|author\|copyright' | sort | uniq
  }
  prefix() {
      sed "s/^/>>>$1 /"
  }
  collect_all() {
      for F; do
         print_commit_authors "$F" | prefix 1
         echo
         print_blame_authors "$F" | prefix 2
         echo
         print_grep "$F" | prefix 3
      done |
      sort |
      uniq |
      sed 's/@/(at)/'
  }

  collect_all \
      shared/nm-udev-aux/nm-udev-utils.c \
      shared/nm-udev-aux/nm-udev-utils.h \
      shared/nm-utils/nm-udev-utils.c \
      shared/nm-utils/nm-udev-utils.h \
      ;

<<<

gives:

>>>1 <bgalvani(at)redhat.com>
>>>1 <lkundrak(at)v3.sk>
>>>1 <thaller(at)redhat.com>
>>>2 <bgalvani(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <rstrode(at)redhat.com>
>>>2 <thaller(at)redhat.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.

The code was initially added by commit e32839838e ('udev: drop
libgudev in favor of libudev'). It did expand on top of existing GPL
code, which is problematic. But it was introduced as an original
contribution.
2020-10-20 16:02:00 +02:00
Thomas Haller
82ca0a0b00 license: relicense "libnm-core/nm-libnm-core-aux/nm-dispatcher-api.h" under LGPL-2.1+
>>>

  H0=a3e75f329446a93a61ca4c458a7657bd919f4fe6
  commit_has_file() {
      git ls-tree -r "$1" | grep -q "\\s$2"\$
  }
  print_commit_authors() {
      git --no-pager log --full-history --follow --no-merges --pretty='format:<%ae>' $H0 -- "$1" | sort | uniq
  }
  print_blame_authors() {
      local LAST_H

      if commit_has_file $H0 "$1"; then
          LAST_H=$H0
      else
          LAST_H="$(git log --full-history --no-merges -n1 --pretty='format:%H' $H0 -- "$1")"^1
      fi
      git blame --no-progress -C -C -C20 -M -M10 -e "$LAST_H" -- "$1" | sed 's/.*\(<[^>]\+@[^>]\+>\).*/\1/' | sort | uniq
  }
  print_grep() {
      git --no-pager log -p --full-history --follow $H0 -- "$1" | grep -i '[a-z0-9]@\|author\|copyright' | sort | uniq
  }
  prefix() {
      sed "s/^/>>>$1 /"
  }
  collect_all() {
      for F; do
         print_commit_authors "$F" | prefix 1
         echo
         print_blame_authors "$F" | prefix 2
         echo
         print_grep "$F" | prefix 3
      done |
      sort |
      uniq |
      sed 's/@/(at)/'
  }

  collect_all \
      shared/nm-libnm-core-aux/nm-dispatcher-api.h \
      callouts/nm-dispatcher-api.h \
      callouts/nm-dispatcher-api.h \
      callouts/nm-dispatcher-action.h \
      ;

<<<

gives:

>>>1 <bgalvani(at)redhat.com>
>>>1 <daniel(at)gnoutcheff.name>
>>>1 <danw(at)gnome.org>
>>>1 <danw(at)redhat.com>
>>>1 <dcbw(at)redhat.com>
>>>1 <lkundrak(at)v3.sk>
>>>1 <mario(at)endlessm.com>
>>>1 <thaller(at)redhat.com>
>>>2 <bgalvani(at)redhat.com>
>>>2 <blueowl(at)centrum.cz>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <mario(at)endlessm.com>
>>>2 <thaller(at)redhat.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.
2020-10-20 15:58:41 +02:00
Thomas Haller
931568fa2f license: relicense "shared/nm-test-utils-impl.c" under LGPL-2.1+
>>>

  H0=a3e75f329446a93a61ca4c458a7657bd919f4fe6
  commit_has_file() {
      git ls-tree -r "$1" | grep -q "\\s$2"\$
  }
  print_commit_authors() {
      git --no-pager log --full-history --follow --no-merges --pretty='format:<%ae>' $H0 -- "$1" | sort | uniq
  }
  print_blame_authors() {
      local LAST_H

      if commit_has_file $H0 "$1"; then
          LAST_H=$H0
      else
          LAST_H="$(git log --full-history --no-merges -n1 --pretty='format:%H' $H0 -- "$1")"^1
      fi
      git blame --no-progress -C -C -C20 -M -M10 -e "$LAST_H" -- "$1" | sed 's/.*\(<[^>]\+@[^>]\+>\).*/\1/' | sort | uniq
  }
  print_grep() {
      git --no-pager log -p --full-history --follow $H0 -- "$1" | grep -i '[a-z0-9]@\|author\|copyright' | sort | uniq
  }
  prefix() {
      sed "s/^/>>>$1 /"
  }
  collect_all() {
      for F; do
         print_commit_authors "$F" | prefix 1
         echo
         print_blame_authors "$F" | prefix 2
         echo
         print_grep "$F" | prefix 3
      done |
      sort |
      uniq |
      sed 's/@/(at)/'
  }

  collect_all \
      shared/nm-test-utils-impl.c \
      include/nm-test-utils-impl.c \
      libnm-glib/tests/common.c \
      libnm-glib/tests/test-nm-client.c \
      libnm-glib/tests/test-remote-settings-client.c \
      ;

<<<

gives:

>>>1 <bgalvani(at)redhat.com>
>>>1 <biebl(at)debian.org>
>>>1 <danw(at)gnome.org>
>>>1 <danw(at)redhat.com>
>>>1 <dcbw(at)redhat.com>
>>>1 <jklimes(at)redhat.com>
>>>1 <lkundrak(at)v3.sk>
>>>1 <thaller(at)redhat.com>
>>>2 <aleksander(at)aleksander.es>
>>>2 <biebl(at)debian.org>
>>>2 <blueowl(at)centrum.cz>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <lkundrak(at)v3.sk>
>>>2 <qiaomuf(at)gentoo.org>
>>>2 <rstrode(at)redhat.com>
>>>2 <tambet(at)gmail.com>
>>>2 <thaller(at)redhat.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.
With exception of <qiaomuf(at)gentoo.org>. However with manual
investigation I think there are no contributions by qiaomuf affected
here. It's only the script that (wrongly) identified the name.
2020-10-20 15:58:36 +02:00
Thomas Haller
dcd162c619 shared: use C comments for SPDX header in "nm-version-macros.h.in" 2020-10-20 14:56:46 +02:00
Thomas Haller
b39d303f3b version: add 1.30 macros 2020-10-20 14:43:03 +02:00
Thomas Haller
65a253f714 libnm: fix detecting address family for error message in NMSettingVxlan.verify()
The address family of local/remote addresses must correspond. Fix the
detection of the address family, so that error message is correct.
2020-10-20 13:45:34 +02:00
Thomas Haller
c7e55b232a libnm: canonicalize local/remote IP address in NMSettingVxlan 2020-10-20 13:45:33 +02:00
barinet
676fe327d4 libnm,core: allow VXLAN connections without an explicit remote VTEP
[thaller@redhat.com: squashed commits, resolve merge conflict and coding
 style]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/645
2020-10-20 13:45:19 +02:00
Thomas Haller
e29f00fa0c NEWS: fix entry that is targeted for 1.30 instead of 1.28
Fixes: 8764d47af6 ('NEWS: update')
2020-10-20 10:02:06 +02:00
Thomas Haller
e07022c977 libnm: merge branch 'th/bond-add-option-relax'
https://bugzilla.redhat.com/show_bug.cgi?id=1887523

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/653
2020-10-20 09:56:53 +02:00
Thomas Haller
cbc6113a83 NEWS: update 2020-10-19 23:18:44 +02:00
Thomas Haller
290e515311 libnm/bond: remove validation from nm_setting_bond_add_option() and explicitly validate
For historic reasons is NMSettingBond implemented differently from other
settings. It uses a strdict, and adds some validation on top of that.
The idea was probably to be able to treat bond options more generically.
But in practice we cannot treat them as opaque values, but need to know,
validate and understand all the options. Thus, this implementation with a
strdict is not nice.

The user can set the GObject property NM_SETTING_BOND_OPTIONS to any
strdict, and the setter performs no validation or normalization. That
is probably good, because g_object_set() cannot return an error to
signalize invalid settings. As often, we have corresponding C API like
nm_setting_bond_add_option() and nm_setting_bond_remove_option(). It
should be possible to get the same result both with the C API and with
the GObject property setting. Since there is already a way to set
certain invalid values, it does not help if the C API tries to prevent
that. That implies, that also add-option does not perform additional
validation and sets whatever the user asks.

Remove all validation from nm_setting_bond_add_option() and
nm_setting_bond_remove_option(). This validation was anyway only very
basic. It was calling nm_setting_bond_validate_option(), which can check
whether the string is (for example) and integer, but it cannot do
validation beyond one option. In most cases, the validation needs to
take into account the bond mode or other options, so validating one
option in isolation is not very useful.

Proper validation should instead be done via nm_connection_verify().
However, due to another historic oddity, that verification is very
forgiving too and doesn't reject many invalid settings when it should.
That is hard to fix, because making validation more strict can break
existing (and working) configurations. However, verify() already contains
basic validation via nm_setting_bond_validate_option(). So in the previous
behavior nm_setting_bond_add_option() would silently do nothing (only
returning %FALSE) for invalid options, while now it would add the
invalid options to the dictionary -- only to have it later fail validation
during nm_connection_verify(). That is a slight change in behavior, however it
seems preferable.

It seems preferable and acceptable because most users that call
nm_setting_bond_add_option() already understand the meaning and valid
values. Keyfile and ifcfg-rh readers are the few exceptions, which really just
parse a string dictionary, without need to understand them. But nmtui
or nmstate already know the option they want to set. They don't expect
a failure there, nor do they need the validation.

Note that this change in behavior could be dangerous for example for the
keyfile/ifcfg-rh readers, which silently ignored errors before. We
don't want them to start failing if they read invalid options from a
file, so instead let those callers explicitly pre-validate the value
and log an warning.

https://bugzilla.redhat.com/show_bug.cgi?id=1887523
2020-10-19 23:18:43 +02:00
Thomas Haller
4dce22de78 libnm: unify implementations for bond-mode to/from string conversions 2020-10-19 23:18:43 +02:00
Thomas Haller
1dce227a59 libnm: small style update to use nm_streq() in _normalize_bond_mode() 2020-10-19 23:18:43 +02:00
Thomas Haller
8dc3f07d34 shared: fix NM_CAST_STRV_CC() for "char **const" pointers
clang-3.4.2-9.el7.x86_64 otherwise fails:

    ../src/devices/wifi/nm-wifi-p2p-peer.c:410:44: error: controlling expression type 'const char **const' not compatible with any generic association type
        if (!nm_utils_strv_equal(priv->groups, peer_info->groups)) {
                                               ^~~~~~~~~~~~~~~~~
    ../shared/nm-glib-aux/nm-shared-utils.h:1689:78: note: expanded from macro 'nm_utils_strv_equal'
    #define nm_utils_strv_equal(strv1, strv2) (nm_utils_strv_cmp_n((strv1), -1, (strv2), -1) == 0)
                                                                                 ^
    ../shared/nm-glib-aux/nm-shared-utils.h:1687:74: note: expanded from macro 'nm_utils_strv_cmp_n'
        _nm_utils_strv_cmp_n(NM_CAST_STRV_CC(strv1), (len1), NM_CAST_STRV_CC(strv2), (len2))
                                                                             ^
    ../shared/nm-glib-aux/nm-macros-internal.h:706:21: note: expanded from macro 'NM_CAST_STRV_CC'
            (_Generic ((value), \
                        ^
2020-10-19 21:25:11 +02:00
Thomas Haller
53bd66b540 contrib/release: fix parsing version in "release.sh" script 2020-10-19 20:50:35 +02:00
Thomas Haller
d7f6fb8378 contrib/release: improve help text for "release.sh" script 2020-10-19 20:43:52 +02:00
Thomas Haller
fdeb960087 contrib/release: use "find-backport" scripts from release.sh 2020-10-19 20:35:51 +02:00
Thomas Haller
57cfa5daf9 contrib: add "find-backports" script
This script was previously on the "automation" branch. Add it to
"master".
2020-10-19 20:34:06 +02:00
Beniamino Galvani
317171ed6e initrd: generate infiniband connections
Generate infiniband connections based on the interface name or MAC
address length.

https://bugzilla.redhat.com/show_bug.cgi?id=1883173
2020-10-19 19:03:00 +02:00
Thomas Haller
ba1e1c364c wifi/iwd: merge branch 'balrog-kun:iwd-hidden-networks-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/646
2020-10-19 18:54:04 +02:00
Andrew Zaborowski
c92ad05cee iwd: Avoid ConnectHiddenNetwork() if network is visible
If the target hidden network is already recorded by IWD with its SSID
during a previous active scan, use the Network.Connect() API instead of
Station.ConnectHiddenNetwork() which would fail in IWD version up to
1.9.  This is a rare corner case scenario though.

Also drop the !nm_wifi_ap_get_supplicant_path(ap) check, I'm not
sure when if ever that condition can be true, more so now that we're
checking nm_wifi_ap_get_fake(ap) before that.
2020-10-19 18:49:30 +02:00
Andrew Zaborowski
a6ece1557c iwd: Track InterfacesAdded/Removed signals for Networks
Until now we didn't rely on InterfacesAdded and InterfacesRemoved
signals for tracking when IWD finds new Wi-Fi networks or expires
networks not seen in the latest scans.  Instead we'd request the whole
list of networks currently seen by IWD every time the Station.Scanning
property would go from true to false.  However the
Station.GetOrderedNetworks() IWD method that we use has a deficiency
up until 1.9 (I plan to fix it soon) where it won't show the hidden
network discovered in the course of the last ConnectHiddenNetwork() call
if that call was unsuccessful, in other words where the new network has
not been saved as a Known Network.  A new ConnectHiddenNetwork() will
fail with the "NotHidden" error, so we have to use the Network.Connect()
call for such a network but to find it out we need to track the
InterfacesAdded signals.  Doing this may also improve autoconnect speed
in some cases so overall I think it's a good idea.
2020-10-19 18:49:29 +02:00
Andrew Zaborowski
3b6c5d5839 iwd: Don't start new secret request if we sent one already
When IWD asks us for a secret check that we're in NM_DEVICE_STATE_CONFIG
and not for example already in NM_DEVICE_STATE_NEED_AUTH.  I believe that
should only happen if IWD is aborting the previous connection attempt and
connecting to a different network due to a timeout or due to somebody
outside NM calling Connect() on an IWD network object...

Guessing what IWD is doing this way is a bit fragile in the long term
but we have to do that as long as we want to override IWD's internal
autoconnect, which I guess we may be able to stop doing at some point.
2020-10-19 18:47:21 +02:00
Andrew Zaborowski
61e4b5a230 iwd: Don't auto-scan while waiting for secrets
IWD's Station.State property remains at "connect" or "disconnected"
while IWD is waiting for secrets for a new conncetion, so if we want to
scan only when NM might be in auto-connect (which was the goal) we need
to also look at NMDevice's state.  We want to scan whenever wifi is
disconnected and there's no active connection request, which is the same
as saying whever priv->current_ap is unset so for simplicity look at
priv->current_ap.  Also in schedule_periodic_scan() don't check whether
Station.State is "disconnected" because priv->can_scan is equivalent to
Station.State being one of ("disconnected", "connected").
2020-10-19 18:47:21 +02:00
Andrew Zaborowski
4f83960ff5 iwd: Hidden networks cleanup
Hidden networks are supported in the iwd backend since 1.24.0 but some
places in the code have not been updated to reflect this.

In check_connection_available copy the hidden network check and
corresponding comment from the wpa_supplicant backend.  In
act_stage1_prepare drop a straight "hidden networks are unsupported"
comment and a check -- fortunately this check happened to be ineffective
because @mode was more often NULL than NM_SETTING_WIRELESS_MODE_INFRA so
nm_streq0 was not enough.  Update comments elsewhere.

There's still one of two corner cases where the user-experience will not
be perfect for hidden networks due to iwd limitations, I'll try to work
around them in another commit.
2020-10-19 18:47:21 +02:00
Andrew Zaborowski
6c5068ee5a iwd: Don't use nm_utils_error_set_literal with a non-literal
I first noticed a format string with missing parameters and then that
the compiler wasn't complaining and that's because
nm_utils_error_set_literal doesn't take a format string.
2020-10-19 18:47:20 +02:00
Andrew Zaborowski
6cf475e6db iwd: Better checks before setting NO_SECRETS reason
When a connection fails and IWD returns net.connman.iwd.Aborted, we know
whether the abort is caused by us cancelling a secrets request so use
tha knowledge to decide whether to use the NM_DEVICE_STATE_REASON_NO_SECRETS
reason code for the state switch to NM_DEVICE_STATE_FAILED.
2020-10-19 18:47:20 +02:00
Andrew Zaborowski
b7d3e99a28 iwd: Drop IWD pre-1.0 and pre-0.8 compatiblity bits 2020-10-19 18:47:20 +02:00
Andrew Zaborowski
0d6911d529 iwd: Use the INCOMPATIBLE reason code for connection unavailable
Use the NM_UTILS_ERROR_CONNECTION_AVAILABLE_INCOMPATIBLE constant in
place of NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY more often in
check_connection_compatible as appropriate.
2020-10-19 18:34:58 +02:00
Thomas Haller
a9ffb5b73e shared: enforce trailing semicolon after NM_UTILS_FLAGS2STR_DEFINE(),NM_UTILS_ENUM2STR_DEFINE() 2020-10-19 16:43:47 +02:00
Thomas Haller
81aebda558 libnm: add trailing comma after NM_UTILS_FLAGS2STR_DEFINE(nm_bluetooth_capability_to_string) 2020-10-19 16:43:30 +02:00
scootergrisen
2a021f2d26 po: update Danish (da) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/654
2020-10-19 09:11:32 +02:00
Thomas Haller
f0c2e35cfe l3cfg: merge branch 'th/l3cfg-12'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/651
2020-10-13 13:49:07 +02:00
Thomas Haller
96c2aee186 l3cfg/tests: add unit tests for NML3Cfg 2020-10-13 13:46:07 +02:00
Thomas Haller
b8f9d7b5dd l3cfg: rework ACD handling in NML3Cfg to support handling conflicts
Heavily rework NML3Cfg's ACD handling.

- the (user facing) API changed, so that we can ask the current ACD
  state of an address with nm_l3cfg_get_acd_addr_info(). So, the
  acd-event signal is only to notify when the state changes, it does
  not carry information that you couldn't fetch anytime.

- add clearer ACD states (NML3AcdAddrState). The current (ACD) state
  of an address is important and becomes part of the information that
  we expose.

- add new ACD state "USED", when ACD fails. This blocks the address from
  being used. Usually the caller would either remove the (used) address
  or force reconfigure it (by setting acd_timeout_msec to zero).

- add new ACD state "CONFLICT". Previously conflicts were not handled.
  Now the API allows to specify the defend policy. A conflicted address
  also gets blocked from being used.

- add new ACD state "EXTERNAL_REMOVED". This happens when we have an
  address we wanted to configure, but then the address is no longer
  on the interface. For example because the user removed it from the
  interface. This also leaves the device indefinitely blocked, and
  is important to stop announcing the address.

- add a new ACD state "READY". This indicates that the address is ready
  to be configured, but not yet actually configured on the device. This
  is the step before "DEFENDING".
2020-10-13 13:46:06 +02:00
Thomas Haller
79664aa106 l3cfg: handle flag "ip4acd_not_ready" for IPv4 addresses
ACD is handled by NML3Cfg and it intercepts the IP addresses when
merging the NML3ConfigData.

Originally, I thought that in such a case, the merged l3cd instance
would simply not contain any addresses that ACD have still pending or
which have a conflict.

However, I think it's better (clearer and possibly useful), to still
merge such addresses, but flag them that they are ignored when syncing
the addresses to platform.
2020-10-13 13:43:21 +02:00
Thomas Haller
e155e4a153 platform: add NMPlatformIP4Address.ip4acd_not_ready flag
It is not yet used, but it will be used to mark instances that
are not supposed to be configured in platform, because ACD is
either still pending of failed.
2020-10-13 13:39:01 +02:00
Thomas Haller
422294974c platform: fix handlng of NMPlatformIP4Address.use_ip4_broadcast_address to be considered for hash/cmp functions
This is an important field. The hash/cmp function cannot just honor
nm_platform_ip4_broadcast_address_from_addr().
2020-10-13 13:39:01 +02:00
Thomas Haller
8b25e4ecfe shared: add nm_g_ptr_array_ref() and similar helpers 2020-10-13 13:39:01 +02:00
Thomas Haller
28bbe2a798 shared,platform: take pointer to NMEtherAddr in NM_ETHER_ADDR_FORMAT_VAL() macro
It seems nicer to require a pointer than the plain struct.
2020-10-13 12:56:25 +02:00
Thomas Haller
6807774b7d clang-format: mark "nm_platform_iter_obj_for_each()"/"nm_l3_config_data_iter_*()" as ForEachMacros 2020-10-13 12:56:25 +02:00
Beniamino Galvani
ae31b4bf4e wifi: set the BridgeIfname supplicant property when needed
When a wifi device is in a bridge, the supplicant must be aware of it,
as a socket must be opened on the bridge to receive packets.

Set the BridgeIfname property of the supplicant Interface object
before starting the association. Note that the property was read-only
in the past and recently [1] became read-write. When using a
supplicant version without the patch, writing the property will return
an InvalidArgs error and NetworkManager will print a warning.

[1] https://w1.fi/cgit/hostap/commit/?id=1c58317f56e312576b6872440f125f794e45f991

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/83
2020-10-13 08:59:10 +02:00
Thomas Haller
ef9510e30c all: remove unneessary cases from nm_utils_strv_equal()/nm_utils_strv_cmp_n() 2020-10-12 22:21:11 +02:00
Thomas Haller
251ba8ea44 shared: automatically cast strv argument for nm_utils_strv_equal()/nm_utils_strv_cmp_n()
It's cumbersome if we always need to cast our arguments for
the strv helper functions. Depending on the situation, we often
have a "char **" or a "const char *const*" argument.

Use NM_CAST_STRV_CC() macros instead. This macro uses C11's _Generic()
and casts types that are presumed to be safe. This tends to be less
typing and more type-safe, because you don't need an explicit C cast
(which would overrule any warning that the compiler might have for you).
2020-10-12 22:20:01 +02:00
Thomas Haller
cbcfc58794 all/trivial: rename _nm_utils_strv_equal()/_nm_utils_strv_cmp_n() to have no leading underscore
The underscore somehow indicated that these would be an internal
function. Which they are in the sense that they are in "shared/nm-glib-aux/".
But they part of our internal helper functions, and in our code base
their use is no discouraged or "private.

Also, next I'll replace the function call with a macro, so, I will
have a need for the underscore name.

Rename.
2020-10-12 22:18:26 +02:00
Benjamin Berg
dc54a946ac wifi: re-add code for tracking a peers groups
The code to track the property was accidentally removed in commit
21d4a26188 ('core: remove code for unused NM_WIFI_P2P_PEER_GROUPS property')
causing all P2P connections to fail after 5 seconds.

Fixes: 21d4a26188 ('core: remove code for unused NM_WIFI_P2P_PEER_GROUPS property')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/551

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/650
2020-10-12 21:39:48 +02:00
Thomas Haller
3cf8620294 device/wifi: fix leak of NMSupplicantPeerInfo.peer_path in NMSupplicantInterface
Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
2020-10-12 17:11:58 +02:00
Juliano de Souza Camargo
0fe92f40fc po: update Portuguese (pt) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/648
2020-10-12 10:02:51 +02:00