Commit graph

19667 commits

Author SHA1 Message Date
Lubomir Rintel
280d095fdf libnm/utils: ignore stuff in parentheses for vendor/product fixups
It's always useless.
2018-02-23 19:47:19 +01:00
Lubomir Rintel
e974261e89 libnm/utils: add more phrases to vendor fixup list
Along with known correctly fixed up vendor names.
2018-02-23 19:47:19 +01:00
Lubomir Rintel
8e32d8fc23 libnm/utils: split out vendor fixup
The hwdb generally contains the strings of rather poor quality,
especially when it comes to sensibly presenting them to the user and
they need various cleanups.

While the following patches add fixups, this one splits out vendor
fixups, because it turns out that a different set of fixups is needed
than for products.
2018-02-23 19:47:19 +01:00
Beniamino Galvani
823839e933 systemd: merge branch systemd into master 2018-02-23 14:13:43 +01:00
Beniamino Galvani
f5b8b37eaf libsystemd-network: fix endianness in ARP BPF filter
systemd commit f11cba7479fe ("libsystemd-network: fix unaligned loads
(issue #7654)") changed the way in which the MAC address is read to
use native endiannes:

 htobe32(*((uint32_t *)x)  ->  unaligned_read_ne32(x)

This is wrong because loads done with BPF_LD + BPF_ABS are big-endian, as it
can be seen for the ethertype and arp-operation loads above in the
filter.  Also, the same commit changed:

 htobe32(*((unsigned int *)x) -> unaligned_read_be32(x)

in _bind_raw_socket(), which is the correct form.

The commit broke IPv4LL in presence of loops, as the sender now considers its
own packets as conflicting.

systemd commit: 6afe9046d570fd86dbc04526b5685c64d7958086
2018-02-23 14:11:27 +01:00
Beniamino Galvani
adced1a22b systemd: update code from upstream (2018-02-23)
This is a direct dump from systemd git on 2018-02-23, git commit
6084c4efa8dcc99659f62c7abc70f69a70220eb2

======

SYSTEMD_DIR=../systemd
COMMIT=6084c4efa8dcc99659f62c7abc70f69a70220eb2

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

git ls-files :/src/systemd/src/ \
             :/shared/nm-utils/siphash24.c \
             :/shared/nm-utils/siphash24.h \
             :/shared/nm-utils/unaligned.h | \
  xargs -d '\n' rm -f

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

nm_copy_sd_shared() {
    mkdir -p "./shared/nm-utils/"
    cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${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_shared "src/basic/siphash24.c"
nm_copy_sd_shared "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_shared "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"
2018-02-23 14:10:24 +01:00
Thomas Haller
0b25e30238 wwan: merge branch 'th/modem-ip-iface'
https://github.com/NetworkManager/NetworkManager/pull/55
2018-02-22 11:45:32 +01:00
Thomas Haller
de16ef91cf wwan: drop nm_modem_get_data_port() function
It was only used by bluetooth's component_added()
check. It should compare rfcomm_iface only against
the control-port, not the data-port.
2018-02-21 20:28:46 +01:00
Thomas Haller
78ca2a70c7 device: don't set invalid ip-iface
Now that every call to nm_device_set_ip_iface() and nm_device_set_ip_ifindex()
is checked, and setting an interface that does not exist causes the device
state to fail, we no longer need to allow setting an ip-iface if we are
unable to retrieve the ip-ifindex.
2018-02-21 20:28:46 +01:00
Thomas Haller
c7b3586b9d wwan: rework setting modem's data-port
Depending on the bearer's configuration method, the data-port is
either a networking interface, or an tty for ppp.

Let's treat them strictily separate.

Also, rework how NM_MODEM_DATA_PORT was used in both contexts.
Instead, use the that we actually care about.

Also, when nm_device_set_ip_ifindex() fails, fail activation
right away.

Also, we early try to resolve the network interface's name to
an ifindex. If that fails, the device is already gone and we
fail early.
2018-02-21 20:28:46 +01:00
Thomas Haller
2ea8e1029f bluetooth: fail activation when setting unknown ip-iface 2018-02-21 20:28:46 +01:00
Thomas Haller
a169d689ba wwan: avoid dangling pointer for error variable in connect_ready() 2018-02-21 20:28:46 +01:00
Thomas Haller
0ef23b139d device: don't set NMDeviceModem's ip-iface right after constuction
nm_device_modem_new() is only called with a newly created
NMModemBroadband or NMModemOfono instance.
See the callers
  - NMModemManager:handle_new_modem()
    - NMWwanFactory:modem_added_cb()
      - NMDeviceModem:nm_device_modem_new()

Hence, at that point, the modem cannot yet have a data-port
or ip-iface set, because that is only obtained later.
2018-02-21 20:28:46 +01:00
Thomas Haller
bfe38c1bf3 wwan: make NM_MODEM_DATA_PORT not a construct property
The property was never set at construct time. Don't make
it a construct property.
2018-02-21 20:28:46 +01:00
Thomas Haller
8209e42106 wwan: notify change of modem:data-port when clearing ip-iface
data-port returns ip-iface, if set. Clearing it,
most likely causes the property to change. Emit
a notification.
2018-02-21 20:28:46 +01:00
Thomas Haller
4fbea56b54 wwan: add modem:ip-ifindex property
Will be used later to replace ip-iface.
2018-02-21 20:28:46 +01:00
Thomas Haller
ab4578302d device: refactor nm_device_set_ip_ifindex() and set_ip_iface()
- don't even bother to look into the platform cache, but use
  if_indextoname() / if_nametoindex(). In most cases, we obtained
  the ifindex/ifname not from the platform cache in the first
  place. Hence, there is a race, where the interface might not
  exist.
  However, try to process events of the platform cache, hoping
  that the cache contains an interface for the given ifindex/ifname.

- let set_ip_ifindex() and set_ip_iface() both return a boolean
  value to indicate whether a ip-interface is set or not. That is,
  whether we have a positive ip_ifindex. That seems more interesting
  information, then to return whether anything changed.

- as before, set_ip_ifindex() can only clear an ifindex/ifname,
  or error out without doing anything. That is different from
  set_ip_iface(), which will also set an ifname if no ifindex
  can be resolved. That is curreently ugly, because then ip-ifindex
  and ip-iface don't agree. That shall be improved in the future
  by:
  - trying to set an interface that cannot be resolved shall
    lead to a disconnect in any case.
  - we shall make less use of the ip-iface and rely more on the
    ifindex.
2018-02-21 20:28:46 +01:00
Thomas Haller
79980536b9 platform: add nm_platform_process_events_ensure_link() function 2018-02-21 20:28:46 +01:00
Thomas Haller
352d063009 wwan/trivial: rename internal variable ppp_iface to ip_iface
This is really the name of the networking device. Whether it
is created by ppp is not that important here. Rename.
2018-02-21 20:28:46 +01:00
Thomas Haller
41e80a02b2 wwan: handle missing data_port in ppp_stage3_ip_config_start() of NMModem
It's not at all clear, that the data_port is set at this point.
Guard against it, and avoid the assertion later.
2018-02-21 20:28:46 +01:00
Thomas Haller
bc3aebbab8 wwan: disconnect signals from ppp-manager before clearing instance 2018-02-21 20:28:46 +01:00
Thomas Haller
19f24574dc wwan: cleanup handling ppp_iface in NMModem 2018-02-21 20:28:46 +01:00
Thomas Haller
66585dc1af wwan: free ppp_iface in NMModem's finalize() 2018-02-21 20:28:46 +01:00
Beniamino Galvani
878a3a4125 ovs: don't consume error in method callback
The error should be freed by callback functions, but only
_monitor_bridges_cb() actually does it. Simplify this by letting the
caller own the error.

Fixes: 830a5a14cb
2018-02-21 14:04:21 +01:00
Thomas Haller
3d987fe2db platform/netlink: merge branch 'th/netlink' (#67)
https://github.com/NetworkManager/NetworkManager/pull/67
2018-02-21 12:12:36 +01:00
Thomas Haller
ad21d54219 iface-helper: fix non-reentrant call to platform for failed IPv6 DAD
Platform invokes change events while reading netlink events. However,
platform code is not re-entrant and calling into platform again is not
allowed (aside operations that do not process the netlink socket, like
lookup of the platform cache).

That basically means, we have to always process events in an idle
handler. That is not a too strong limitation, because we anyway don't
know the call context in which the platform event is emitted and we
should avoid unguarded recursive calls into platform.

Otherwise, we get hit an assertion/crash in nm-iface-helper:

     1  raise()
     2  abort()
     3  g_assertion_message()
     4  g_assertion_message_expr()
     5  do_delete_object()
     6  ip6_address_delete()
 >>> 7  nm_platform_ip6_address_delete()
     8  nm_platform_ip6_address_sync()
     9  nm_ip6_config_commit()
     10 ndisc_config_changed()
     11 ffi_call_unix64()
     12 ffi_call()
     13 g_cclosure_marshal_generic_va()
     14 _g_closure_invoke_va()
     15 g_signal_emit_valist()
     16 g_signal_emit()
 >>> 17 nm_ndisc_dad_failed()
     18 ffi_call_unix64()
     19 ffi_call()
     20 g_cclosure_marshal_generic()
     21 g_closure_invoke()
     22 signal_emit_unlocked_R()
     23 g_signal_emit_valist()
     24 g_signal_emit()
 >>> 25 nm_platform_cache_update_emit_signal()
     26 event_handler_recvmsgs()
     27 event_handler_read_netlink()
     28 delayed_action_handle_one()
     29 delayed_action_handle_all()
     30 do_delete_object()
     31 ip6_address_delete()
     32 nm_platform_ip6_address_delete()
     33 nm_platform_ip6_address_sync()
 >>> 34 nm_ip6_config_commit()
     35 ndisc_config_changed()
     36 ffi_call_unix64()
     37 ffi_call()
     38 g_cclosure_marshal_generic_va()
     39 _g_closure_invoke_va()
     40 g_signal_emit_valist()
     41 g_signal_emit()
     42 check_timestamps()
     43 receive_ra()
     44 ndp_call_eventfd_handler()
     45 ndp_callall_eventfd_handler()
     46 event_ready()
     47 g_main_context_dispatch()
     48 g_main_context_iterate.isra.22()
     49 g_main_loop_run()
 >>> 50 main()

NMPlatform already has a check to assert against recursive calls
in delayed_action_handle_all():

    g_return_val_if_fail (priv->delayed_action.is_handling == 0, FALSE);

    priv->delayed_action.is_handling++;
    ...
    priv->delayed_action.is_handling--;

Fixes: f85728ecff

https://bugzilla.redhat.com/show_bug.cgi?id=1546656
2018-02-21 12:08:46 +01:00
Thomas Haller
d074ffc836 platform: refactor completing netlink responses in event_handler_read_netlink()
- refactor the loop in event_handler_read_netlink() to mark pending
  requests as answered by adding a new helper function
  delayed_action_wait_for_nl_response_complete_check()

- delayed_action_wait_for_nl_response_complete_all() can be implemented
  in terms of delayed_action_wait_for_nl_response_complete_check()

- if nm_platform_netns_push() fails, also complete all pending requests
  with a new error code WAIT_FOR_NL_RESPONSE_RESULT_FAILED_SETNS.
2018-02-21 12:08:46 +01:00
Thomas Haller
b3633a282d platform: cleanup error handling in event_handler_recvmsgs()
Now that we cleaned up nl_recv(), we have full control over which error
variables are returned when. We no longer need to check "errno"
directly, and we no longer need the NLE_USER_* workaround.
2018-02-21 12:08:46 +01:00
Thomas Haller
ba25221236 netlink: various cleanups and use cleanup attribute
- adjust some coding style (space after function name).
- ensure to use g_free(), as we no longer use malloc
  but the g_malloc aliases. Nowadays, glib's malloc
  is identical to malloc from the standard library and
  so this is no issue in practice. Still it's bad
  style to mix g_malloc() with free().
- use cleanup attribute for memory handling.
2018-02-21 12:08:46 +01:00
Thomas Haller
5376aa2db7 netlink: use slice allocator for "struct nl_msg" 2018-02-21 12:08:46 +01:00
Thomas Haller
ff7f8b3a79 netlink: use glib allocator functions for nlmsg_alloc*()
Glib is not out of memory safe, meaning it always aborts the program
when an allocation fails. It is not possible to meaningfully handle
out of memory when using glib.

Replace all allocation functions for netlink message with their glib
counter part and remove the NULL checks.
2018-02-21 12:08:46 +01:00
Thomas Haller
a7bda2ed12 netlink: simplify netlink callback handling
With libnl3, each socket has it's own callback structure.
One would often take that callback structure, clone it, modify it
and invoke a receive operation with it.

We don't need this complexity. We got rid of all default handlers,
hence, by default all callbacks are unset.

The only callbacks that are set, are those that we specify immediately
before invoking the receive operation. Just pass the callback structure
at that point.

Also, no more ref-counting, and cloning of the callback structure. It is
so simple, just stack allocate one if you need it.
2018-02-21 12:08:46 +01:00
Thomas Haller
9071e8cc05 wifi: drop unused netlink callback instance 2018-02-21 12:08:46 +01:00
Thomas Haller
4da2a19a87 netlink: drop redundant nl_recvmsgs_report() function
The only difference between nl_recvmsgs_report() and nl_recvmsgs() is
the return value on success. libnl3 couldn't change that for backward
compatibility reasons. We can merge them.
2018-02-21 12:08:46 +01:00
Thomas Haller
03420e6a5c netlink: drop unused callback types 2018-02-21 12:08:46 +01:00
Thomas Haller
356332a840 netlink: remove unused callback hooks 2018-02-21 12:08:46 +01:00
Thomas Haller
b6f31a2d22 netlink: refactor error numbers from netlink
Originally, these were error numbers from libnl3. These error numbers
are separate from errno, which is unfortunate, because sometimes we
care about the native errno returned from kernel.

Now, refactor them so that the error numbers are in the shared realm
of errno, but failures from kernel or underlying API are still returned
via their native errno.

- NLE_INVAL doesn't exist anymore. Passing invalid arguments to a function
  is commonly a bug. g_return_*(NLE_BUG) is the right answer to that.

- NLE_NOMEM and NLE_AGAIN is replaced by their errno counterparts.

- drop several error numbers. If nobody cares about these numbers,
  there is no reason to have a specific error number for them.
  NLE_UNSPEC is sufficient.
2018-02-21 12:08:46 +01:00
Thomas Haller
f3a0f60e9a netlink: drop workaround for libnl3 bug in nl_recv() 2018-02-21 12:08:46 +01:00
Thomas Haller
3fab322a20 netlink: drop libnl3 dependency
From libnl3, we only used the helper function to parse/generate netlink
messages and the socket functions to send/receive messages. We don't
need an external dependency to do that, it is simple enough.

Drop the libnl3 dependency, and replace all missing code by directly
copying it from libnl3 sources. At this point, I mostly tried to
import the required bits to make it working with few modifications.

Note that this increases the binary size of NetworkManager by 4736 bytes
for contrib/rpm build on x86_64. In the future, we can simplify the code
further.

A few modifications from libnl3 are:

- netlink errors NLE_* are now in the domain or regular errno.
  The distinction of having to bother with two kinds of error
  number domains was annoying.

- parts of the callback handling is copied partially and unused parts
  are dropped. Especially, the verbose/debug handlers are not used.
  In following commits, the callback handling will be significantly
  simplified.

- the complex handling of seleting ports was simplified. We now always
  let kernel choose the right port automatically.
2018-02-21 12:08:46 +01:00
Thomas Haller
ffbad3d0e8 netlink: move nl_nlmsghdr_to_str() to netlink header 2018-02-21 12:08:46 +01:00
Beniamino Galvani
cf79615169 ovs: add error code for callbacks to indicate NM is quitting
When NM quits it destroys all singletons including NMOvsdb, which
invokes callbacks for every pending method call. In the shutdown,
extra care must be taken to not access objects that are already in a
inconsistent state; for example here, the callback changes the device
state, and this causes an access to data that has already been
cleared:

 #0  _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:554
 #1  g_logv (log_domain=0x5635653b6817 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffb4b2c1e0) at gmessages.c:1362
 #2  g_log (log_domain=log_domain@entry=0x5635653b6817 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fbb3f58fa4a "%s: assertion '%s' failed") at gmessages.c:1403
 #3  g_return_if_fail_warning (log_domain=log_domain@entry=0x5635653b6817 "NetworkManager", pretty_function=pretty_function@entry=0x5635653b6b00 <__func__.34463> "nm_device_factory_manager_find_factory_for_connection", expression=expression@entry=0x5635653b6719 "factories_by_setting") at gmessages.c:2702
 #4  nm_device_factory_manager_find_factory_for_connection (connection=connection@entry=0x56356627e0e0) at src/devices/nm-device-factory.c:243
 #5  nm_manager_get_connection_iface (self=0x563566241080 [NMManager], connection=connection@entry=0x56356627e0e0, out_parent=out_parent@entry=0x0, error=error@entry=0x0) at src/nm-manager.c:1458
 #6  check_connection_compatible (self=<optimized out>, connection=0x56356627e0e0) at src/devices/nm-device.c:4679
 #7  check_connection_compatible (device=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0) at src/devices/ovs/nm-device-ovs-interface.c:95
 #8  _nm_device_check_connection_available (self=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0, flags=NM_DEVICE_CHECK_CON_AVAILABLE_NONE, specific_object=0x0) at src/devices/nm-device.c:12102
 #9  nm_device_check_connection_available (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], connection=0x56356627e0e0, flags=flags@entry=NM_DEVICE_CHECK_CON_AVAILABLE_NONE, specific_object=specific_object@entry=0x0) at src/devices/nm-device.c:12131
 #10 nm_device_recheck_available_connections (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface]) at src/devices/nm-device.c:12238
 #11 _set_state_full (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=NM_DEVICE_STATE_REASON_OVSDB_FAILED, quitting=quitting@entry=0) at src/devices/nm-device.c:13065
 #12 nm_device_state_changed (self=self@entry=0x56356647b1b0 [NMDeviceOvsInterface], state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=NM_DEVICE_STATE_REASON_OVSDB_FAILED) at src/devices/nm-device.c:13328
 #13 del_iface_cb (error=<optimized out>, user_data=0x56356647b1b0) at src/devices/ovs/nm-device-ovs-port.c:160
 #14 _transact_cb (self=self@entry=0x5635662b9ba0 [NMOvsdb], result=result@entry=0x0, error=0x563566259a10, user_data=user_data@entry=0x5635662ff320) at src/devices/ovs/nm-ovsdb.c:1449
 #15 ovsdb_disconnect (self=self@entry=0x5635662b9ba0 [NMOvsdb]) at src/devices/ovs/nm-ovsdb.c:1331
 #16 dispose (object=0x5635662b9ba0 [NMOvsdb]) at src/devices/ovs/nm-ovsdb.c:1558
 #17 g_object_unref (_object=0x5635662b9ba0) at gobject.c:3293
 #18 _nm_singleton_instance_destroy () at src/nm-core-utils.c:138
 #19 _dl_fini () at dl-fini.c:253
 #20 __run_exit_handlers (status=status@entry=0, listp=0x7fbb3e1ad6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:77
 #21 __GI_exit (status=status@entry=0) at exit.c:99
 #22 main (argc=1, argv=0x7fffb4b2cc38) at src/main.c:468

Add a new error code to indicate to callbacks that we are quitting and
no further action must be taken. This is preferable to having
additional references because it allows us to free the resources owned
by callbacks immediately, while references can easily create loops.

https://bugzilla.redhat.com/show_bug.cgi?id=1543871
2018-02-21 11:44:25 +01:00
Francesco Giudici
b9e22ece2d dhcp: merge branch 'fg/dhcp_lease-rh1503587'
https://bugzilla.redhat.com/show_bug.cgi?id=1503587
2018-02-20 16:51:50 +01:00
Francesco Giudici
1289450146 device: enable DHCPv6 retries on lease renewal failure
https://bugzilla.gnome.org/show_bug.cgi?id=792745
2018-02-20 16:51:06 +01:00
Francesco Giudici
1a20ff86d5 device: never stop trying renewing the lease
Always reschedule a lease renewal attempt: just clear the scheduled
renewal if the connection is really deactivated.
2018-02-20 16:51:06 +01:00
Francesco Giudici
da0fee4d9f device: always consider both ip families when deciding to fail
Example: when dhcpv4 lease renewal fails, if ipv4.may-fail was "yes",
check also if we have a successful ipv6 conf: if not fail.
Previously we just ignored the other ip family status.
2018-02-20 16:51:06 +01:00
Lubomir Rintel
66ae0cc306 core/connection: don't emit Updated on Connection.GetSecrets
The secrets are transient -- when they are loaded into the connections and
subsequently cleared the connection itself doesn't change. The Update
signal is to be emmited only on explicit Update()/Update2() or
ClearSecrets() which is already the case.

Apart from Update being wrong, it has the ill effect of causing libnm to
drop secrets from the cached connection.
2018-02-20 12:16:21 +01:00
Adrián Laviós Gomis
7621fe4e1a man: update NetworkManager.conf man page to account for stub-resolv.conf (#68)
NetworkManager checks if /etc/resolv.conf is a symlink to
/run/systemd/resolve/stub-resolv.conf since commit
e09503dcc4. This should be
documented in the corresponding section of NetworkManager.conf(5).

https://github.com/NetworkManager/NetworkManager/pull/68
2018-02-18 14:22:24 +01:00
Lubomir Rintel
9daa9346e2 build: disable -Wgnu-variable-sized-type-not-at-end for systemd code
clang 5.0.1 complains:

  src/systemd/src/libsystemd-network/dhcp6-option.c:40:28: error:
      field 'option' with variable sized type 'struct DHCP6Option' not at
      the end of a struct or class is a GNU extension
      [-Werror,-Wgnu-variable-sized-type-not-at-end]
        struct DHCP6Option option;
                           ^

systemd disables this warning too.
2018-02-16 16:09:50 +01:00
Lubomir Rintel
0999ebdf6d m4: parametrize flags variable
Make it possible to add compiler options to a different variable than
CFLAGS. This is useful to conditionally disable a compiler warning for a
subpart of a tree.
2018-02-16 16:06:59 +01:00
Beniamino Galvani
627107d640 cli: accept string values for secret flags
I find very annoying to have to remember the numeric value of secret
flags or have to look them up in the manual every time. Accept the
textual version as well and add support for auto-completion.

 $ nmcli con modify c 802-11-wireless-security.psk-flags not-required

 $ nmcli con modify c 802-11-wireless-security.psk-flags <TAB>
   agent-owned   none          not-required  not-saved
2018-02-16 14:25:25 +01:00