Thomas Haller
6044fce960
bridge: refactor definition of options array to use a macro and C99 designated initializer
...
Yes, it's a macro and it's more lines of code.
But I think this is much easier to read and to maintain.
2020-05-08 08:02:51 +02:00
Thomas Haller
7c22710c17
libnm: use boolean values for range of NM_SETTING_BRIDGE_PORT_HAIRPIN_MODE in slave_options
2020-05-08 08:02:51 +02:00
Thomas Haller
42288df043
libnm: adjust bridge defines NM_BRIDGE_VLAN_DEFAULT_PVID_DEF
2020-05-08 08:02:51 +02:00
Thomas Haller
bfcfdc2955
libnm: adjust bridge defines NM_BRIDGE_VLAN_STATS_ENABLED_DEF
2020-05-08 08:02:51 +02:00
Thomas Haller
f34144f70b
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_STARTUP_QUERY_INTERVAL_*
2020-05-08 08:02:51 +02:00
Thomas Haller
55311c6a6a
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_STARTUP_QUERY_COUNT_*
2020-05-08 08:02:51 +02:00
Thomas Haller
433bb1fbe4
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_SNOOPING_DEF
2020-05-08 08:02:50 +02:00
Thomas Haller
96bb90a1ef
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_QUERY_USE_IFADDR_DEF
2020-05-08 08:02:50 +02:00
Thomas Haller
0db1d28e6d
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_QUERY_RESPONSE_INTERVAL_*
2020-05-08 08:02:50 +02:00
Thomas Haller
58001f70e8
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_QUERY_INTERVAL_*
2020-05-08 08:02:50 +02:00
Thomas Haller
08cfe812ec
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_QUERIER_DEF
2020-05-08 08:02:50 +02:00
Thomas Haller
da6bbd73aa
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_QUERIER_INTERVAL_*
2020-05-08 08:02:50 +02:00
Thomas Haller
a75ec12d8b
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_MEMBERSHIP_INTERVAL_*
2020-05-08 08:02:50 +02:00
Thomas Haller
ec9e58ee01
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_LAST_MEMBER_INTERVAL_*
2020-05-08 08:02:50 +02:00
Thomas Haller
769b176263
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_LAST_MEMBER_COUNT_*
2020-05-08 08:02:50 +02:00
Thomas Haller
4c3691e52e
libnm: adjust bridge defines NM_BRIDGE_PORT_PATH_COST_*
2020-05-08 08:02:49 +02:00
Thomas Haller
a7421f8bf2
libnm: adjust bridge defines NM_BRIDGE_PORT_PRIORITY_*
2020-05-08 08:02:49 +02:00
Thomas Haller
a690cedcba
libnm: adjust bridge defines NM_BRIDGE_PRIORITY_*
2020-05-08 08:02:49 +02:00
Thomas Haller
e2cb0837cc
libnm: adjust bridge defines NM_BRIDGE_MAX_AGE_*
2020-05-08 08:02:49 +02:00
Thomas Haller
d7dd4c70d0
libnm: adjust bridge defines NM_BRIDGE_HELLO_TIME_*
2020-05-08 08:02:49 +02:00
Thomas Haller
696fae40b7
libnm: adjust bridge defines NM_BRIDGE_STP_DEF
2020-05-08 08:02:49 +02:00
Thomas Haller
8ee4dbf709
libnm: adjust bridge defines NM_BRIDGE_FORWARD_DELAY_*
2020-05-08 08:02:49 +02:00
Thomas Haller
f61e354cfa
libnm: adjust bridge defines NM_BRIDGE_AGEING_TIME_*
2020-05-08 08:02:48 +02:00
Thomas Haller
f5527ecc5a
libnm: adjust bridge defines NM_BRIDGE_MULTICAST_HASH_MAX_*
2020-05-08 08:02:48 +02:00
Thomas Haller
adf377c2c0
libnm: move defines for bridge defaults to "nm-core-internal.h" header
2020-05-08 08:02:48 +02:00
Thomas Haller
4338cf3800
ifcfg-rh/trivial: rename variable i in write_bridge_*setting() to indicate integer type
2020-05-08 08:02:48 +02:00
Thomas Haller
9996597666
ifcfg: refactor GObject accessors in write_bridge_setting()
2020-05-08 08:02:48 +02:00
Thomas Haller
83830badda
device: use NM_G_PARAM_SPEC_GET_DEFAULT_*() in NMDeviceBridge's commit_option()
2020-05-08 08:02:48 +02:00
Thomas Haller
0b2ecf5e35
shared: add NM_G_PARAM_SPEC_GET_DEFAULT_*() helper macros
2020-05-08 08:02:48 +02:00
Thomas Haller
a0b2955907
shared: add NM_ENSURE_NOT_NULL() macro
2020-05-08 08:00:41 +02:00
Thomas Haller
6e9967939b
acd: fix char buffer argument to _acd_event_to_string_buf()
2020-05-08 07:43:27 +02:00
Thomas Haller
bdac27eb28
config: merge branch 'th/config-fix-subtract-plugins'
...
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/491
2020-05-07 14:15:28 +02:00
Thomas Haller
85fa23a6b5
config: minor cleanup in _sort_groups_cmp() and _intern_config_write_sort_fcn()
2020-05-07 14:08:34 +02:00
Thomas Haller
9ea7bf0da7
config: use nm_streq() and NM_STR_HAS_PREFIX() in "nm-config.c"
...
- nm_streq() is easier to read.
- NM_STR_HAS_PREFIX() works only with string literals, and gets
inlined up to one strncmp() call. There is no need to call glib,
to determine strlen(prefix) (that we already know), and then to
call strncmp().
2020-05-07 14:08:34 +02:00
Thomas Haller
ff321e250e
config: use NM_STR_HAS_PREFIX_WITH_MORE() instead of duplicate implementation
2020-05-07 14:08:33 +02:00
Thomas Haller
3201b06925
config: use cleanup attribute in read_config()
2020-05-07 14:08:33 +02:00
Thomas Haller
f588dabb4f
settings: ensure that "plugins-=ifcfg-rh" works with the default plugins
...
On Fedora/RHEL, the default for main.plugins is "ifcfg-rh". You would
expect that a single configuration file
[main]
plugins-=ifcfg-rh
would result in an empty list of plugins (which subsequently gets
completed with "keyfile").
That didn't happen due to a bug. Fix it.
2020-05-07 14:08:33 +02:00
Thomas Haller
5cdb636301
keyfile: use nm_g_error_matches() in g_error_matches()
...
nm_g_error_matches() can be inlined and first checks whether the error
argument is not NULL. At least from the keyfile accessor functions, use
this macro, as they are called many times.
2020-05-07 14:08:32 +02:00
Thomas Haller
e08bb66b34
keyfile,config: use nm_keyfile_error_is_not_found() helper
2020-05-07 14:08:32 +02:00
Thomas Haller
df27164d5e
shared: add nm_keyfile_error_is_not_found() helper
2020-05-07 14:08:32 +02:00
Thomas Haller
e31b31e5e5
shared: add nm_g_error_matches() helper
2020-05-07 14:08:31 +02:00
Thomas Haller
a617177070
shared: add NM_STR_HAS_PREFIX_WITH_MORE() helper
2020-05-07 14:08:31 +02:00
Thomas Haller
5a09292f1f
shared: fix accessing "str" argument to NM_STR_HAS_PREFIX() macro twice
...
Macros preferably behave function-like, for example in that they evaluate
arguments exactly ones. Sometimes, we want to evaluate arguments
lazily, like in NM_IN_SET() or nm_g_set_error_take_lazy(). But it
is almost always undesirable to evaluate an argument more than once.
Fix NM_STR_HAS_PREFIX() for that.
Also, rename the local variable to not use the name "_str",
which may be a common name that the caller would like to use.
2020-05-07 14:08:31 +02:00
Thomas Haller
6325297367
all: merge branch 'th/lgtm-com-fixes-1'
...
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/494
2020-05-07 14:01:14 +02:00
Thomas Haller
64331d6085
examples: remove unused code from "examples/python/dbus/vpn.py"
...
lgtm.com says "The value assigned to local variable all_connections is never used".
Just drop the entire statement. It's not right there.
2020-05-07 13:58:16 +02:00
Thomas Haller
8ad448444a
examples: avoid "x == None" checks in python examples
...
lgmt.com says "Testing for None should use the is operator".
2020-05-07 13:58:15 +02:00
Thomas Haller
c7d0a86050
examples: avoid "except" for BaseException in examples
...
lgtm.com flags this as "Except block directly handles BaseException".
2020-05-07 13:58:14 +02:00
Thomas Haller
5c08981356
examples: avoid non-thread-safe localtime() function example
...
Just to silence the warning on lgtm.com.
2020-05-07 13:58:13 +02:00
Thomas Haller
41a7a26259
examples: remove unused imports from python examples
2020-05-07 13:58:13 +02:00
Thomas Haller
a5614dc469
examples: remove unused assignment in "examples/python/gi/wifi-p2p.py"
...
lgtm.com warns about this.
2020-05-07 13:58:12 +02:00