Commit Graph

7207 Commits

Author SHA1 Message Date
Lubomir Rintel
f44ac46485 bluetooth: avoid an assertion failure if built w/o bluez5 support
Fail with a proper error if we built without Bluez 5 support, but detect it at
runtime.
2015-07-09 17:56:20 +02:00
Thomas Haller
e101167e55 systemd: fix compiler warning about uninitialized variable
make[4]: Entering directory './NetworkManager/src'
    CC       libsystemd_nm_la-util.lo
  systemd/src/basic/util.c: In function 'cunescape_length_with_prefix':
  systemd/src/basic/util.c:1271:30: error: 'u' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                           t += utf8_encode_unichar(t, u);
                                ^
  systemd/src/basic/util.c:1230:26: note: 'u' was declared here
                   uint32_t u;
                            ^
2015-07-09 16:12:31 +02:00
Beniamino Galvani
2deaa39921 systemd: merge branch 'systemd' 2015-07-08 17:39:46 +02:00
Jiří Klimeš
640eb8f284 supplicant: allow with_system_ca_path to be a file name (rh #1236548)
NetworkManager uses wpa_supplicant, which in turn calls OpenSSL for verifying
certificates. wpa_supplicant calls
SSL_CTX_load_verify_locations(ctx, CAfile, CApath)
using its ca_cert and ca_path options as CAfile and CApath parameters.

We have a configure time option with_system_ca_path to override ca_path.
However, it doesn't work when a system (like Fedora) only uses bundled PEM
certificates instead of a directory with hashed certificates ([1], [2]).

So this commit allows setting --with_system_ca_path to a file name (the
trusted certificate bundle). Then the name is used to populate wpa_supplicant's
ca_cert instead of ca_path.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1053882
[2] https://www.happyassassin.net/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/

https://bugzilla.redhat.com/show_bug.cgi?id=1236548
2015-07-08 17:07:02 +02:00
Jiří Klimeš
43a50fd5f2 utils: fix error logging in ASSERT_VALID_PATH_COMPONENT() 2015-07-08 16:50:28 +02:00
Jiří Klimeš
46f29a4abc device: use NULL instead of 0 in g_return_val_if_fail() for pointer 2015-07-08 16:50:28 +02:00
Jiří Klimeš
dce050a45d device: trivial: fix a copy/paste error in comment 2015-07-08 16:50:18 +02:00
Thomas Haller
ce2964c021 route-manager: restore shadowed gateway routes after direct routes 2015-07-08 11:44:40 +02:00
Jiří Klimeš
bb1692707f device: just get ip_iface in the place where it is needed
priv->iface could change in device_link_changed() which reacts on platform link
changes caused by nm_platform_link_set_user_ipv6ll_enabled(). (The variable could
change between obtaining and using its value, because emitting a glib signal runs
callbacks synchronously).

Actually, the problem is already fixed by commit 04caae735f.
But still this is better.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1224366
2015-07-07 18:50:38 +02:00
Thomas Haller
ce9d8e0817 route-manager/trivial: move code
Have related functions closer together.

Fixes: 635eea60cf
2015-07-07 17:29:05 +02:00
Thomas Haller
08b99eea10 settings: get_plugin() should return plugin that has all requested capabilities
This bug had no real consequences because we only called
get_plugin() with one capability at a time.
2015-07-07 16:55:31 +02:00
Thomas Haller
f5c087c8e9 route-manager: always add conflicting direct routes and bump the route-metric if necessary
Kernel does not allow to add the same route (as determined by network/plen,metric)
on two different interfaces (ifindex). In case of conflict, NMRouteManager used to
ignore any but the firstly added route.

On the other hand, we cannot add a gateway-route, if there is no direct
route to the gateway. Hence, skipping duplicate routes can mean that we
skip a direct route what was necessary to add another gateway-route,
which then leads to a failure to add that route.

This also applies to IPv4 device routes that since recently are managed
by NMRouteManager.

For example, say you connect two interfaces to the same IP subnet.
The route-metric can conflict if the interfaces are of the same type
or if the user explicitly configured a conflict.
In case of conflicts, NMRouteManager would only configure the first
appearing route and skip the shadowed route on the second interface.
Now we cannot configure gateway-routes on the second interface because
the gateway is unreachable.

There are many scenarios where this issue can happen, especially with
default-routes and user-configured-routes.
For example with default-routes, ip4_config_merge_and_apply() would check
if the default-gateway requires an explict route and possibly add it.
But then NMRouteManager might not add the route because it is shadowed
by a route on an other interface.

This patch solves the issue by having NMRouteManager configure shadowed
routes too, similar to what NMDefaultRouteManager does.
It does that by searching for an unused, non-conflicting, higher metric
for the route, i.e. bump the metric by 1 until we can add it without
conflict.

Also note that NMRouteManager still ensures that for conflicting routes
the best route sticks to the interface that configured it first. That
means if you later add the conflicting route on another interface, it
will be added with higher metric and the data is still routed along the
first interface.
2015-07-07 16:24:56 +02:00
Thomas Haller
700bb96523 route-manager: add optional @r2_metric argument to _route_equals_ignoring_ifindex() 2015-07-07 16:18:46 +02:00
Thomas Haller
09fdf58f4d platform: add optional @metric argument to route_add() function
Allow overwriting the route metric.
2015-07-07 16:18:46 +02:00
Thomas Haller
635eea60cf route-manager: add compare function for route-destination 2015-07-07 16:18:46 +02:00
Thomas Haller
0055a7dd74 route-manager: fix trace logging statement 2015-07-05 13:12:03 +02:00
Beniamino Galvani
00051ad71a systemd: update code from upstream
This is a direct dump from systemd git on 2015-07-03, git commit
2812dcba8543.

SYSTEMD_DIR=../systemd
COMMIT=2812dcba85435c59203268ab54901a72c6c24a69

(
	cd "$SYSTEMD_DIR"
	git checkout "$COMMIT"
	git reset --hard
	git clean -fdx
)

git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f
mkdir src/systemd/src/basic

cp "$SYSTEMD_DIR"/src/libsystemd/sd-id128/sd-id128.c ./src/systemd/src/libsystemd/sd-id128/sd-id128.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-identifier.c ./src/systemd/src/libsystemd-network/dhcp-identifier.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-identifier.h ./src/systemd/src/libsystemd-network/dhcp-identifier.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-internal.h ./src/systemd/src/libsystemd-network/dhcp-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-lease-internal.h ./src/systemd/src/libsystemd-network/dhcp-lease-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-network.c ./src/systemd/src/libsystemd-network/dhcp-network.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-option.c ./src/systemd/src/libsystemd-network/dhcp-option.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-packet.c ./src/systemd/src/libsystemd-network/dhcp-packet.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp-protocol.h ./src/systemd/src/libsystemd-network/dhcp-protocol.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp6-internal.h ./src/systemd/src/libsystemd-network/dhcp6-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp6-lease-internal.h ./src/systemd/src/libsystemd-network/dhcp6-lease-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp6-network.c ./src/systemd/src/libsystemd-network/dhcp6-network.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp6-option.c ./src/systemd/src/libsystemd-network/dhcp6-option.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/dhcp6-protocol.h ./src/systemd/src/libsystemd-network/dhcp6-protocol.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/network-internal.c ./src/systemd/src/libsystemd-network/network-internal.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/network-internal.h ./src/systemd/src/libsystemd-network/network-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/sd-dhcp-client.c ./src/systemd/src/libsystemd-network/sd-dhcp-client.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/sd-dhcp-lease.c ./src/systemd/src/libsystemd-network/sd-dhcp-lease.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/sd-dhcp6-client.c ./src/systemd/src/libsystemd-network/sd-dhcp6-client.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/sd-dhcp6-lease.c ./src/systemd/src/libsystemd-network/sd-dhcp6-lease.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/ipv4ll-internal.h ./src/systemd/src/libsystemd-network/ipv4ll-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/ipv4ll-internal.h ./src/systemd/src/libsystemd-network/ipv4ll-internal.h
cp "$SYSTEMD_DIR"/src/libsystemd-network/ipv4ll-network.c ./src/systemd/src/libsystemd-network/ipv4ll-network.c
cp "$SYSTEMD_DIR"/src/libsystemd-network//ipv4ll-packet.c ./src/systemd/src/libsystemd-network//ipv4ll-packet.c
cp "$SYSTEMD_DIR"/src/libsystemd-network/sd-ipv4ll.c ./src/systemd/src/libsystemd-network/sd-ipv4ll.c
cp "$SYSTEMD_DIR"/src/basic/async.h ./src/systemd/src/basic/async.h
cp "$SYSTEMD_DIR"/src/basic/fileio.c ./src/systemd/src/basic/fileio.c
cp "$SYSTEMD_DIR"/src/basic/fileio.h ./src/systemd/src/basic/fileio.h
cp "$SYSTEMD_DIR"/src/basic/list.h ./src/systemd/src/basic/list.h
cp "$SYSTEMD_DIR"/src/basic/log.h ./src/systemd/src/basic/log.h
cp "$SYSTEMD_DIR"/src/basic/macro.h ./src/systemd/src/basic/macro.h
cp "$SYSTEMD_DIR"/src/basic/path-util.c ./src/systemd/src/basic/path-util.c
cp "$SYSTEMD_DIR"/src/basic/path-util.h ./src/systemd/src/basic/path-util.h
cp "$SYSTEMD_DIR"/src/basic/refcnt.h ./src/systemd/src/basic/refcnt.h
cp "$SYSTEMD_DIR"/src/basic/siphash24.c ./src/systemd/src/basic/siphash24.c
cp "$SYSTEMD_DIR"/src/basic/siphash24.h ./src/systemd/src/basic/siphash24.h
cp "$SYSTEMD_DIR"/src/basic/socket-util.h ./src/systemd/src/basic/socket-util.h
cp "$SYSTEMD_DIR"/src/basic/sparse-endian.h ./src/systemd/src/basic/sparse-endian.h
cp "$SYSTEMD_DIR"/src/basic/strv.c ./src/systemd/src/basic/strv.c
cp "$SYSTEMD_DIR"/src/basic/strv.h ./src/systemd/src/basic/strv.h
cp "$SYSTEMD_DIR"/src/basic/time-util.c ./src/systemd/src/basic/time-util.c
cp "$SYSTEMD_DIR"/src/basic/time-util.h ./src/systemd/src/basic/time-util.h
cp "$SYSTEMD_DIR"/src/basic/utf8.c ./src/systemd/src/basic/utf8.c
cp "$SYSTEMD_DIR"/src/basic/utf8.h ./src/systemd/src/basic/utf8.h
cp "$SYSTEMD_DIR"/src/basic/util.c ./src/systemd/src/basic/util.c
cp "$SYSTEMD_DIR"/src/basic/util.h ./src/systemd/src/basic/util.h
cp "$SYSTEMD_DIR"/src/basic/unaligned.h ./src/systemd/src/basic/unaligned.h
cp "$SYSTEMD_DIR"/src/basic/in-addr-util.c ./src/systemd/src/basic/in-addr-util.c
cp "$SYSTEMD_DIR"/src/basic/in-addr-util.h ./src/systemd/src/basic/in-addr-util.h
cp "$SYSTEMD_DIR"/src/basic/hostname-util.c ./src/systemd/src/basic/hostname-util.c
cp "$SYSTEMD_DIR"/src/basic/hostname-util.h ./src/systemd/src/basic/hostname-util.h
cp "$SYSTEMD_DIR"/src/basic/random-util.c ./src/systemd/src/basic/random-util.c
cp "$SYSTEMD_DIR"/src/basic/random-util.h ./src/systemd/src/basic/random-util.h
cp "$SYSTEMD_DIR"/src/shared/dns-domain.c ./src/systemd/src/shared/dns-domain.c
cp "$SYSTEMD_DIR"/src/shared/dns-domain.h ./src/systemd/src/shared/dns-domain.h
cp "$SYSTEMD_DIR"/src/systemd/_sd-common.h ./src/systemd/src/systemd/_sd-common.h
cp "$SYSTEMD_DIR"/src/systemd/sd-dhcp-client.h ./src/systemd/src/systemd/sd-dhcp-client.h
cp "$SYSTEMD_DIR"/src/systemd/sd-dhcp-lease.h ./src/systemd/src/systemd/sd-dhcp-lease.h
cp "$SYSTEMD_DIR"/src/systemd/sd-dhcp6-client.h ./src/systemd/src/systemd/sd-dhcp6-client.h
cp "$SYSTEMD_DIR"/src/systemd/sd-dhcp6-lease.h ./src/systemd/src/systemd/sd-dhcp6-lease.h
cp "$SYSTEMD_DIR"/src/systemd/sd-event.h ./src/systemd/src/systemd/sd-event.h
cp "$SYSTEMD_DIR"/src/systemd/sd-id128.h ./src/systemd/src/systemd/sd-id128.h
cp "$SYSTEMD_DIR"/src/systemd/sd-ipv4ll.h ./src/systemd/src/systemd/sd-ipv4ll.h
2015-07-05 09:47:12 +02:00
Lubomir Rintel
31c8bd6b69 platform: avoid assuming a permanent address is an ethernet address
This gets called for all links via link_get_permanent_address(). This could
easily be an infiniband address and we don't want to assert it's not.
2015-07-02 23:03:43 +02:00
Lubomir Rintel
1a5fec681b infiniband: don't crash if the parent interface is not yet there
Just bail politely just like vlans do.
2015-07-02 23:03:43 +02:00
Thomas Haller
f41fc2f33e config/test: fix test failiure due to invalid paths for out-of-tree build
Fixes: 25b23f931e
2015-07-02 17:52:39 +02:00
Thomas Haller
17216ed453 platform: fix wrong removal of generated enums
Fixes: a130f72d74
2015-07-02 16:57:28 +02:00
Thomas Haller
a130f72d74 platform: mark internal enums to be skipped by glib-mkenums
No need to generate glib type information for these internal
enums.
2015-07-02 16:26:17 +02:00
Thomas Haller
25b23f931e config/test: add test for set_values() 2015-07-02 16:01:21 +02:00
Thomas Haller
40c57fa7f1 config: add write support to atomic-sections
We already support setting configuration values, either:
 (1) set any internal section, i.e. groups starting with [.intern*].
     Those values don't ever interfere with that the user can
     configure.
 (2) set individual properties that overwrite user configuration.
     When doing that, we record the value from user configuration
     and on load, we reject our internal overwrite if the user
     configuration changed in the meantime.
     This is done by storing the values with ".set." and ".was." prefixes.

Now add support for "atomic sections". In this case, certain groups
can be marked as "atomic". When writing to such sections, we overwrite
the entire user-provided setting.
We also record the values from user configuration, and reject our
internal value if we notice modifications. This basically extends
(2) from individual properties to the entire section.
2015-07-02 16:01:20 +02:00
Thomas Haller
947fc9a278 config: add write support for NMConfig
Internal configuration is written as keyfile to
NMSTATEDIR"/NetworkManager-intern.conf"

Basically, the content of this file is merged with user
configuration from "NetworkManager.conf" files. After loading
the configuration, NMConfig exposes a merged view of user-provided
settings and internal overwrites.

All sections/groups named [.intern*] are reserved for internal
configuration values. They can be written by API, but are ignored
when the user sets them via "NetworkManager.conf". For these
internal sections, no conflicts can arise.

We can also overwrite individual properties from user configuration.
In this case, we store the value we want to set, but also remember
the value that the user configuration had, at the time of setting.
If on a later reload the user configuration changed, we ignore our
internal value -- as we assume that the user modified the value
afterwards.
We can also hide/delete value from user configuration.
This works on a per-setting basis.
2015-07-02 16:01:20 +02:00
Thomas Haller
6f0036151f settings: enable "ibft" plugin by default together with "ifcfg-rh"
Originally, ibft settings were handled by "ifcfg-rh" plugin. Later, we added
a separate "ibft" plugin and moved the functionality there.

The problem was that users quite possibly had a configuration like
  [main]
  plugins=ifcfg-rh
in their "NetworkManager.conf". That meant, after upgrade users would
no longer have ibft support.

We fixed that by installing "/etc/NetworkManager/conf.d/10-ibft-plugin.conf"
which was read after the main file and contained:
  [main]
  plugins+=ibft

We no longer want to install configuration snippets with our core packages to
/etc. Avoid the regression by changing the meaning of "ifcfg-rh". By enabling
"ifcfg-rh" you now implicitly enable "ibft" plugin as well. This can be
turned off via "no-ibft". And you can continue to enable "ibft" plugin
alone.
2015-07-02 16:01:20 +02:00
Thomas Haller
98dd29e4ae config: fix setting default configuration for 'main.plugins'
'main.plugins' is the only configuration options for which we
have a default value and which we always want to set.

This property has a compile time default and can be set via command line,
fix the logic to set the value.

The proper way is:

  - first set it (always) to the compile time default
  - then read the configuration files, which potentially modify
    the value.
  - finally, if set via command line, overwrite it because
    command line always wins.

Also comment-out the setting from our default file in
"contrib/fedora/rpm/NetworkManager.conf". We don't really need it to be
configured there, as we have a compile time default. Commenting it out
makes this clearer to the user.

Note that we cannot drop "10-ibft-plugin.conf" snippet from
NetworkManager package, because many users might have an old
"NetworkManager.conf" file with "plugin=ifcfg-rh".

This is a change in behavior if the user has no explicit
"plugins=ifcfg-rh" setting but followed by "plugins+=ibft".
2015-07-02 16:01:20 +02:00
Thomas Haller
d783742b22 config: read configuration directory "/usr/lib/NetworkManager/conf.d"
This allows packages to install their configuration snippets to
"/usr/", which is a better place for system-provided configuration
files then "/etc".

"/usr/lib/NetworkManager/conf.d/" is read first, so that the values
in /etc have higher priority.

In general, we want to move system-provided configuration away from
/etc, so that a user can do a "factory-reset" by purging /etc.

https://bugzilla.gnome.org/show_bug.cgi?id=738853
2015-07-02 16:01:20 +02:00
Thomas Haller
a1ea678f78 config: only handle 'option+' and 'option-' keys for known settings
It is wrong to blindly merge keys that have an 'option+' or 'option-'.
Merging options is only possibly when we understand what the option
means and how to merge it.

No longer handle every setting but only those that are explicitly known
to be string-lists (or device-specs).
2015-07-02 15:50:04 +02:00
Thomas Haller
bd57d76af8 core: add nm_match_spec_join() function
We have a special implemenation nm_match_spec_split() to split
a string. We also need the reverse operation to be able to convert
a list of specs to string without loss.
2015-07-02 15:50:04 +02:00
Thomas Haller
0c6a011e34 config/trivial: add code comment 2015-07-02 15:50:04 +02:00
Thomas Haller
d3e2193783 config: add NMConfigGetValueFlags argument to nm_config_data_get_value()
In some cases we want the returned value to be stripped. In some cases,
we want to read the raw value instead of the string parsed by GKeyFile.
Add an flags argument to nm_config_data_get_value(). It is up to the caller
to determine the exact meaning (and whether to strip).

By adding the flags argument, the caller can get the desired behavior easier
without having to workaround it afterwards. But more importantly, it becomes
apparent that there are different ways to retrieve the value and the caller
should decide on the details.
2015-07-02 15:50:04 +02:00
Thomas Haller
076ffda6f3 config: strip white space from configuration values
https://bugzilla.gnome.org/show_bug.cgi?id=750659
https://bugzilla.redhat.com/show_bug.cgi?id=1229861
2015-07-02 15:50:04 +02:00
Thomas Haller
7498b670a8 utils: strip whitespace for device spec in nm_match_spec_split()
Via escape sequences, the user still can specify trailing and leading
white spaces: such as "\s \s" will result in 3 spaces.
2015-07-02 15:50:04 +02:00
Thomas Haller
11c0e107b9 config: add config utility accessors 2015-07-02 15:50:04 +02:00
Thomas Haller
7e94785f28 config: ensure nm_config_get_plugins() to return stripped values 2015-07-02 15:50:04 +02:00
Thomas Haller
0abb502ff3 config: fix usage of g_key_file_get_value() vs. g_key_file_get_string()
g_key_file_get_value() returns the raw value as stored in the file.
When accessing a string value, in most cases it is correct to use
g_key_file_get_string() instead.

When working with internals, such as comparing two keyfiles for
equality, g_key_file_get_value() is correct.

When parsing booleans, we parse it based on the raw value.

Fix the usages. This is a change in behavior if the config file
contained unusual strings.
2015-07-02 15:50:04 +02:00
Thomas Haller
b506c29fe1 config: log configuration at startup and on reload 2015-07-02 15:50:04 +02:00
Thomas Haller
6d6ab20be0 config: add defines for keyfile groups to "nm-config.h"
Some plugins had their local defines for the name of the sections and
keys in NMConfig. Move those defines to "nm-config.h".

Usually plugins make use of code in core, but not the other
way round. Defining the names inside "nm-config.h" is no violation of
that because the config section names are anyway not local to the
plugin, but global in the shared name-space with other settings.
For example, another plugins shouldn't reuse the section "ifnet".
For that reason, it is correct and consistent to move these defines
to "nm-config.h".
We don't use those names in core, we merely signal their existance.
2015-07-02 15:50:04 +02:00
Thomas Haller
1b0ab2129c config: use nm_config_data_get_value_boolean()
This removes duplicate parsing, but also makes all places use the
same str-to-boolean convention.
2015-07-02 15:50:04 +02:00
Thomas Haller
a0e92799af config: add nm_config_data_get_value_boolean() 2015-07-02 15:50:04 +02:00
Thomas Haller
35d2981546 config: add nm_config_parse_boolean() function
Add function to parse as boolean according our NMConfig convention.
Split this out from nm_config_keyfile_get_boolean() so that we can use
it independently. Also, change the return type to gint, so that one might
pass -1 to indicate an invalid/missing boolean value.

Thereby also don't log a warning in nm_config_keyfile_get_boolean()
We don't want to log a warning every time we access a keyfile value.
If we want to warn about invalid values, we should do it once after
the configuration is loaded. And then we should not only do it
for booleans, but for other types as well.
2015-07-02 15:50:03 +02:00
Thomas Haller
2c46003e99 config: add macros NM_CONFIG_GET_DATA and NM_CONFIG_GET_DATA_ORIG 2015-07-02 15:50:03 +02:00
Thomas Haller
a5f7abb842 config: get rid of @error argument to nm_config_data_get_value()
We don't use this argument. A failure to retrieve a key is (for
every practical purpose) the same as no such key.
2015-07-02 15:50:03 +02:00
Thomas Haller
7fbfaf567d libnm: consider ordering for _nm_keyfile_equals()
GKeyFile considers the order of the files, so add a possibility
to check whether to keyfiles are equal -- also with respect to
the order of the elements.
2015-07-02 15:50:03 +02:00
Thomas Haller
71323122c6 libnm: add keyfile utility functions 2015-07-02 15:50:03 +02:00
Thomas Haller
4a8a0b0918 config: reload also no-auto-default state
The content of the no-auto-default state file is part of NMConfig.
During a reload, also reload that.

This way, a user could edit the no-auto-default file and it would
be properly reloaded.
2015-07-02 15:50:03 +02:00
Thomas Haller
3e4458659b config: fix evaluation of no-auto-default setting
We used to merge the spec list for no-auto-default from keyfile with the
content of the state file. Since the addition of the "except:" spec this
is wrong.
For example, if the user configured:

  no-auto-default=except:mac:11:11:11:11:11

and statefile contained "11:11:11:11:11" and "22:22:22:22:22", we would
wrongly not match "11:11:11:11:11". The two lists must be kept separate,
so that devices that are blocked by internal decision always match.

This separation is also clearer. Now the spec list is devided into a
part that comes from user configuration, and a part that comes from
internal decision.
2015-07-02 15:50:03 +02:00
Thomas Haller
fab5c6a372 config: refactor processing of 'option+' and 'option-' config settings
We have a hack to extend GKeyFile to support specifying an 'option+'
key. Also add support for 'option-'.

Options that make use of these modifiers can only be string lists.
So do the concatenation not based on plain strings, but by treating
the values as string lists. Also, don't add duplicates.
2015-07-02 15:50:03 +02:00
Thomas Haller
bb4ae800a1 config: add nm_config_keyfile_set_string_list() utils function 2015-07-02 15:50:03 +02:00