Commit Graph

21088 Commits

Author SHA1 Message Date
Lubomir Rintel
9481bda939 clients: don't default Bluetooth to the PANU profile
No reason to, the other types are no less likely. Quite the contrary, if
the user specifies a GSM APN we're sure to use a DUN profile.

  $ ./clients/cli/nmcli c add type bluetooth ifname '*' bluetooth.bdaddr 1C:E2:CC:56:6C:45 apn internet
  $ nmcli c show bluetooth-1 |grep bluetooth.type
  bluetooth.type:                         panu
                                          ^^^^ not cool
2017-08-23 16:19:32 +02:00
Lubomir Rintel
9b28c9ba91 core: infer the bluetooth type from the presence of the supplemental settings
When the user sets a GSM or CDMA setting along with a Bluetooth setting
we know we're dealing with a DUN profile. No need to ask.

[thaller@redhat.com: verify() and normalize() must strongly agree whether a
connection is normalizable, and now to do it. That is, after verify()
determines the connection is normalizable, normalize() must fix it as
anticipated.

The reason is, we only want to modify the connection, if we are able
to create a valid result. Hence, after normalize() it *must* verify().

Try to simplify that by moving the logic of fixing the bt-type to a
common place _nm_connection_detect_bluetooth_type().]

Co-Authored-By: Thomas Haller <thaller@redhat.com>
2017-08-23 16:18:44 +02:00
Lubomir Rintel
0718b25508 clients: allow GSM and CDMA for Bluetooth connections
Unbreaks Bluetooth DUN. Probably broken with the nm-meta-setting-desc
refactor, hence the Fixes tag. I didn't actually check.

  $ nmcli c add type bluetooth ifname '*' bluetooth.bdaddr 1C:E2:CC:56:6C:45 connection.id bt bt-type dun-gsm
  Error: 'apn' argument is required.
  $ nmcli c add type bluetooth ifname '*' bluetooth.bdaddr 1C:E2:CC:56:6C:45 connection.id bt bt-type dun-gsm apn internet
  Error: invalid <setting>.<property> 'apn'.
  $

This is where it starts to get sad ^

  $ nmcli c add type bluetooth ifname '*' bluetooth.bdaddr 1C:E2:CC:56:6C:45 connection.id bt bt-type dun-gsm gsm.apn internet
  Error: invalid or not allowed setting 'gsm': 'gsm' not among [connection, bluetooth, bridge, ipv4, ipv6, proxy].
  $

This is where it gets obvious what went wrong ^

Fixes: b5c8622ad3
2017-08-23 16:08:42 +02:00
Francesco Giudici
5df2c96be0 device: skip creating VLAN devices if parent device is not ready yet
do a check on parent ifindex before calling "nm_device_supports_vlans"
otherwise if the parent device is a software device and its ifindex
member has not been updated yet we will trigger the g_return_if_fail
statement in "nmp_cache_lookup_entry_link".

This has been osserved in NetworkManager CI test suite, on NetworkManager
boot, during the creation of a vlan on top of a bond interface.

CI test: vlan_update_mac_from_bond

    [...]
    <info>  [1503323670.0229] manager: (bond0): new Bond device (/org/freedesktop/NetworkManager/Devices/23)
    <debug> [1503323670.0231] device[0x555555c3e320] (vlan10): constructed (NMDeviceVlan)
    <debug> [1503323670.0231] manager: (vlan-vlan10) create virtual device vlan10
    <debug> [1503323670.0231] device[0x555555c3e320] (vlan10): unmanaged: flags set to [platform-init,!sleeping=0x10/0x11/unmanaged/unrealized], set-managed [sleeping=0x1])
    <trace> [1503323670.0235] exported-object[0x555555c3e320]: export: "/org/freedesktop/NetworkManager/Devices/24"
    <trace> [1503323670.0235] properties-changed[0x555555c3e320]: ignoring notification for prop g-object-path on type NMDeviceVlan
    <trace> [1503323670.0236] properties-changed[0x555555c3e320]: ignoring notification for prop path on type NMDeviceVlan
    <info>  [1503323670.0237] manager: (vlan10): new VLAN device (/org/freedesktop/NetworkManager/Devices/24)
    <debug> [1503323670.0239] device[0x555555c3e320] (vlan10): create (is nm-owned)

    Program received signal SIGTRAP, Trace/breakpoint trap.
    g_logv (log_domain=0x5555557c39a9 "NetworkManager", log_level=
        G_LOG_LEVEL_CRITICAL, format=<optimized out>,
        args=args@entry=0x7fffffffdef0) at gmessages.c:1086
    1086		  g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));

    (gdb) bt

    #0  0x00007ffff5ce3643 in g_logv (log_domain=0x5555557c39a9 "NetworkManager", log_level=
        G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffdef0) at gmessages.c:1086
    #1  0x00007ffff5ce37bf in g_log (log_domain=log_domain@entry=0x5555557c39a9 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff5d51190 "%s: assertion '%s' failed") at gmessages.c:1119
    #2  0x00007ffff5ce37f9 in g_return_if_fail_warning (log_domain=log_domain@entry=0x5555557c39a9 "NetworkManager", pretty_function=pretty_function@entry=0x5555557b2a20 <__func__.32407> "nmp_cache_lookup_entry_link", expression=expression@entry=0x5555557b1037 "ifindex > 0") at gmessages.c:1128
    #3  0x000055555566688a in nmp_cache_lookup_entry_link (cache=0x555555a780f0, ifindex=<optimized out>) at src/platform/nmp-object.c:1449
    #4  0x00005555556668f9 in nmp_cache_lookup_link (cache=<optimized out>, ifindex=ifindex@entry=0) at src/platform/nmp-object.c:1464
    #5  0x00005555556515e9 in nm_platform_link_get_obj (self=self@entry=0x555555a88880 [NMLinuxPlatform], ifindex=ifindex@entry=0, visible_only=visible_only@entry=1) at src/platform/nm-platform.c:618
    #6  0x0000555555633e91 in link_supports_vlans (platform=0x555555a88880 [NMLinuxPlatform], ifindex=0) at src/platform/nm-linux-platform.c:4482
    #7  0x00005555556d6d41 in create_and_realize (device=0x555555c3e320 [NMDeviceVlan], connection=0x7fffdc007890, parent=0x555555c33560 [NMDeviceBond], out_plink=0x7fffffffe1f8, error=0x7fffffffe358) at src/devices/nm-device-vlan.c:239
    #8  0x00005555556b934c in nm_device_create_and_realize (self=self@entry=0x555555c3e320 [NMDeviceVlan], connection=connection@entry=0x7fffdc007890, parent=0x555555c33560 [NMDeviceBond], error=error@entry=0x7fffffffe358)
        at src/devices/nm-device.c:2946
    #9  0x00005555555b84c7 in connection_changed (connection=0x7fffdc007890, self=0x555555ab1070 [NMManager]) at src/nm-manager.c:1381
    #10 0x00005555555b84c7 in connection_changed (self=0x555555ab1070 [NMManager], connection=0x7fffdc007890) at src/nm-manager.c:1431
    #11 0x00005555555b9130 in retry_connections_for_parent_device (self=self@entry=0x555555ab1070 [NMManager], device=device@entry=0x555555c33560 [NMDeviceBond])
        at src/nm-manager.c:1416
    #12 0x00005555555b95c7 in add_device (self=self@entry=0x555555ab1070 [NMManager], device=device@entry=0x555555c33560 [NMDeviceBond], error=error@entry=0x7fffffffe598) at src/nm-manager.c:2238
    #13 0x00005555555b83e1 in connection_changed (connection=0x7fffdc007b30, self=0x555555ab1070 [NMManager]) at src/nm-manager.c:1352
    #14 0x00005555555b83e1 in connection_changed (self=0x555555ab1070 [NMManager], connection=0x7fffdc007b30) at src/nm-manager.c:1431
    #15 0x00005555555be25b in nm_manager_start (self=0x555555ab1070 [NMManager], error=error@entry=0x7fffffffe720) at src/nm-manager.c:5202
    #16 0x0000555555586b13 in main (argc=1, argv=0x7fffffffe888) at src/main.c:413
2017-08-22 11:54:37 +02:00
Thomas Haller
a3e84daf44 libnm/build: un-export wrong symbols for nm-manager.h
libnm/nm-manager.h is a private header file. It's symbols
should not be exported.

Fixes: 75aa3ea194
2017-08-21 12:19:27 +02:00
Thomas Haller
13f955db58 config: write connectivity=true to internal state file
The internal state file is supposed to overwrite the files from /etc.
Hence, we must also explicitly enable connectivity checking, when the
user wishes to do so. Otherwise, if /etc contains connectivity=false,
the setting cannot be overruled via D-Bus.
2017-08-21 12:18:13 +02:00
Thomas Haller
804b2c2365 config/tests: remove test artifact after test_config_connectivity_check()
Fixes: 9a58ee0705
2017-08-18 21:42:22 +02:00
Thomas Haller
17f0c19473 platform: fix updating object in nmp_cache_update_netlink_route()
_idxcache_update() may remove @entry_old or it may update @entry_old
in-place.

We must assign @out_obj_old before and not touch @entry_old after
_idxcache_update().

Fixes: cdd8c65799
2017-08-18 11:32:29 +02:00
Thomas Haller
75aa3ea194 libnm/connectivity: fix exporting new connectivity ABI in linker version script
Fixes: 0480dae749
2017-08-17 23:27:31 +02:00
Thomas Haller
2eb02543c2 connectivity: merge branch 'connectivity-enable-dbus-bgo785117'
https://bugzilla.gnome.org/show_bug.cgi?id=785117
https://github.com/NetworkManager/NetworkManager/pull/23
https://mail.gnome.org/archives/networkmanager-list/2017-July/msg00035.html
2017-08-17 23:15:43 +02:00
Thomas Haller
24a732c8e7 cli: show new enable-disable-connectivity-check permission 2017-08-17 23:09:07 +02:00
Thomas Haller
72baa8e30b libnm: add gtk-doc Since markers for new API and missing enum documentation 2017-08-17 23:08:44 +02:00
James Henstridge
0480dae749 client: expose connectivity-check-{available,enabled} properties
https://bugzilla.gnome.org/show_bug.cgi?id=785117
2017-08-17 22:31:47 +02:00
James Henstridge
4dd30b784c manager: add connectivity-check-{available,enabled} properties.
https://bugzilla.gnome.org/show_bug.cgi?id=785117
2017-08-17 22:31:47 +02:00
James Henstridge
9a58ee0705 config: add an API to disable connectivity check via internal config file.
https://bugzilla.gnome.org/show_bug.cgi?id=785117
2017-08-17 22:31:47 +02:00
Thomas Haller
c0ac4a2fdd platform: merge branch 'th/platform-route-pt2'
Fix the platform cache for routes, to be able to track routes
like they can be added to kernel. Basically, the previous notion
of the identifier for routes (ifindex,network/plen,metric) was
not what kernel does.

NMRouteManager and other code outside of platform is still oblivious
to this change. That has to be addressed in future commits.

https://github.com/NetworkManager/NetworkManager/pull/24
2017-08-12 16:19:50 +02:00
Thomas Haller
94560e4ad2 platform: cleanup nmp_lookup_init_route_visible() lookup helper
nmp_lookup_init_route_visible() was originally named this way, to only return routes
that are nmp_object_is_visible(). However, all routes are visible (as long as they are
nmp_object_is_alive()). Hence, this is a historic misnomer.

Also, passing @only_default FALSE is identical to the
nmp_lookup_init_addrroute() lookup.

So, rename the function to indicate it is a lookup for default routes
only. Also, get rid of the unsupported ifindex argument for which there
is no index.
2017-08-12 16:04:28 +02:00
Thomas Haller
3ec110b67e platform: drop workaround for deleting IPv4 routes with metric zero
Deleting an IPv4 route with metric zero will either delete the intended route,
or if no such route exists, it will delete another existing route with different
metric (but otherwise matching parameters).

I think this is a shortcoming of the kernel API. It allows omitting
the metric during delete. However, it gives not way to express to
explicitly delete an IPv4 route with metric zero, but no other.

Since we only delete routes that we obtain from the platform cache
in the first place, we don't need the workaround. Of course, there
is still a race that platform cache might be out of date at the
moment we attempt to delete the route. Or the cache might be
inconsistent, both cases leading to deletion of the wrong route.
But such cases should be very rare, and only present when the user
changes the routing table outside of NM.
2017-08-12 16:04:28 +02:00
Thomas Haller
cdd8c65799 platform: fix cache to use kernel's notion for equality of routes
Until now, NetworkManager's platform cache for routes used the quadruple
network/plen,metric,ifindex for equaliy. That is not kernel's
understanding of how routes behave. For example, with `ip route append`
you can add two IPv4 routes that only differ by their gateway. To
the previous form of platform cache, these two routes would wrongly
look identical, as the cache could not contain both routes. This also
easily leads to cache-inconsistencies.

Now that we have NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID, fix the route's
compare operator to match kernel's.

Well, not entirely. Kernel understands more properties for routes then
NetworkManager. Some of these properties may also be part of the ID according
to kernel. To NetworkManager such routes would still look identical as
they only differ in a property that is not understood. This can still
cause cache-inconsistencies. The only fix here is to add support for
all these properties in NetworkManager as well. However, it's less serious,
because with this commit we support several of the more important properties.
See also the related bug rh#1337855 for kernel.

Another difficulty is that `ip route replace` and `ip route change`
changes an existing route. The replaced route has the same
NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID, but differ in the actual
NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID:

    # ip -d -4 route show dev v
    # ip monitor route &
    # ip route add 192.168.5.0/24 dev v
    192.168.5.0/24 dev v scope link
    # ip route change 192.168.5.0/24 dev v scope 10
    192.168.5.0/24 dev v scope 10
    # ip -d -4 route show dev v
    unicast 192.168.5.0/24 proto boot scope 10

Note that we only got one RTM_NEWROUTE message, although from NMPCache's
point of view, a new route (with a particular ID) was added and another
route (with a different ID) was deleted. The cumbersome workaround is,
to keep an ordered list of the routes, and figure out which route was
replaced in response to an RTM_NEWROUTE. In absence of bugs, this should
work fine. However, as we only rely on events, we might wrongly
introduce a cache-inconsistancy as well. See the related bug rh#1337860.

Also drop nm_platform_ip4_route_get() and the like. The ID of routes
is complex, so it makes little sense to look up a route directly.
2017-08-12 16:04:28 +02:00
Thomas Haller
94c025452b platform: preserve order of objects during dump
NMPCache can preserve the order of the objects. Until now, the order
was however arbitrary. Soon we will require to preserve the order of
routes.

During a dump, force appending new objects at the end. That ensures,
correct ordering during the dump.

Note that we track objects in several distrinct indexes. Those partition the
set of all objects. Outside a dump when receiving events about new objects (e.g.
RTM_NEWROUTE), it is very unclear at which place the new object should be sorted.
It is especially unclear, as an object might move from one partition (of
an index) to another.
In general, a deterministic order will only be useful in one particular
instance: the NMP_CACHE_ID_TYPE_ROUTES_BY_DESTINATION index for routes.
In this case, we will ensure a particular order of the routes.
2017-08-12 16:02:11 +02:00
Thomas Haller
9012ae00aa shared: add nm_dedup_multi_entry_reorder() function
This allows to reorder elements in NMDedupMultiIndex.
2017-08-12 16:02:11 +02:00
Thomas Haller
3e1914e4fc platform: cleanup lookup API for objects in NMPCache 2017-08-12 16:02:11 +02:00
Thomas Haller
5331d4d63e platform: fix code comment for nmp_cache_remove_netlink() 2017-08-12 16:02:11 +02:00
Thomas Haller
82fd320900 platform: improve logging of netlink message
Also log the nlmsg_flags, they will be useful for RTM_NEWROUTE messages.
2017-08-12 16:02:11 +02:00
Thomas Haller
7c52235026 platform: simplify to-string output of IPv6 routes by dropping " src ::/0"
IPv6 routes without source are common. Simplify the output in this case.
2017-08-12 16:02:11 +02:00
Thomas Haller
80e585a65d test: redirect glib logging to stdout
Default g_log() logs to stdout for INFO level and higher, but logs to stderr
for DEBUG/TRACE. That is annoying, because especially when redirecting the streams,
the messages get mixed up. Install a log handler and just print to stdout for
the tests.
2017-08-12 16:02:11 +02:00
Thomas Haller
1fcc3c8c39 platform: add nmp_object_id_cmp() function
We already had a nmp_object_id_equal() function. Generally, an equal() function
is more useful then a cmp() function.

However, implementing a cmp() function is about the same effort then implementing
an equal() function. Also, an equal function can be trivially implemented based on
a compare function, but not the other way around.

That means, it is little extra effort to have both an equal() function
and a cmp() function. Add nmp_object_id_cmp(). If only to be
consistent with other code, which also provides both.
2017-08-12 15:58:58 +02:00
Dan Williams
d989be8235 wifi: merge branch 'dcbw/wifi-scan' 2017-08-11 12:36:41 -05:00
Dan Williams
4acc17053b devices/wifi: move scan option processing to D-Bus request scan handler
Only the D-Bus bits use it, and we wouldn't pass a GVariant array around
in internal code anyway.  Also validate the scan options earlier rather
than waiting for the supplicant to tell us they are invalid.
2017-08-11 12:35:01 -05:00
Dan Williams
e1da16f799 supplicant: don't allow scans to trigger a supplicant roaming decision
Just because the user requested a scan doesn't mean the supplicant should
use the result of that scan to jump to an AP that's slightly better than
the current one.  Let the supplicant handle when it's supposed to roam
based on it's own logic, not random scans from users or NM clients.
2017-08-11 12:35:01 -05:00
Dan Williams
fd6ddcc794 devices/wifi: delegate connected periodic scanning to the supplicant (bgo #766482)
Enable background scanning for most WiFi connections except for
shared/AP and BSSID-locked ones.  Make the non-WPA-Enterprise
interval very, very long to effectively disable periodic scanning
while connected.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=766482
2017-08-11 12:35:01 -05:00
Dan Williams
631ca80692 devices/wifi: flip meaning of scanning allowed signal
Change it to return TRUE when scanning is prohibited so that we
don't have to use use g_signal_emitv() and its special handling of
return values.  Make the return value only change when we don't
want the default behavior (which would be to allow the scan).

Also add a parameter to the signal indicating whether the scan is
user/dbus-requested or whether it's an internal periodic scan.
2017-08-11 11:59:58 -05:00
Francesco Giudici
121a6bb638 build: fix building src/systemd
While rebasing systemd from upstream the "sd-adapt/process-util.h" file
was renamed and few other header files were added in the sources.
Update Makefile.am.

Fixes: e0cdaf9880
2017-08-11 12:42:21 +02:00
Thomas Haller
752afada0b docs: fix spelling errors in tranlated strings and documentation
https://bugzilla.gnome.org/show_bug.cgi?id=786131
2017-08-11 11:05:12 +02:00
Beniamino Galvani
e0cdaf9880 systemd: merge branch systemd into master
- fix DHCP over Infiniband

https://bugzilla.redhat.com/show_bug.cgi?id=1477678
2017-08-10 11:21:31 +02:00
Beniamino Galvani
dc1bfde56b systemd: update code from upstream (2017-08-09)
This is a direct dump from systemd git on 2017-08-09, git commit
c7f6ca9379279affa8f22d15fa13063491f86a49.

======

SYSTEMD_DIR=../systemd
COMMIT=c7f6ca9379279affa8f22d15fa13063491f86a49

(
  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-08-09 14:30:44 +02:00
Thomas Haller
a7aca2ab08 core: fix crash with bluetooth device factory wrongly claiming NAP connection
The bluetooth device *never* manages NAP connection. Hence, checking for
nm_bt_vtable_network_server in "nm-bluez-manager.c" is wrong.
Especially, because nm_bt_vtable_network_server is only initialized
much later, so during initial start, the bluetooth factory would wronly
claim to support it. This leads to a crash when having a NAP connection.

Also, the bridge factory requires the bluetooth plugin. It should only
claim to support NAP when the bluetooth plugin is present. That
way, we get a proper "missing plugin" error message, instead of failing
later during activation.

It seems to me, distributing the logic to various match_connection()
functions makes it more complicated, because the implementation is
spread out and interact in complicated ways. Anyway.

Fixes: 8665cdfeff
2017-08-06 07:50:48 +02:00
Beniamino Galvani
220a329fea ppp: merge branch 'bg/ppp-bgo559134'
Support for PPPoE on arbitrary devices.

https://bugzilla.gnome.org/show_bug.cgi?id=559134
2017-08-05 08:05:14 +02:00
Beniamino Galvani
74bf32ff9a core: ppp: use a different unit for each activation
We can't tell pppd to create an interface with a given name, so we use
the name generated by kernel and rename the interface afterwards. A
race condition can happen during the rename: NM receives the interface
name from pppd, but in the meantime the interface could be deleted and
another one with that name could appear. In this case we would rename
the wrong interface.

Using a changing unit index, we ensure that interfaces created by NM
don't race with each others. There is still the chance to race with
externally-created interfaces, but I guess this is not easily solvable
since the pppd plugin does not expose the ifindex.

When the specified unit is already in use, the kernel selects another
one.
2017-08-05 08:03:16 +02:00
Beniamino Galvani
a7afa9ead7 device: use ppp device for new style pppoe setting 2017-08-05 08:03:16 +02:00
Beniamino Galvani
6c3195931e core: implement activation of PPP devices
Add code to NMPppDevice to activate new-style PPPoE connections. This
is a bit tricky because we can't create the link as usual in
create_and_realize(). Instead, we create a device without ifindex and
start pppd in stage2; when pppd reports a new configuration, we rename
the platform link to the correct name and set the ifindex into the
device.

This mechanism is inherently racy, but there is no way to tell pppd to
create an arbitrary interface name.
2017-08-05 08:03:16 +02:00
Beniamino Galvani
695f6ceebb device: accept NULL plink
For PPP devices we can't create a link in advance, as the link is
created by pppd when the connection is established.
2017-08-05 08:03:16 +02:00
Beniamino Galvani
8665cdfeff core: device-factory: implement match_connection()
Make it possible to register different factories for the same setting
type, and add a match_connection() method to let each factory decide
if it's capable of handling a connection.

This will be used to decide whether a PPPoE connection must be handled
through the legacy Ethernet factory or through the new PPP factory.
2017-08-05 08:03:16 +02:00
Beniamino Galvani
df72cad107 device: add NMDevicePPP
The new device type represents a PPP interface, and will implement the
activation of new-style PPPoE connections, i.e. the ones that don't
claim the parent device.
2017-08-05 08:03:15 +02:00
Beniamino Galvani
d5c2c3f6d7 platform: add nm_platform_link_set_name()
We'll need it to rename the new PPP interface to a given name.
2017-08-05 08:03:15 +02:00
Beniamino Galvani
f83e56ec6d libnm,clients: add 'parent' property to PPPoE setting
When the property is set, it specifies the device on which PPPoE is to
be started. The ppp interface will be named as the
connection.interface-name property.

When the property is not set the previous behavior will be retained,
i.e. the PPPoE connection will be started on connection.interface-name
and the PPP interface will have a random name.
2017-08-05 08:03:15 +02:00
Beniamino Galvani
c521cffd7b device: ethernet: remove unused private member 2017-08-05 08:03:04 +02:00
Thomas Haller
6da6323080 platform: merge branch 'th/platform-route-pt1-bgo785449'
- extend platform's route-compare() functions with a mode argument.
  Most important is the new mode NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID,
  which corresponds kernels ID of how routes compare.

- when deleting routes, set all known parameters in the netlink message.
  Previously we would omit paramters, but that causes kernel to delete
  the first matching route.

- cleanup fields of routes

https://bugzilla.gnome.org/show_bug.cgi?id=785449
2017-08-03 19:04:54 +02:00
Thomas Haller
d373855e98 platform: extend API for adding routes
Via the flags of the RTM_NEWROUTE netlink message, kernel and iproute2
support various variants to add a route.

 - ip route add
 - ip route change
 - ip route replace
 - ip route prepend
 - ip route append
 - ip route test

Previously, our nm_platform_ip4_route_add() function was basically
`ip route replace`. In the future, we should rather user `ip route
append` instead.

Anyway, expose the netlink message flags in the API. This allows to
use the various forms, and makes it also more apparent to the user that
they even exist.
2017-08-03 18:51:57 +02:00
Thomas Haller
75dc0fdd27 platform,libnm: cleanup handling of TOS for routes
- kernel ignores rtm_tos for IPv6 routes. While iproute2 accepts it,
  let libnm reject TOS attribute for routes as well.

- move the tos field from NMPlatformIPRoute to NMPlatformIP4Route.

- the tos field is part of the weak-id of an IPv4 route. Meaning,
  `ip route add` can add routes that only differ by their TOS.
2017-08-03 18:51:57 +02:00