Commit Graph

27030 Commits

Author SHA1 Message Date
Beniamino Galvani
880fe31ef2 wifi: merge branch 'balrog-kun/NetworkManager-iwd-query-speed'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/652
2020-10-22 16:58:40 +02:00
Andrew Zaborowski
ada71a4af6 iwd: Remove a redundant set_current_ap call
set_current_ap is always called before remove_all_aps.
2020-10-22 16:58:27 +02:00
Andrew Zaborowski
d868ce153e iwd: Use platform-utils to update signal/rate/bssid/frequency
Use a periodic_update callback similar to the wpa_supplicant backend.
While there also update one unrelated comment.
2020-10-22 16:58:27 +02:00
Andrew Zaborowski
e0394689b3 platform/wifi: Cache GET_STATION dump data between calls
The wifi backends call nm_platform_wifi_get_quality and
nm_platform_wifi_get_rate one after another in periodic_update (every
6s) and the same information is queried twice, synchronously.  For the
lack of a better mechanism to decide whether we're still inside the same
periodic_update call, store the timestamp in msecs and reuse the data
for 500ms.
2020-10-22 16:58:27 +02:00
Andrew Zaborowski
277e8eaa1f platform/wifi: Use GET_STATION instead of GET_SCAN dumps
As an optimization, use the NL80211_CMD_GET_STATION dump data instead
of the NL80211_CMD_GET_SCAN dump + GET_STATION command (non-dump) to
implement the following methods:
wifi_nl80211_get_bssid
wifi_nl80211_get_rate
wifi_nl80211_get_qual

GET_STATION records vary in size from a few hundred bytes to a few kB.
GET_SCAN records are usually on the few hundred bytes side, but there
can be many of them.  In managed mode there will only be one
GET_STATION record.  In AdHoc mode there may be more.  These methods are
not used in AP or Mesh mode.

So without that patch we'd have a GET_SCAN dump that could be quite big
and then a GET_STATION with one record.  Now it should be a GET_STATION
dump with one record or a few records, in any case fewer synchronous
commands is better.  Additionally this should now not depend on the
currently-connected BSS being in the kernel's scan result cache.

The downside is that the signal strength is "optional" in the
GET_STATION records, depends on the driver's capabilities.  Most
mainline drivers do seem to include it (the mac80211 based ones and a
few full-mac ones) but I can't know if all of them do.
2020-10-22 16:58:27 +02:00
Andrew Zaborowski
c6456dd104 platform/wifi: Read frequency from NL80211_CMD_GET_INTERFACE
As an optimization, implement wifi_nl80211_get_freq() using the
GET_INTERFACE nl8022 command instead of the GET_SCAN dump.
The GET_SCAN dump can be over 10kB of data that the kernel has to build
and we have to parse.  Additionally the GET_SCAN dump is not guaranteed
to contain the currently-connected BSS if there was no recent scan (30s),
or if the recent scan missed the beacon from the current BSS, or if the
recent scan was for a subset of channels/SSIDs/BSSIDs etc. and the last
full scan was already flushed.  Scan results are flushed after (I think)
30 seconds or if a new scan has the flush flag set.

In IWD we do occasionally do partial scans (on a subset of channels or
for a specific SSID) with the flush flag.  In that case the previous
wifi_nl80211_get_freq() logic would probably return 0.
2020-10-22 16:58:27 +02:00
Thomas Haller
cc030b9112 all/trivial: rename local variable for user_data for nm_utils_user_data_unpack()
In almost all cases, the variable of this kind is named "user_data".
Rename it for consistency.
2020-10-22 15:14:44 +02:00
Thomas Haller
a2ecd073c8 mailmap: add Matt to mailmap 2020-10-22 13:34:55 +02:00
Matt Bernstein
82b2251d2d cli: make clients able to configure VXLAN without "remote"
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/658
2020-10-22 13:32:29 +02:00
Thomas Haller
6677480a2d checkpatch: ignore warning about g_assert*() also for files like "shared/nm-utils/nm-test-utils.h" 2020-10-22 09:29:28 +02:00
Thomas Haller
e55f0a2788 shared/c-rbtree: reimport
git subtree pull --prefix shared/c-rbtree git@github.com:c-util/c-rbtree.git master --squash
2020-10-21 10:40:29 +02:00
Thomas Haller
991eec3842 Squashed 'shared/c-rbtree/' changes from bd1c14dc0d93..3162c5c04574
3162c5c04574 build: synchronize AUTHORS
c795b7657f4f c-rbtree: align CRBTree with CRBNode
10d973a9e671 c-rbtree: fix struct alignment of CRBTree on m68k architectures

git-subtree-dir: shared/c-rbtree
git-subtree-split: 3162c5c04574789144aff9de55c423cc8b636c85
2020-10-21 10:40:07 +02:00
David Rheinsberg
1250fcc2b1 c-rbtree: align CRBTree with CRBNode
We sometimes store pointers to `CRBTree` in `CRBNode*` variables, so we
must make sure CRBTree has matching alignment guarantees. We already
check for that with static-assertions.

This commit aligns CRBTree with CRBNode for 2-byte aligned machines.
While at it, add a short comment explaining what the unions are for.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>

c795b7657f
2020-10-21 10:38:34 +02:00
Thomas Haller
143130066b c-rbtree: fix struct alignment of CRBTree on m68k architectures
On m68k, 32bit integer are aligned to only 2 bytes. This breaks
assumptions and a static assertion of c-rbtree.

Explicitly require that the first field is aligned to at least 4 bytes.
This fixes the build and ensures that all valid pointers to a CRBTree have
the lowest two bits unset (so they can be used for storing 2 additional flags).

Use a union instead of aligning __parent_and_flags itself. That is
because alignas() cannot lower the natural alignment, so if we would
want to align __parent_and_flags, we could only do

  alignas(sizeof(unsigned long) > 4 ? sizeof(unsigned long) : 4)

That would not be correct if "long" is 8 bytes long but had a natural
alignment of only 4. The union allows us to specify an alignment
of at least 4, but otherwise follow natural alignment.

10d973a9e6
2020-10-21 10:38:25 +02:00
Thomas Haller
b6d6a16b2a license: merge branch 'th/keyfile-relicense-as-lgpl'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/514
2020-10-20 21:05:00 +02:00
Thomas Haller
a12a0d0c03 keyfile: remove "keyfile-history.sh" script 2020-10-20 21:04:46 +02:00
Thomas Haller
bd4b067186 keyfile: relicense the code under LGPL-2.1+
Historically, keyfile read/write code was part of core, and thus
GPL-2.0+ licensed. Keyfile is the native file format for NetworkManager
connection profiles, and code to handle that should be part of libnm.
This would unlock many interesting features, like tools being able
to import/export connection profiles in the native file format.
However, libnm is LGPL-2.1+ licensed, so this is a problem.

The alternative would be to add a separate, GPL licensed library
(libnm-keyfile.so or libnm-gpl.so). However that also requires a larger
rework, because the current keyfile implementation uses internal API
from libnm-core and it would need to be reworked to only use public
API of libnm.

Relicense the code instead. According to research and "keyfile-history.sh"
script, the following individuals and companies possibly hold copyright
on the code:

  <bgalvani(at)redhat.com>
  <blueowl(at)centrum.cz>
  <daniel(at)gnoutcheff.name>
  <danw(at)redhat.com>
  <dcantrell(at)redhat.com>
  <dcbw(at)redhat.com>
  <evan(at)ebroder.net>
  <fgiudici(at)redhat.com>
  <floe(at)butterbrot.org>
  <j(at)bootlab.org>
  <kmaraas(at)gnome.org>
  <lkundrak(at)v3.sk>
  <luzpaz(at)users.noreply.github.com>
  <martinpitt(at)gnome.org>
  <michael.i.doherty(at)intel.com>
  <pavlix(at)pavlix.net>
  <pmarti(at)warp.es>
  <rafaelff(at)gnome.org>
  <rstrode(at)redhat.com>
  <tambet(at)gmail.com>
  <tgraf(at)redhat.com>
  <thaller(at)redhat.com>
  <walters(at)verbum.org>
  <yurchor(at)ukr.net>
  Intel Corporation
  Novell, Inc.
  Red Hat, Inc.
  Ximian, Inc.

Most contributors on this list agreed to relicensing according to RELICENSE.md.

The following copyright holders did not answer the request for agreeing
to relicensing:

- <j(at)bootlab.org>: no contributions were made that are related to
  keyfile implementation. The script just gives a false positive.

- <pmarti(at)warp.es>: the contribution is a fix of a spelling error
  (commit 6029288ffb).

- <tgraf(at)redhat.com>: the contribution to keyfile code are small
  (I only identified commit 5b7503e95e).
  Also, Thomas worked for Red Hat at the time.

After research, I think it's fair to conclude that everybody who holds
non-trivial copyright on the keyfile code agreed to the relicensing.
2020-10-20 21:02:47 +02:00
Thomas Haller
118556af4f keyfile: add "keyfile-history.sh" script for finding copyright holders of "shared/nm-keyfile" 2020-10-20 20:59:23 +02:00
Beniamino Galvani
8b7a81175d NEWS: update 2020-10-20 17:28:10 +02:00
Thomas Haller
1806b80f31 license: merge branch 'th/fix-lgpl-license-violations' (part 3)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/390
2020-10-20 16:50:28 +02:00
Thomas Haller
7d89437480 license: relicense "libnm-core/nm-vpn-dbus-interface.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 \
      include/NetworkManagerVPN.h \
      libnm-core/NetworkManagerVPN.h \
      libnm-core/nm-vpn-dbus-interface.h \
      libnm-util/NetworkManagerVPN.h \
      ;

<<<

gives:

>>>1 <atulhjp(at)gmail.com>
>>>1 <bgalvani(at)redhat.com>
>>>1 <danw(at)gnome.org>
>>>1 <dcbw(at)redhat.com>
>>>1 <evan(at)ebroder.net>
>>>1 <jklimes(at)redhat.com>
>>>1 <lkundrak(at)v3.sk>
>>>1 <tambet(at)gmail.com>
>>>1 <thaller(at)redhat.com>
>>>1 <warp(at)aehallh.com>
>>>2 <atulhjp(at)gmail.com>
>>>2 <blueowl(at)centrum.cz>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <evan(at)ebroder.net>
>>>2 <lkundrak(at)v3.sk>
>>>2 <tambet(at)gmail.com>
>>>2 <thaller(at)redhat.com>
>>>2 <warp(at)aehallh.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.
2020-10-20 16:47:33 +02:00
Thomas Haller
6417af5b9e license: relicense "libnm-core/nm-dbus-interface.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 \
      include/NetworkManager.h \
      libnm-core/NetworkManager.h \
      libnm-core/nm-dbus-interface.h \
      libnm-util/NetworkManager.h \
      NetworkManager.h \
      ;

<<<

>>>1 <alfonso.sanchez-beato(at)canonical.com>
>>>1 <bberg(at)redhat.com>
>>>1 <bgalvani(at)redhat.com>
>>>1 <caillon(at)redhat.com>
>>>1 <daniel(at)gnoutcheff.name>
>>>1 <danw(at)gnome.org>
>>>1 <dcbw(at)redhat.com>
>>>1 <dsd(at)laptop.org>
>>>1 <gcampagna(at)src.gnome.org>
>>>1 <jarteaga(at)jbeta.is>
>>>1 <jiri(at)resnulli.us>
>>>1 <jklimes(at)redhat.com>
>>>1 <jlu(at)pengutronix.de>
>>>1 <lkundrak(at)v3.sk>
>>>1 <luzpaz(at)users.noreply.github.com>
>>>1 <mvollmer(at)redhat.com>
>>>1 <pktoss(at)gmail.com>
>>>1 <radykal(at)radykal.com>
>>>1 <rml(at)novell.com>
>>>1 <rodrigo(at)gnome-db.org>
>>>1 <tambet(at)gmail.com>
>>>1 <tambet(at)ximian.com>
>>>1 <tgraf(at)redhat.com>
>>>1 <thaller(at)redhat.com>
>>>1 <thomasbechtold(at)jpberlin.de>
>>>1 <tredaelli(at)redhat.com>
>>>2 <bberg(at)redhat.com>
>>>2 <bgalvani(at)redhat.com>
>>>2 <blueowl(at)centrum.cz>
>>>2 <daniel(at)gnoutcheff.name>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <jarteaga(at)jbeta.is>
>>>2 <jiri(at)resnulli.us>
>>>2 <jlu(at)pengutronix.de>
>>>2 <lkundrak(at)v3.sk>
>>>2 <luzpaz(at)users.noreply.github.com>
>>>2 <mvollmer(at)redhat.com>
>>>2 <pktoss(at)gmail.com>
>>>2 <radykal(at)radykal.com>
>>>2 <rml(at)novell.com>
>>>2 <tambet(at)gmail.com>
>>>2 <tgraf(at)redhat.com>
>>>2 <thaller(at)redhat.com>
>>>2 <thomasbechtold(at)jpberlin.de>
>>>2 <tredaelli(at)redhat.com>
>>>3 [...] Red Hat, Inc.
>>>3 Thiago Bauermann <thiago.bauermann(at)gmail.com>
>>>3 <j(at)bootlab.org>

Most contributors on this list agreed to relicensing according to RELICENSE.md.

The following copyright holders did not answer the request for agreeing to
relicensing:

- <caillon(at)redhat.com>: the only contributions are removing code.
  Also, Christopher was working for Red Hat at that time.

- <j(at)bootlab.org>: the patch was trivial, but the relevant code also got
  removed by commit f003ba8ef7.

- <jiri(at)resnulli.us>: a trivial contribution to the header. Also,
  Jiri was working for Red Hat at that time.

- <radykal(at)radykal.com>: fix spelling error in code comment.

- <rodrigo(at)gnome-db.org>: trivial contribution of adding a #define for
  NM_DBUS_PATH_CONNECTION_SETTINGS.

- <tgraf(at)redhat.com>: a trivial contribution to the header. Also,
  Thomas was working fro Red Hat at that time.

- <thiago.bauermann(at)gmail.com>: add a define to the header. This
  was later removed by commit 7a8f33aa3d.

While not everybody agreed to this relicensing, I think the not covered
contributions are trivial additions to our header file. Also, this file
was always part of libnm. While it had the wrong license comment, it was
never intended to be GPL licensed.
2020-10-20 16:43:01 +02:00
Thomas Haller
335d13c354 license: merge branch 'th/fix-lgpl-license-violations' (part 2)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/390
2020-10-20 16:14:48 +02:00
Thomas Haller
afc5266460 license: relicense "libnm-core/nm-core-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-core/nm-core-types.h \
      ;

<<<

gives:

>>>1 <atulhjp(at)gmail.com>
>>>1 <bberg(at)redhat.com>
>>>1 <bgalvani(at)redhat.com>
>>>1 <danw(at)gnome.org>
>>>1 <lkundrak(at)v3.sk>
>>>1 <thaller(at)redhat.com>
>>>2 <atulhjp(at)gmail.com>
>>>2 <bgalvani(at)redhat.com>
>>>2 <danw(at)redhat.com>
>>>2 <dcbw(at)redhat.com>
>>>2 <lkundrak(at)v3.sk>
>>>2 <thaller(at)redhat.com>
>>>3 [...] Red Hat, Inc.

Everybody in this list agreed to relicensing according to RELICENSE.md.
2020-10-20 16:08:02 +02:00
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