No description
Find a file
Beniamino Galvani 8bd72d5f2e std-aux: fix NM_LIKELY()/NM_UNLIKELY() macros
Fix this compile error when "defined(__GNUC__) && (__GNUC__ > 2) &&
defined(__OPTIMIZE__)" doesn't match:

  In file included from ../src/libnm-std-aux/nm-default-std.h:102,
                   from ../src/libnm-std-aux/nm-std-utils.c:3:
  ../src/libnm-std-aux/nm-std-aux.h: In function ‘NM_ALIGN_TO’:
  ../src/libnm-std-aux/nm-std-aux.h:160:6: error: expected expression before ‘{’ token
    160 |     ({                                 \
        |      ^
  ../src/libnm-std-aux/nm-std-aux.h:169:31: note: in expansion of macro ‘_NM_BOOLEAN_EXPR_IMPL’
    169 | #define NM_BOOLEAN_EXPR(expr) _NM_BOOLEAN_EXPR_IMPL(NM_UNIQ, expr)
        |                               ^~~~~~~~~~~~~~~~~~~~~
  ../src/libnm-std-aux/nm-std-aux.h:175:27: note: in expansion of macro ‘NM_BOOLEAN_EXPR’
    175 | #define NM_LIKELY(expr)   NM_BOOLEAN_EXPR(expr)
        |                           ^~~~~~~~~~~~~~~
  ../src/libnm-std-aux/nm-std-aux.h:238:19: note: in expansion of macro ‘NM_LIKELY’
    238 |         } else if NM_LIKELY (cond) {                                  \
        |                   ^~~~~~~~~
  ../src/libnm-std-aux/nm-std-aux.h:449:5: note: in expansion of macro ‘nm_assert’
    449 |     nm_assert(nm_utils_is_power_of_two(ali));
        |     ^~~~~~~~~

The NM_LIKELY()/NM_UNLIKELY() macros should be alwas called enclosed
in parentheses like in:

 if (NM_LIKELY(i == 1)) ...

and should be expanded with only a single pair of parentheses so that
expressions like (i = 1) generate a compiler warning.

Fixes: 030d68aef7 ('shared: add nm_assert() to "nm-std-aux.h"')
2022-11-04 09:12:04 +01:00
.gitlab-ci gitlab-ci: update ci-templates version 2022-10-11 09:47:39 +02:00
contrib all: cleanup close() handling and clarify nm_close()/nm_close_with_error() 2022-10-25 13:12:48 +02:00
data build: stop relying on intltool for i18n 2022-06-27 13:40:09 +02:00
docs docs: add "sandboxing.md" 2022-03-28 18:04:18 +02:00
examples examples: fix code formatting in "gmaincontext.py" 2022-10-25 16:47:48 +02:00
introspection doc: fix bind-activation description for AddAndActivateConnection2 D-Bus API 2022-10-03 20:30:20 +02:00
m4 m4: add NM_COMPILER_WARNING_FLAG() macro 2022-08-11 19:49:41 +02:00
man nmcli: rename "generate-docs-nm-settings-nmcli" to "gen-metadata-nm-settings-nmcli" 2022-10-31 09:11:30 +01:00
po po: update Hungarian (hu) translation 2022-10-14 19:01:24 +02:00
src std-aux: fix NM_LIKELY()/NM_UNLIKELY() macros 2022-11-04 09:12:04 +01:00
tools build: pass both filenames to "tools/check-compare-generated.sh" script 2022-10-31 09:11:30 +01:00
vapi vapi: annotate finish function for DeviceWifi.request_scan_options_async 2022-02-21 19:37:23 +01:00
.clang-format clang-format: mark FOR_EACH_DELAYED_ACTION() as a ForEachMacro 2022-01-13 15:25:17 +01:00
.dir-locals.el misc: add toplevel .dir-locals file that tells Emacs to show trailing whitespace 2013-03-08 15:15:28 +01:00
.git-blame-ignore-revs add reformatting commit to ".git-blame-ignore-revs" 2022-07-06 11:08:23 +02:00
.gitignore gitignore: ignore "po/.Makefile.patched" file 2022-10-31 09:20:53 +01:00
.gitlab-ci.yml gitlab-ci: update ci-templates version 2022-10-11 09:47:39 +02:00
.mailmap mailmap: update to add Adrian 2022-05-27 12:42:56 +02:00
.triage-policies.yml gitlab-ci: use ruby:2.7 for triage pipeline 2020-03-18 17:40:59 +01:00
AUTHORS all: update references to our mailing list 2022-11-02 12:58:57 +01:00
autogen.sh build: stop relying on intltool for i18n 2022-06-27 13:40:09 +02:00
ChangeLog Changelog: update references to "main" branch 2021-04-01 22:30:20 +02:00
config-extra.h.meson build: remove duplicate and unused RUNDIR define 2019-05-17 21:24:18 +02:00
config-extra.h.mk build: regenerate config-extra.h if configure was re-run with different arguments 2019-09-25 15:55:37 +02:00
config.h.meson dns/unbound: drop deprecated "unbound" DNS plugin 2022-04-15 09:04:30 +02:00
configure.ac release: bump version to 1.41.4 (development) 2022-11-02 18:13:08 +01:00
CONTRIBUTING.md all: update references to our mailing list 2022-11-02 12:58:57 +01:00
COPYING COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
COPYING.GFDL COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
COPYING.LGPL COPYING: make sure we ship the relevant license texts 2019-09-10 11:10:52 +02:00
linker-script-binary.ver iface-helper/build: add linker version script 2016-10-13 21:33:33 +02:00
linker-script-devices.ver devices/build: use one linker-script-devices.ver for all device plugins 2016-10-13 21:36:06 +02:00
linker-script-settings.ver settings/build: add linker version script for settings plugins 2016-10-13 21:33:33 +02:00
lsan.suppressions tests/sanitizer: suppress leak in openssl 2020-05-14 12:03:24 +02:00
MAINTAINERS misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
MAINTAINERS.md MAINTAINERS: improve documentation about backports 2022-10-17 09:53:15 +02:00
Makefile.am libnm: generate "gen-metadata-nm-settings-libnm-core.xml" with meta data 2022-10-31 09:11:30 +01:00
Makefile.examples example: add python example for libnm, NMClient, GMainContext and async 2022-07-05 18:36:01 +02:00
Makefile.glib all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
Makefile.vapigen build: fix make always re-making vapigen target 2016-10-21 18:46:03 +02:00
meson.build release: bump version to 1.41.4 (development) 2022-11-02 18:13:08 +01:00
meson_options.txt build/meson: fix autodetecting ifcfg_rh/ifupdown plugins 2022-07-25 10:32:10 +02:00
NEWS NEWS: update 2022-10-27 09:15:26 +02:00
README.md doc: rename "README" to "README.md" 2022-03-21 17:19:47 +01:00
RELICENSE.md all: update references to our mailing list 2022-11-02 12:58:57 +01:00
TODO core/trivial: rename NM_SHUTDOWN_TIMEOUT_MS to NM_SHUTDOWN_TIMEOUT_MAX_MSEC 2022-02-24 09:38:52 +01:00
valgrind.suppressions all: goodbye libnm-glib 2019-04-16 15:52:27 +02:00


NetworkManager core daemon has moved to gitlab.freedesktop.org!

git clone https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git


Networking that Just Works

NetworkManager attempts to keep an active network connection available at all times. The point of NetworkManager is to make networking configuration and setup as painless and automatic as possible. NetworkManager is intended to replace default route, replace other routes, set IP addresses, and in general configure networking as NM sees fit (with the possibility of manual override as necessary). In effect, the goal of NetworkManager is to make networking Just Work with a minimum of user hassle, but still allow customization and a high level of manual network control. If you have special needs, we'd like to hear about them, but understand that NetworkManager is not intended for every use-case.

NetworkManager will attempt to keep every network device in the system up and active, as long as the device is available for use (has a cable plugged in, the killswitch isn't turned on, etc). Network connections can be set to 'autoconnect', meaning that NetworkManager will make that connection active whenever it and the hardware is available.

"Settings services" store lists of user- or administrator-defined "connections", which contain all the settings and parameters required to connect to a specific network. NetworkManager will never activate a connection that is not in this list, or that the user has not directed NetworkManager to connect to.

How it works:

The NetworkManager daemon runs as a privileged service (since it must access and control hardware), but provides a D-Bus interface on the system bus to allow for fine-grained control of networking. NetworkManager does not store connections or settings, it is only the mechanism by which those connections are selected and activated.

To store pre-defined network connections, two separate services, the "system settings service" and the "user settings service" store connection information and provide these to NetworkManager, also via D-Bus. Each settings service can determine how and where it persistently stores the connection information; for example, the GNOME applet stores its configuration in GConf, and the system settings service stores its config in distro-specific formats, or in a distro- agnostic format, depending on user/administrator preference.

A variety of other system services are used by NetworkManager to provide network functionality: wpa_supplicant for wireless connections and 802.1x wired connections, pppd for PPP and mobile broadband connections, DHCP clients for dynamic IP addressing, dnsmasq for proxy nameserver and DHCP server functionality for internet connection sharing, and avahi-autoipd for IPv4 link-local addresses. Most communication with these daemons occurs, again, via D-Bus.

Why doesn't my network Just Work?

Driver problems are the #1 cause of why NetworkManager sometimes fails to connect to wireless networks. Often, the driver simply doesn't behave in a consistent manner, or is just plain buggy. NetworkManager supports only those drivers that are shipped with the upstream Linux kernel, because only those drivers can be easily fixed and debugged. ndiswrapper, vendor binary drivers, or other out-of-tree drivers may or may not work well with NetworkManager, precisely because they have not been vetted and improved by the open-source community, and because problems in these drivers usually cannot be fixed.

Sometimes, command-line tools like 'iwconfig' will work, but NetworkManager will fail. This is again often due to buggy drivers, because these drivers simply aren't expecting the dynamic requests that NetworkManager and wpa_supplicant make. Driver bugs should be filed in the bug tracker of the distribution being run, since often distributions customize their kernel and drivers.

Sometimes, it really is NetworkManager's fault. If you think that's the case, please file a bug at:

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

Attaching NetworkManager debug logs from the journal (or wherever your distribution directs syslog's 'daemon' facility output, as /var/log/messages or /var/log/daemon.log) is often very helpful, and (if you can get) a working wpa_supplicant config file helps enormously. See the logging section of file contrib/fedora/rpm/NetworkManager.conf for how to enable debug logging in NetworkManager.