Commit Graph

21088 Commits

Author SHA1 Message Date
Thomas Haller
6aed608011 libnm-core: sort attribute names for nm_ip_route_get_attribute_names()
The function shall return the attribute names in a consistent order.
Let's sort by name.
2017-09-26 19:36:51 +02:00
Thomas Haller
7cd04ce014 core: inject route list to delete for nm_platform_ip_route_sync()
Whenever we call a platform operation that reads or writes the netlink
socket, there is the possibility that the cache gets updated, as we
receive netlink events.

It is thus racy, if nm_platform_ip_route_sync() *first* adds routes, and
then obtains a list of routes to delete. The correct approach is to
determine which routes to delete first (and keep it in a list
@routes_prune), and pass that list down to nm_platform_ip_route_sync().

Arguably, this doesn't yet solve every race. For example, NMDevice
calls update_ext_ip_config() during ip4_config_merge_and_apply().
That is good, as it resyncs with platform. However, before calling
nm_ip4_config_commit() it calls other platform operations, like
_commit_mtu(). So, the race is still there.
2017-09-26 19:36:51 +02:00
Thomas Haller
0fce60c767 device: do full update_ext_ip_config() during merge-and-apply
Since commit a21b8882cc ("device: update
external configuration before commit"), we correctly re-sync the
external IP configuration before a merge, in case we notice that
there were some changes in platform.

Go a step further, and do the full update_ext_ip_config(). We should
have one way how to capture the external config, including intersect
and subtract. Otherwise, we end up with an @ext_ip4_config, which is
different from how it looks usually.
2017-09-26 19:36:51 +02:00
Thomas Haller
8207bfd5d6 device: refactor update-ip-config for device
Refactor the code. There should be no changes in behavior at all.

The point is, to be able to reuse update_ext_ip_config() in the
next commit.

And also, I think it's an antipattern to have mirroring functions like
ip4_xyz() and ip6_xyz(). Instead, there should be one function, with
extra addr_family argument. That way, it'much clearer where two
implementations differ and where they are identical.
Basically, it moves the differentiation per the address family down
the call stack, closer to the place where the behavior is actually
different.
2017-09-26 19:35:32 +02:00
Thomas Haller
f7616eee1e shared: move nm_dedup_multi_obj_ref() to header as inline
nm_dedup_multi_obj_ref() is a trivial function, that only uses the field
which is already declared in the same header file. Move it to the header
so that it can be inlined (without LTO).
2017-09-26 19:31:17 +02:00
Thomas Haller
9acf80a979 platform: handle route table RT_TABLE_UNSPEC specially
Kernel does not allow to add a route with table 0 (RT_TABLE_UNSPEC). It
effectively is an alias for the main table. We must consider that when
comparing routes sementically.
2017-09-26 19:31:17 +02:00
Thomas Haller
4ca2e1b10c cli: merge branch 'th/cli-interactive-mode-crash-bgo788104'
https://bugzilla.gnome.org/show_bug.cgi?id=788104
2017-09-26 15:14:57 +02:00
Thomas Haller
889ecc98a1 cli: use cleanup attribute in editor_menu_main() 2017-09-26 15:11:58 +02:00
Thomas Haller
54490be96d cli: fix crash in interactive mode for "describe ."
https://bugzilla.gnome.org/show_bug.cgi?id=788104
2017-09-26 15:11:58 +02:00
Beniamino Galvani
7070d17ced device: reset @con_ip6_config on failure before RA
If the commit of static connection parameters fails before starting
RA, we should reset @con_ip6_config; otherwise any external update
arriving before the commit of RA parameters will remove from
@con_ip6_config all parameters not present externally, because in
update_ip6_config() we do:

  /* This function was called upon external changes. Remove the configuration
   * (addresses,routes) that is no longer present externally from the internal
   * config. This way, we don't re-add addresses that were manually removed
   * by the user. */
  if (priv->con_ip6_config)
      nm_ip6_config_intersect (priv->con_ip6_config, priv->ext_ip6_config);

Instead if @con_ip6_config is cleared it will be rebuilt from the
connection setting at the next commit.

Fixes-test: @ipv6_preserve_cached_routes
2017-09-26 08:53:56 +02:00
Beniamino Galvani
7dc1f8b479 ifcfg-rh: trivial: rename write_bonding_setting() to write_bond_setting()
The setting name is NMSettingBond.
2017-09-25 22:36:45 +02:00
Beniamino Galvani
e89ed9b51e ifcfg-rh: write DEVICE only once
The plugin already writes DEVICE in write_connection_setting(), there
is no need to write it again elsewhere.
2017-09-25 22:36:43 +02:00
Thomas Haller
18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller
01677a3e40 build: cleanup style for toplevel Makefile.am
Use consistently $() instead of ${}.

Don't use the $(top_*) variables, because we don't do recursive make
and the toplevel directory is the same as the current directory.
For consistency, only use the non-toplevel versions of the variables.
2017-09-25 18:23:15 +02:00
Thomas Haller
9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller
5819988ac7 platform: cleanup logging for adding link
No need for duplicate log lines

  <debug> [1506146476.8462] platform: link: adding tap tap0 owner 107 group -1
  <debug> [1506146476.8462] platform-linux: link: add tap tap0 owner 107 group -1

Merge them.

Also, for consistency change the logging output for adding generic
interfaces in nm_platform_link_add().
2017-09-25 14:49:44 +02:00
Iain Lane
b18896f770 {vpn,remote}-connection: disconnect signal handlers when disposed
GNOME Settings 3.26 is crashing every time a VPN connection changed its
state. After some digging, a debug message was put on dispose, and this
issue was found:

libnm-Message: Object 0x55555633c070 disposed
libnm-Message: Object 0x55555633c730 disposed
libnm-Message: Object 0x55555633eae0 disposed
libnm-Message: Object 0x555556340a80 disposed

Thread 1 "gnome-control-c" received signal SIGSEGV, Segmentation fault.
g_type_check_instance_cast (type_instance=type_instance@entry=0x55555633c070, iface_type=93825006537856) at /.../glib/gobject/gtype.c:4057
4057		  node = lookup_type_node_I (type_instance->g_class->g_type);
(gdb) bt

NetworkManager is calling callbacks on disposed objects, which leads to
crashes in clients (e.g. GNOME Settings).

Fix this issue by disconnecting signal handlers when the objects are
disposed.

Patch originally by Georges Basile Stavracas Neto <georges.stavracas@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787893
2017-09-22 14:16:50 +02:00
Iain Lane
91fa202379 manager: Disconnect from signals on the proxy when we're disposed
We're calling a callback on a proxy after it has been disposed. We
should make sure to disconnect from it when we go away.

https://bugzilla.gnome.org/show_bug.cgi?id=787897
2017-09-22 14:15:53 +02:00
Francesco Giudici
15344be0e1 device: avoid touching IPv6 on "external" connections without IPv6 conf
When a device managed by NetworkManager is configured manually (adding
ip addresses), NetworkManager will track the device configuration with
an in-memory only config, marking the device as "external".
Devices marked external should be just tracked but left untouched.
This does not happens on current code base: if an ipv4 address is added,
NM generates the in-memory connection, marking the ipv6.method as "ignore".
While activating the connection, NM will process the IPv6 "ignore" method:
this implies leaving the IPv6LL address generation to the kernel. To
trigger this NM will disable/enable IPv6 on the interface.
This not only may change the device configuration but may cause also
a potential race with an external IPv6 assignment on the device.

NetworkManager should do nothing to IPv6 when method is "ignore" and
connection is marked as "external": this commit fixes this behavior.
Note that if/once an IPv6 address is externally added, IPv6 method in the
tracked connection is changed to "manual" and a link local address will be
generated if needed.

https://bugzilla.redhat.com/show_bug.cgi?id=1462260
2017-09-22 13:19:10 +02:00
Beniamino Galvani
2f66fbf32d build: add missing header file to Makefile
Fixes: 734c5b38ad
2017-09-22 12:06:11 +02:00
Thomas Haller
734c5b38ad dhcp: use systemd defines for DHCP options 2017-09-21 15:49:48 +02:00
Thomas Haller
61f0f198bf systemd: merge branch systemd into master 2017-09-21 15:33:32 +02:00
Thomas Haller
eba874f859 systemd: update code from upstream (2017-09-21)
This is a direct dump from systemd git on 2017-09-21, git commit
f679ed61163468f4fb2d4a17fa0984c8c1f0ba36.

======

SYSTEMD_DIR=../systemd
COMMIT=f679ed61163468f4fb2d4a17fa0984c8c1f0ba36

(
  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/alloc-util.c"
nm_copy_sd "src/basic/alloc-util.h"
nm_copy_sd "src/basic/async.h"
nm_copy_sd "src/basic/escape.c"
nm_copy_sd "src/basic/escape.h"
nm_copy_sd "src/basic/ether-addr-util.c"
nm_copy_sd "src/basic/ether-addr-util.h"
nm_copy_sd "src/basic/extract-word.c"
nm_copy_sd "src/basic/extract-word.h"
nm_copy_sd "src/basic/fileio.c"
nm_copy_sd "src/basic/fileio.h"
nm_copy_sd "src/basic/fd-util.c"
nm_copy_sd "src/basic/fd-util.h"
nm_copy_sd "src/basic/fs-util.c"
nm_copy_sd "src/basic/fs-util.h"
nm_copy_sd "src/basic/hash-funcs.c"
nm_copy_sd "src/basic/hash-funcs.h"
nm_copy_sd "src/basic/hashmap.c"
nm_copy_sd "src/basic/hashmap.h"
nm_copy_sd "src/basic/hexdecoct.c"
nm_copy_sd "src/basic/hexdecoct.h"
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/io-util.c"
nm_copy_sd "src/basic/io-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/parse-util.c"
nm_copy_sd "src/basic/parse-util.h"
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/process-util.h"
nm_copy_sd "src/basic/process-util.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/signal-util.h"
nm_copy_sd "src/basic/siphash24.c"
nm_copy_sd "src/basic/siphash24.h"
nm_copy_sd "src/basic/socket-util.c"
nm_copy_sd "src/basic/socket-util.h"
nm_copy_sd "src/basic/sparse-endian.h"
nm_copy_sd "src/basic/stdio-util.h"
nm_copy_sd "src/basic/string-table.c"
nm_copy_sd "src/basic/string-table.h"
nm_copy_sd "src/basic/string-util.c"
nm_copy_sd "src/basic/string-util.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/umask-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-internal.h"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.c"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.h"
nm_copy_sd "src/libsystemd-network/lldp-network.c"
nm_copy_sd "src/libsystemd-network/lldp-network.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-event/sd-event.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
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-ndisc.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"
2017-09-21 15:08:50 +02:00
Lucas Rangit Magasweran
843ea77e93 examples: linker requires that library dependencies follow use
On modern distributions, ld runs with the '--as-needed' option
enabled by default, meaning library dependencies must come after
files that require them. Also, this allows indirect linking so the
build commands can be simplified.

The alternative is to add the '-Wl,--no-as-needed' gcc option or
use the top-level Makefile.

Tested on:
 * Ubuntu 16.04.3 with gcc Ubuntu 5.4.1-8ubuntu1
 * Fedora 24 with gcc Red Hat 6.1.1-3

Signed-off-by: Lucas Magasweran <lucas.magasweran@ieee.org>

https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00022.html
https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00023.html
https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00025.html
2017-09-21 13:14:56 +02:00
Thomas Haller
8022ed3ab2 core: avoid maybe-uninitialized compiler warning with nmp_cache_iter_for_each()
CC       src/devices/src_libNetworkManager_la-nm-device.lo
  In file included from src/devices/nm-device.c:45:0:
  src/devices/nm-device.c: In function ‘_v4_has_shadowed_routes_detect’:
  ./src/platform/nmp-object.h:400:54: error: ‘o’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip4_route : NULL; \
                                                        ^
  src/devices/nm-device.c:2774:19: note: ‘o’ was declared here
    const NMPObject *o;
                     ^
2017-09-21 13:14:56 +02:00
Thomas Haller
85e3f956ad contrib/rpm: update spec file with upstream source URL
This isn't useful for contrib/fedora/rpm itself because here
the __SOURCE__ gets set by the build scripts.

But this spec file is copied to Fedora downstream where the
SOURCE URL is used.
2017-09-20 14:29:53 +02:00
Beniamino Galvani
7af471919a cli: wifi: connect with PSK when the AP supports WPA-PSK and WPA-EAP
'nmcli device wifi connect' only supports WEP and WPA-PSK at the
moment, but not WPA-EAP. If the AP supports both WPA-PSK and WPA-EAP,
nmcli doesn't add the PSK to the connection, causing a connection
failure. Fix this.

https://bugzilla.redhat.com/show_bug.cgi?id=1492064
2017-09-20 09:23:54 +02:00
Beniamino Galvani
05618aaaf3 core: merge branch 'bg/manager-parent-warnings-rh1490157'
https://bugzilla.redhat.com/show_bug.cgi?id=1490157
2017-09-20 08:07:05 +02:00
Beniamino Galvani
b53f8de08b vlan: improve error message on missing parent ifindex
The message should only tell what went wrong.
2017-09-20 08:01:02 +02:00
Beniamino Galvani
41b0e8c5a5 manager: downgrade error message for missing dependencies
At startup the manager tries to create virtual devices without a
specific order and spits warnings when a device can't be realized
because the parent device is not yet created. These failures are not
something the user should worry about because the creation will be
retried when the parent appears.

A better approach is to return an error code from the device's
create_and_realize() telling that it failed because the parent doesn't
exist. In this way, the manager knows that the device isn't ready and
can avoid printing warning messages.
2017-09-20 08:01:02 +02:00
Beniamino Galvani
74845f80ec manager: try other connections only after the device is realized
After a device is created in system_create_virtual_device(), the
manager tries to activate connections that depend on the device
even if the device isn't realized, as in the following log:

 # team0 gets created
  <info>  manager: (team0): new Team device (/org/freedesktop/NetworkManager/Devices/7)

 # team0.23 gets created
  <debug> device[0x28079b0] (team0.23): constructed (NMDeviceVlan)
  <debug> manager: (team0-vlan23) create virtual device team0.23
  <debug> device[0x28079b0] (team0.23): unmanaged: flags set to [platform-init,!sleeping=0x10/0x11/unmanaged/unrealized], set-managed [sleeping
  <info>  manager: (team0.23): new VLAN device (/org/freedesktop/NetworkManager/Devices/8)

 # the manager tries to realize team0.23
  <debug> device[0x28079b0] (team0.23): create (is nm-owned)
  <warn>  manager: (team0-vlan23) couldn't create the device: cannot retrieve ifindex of interface team0 (Team): skip VLAN creation for now
  <debug> manager: (team0.23): removing device (allow_unmanage 1, managed 0)
  <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=0, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=0, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): disposing
  <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=1, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=1, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): finalize(): NMDeviceVlan

 # the manager realizes team0
  <debug> device[0x2800870] (team0): create (is nm-owned)
  <debug> platform: link: add link 'team0' of type 'team' (196610)

Change the order of operations and try the child connection only after
the parent has been realized.
2017-09-20 07:54:13 +02:00
Thomas Haller
03e1cc96a5 core: fix handling IPv6 device-route and use correct route metric
Before commit 6698bf58bb, we would rely on
kernel to add the device-route for manual IPv6 routes. We broke that and now
kernel would still add the device-route, however nm_platform_ip_route_sync()
would delete it immediately after.
That is because previously nm_platform_ip_route_sync() would ignore routes
with rtm_protocol RTPRO_KERNEL. Now, it will sync and delete those too.

Fix that by adding the device-route like we do it for IPv4. This also
fixes an actual issue where the automatically added route always had
route-metric 256. Instead, we now use the metric from ipv6.route-metric
setting.

Fixes: 6698bf58bb
2017-09-19 11:49:29 +02:00
Thomas Haller
39d30a170d man: fix docu of AUTOCONNECT_SLAVES variable in nm-settings-ifcfg-rh
Fixes: 6caafab258

https://bugzilla.redhat.com/show_bug.cgi?id=1492912
2017-09-19 08:35:16 +02:00
Thomas Haller
63104b7213 ifcfg-rh: merge branch 'th/ifcfg-route-parse'
https://github.com/NetworkManager/NetworkManager/pull/28
2017-09-18 20:15:07 +02:00
Thomas Haller
6d675a943b ifcfg-rh: refactor parsing of route options to be strict
The previous parsing was done using regex. One could implement a
complex regex to parse the setting. However, as it was implemented,
the regex would just pick out parts of the line that it expects,
and ignore unknown parts.

Let's be strict about what we parse. The only strong requirement
is that NM can parse everything that was written by NM itself.
Eventually, we could extend the parser to accept everything that
initscripts accept.

Initscripts split the line at $IFS and do filename globbing on the
arguments. That is ugly, because globbing is of coures wrong (we don't
do that). But also, the splitting at $IFS cannot be escaped, hence for
initscripts it is impossible to use '<space><tab><newline>'. We do that
too, as it makes it easy to parse. Later we may want to extend this to
allow a form of escaping/quoting.

Yes, we may now ignore routes that are not defined as we expect them.
2017-09-18 20:14:09 +02:00
Thomas Haller
62f2c4cf20 ifcfg-rh: write lock route attribute with zero value
Only specifying "lock" without a corresponding attribute shall have
the meaning of "$NAME lock 0".
2017-09-18 20:14:09 +02:00
Thomas Haller
e54fad0886 ifcfg-rh: refactor code to avoid unnecessary copies
svGetValueStr() is preferred over svGetValueStr_cp() because it may safe
an additional string copy (if the value needs no unescaping/unquoting).

Also, use nm_utils_strsplit_set() because it saves to copy each word.

There are some changes here. For example, read_8021x_list_value()
previously would not strip empty words. When switching from
g_strsplit_set() to nm_utils_strsplit_set(), empty words are implicitly
skipped.
2017-09-18 20:14:09 +02:00
Thomas Haller
b1029c6198 ifcfg-rh/trivial: rename function that are only for testing
We have similar functions, like _nmtst_ip4_config_del_route(). Rename testing
functions to have "_nmtst_" prefix for consistency.
2017-09-18 20:14:09 +02:00
Thomas Haller
daa4604c12 shared: add nm_utils_strsplit_set() helper
A replacement for g_strsplit_set(). While g_strsplit_set()
does (n+1) malloc and n slice allocations, this needs
roughtly (O(log(n))) mallocs.

Another difference from g_strsplit_set() is that this function
treats multiple delimiters as one (and thus never returns empty
words). While I can see that sometimes you may want to keep empty
words (like parsing a CSV file and preserve empty cells), we usually
use this function for splitting user input. In such case, we want
to treat multiple delimiters as one.
2017-09-18 20:14:09 +02:00
Thomas Haller
f6a727685e shared: add nm_utils_parse_inaddr_prefix_bin() helper 2017-09-18 20:14:09 +02:00
Thomas Haller
dd0617547d shared: add NMIPAddr struct 2017-09-18 20:14:09 +02:00
Thomas Haller
569b443233 shared: add nm-glib.h compat implementation for g_variant_new_printf() 2017-09-18 20:14:09 +02:00
Beniamino Galvani
3be7910520 bluetooth: drop unused function declaration 2017-09-18 18:56:50 +02:00
Beniamino Galvani
87e17d96df bluetooth: generate connections only for paired devices
It makes little sense to have a connection while the device is not
paired.

https://bugzilla.gnome.org/show_bug.cgi?id=787440
2017-09-18 18:50:08 +02:00
Francesco Giudici
dcaed616f7 dhcp: merge branch 'fg/persistent_dhcp_rh1350830'
https://bugzilla.redhat.com/show_bug.cgi?id=1350830
2017-09-18 18:45:48 +02:00
Francesco Giudici
e04c9af5fd nmcli: allow to set dhcp-timeout as "infinity"
DHCP timeout may now be explicitly disabled by setting the
ipv[4,6].dhcp-timeout options to "infinity".
This will set the DHCP timeout value to MAXINT32.
2017-09-18 18:44:43 +02:00
Francesco Giudici
a245554984 dhcp: consider a timeout equal to MAXINT32 as infinity
This will avoid to spawn internally a timer for the lease to complete.
2017-09-18 18:44:43 +02:00
Beniamino Galvani
239c59a627 src/devices: use macros for property and signal names 2017-09-18 15:40:31 +02:00
Thomas Haller
289f0f703f core: fix tracking default-route during device's merge and apply
If we don't commit the IP config, we must merge the currently tracked
default route. Otherwise, on every non-commit call of
ip4_config_merge_and_apply(), the default-route gets lost.

Fixes: 77ec302714
2017-09-18 09:58:58 +02:00
Thomas Haller
2cc1813340 core: workaround configuring IPv6 routes with "src" (RTA_PREFSRC)
Kernel does not allow to add IPv6 routes with "src", as long as the
corresponding address is still tentative (related bug rh#1457196).

The workaround for this is cumbersome. First, when we fail to add such a
route with "pref_src", we guess that it happend due to this issue. In
that case, nm_ip6_config_commit() returns the list of routes that could
not be added for the moment (but hopefully can be added later).

We track this list in NMDevice, and keep trying to merge the routes
back into ip6_config. In order to not try indefinitely, keep track of a
timestamp when we tried to add this route for the first time.

Another uglyness is that pending tentative routes don't explicitly block
activation. In practice they may do, because for these routes we also have
an IPv6 address that is still doing DAD, so the IP configuration is
still pending due to that.

https://bugzilla.redhat.com/show_bug.cgi?id=1452684
2017-09-15 17:28:48 +02:00