Commit graph

13175 commits

Author SHA1 Message Date
Thomas Haller 98e34208bd platform: warn about growing sysctl logging cache and clear it
When debug-logging for platform is enabled, every access to sysctl
is cached (to log the last values).

This cache can grow quite large if the system has a large number of
interfaces (e.g. docker creating veth pairs for each container).

We already used to clear the cache, when we were about to access
sysctl *and* logging was disabled in the meantime.

Now, when logging setup changes, immediately clear the cache.
Having "nm-logging.c" call into platform code is a bit of a hack
and a better design would be to have logging code emit a signal to
which platform would subscribe. But that seems to involve much
more code (especially, as no other users care about such a signal
and because nm-logging is not a GObject).

Also, log a warning when the cache grows large to inform the user
about the cache and what he can do to clear it. The extra effort to
clear the cache when changing logging setup is done so that we do
what we tell the user: changing the logging level, will clear the
cache -- right away, not some time later when the next message is
logged.
2015-10-09 14:56:50 +02:00
Thomas Haller fd87ce503c logging: add special logging level "KEEP"
Without this, the user cannot configure only certain logging domains
without touching them all.

E.g.

  # nmcli general logging level DEBUG domains PLATFORM

will disable all non-PLATFORM domains.
Well, the user can do:

  # nmcli general logging level INFO domains PLATFORM:DEBUG
  # nmcli general logging level DEBUG domains ALL:INFO,PLATFORM

but in this case all non-PLATFORM domains are reset explicitly.

Now the user can:

  # nmcli general logging level KEEP domains PLATFORM:DEBUG
  # nmcli general logging level DEBUG domains ALL:KEEP,PLATFORM

which will only change the platform domain.
2015-10-09 14:55:00 +02:00
Lubomir Rintel cc6b07c439 ifcfg-rh/tests: add a missing file to the distribution
Fixes: 68eb350ad8
2015-10-09 14:26:46 +02:00
Jiří Klimeš ce27e1e21e tui: add a checkbox for ignore-auto-routes (bgo #756200)
https://bugzilla.gnome.org/show_bug.cgi?id=756200
2015-10-09 09:27:49 +02:00
Beniamino Galvani 296ea386bf device: get rid of ipv4ll_timeout_remove()
nm_clear_g_source() already does that.
2015-10-08 22:29:49 +02:00
Beniamino Galvani e6d7fee5a6 device/vlan: update VLAN MAC address when parent's one changes
When a VLAN has a bond as parent device the MAC address of the bond
may change when other devices are enslaved and then the VLAN would
have a MAC which is different from parent's one.

Let the VLAN device listen for changes in hw-address property of
parent and update its MAC address accordingly.

https://bugzilla.redhat.com/show_bug.cgi?id=1264322
2015-10-08 22:01:48 +02:00
Thomas Haller e29ab54335 device: fix race wrongly managing external-down device due to late udev signal
Executing:

  # brctl addbr lbr0
  # ip addr add 10.1.1.1/24 dev lbr0
  # ip link set lbr0 up

can result in a race so that NetworkManager would manage the device
(and clear the IP addresses).

It happens, when NetworkManager first receives platform signals that
the device is already up:

    signal: link changed: 11: lbr0 <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 bridge* not-init addrgenmode eui64 addr D2:A1:B4:17:18:F2 driver bridge

Note that the device is still unknown via udev (not-init). The
unmanaged-state NM_UNMANAGED_EXTERNAL_DOWN gets cleared, but the
device still stays unmanaged.

Only afterwards the device is known in udev:

    signal: link changed: 11: lbr0 <UP,LOWER_UP;broadcast,multicast,up,running,lowerup> mtu 1500 arp 1 bridge* init addrgenmode eui64 addr D2:A1:B4:17:18:F2 driver bridge

At this point, we also clear NM_UNMANAGED_PLATFORM_INIT, making
the device managed with reason NM_DEVICE_STATE_REASON_NOW_MANAGED.
That results in managing the external device.

Fix that by only clearing NM_UNMANAGED_EXTERNAL_DOWN after the device
is no longer NM_UNMANAGED_PLATFORM_INIT.

https://bugzilla.redhat.com/show_bug.cgi?id=1269199
2015-10-08 20:01:16 +02:00
Lubomir Rintel 97a962a788 systemd: grant the daemon a license to kill kids
It's for their own good. Otherwise stale dnsmasq instances haunt the shared
connections.
2015-10-08 19:23:53 +02:00
Josef Bacik 68eb350ad8 ifcfg-rh: accept BOOTPROTO=static with missing IPv4 addresses
Dracut when faced with an ipv6 only setup during kickstart will generate a ifcfg
file that sets the ipv4 address things to null but sets BOOTPROTO=static.  This
makes network manager screw up because it expects an ipv4 address to be set.
Instead deal with this case by checking if we have any ipv4 addrs set, and if
not just disable ipv4.  This fixes our inability to kickstart in our ipv6 only
clusters.  Thanks,

Signed-off-by: Josef Bacik <jbacik@fb.com>

https://mail.gnome.org/archives/networkmanager-list/2015-October/msg00015.html
2015-10-08 19:00:19 +02:00
Beniamino Galvani 90fb64024c merge: merge branch 'systemd' into master 2015-10-08 14:14:19 +02:00
Thomas Haller 68b3790ad3 libnm: explicitly cast enum type for g_object_set()
Fixes: 687b651598
2015-10-08 13:11:44 +02:00
Lubomir Rintel a8af3fae57 dhcp-systemd: sd_dhcp_lease_load() returns no lease or error on ENOENT
If the lease file doesn't exist sd_dhcp_lease_load() still indicates
success while not returning any lease, resulting in an assertion fail
when we try to generate an IP4Config:

  #0  g_logv (log_domain=0x7f309b45dba0 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffc815c38e0) at gmessages.c:1046
  #1  0x00007f3097d4fa3f in g_log (log_domain=log_domain@entry=0x7f309b45dba0 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f3097dbd73d "%s: assertion '%s' failed")
      at gmessages.c:1079
  #2  0x00007f3097d4fa79 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7f309b45dba0 "NetworkManager", pretty_function=pretty_function@entry=0x7f309b456b30 <__FUNCTION__.31435> "lease_to_ip4_config",
      expression=expression@entry=0x7f309b456417 "lease != NULL") at gmessages.c:1088
  #3  0x00007f309b35454a in lease_to_ip4_config (lease=0x0, options=options@entry=0x0, default_priority=default_priority@entry=100, log_lease=log_lease@entry=0, error=0x0) at dhcp-manager/nm-dhcp-systemd.c:230
  #4  0x00007f309b3546a0 in nm_dhcp_systemd_get_lease_ip_configs (iface=<optimized out>, uuid=<optimized out>, ipv6=<optimized out>, default_route_metric=100) at dhcp-manager/nm-dhcp-systemd.c:397
  #5  0x00007f309b35ed4a in find_ip4_lease_config (ext_ip4_config=0x7f309cbe8640, connection=0x7f309cb98250, self=0x7f309cbfb7b0) at devices/nm-device.c:7215
  #6  capture_lease_config (ext_ip6_config=0x0, out_ip6_config=0x0, out_ip4_config=0x7f309cbfb5d0, ext_ip4_config=0x7f309cbe8640, self=0x7f309cbfb7b0) at devices/nm-device.c:7289
  #7  update_ip4_config (self=self@entry=0x7f309cbfb7b0, initial=initial@entry=1) at devices/nm-device.c:7323
  #8  0x00007f309b3608be in nm_device_capture_initial_config (self=self@entry=0x7f309cbfb7b0) at devices/nm-device.c:7428
  #9  0x00007f309b3dbaad in get_existing_connection (out_generated=<synthetic pointer>, device=0x7f309cbfb7b0, manager=0x7f309cb7f150) at nm-manager.c:1550
  #10 recheck_assume_connection (device=device@entry=0x7f309cbfb7b0, user_data=user_data@entry=0x7f309cb7f150) at nm-manager.c:1689
  #11 0x00007f309b3dc62d in add_device (self=0x7f309cb7f150, device=0x7f309cbfb7b0, try_assume=1) at nm-manager.c:1875
  #12 0x00007f309b3dcd10 in platform_link_added (self=self@entry=0x7f309cb7f150, ifindex=<optimized out>, plink=plink@entry=0x7f309cbcff40) at nm-manager.c:1984
  #13 0x00007f309b3df7d4 in platform_query_devices (self=0x7f309cb7f150) at nm-manager.c:2056
  #14 nm_manager_start (self=0x7f309cb7f150) at nm-manager.c:4220
  #15 0x00007f309b341f2c in main (argc=1, argv=0x7ffc815c3f68) at main.c:494
2015-10-08 12:20:29 +02:00
Thomas Haller 16522ec7f5 core: merge branch 'th/device-schedule-activation-bgo756129'
https://bugzilla.gnome.org/show_bug.cgi?id=756129
2015-10-07 18:23:09 +02:00
Thomas Haller 061028961a device: refactor setting firewall zone during activation-stage2
schedule_stage3() used to set the firewall before really
scheduling the stage3. In that case, fw_change_zone_cb() would
then directly call:
  activation_source_schedule (self, activate_stage3_ip_config_start, AF_INET);

This was different from all other places. Usually, only the
nm_device_schedule_*() functions would directly call to
activation_source_schedule().

Change this, to behave similar as when we wait for master-ready
while scheduling stage2. As such, it is more idiomatic, and
it would still work correctly even if there were multiple conditions
that would block scheduling-stage3.
2015-10-07 18:22:57 +02:00
Thomas Haller b343956d40 device/logging: refactor logging for activation-stage
Instead of adding explicit logging lines while scheduling and processing
the activation-stages, only log them in activation_source_schedule()
and activation_source_handle_cb().

Effectively, lines like:

  "Activation: Stage 1 of 5 (Device Prepare) started..."

are now:

  "activation-stage: invoke activate_stage1_device_prepare,2 (id x)"
2015-10-07 18:21:37 +02:00
Thomas Haller 823ce8bf73 device: rename nm_device_activate_*() functions
The function name is logged, so change them to be more suitable:

  - drop the "nm_device_" prefix. It is redundant in the logging,
    and usually our static functions don't have an nm-prefix.
  - have all functions now start with "activate_stagex_". The
    stage number corresponds to what we are currently logging
    during activation:
       "Activation: Stage 1 of 5 (Device Prepare)..."
    No other functions start with a "activate_stagex_" prefix,
    so it's easy to grep.
2015-10-07 16:48:48 +02:00
Thomas Haller 78ca961c0f device: refactor scheduling the activation source
Every activation-source handler first cleared the current
activation-source (activation_source_clear()) and later
returned FALSE/G_SOURCE_REMOVE.

Do not directly attach the handlers to g_idle_add().
Instead wrap the actual handler. This wrapper
  - always clears the activation source first
  - always returns G_SOURCE_REMOVE
  - does trace logging about invoking the handler

This also avoids a possibility for a bug where the handler returns
G_SOURCE_REMOVE, without also clearing activation_source_clear().
2015-10-07 16:48:48 +02:00
Thomas Haller d4d2e65eb7 macros: add NM_SET_OUT() macro 2015-10-07 16:35:19 +02:00
Thomas Haller e73e55c6ec device: update hw_addr_len before emitting signal in nm_device_update_hw_address() 2015-10-07 16:35:06 +02:00
Lubomir Rintel 3abe1bb21a device: don't complain about repeated schedules of the same activation stage
Can easily happend with a storm of DHCP responses or RAs before the idle
handler has a chance to run.

https://bugzilla.redhat.com/show_bug.cgi?id=1269520
2015-10-07 15:54:45 +02:00
Beniamino Galvani 76726b9922 dhcp-manager: fix memory leak in DHCP listener
Fixes: 7f6e39ec6e
2015-10-07 14:21:37 +02:00
Jiří Klimeš ee3c6d57a4 ifcfg-rh: write REORDER_HDR as more common "yes", "no"
initscripts just search for negative values "no" or "0"
(/etc/sysconfig/network-scripts/ifup)

Related: ccea442504
2015-10-07 13:45:30 +02:00
Jiří Klimeš e8257af0d9 ifcfg-rh: allow svTrueValue() to accept "0" and "1" values
Some initscripts variables can use "0" or "1" instead of more common
"yes", "no", for example REORDER_HDR.

And we also write REORDER_HDR=0|1 in writer.c, so we did not read REODER_HDR
correctly.

Fixes: ccea442504
2015-10-07 13:45:30 +02:00
Jiří Klimeš 687b651598 libnm/vlan: default to vlan.flags=REORDER_HDR for new connections (rh #1250225)
The kernel defaults REORDER_HDR to 1 when creating a new VLAN, but
NetworkManager's VLAN flags property defaulted to 0. Thus REORDER_HDR was not
set for NM-created VLANs with default values.

We want to match the kernel default, so we change the default value for the
vlan.flags property. However, we do not want to change the flags for existing
connections if the property is missing in connection files. Thus we have to
update plugins for that. We also make sure that vlan.flags is always written
by 'keyfile' when the value is default. That way new connections have flags
property explicitly written and it will be loaded as expected.

https://bugzilla.redhat.com/show_bug.cgi?id=1250225
2015-10-07 13:45:30 +02:00
Beniamino Galvani 8bfe99a1ae systemd: update code from upstream
This is a direct dump from systemd git on 2015-10-07, git commit
69b8a8ebaeaae13e82d44b386555921877bc0309.

======

SYSTEMD_DIR=../systemd
COMMIT=69b8a8ebaeaae13e82d44b386555921877bc0309

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

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

nm_copy_sd() {
    mkdir -p "./src/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
}

nm_copy_sd "src/basic/async.h"
nm_copy_sd "src/basic/fileio.c"
nm_copy_sd "src/basic/fileio.h"
nm_copy_sd "src/basic/hashmap.h"
nm_copy_sd "src/basic/hashmap.c"
nm_copy_sd "src/basic/hostname-util.c"
nm_copy_sd "src/basic/hostname-util.h"
nm_copy_sd "src/basic/in-addr-util.c"
nm_copy_sd "src/basic/in-addr-util.h"
nm_copy_sd "src/basic/list.h"
nm_copy_sd "src/basic/log.h"
nm_copy_sd "src/basic/macro.h"
nm_copy_sd "src/basic/mempool.h"
nm_copy_sd "src/basic/mempool.c"
nm_copy_sd "src/basic/path-util.c"
nm_copy_sd "src/basic/path-util.h"
nm_copy_sd "src/basic/prioq.h"
nm_copy_sd "src/basic/prioq.c"
nm_copy_sd "src/basic/random-util.c"
nm_copy_sd "src/basic/random-util.h"
nm_copy_sd "src/basic/refcnt.h"
nm_copy_sd "src/basic/set.h"
nm_copy_sd "src/basic/siphash24.c"
nm_copy_sd "src/basic/siphash24.h"
nm_copy_sd "src/basic/socket-util.h"
nm_copy_sd "src/basic/sparse-endian.h"
nm_copy_sd "src/basic/strv.c"
nm_copy_sd "src/basic/strv.h"
nm_copy_sd "src/basic/time-util.c"
nm_copy_sd "src/basic/time-util.h"
nm_copy_sd "src/basic/unaligned.h"
nm_copy_sd "src/basic/utf8.c"
nm_copy_sd "src/basic/utf8.h"
nm_copy_sd "src/basic/util.c"
nm_copy_sd "src/basic/util.h"
nm_copy_sd "src/libsystemd-network/arp-util.c"
nm_copy_sd "src/libsystemd-network/arp-util.h"
nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-network.c"
nm_copy_sd "src/libsystemd-network/dhcp-option.c"
nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
nm_copy_sd "src/libsystemd-network/lldp.h"
nm_copy_sd "src/libsystemd-network/lldp-internal.h"
nm_copy_sd "src/libsystemd-network/lldp-internal.c"
nm_copy_sd "src/libsystemd-network/lldp-network.h"
nm_copy_sd "src/libsystemd-network/lldp-network.c"
nm_copy_sd "src/libsystemd-network/lldp-port.c"
nm_copy_sd "src/libsystemd-network/lldp-port.h"
nm_copy_sd "src/libsystemd-network/lldp-tlv.c"
nm_copy_sd "src/libsystemd-network/lldp-tlv.h"
nm_copy_sd "src/libsystemd-network/lldp-util.h"
nm_copy_sd "src/libsystemd-network/network-internal.c"
nm_copy_sd "src/libsystemd-network/network-internal.h"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c"
nm_copy_sd "src/libsystemd-network/sd-lldp.c"
nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd "src/libsystemd/sd-event/event-util.h"
nm_copy_sd "src/shared/dns-domain.c"
nm_copy_sd "src/shared/dns-domain.h"
nm_copy_sd "src/systemd/_sd-common.h"
nm_copy_sd "src/systemd/sd-dhcp6-client.h"
nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd "src/systemd/sd-dhcp-client.h"
nm_copy_sd "src/systemd/sd-dhcp-lease.h"
nm_copy_sd "src/systemd/sd-event.h"
nm_copy_sd "src/systemd/sd-icmp6-nd.h"
nm_copy_sd "src/systemd/sd-id128.h"
nm_copy_sd "src/systemd/sd-ipv4acd.h"
nm_copy_sd "src/systemd/sd-ipv4ll.h"
nm_copy_sd "src/systemd/sd-lldp.h"
2015-10-07 09:35:08 +02:00
Thomas Haller c41be469ab device: assert that master-ready handler is not scheduled in schedule_stage2_device_config() 2015-10-06 17:35:13 +02:00
Thomas Haller 7bbc090387 device: handle master-ready before scheduling stage2
Don't handle master-ready at the beginning of stage2, but instead while
scheduling (and then possibly delaying the scheduling of stage2).

This seems more idiomatic:

  When inside a stage and your part is done: call schedule-next-stage.
  That is, always schedule the next stage, not the current one.
  schedule-next-stage then might delay to really scheduling until the
  device is ready for the next state.

Fixes: 85ac903bb8
2015-10-06 17:35:13 +02:00
Thomas Haller c5210b322d device: fix activating master/slave devices during stage2
During stage2, if the slave detected that it would need to wait for
the master, it would return FALSE (which removes the g-idle-handler).

However, it would not clear the activation-source, so later, when
the master becomes ready, its attempt to schedule stage2 again would
result in an error-log and the idle-handler would not be scheduled
again.

Fixes: 85ac903bb8
https://bugzilla.redhat.com/show_bug.cgi?id=1268797
https://bugzilla.redhat.com/show_bug.cgi?id=1183444
2015-10-06 17:35:13 +02:00
Lubomir Rintel b0ba25cdbc dbus: allow talking to fortisslvpn plugin 2015-10-06 17:31:50 +02:00
Lubomir Rintel bdedad5f72 ifcfg-rh: don't disallow console users from owning the bus name
Root can be logged on console and this would prevent NM from acquiring the bus
name. Non-privileged users are covered by the default policy anyway.
2015-10-06 17:30:51 +02:00
Lubomir Rintel 343bade03b merge: branch 'lr/ipv4-dhcp-timeout-rh1262922'
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:18:02 +02:00
Lubomir Rintel 7d1b2efc52 cli: add support for ipv4.dhcp-timeout property
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Lubomir Rintel 7b46cab8eb device: allow overriding the DHCPv4 timeout
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Lubomir Rintel fdbf4ae5e6 ifcfg-rh: add IPV4_DHCP_TIMEOUT key for ipv4.dhcp-timeout property
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Lubomir Rintel c17ab1b6ff libnm-util: add ipv4.dhcp-timeout property
https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Lubomir Rintel 3f0d595cc8 libnm,ip4-config: add ipv4.dhcp-timeout property
This is intentionally IPv4 specific since this is used for a quick fallback to
method=link-local -- something that's not needed for IPv6 since the link local
address is always there.

https://bugzilla.redhat.com/show_bug.cgi?id=1262922
2015-10-06 14:16:55 +02:00
Lubomir Rintel 8c9b791768 libnm: avoid notifying for objects until they're async-inited
Otherwise the uninitializeded objects could be prematurely signalled if their
paths are seen twice in quick succession. This happens when you have ethernet
hardware and add an ethernet connection -- it's immediatelly added to
AvialableConnections and the property reload signals the object addition
before the NMRemoteSettings's GetSettings() finishes:

  # nmcli c add type ethernet autoconnect no ifname '*'
  (process:4610): libnm-CRITICAL **: nm_connection_get_id: assertion 's_con != NULL' failed
  Connection '(null)' ((null)) successfully added.
  #

https://bugzilla.gnome.org/show_bug.cgi?id=754794
2015-10-06 14:10:55 +02:00
Lubomir Rintel 4691101517 Revert "libnm: fix initializing of new connections"
This reverts commit d20bed069c.
2015-10-06 14:10:32 +02:00
Thomas Haller 7b446137f5 config: merge branch 'th/config-enable-bgo755935'
https://bugzilla.gnome.org/show_bug.cgi?id=755935
2015-10-05 18:32:42 +02:00
Thomas Haller da0ded4927 config: drop global-dns.enable option in favor of .config.enable
No longer support disabling the global-dns configuration via the
"enable" option.

Instead, the user can put the entire dns-configuration in one separate
snippet, and disable it altogether with ".config.enable".
2015-10-05 17:12:50 +02:00
Thomas Haller 7182304684 config: allow to enable/disable configuration snippets
Support a new configuration option

  [.config]
  enable=<ENABLED>

for configuration snippets.

This new [.config] section is only relevant within the snippet itself
and it is not merged into the combined configuration.

Currently only the "enable" key is supported. If the "enable" key is
missing, it obviously defaults to being enabled. It allows snippets
to be skipped from loading. The main configuration "NetworkManager.conf"
cannot be skipped.

<ENABLED> can be a boolean value (false), to skip a configuration
snippet from loading.
It can also be a string to match against the NetworkManager version,
like "enable=nm-version-min:1.1,nm-version-min:1.0.6"

There are several motivations for this:

- the user can disable an entire configuration snippet by toggeling
  one entry.
  This generalizes  the functionality of the global-dns.enable
  setting, but in a way that applies to configuration on a per-file
  basis.

- for developing, we often switch between different versions of
  NetworkManager. Thus, we might want to use different configuration.
  E.g. before global-dns options, I want to use "dns=none" and manage
  resolv.conf myself. Now, I can use global-dns setting to do that.
  That can be achieved with something like the following (not exactly,
  it's an example only):

      [.config]
      enable=nm-version-min:1.1
      [main]
      dns=default
      [global-dns-domain-*]
      nameserver=127.0.0.1

  Arguably, this would be more awesome, if we would bump our micro devel
  version (1.1.0) more often while developing 1.2.0 (*hint*).

- in principle, packages could drop configuration snippets and enable
  them based on the NetworkManager version.

- with the "env:" spec, you can enable/disable snippets by configuring
  an environment variable. Again, useful for testing and developing.
2015-10-05 17:12:50 +02:00
Thomas Haller 72ff5e8cac core: add nm_utils_ascii_str_to_bool()
This is effectively the same as nm_config_parse_boolean(). The difference is,
that "nm-config.c" is not available to the interface-helper, thus any
code used by interface-helper (like "NetworkManager.c") cannot use this
function.

Still don't drop nm_config_parse_boolean() entirely, because it's better
to have the explicit notion of parsing a string in the config-context.

I ended up not using the function. But I'd still keep this patch.
2015-10-05 17:12:50 +02:00
Thomas Haller ced1dcabef config/trivial: rename nm_config_get_device_match_spec() to nm_config_get_match_spec()
We want to use the term match-spec more generally and not only
for "device-specs".
2015-10-05 17:12:50 +02:00
Thomas Haller d5bfe04dea core: merge branch 'th/more-asserts'
Change NM_MORE_ASSERTS to allow for different levels for which
asserts are enabled.
2015-10-05 16:02:38 +02:00
Thomas Haller 3b6c1aa1a3 device: add assertion to consistency of nm_device_check_connection_available() 2015-10-05 15:58:51 +02:00
Thomas Haller 6395c829bb build: make NM_MORE_ASSERTS define numeric for different levels of more-asserts
Allows to enable more-asserts more granularly.

Unfortunately, the old check was "${enable_more_asserts} == "yes", thus
we cannot extend "--enable-more-assert=level" because that would mean
that the same build script cannot set the option on both old and new
NetworkManager.
Thus, add a new option --with-more-asserts=level. If you put the
following in your build script, it will work as expected whether
you build a new or an old version of NetworkManager.
  ./configure --enable-more-asserts --with-more-asserts=5
2015-10-05 15:25:54 +02:00
Thomas Haller 0907f3c21e build: include "config.h" in nm*enum-types.c sources
Also include the "config.h" file in the generated sources
like "nm-enum-types.c".
2015-10-05 15:01:38 +02:00
Thomas Haller 82c37e643b config: add missing include to "config.h" header 2015-10-05 15:01:38 +02:00
Thomas Haller 9358588a2a build: drop generating empty nm-*-enum-types for device plugins
The device plugins adsl, team and wifi were generating empty
"nm-*-enum-types" header and source files.
2015-10-05 15:01:38 +02:00
Thomas Haller bb9d4b0ad1 device: use _LOG() logging macros for per-device logging 2015-10-05 13:05:05 +02:00