summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* devices: add support for openvswitch deviceslr/ovs-3Lubomir Rintel2017-09-1110-0/+1859
| | | | XXX needs more work
* clients: add support for ovs-bridge settingLubomir Rintel2017-09-113-1/+19
|
* clients: add support for ovs-port settingLubomir Rintel2017-09-113-0/+20
|
* libnm: add support for openvswitch devicesLubomir Rintel2017-09-1110-24/+173
|
* introspection: add o.fd.NM.Device.Openvswitch interfaceLubomir Rintel2017-09-113-35/+60
| | | | No properties or methods here yet either.
* libnm-core: add ovs-bridge settingLubomir Rintel2017-09-1110-0/+166
| | | | No properties there yet.
* libnm-core: add ovs-port settingLubomir Rintel2017-09-1110-0/+166
| | | | No properties there yet.
* device: ignore enslavement to ovs-masterLubomir Rintel2017-09-111-13/+18
| | | | | | That one is special. All interfaces that are attached to OpenVSwitch ports appear as slaves to that one even for our purposes we like to pretend they're slaves to the actual OpenVSwitch bridges.
* device: let the device subclass decide whether a slave is compatibleLubomir Rintel2017-09-112-5/+17
| | | | | Will be useful with OpenVSwitch where we want to be able to enslave "ovs-port" slaves, but also "ovs-bridge" slaves as a shorthand.
* manager: always update the device when the plink comes and goesLubomir Rintel2017-09-113-45/+45
| | | | | | | | | | | For some software devices, the platform link appears only after they've been realized. Update their properties and let them know that the link has changed so they can eventually proceed with activation. Also, reset the properties (udi, iface, driver) that are set from the platform link when the link goes away. At that point they don't reflect reality anymore. Removes some code duplication too.
* core/dhcp: use addr-family parameter for instead of booleanThomas Haller2017-09-1111-136/+166
| | | | | | | | | | | | | In many cases we want to treat IPv4 and IPv6 generically. That looks nicer if we distingish by an @addr_family integer, instead of a boolean. Replace the @is_ipv6 boolean with an @addr_family paramter. The @is_ipv6 boolean is inconsistent with other places where we use @is_ipv4 to indicate the opposite. Eventually, we should use @addr_family everywhere. Also, at the call site it's not immediately clear what TRUE/FALSE means, here AF_INET/AF_INET6 is better.
* device: enable support for ipv6.dhcp-timeoutThomas Haller2017-09-1110-62/+81
| | | | | | | | | | | | | | | - cleanup data type and use guint32 consistently. We might want to introduce a new "infinity" value. But since libnm's NM_SETTING_IP_CONFIG_DHCP_TIMEOUT asserts against the range 0 - G_MAXINT32, we cannot express it as -1 anyway. So, infinity will have the numerical value G_MAXINT32, hence guint32 is just fine. - make use of existing ipv6.dhcp-timeout setting and add global default configuration in NetworkManager.conf - instead of having subclasses call nm_device_set_dhcp_timeout(), add a virtual function get_dhcp_timeout().
* dhcp: dhclient: fix daemon start when dhcp-timeout is specifiedFrancesco Giudici2017-09-111-1/+1
| | | | | | | | A typo in the new dhcp-timeout option caused the dhclient daemon to exit with error when the dhcp-timeout option was specified. This prevents dhcp connection to be upped. Fixes: 82ef497cc9e2728e73cb0426efbae85c83bec3fe
* contrib/rpm: allow building RPM without fatal warningsThomas Haller2017-09-111-0/+4
| | | | | | | | | A newer compiler version might emit some warnings and break the build of the RPM. Of course, such warnings must be fixed. But it is still very inconvenient to break the build of an old RPM version without easy workaround. When building without "test" (which is on by default), don't use fatal warnings for compilation.
* contrib/NM-log: don't use exec in bash functionsThomas Haller2017-09-081-2/+2
| | | | | When sourcing the file, using exec inside NM-show-journal is a bad idea, because it replaces the calling shell.
* ppp: rename the interface only when necessaryBeniamino Galvani2017-09-083-15/+28
| | | | | | | | Previously when the interface created by pppd was already the one we expected, we would rename it to itself and remove the device from the manager. Don't do it. Fixes: 6c3195931e94cab70208ce97f3b834f5d9f5ff62
* core: merge branch 'th/platform-route-pt4' (part 2)Thomas Haller2017-09-0818-2048/+723
|\ | | | | | | | | | | Drop NMDefaultRouteManager. https://github.com/NetworkManager/NetworkManager/pull/26
| * core: rework handling of default-routes and drop NMDefaultRouteManagerth/platform-route-pt4Thomas Haller2017-09-0813-1979/+284
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove NMDefaultRouteManager. Instead, add the default-route to the NMIP4Config/NMIP6Config instance. This basically reverts commit e8824f6a5205ffcf761abd3e0897a22b254c7797. We added NMDefaultRouteManager because we used the corresponding to `ip route replace` when configuring routes. That would replace default-routes on other interfaces so we needed a central manager to coordinate routes. Now, we use the corresponding of `ip route append` to configure routes, and each interface can configure routes indepdentently. In NMDevice, when creating the default-route, ignore @auto_method for external devices. We shall not touch these devices. Especially the code in NMPolicy regarding selection of the best-device seems wrong. It probably needs further adjustments in the future. Especially get_best_ip_config() should be replaced, because this distinction VPN vs. devices seems wrong to me. Thereby, remove the @ignore_never_default argument. It was added by commit bb750260045239ab85574366bae8102eff8058cc, I don't think it's needed anymore. This brings another change. Now that we track default-routes in NMIP4Config/NMIP6Config, they are also exposed on D-Bus like regular routes. I think that makes sense, but it is a change in behavior, as previously such routes were not exposed there.
| * core: support tracking default-route in NMIP4Config/NMIP6ConfigThomas Haller2017-09-087-69/+439
|/ | | | | | | | | | | | | | | | Default-routes are for the most part like regular routes. Add support to track them like regular routes in NMIP4Config/NMIP6Config. One thing is, sometimes we need to figure out whether an ip-config instance has a default-route. For that, keep track of the best default-route (there might be multiple) and expose it. That is the most complicated part of this patch, because there are so many places where the list of routes gets modified (replace, intersect, subtract, merge, add), and they all need to take care of updating the best default-route. In a next patch, NMDefaultRouteManager will be dropped and default-routes will be tracked by NMIP4Config/NMIP6Config.
* core: merge branch 'th/platform-route-pt4' (part 1)Thomas Haller2017-09-0823-370/+530
|\ | | | | | | | | | | | | Several patches with cleanup and in prepration for dropping NMDefaultRouteManager. https://github.com/NetworkManager/NetworkManager/pull/26
| * core: return new route from _nm_ip_config_add_obj()Thomas Haller2017-09-0811-54/+95
| | | | | | | | | | Later we will need the exact instance that we just added (or the previously existing one, if the new route is already tracked).
| * core/trivial: rename test functions _nmtst_nm_ip*_config_*() to ↵Thomas Haller2017-09-088-50/+50
| | | | | | | | _nmtst_ip*_config_*()
| * platform: delete routes after adding in nm_platform_ip_route_sync()Thomas Haller2017-09-081-60/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we would first delete routes that are not to be added, before adding the new ones. This has the advantage, that even if delete removes the wrong route, add would restore the expected state. This tries to workaround the fact that RTM_DELROUTE allows for wild-card fields, and might delete the wrong route. However, for example when bumping the route metric after connectivty check (removing the default-route with metric 20100 and adding the one with metric 100), there is a short moment when there is no default-route. To avoid that, don't do delete-then-add, but add-then-delete.
| * core: ignore routes from non-main table in nm_ip4_config_capture()Thomas Haller2017-09-082-2/+8
| | | | | | | | and nm_ip6_config_capture().
| * core: don't loop twice over routes in nm_ip4_config_capture()Thomas Haller2017-09-082-17/+8
| | | | | | | | and nm_ip6_config_capture().
| * core: add nm_utils_connection_has_default_route()Thomas Haller2017-09-085-67/+56
| | | | | | | | Taken from "src/nm-default-route-manager.c".
| * device: expose nm_device_get_ip_route_metric() functionThomas Haller2017-09-082-22/+21
| | | | | | | | Will be used later.
| * core: nm_utils_ip_route_metric_normalize() utilThomas Haller2017-09-082-4/+7
| | | | | | | | | | Functions that take and addr_family argument are just nicer to use at places where we treat IPv4 and IPv6 generically.
| * platform: add nm_clear_nmp_object() utilThomas Haller2017-09-081-0/+15
| |
| * core: return new object from _nm_ip_config_add_obj()Thomas Haller2017-09-083-15/+33
| | | | | | | | Will be used later.
| * core: use _nm_ip_config_add_obj() in nm_ip4_config_replace() for routesThomas Haller2017-09-081-6/+7
| | | | | | | | | | | | | | | | Avoid calling nm_dedup_multi_index_add() directly, like we do for all other places. Instead, call the wrapper _nm_ip_config_add_obj() which does some pre-precessing. In practice, the result is exactly the same (at the moment). But there should by only one way to add the route.
| * core/tests: add test for nm_ip6_config_replace()Thomas Haller2017-09-081-0/+67
| |
| * platform/trivial: add code commentsThomas Haller2017-09-082-1/+8
| |
| * policy: take reference to best_device/activating_deviceThomas Haller2017-09-081-21/+17
| | | | | | | | | | | | | | | | Don't rely on manager keeping them alive long enough. E.g. get-best-device() is used when resetting the best device, however, it accesses the current device (hence, it relies on manager removing the device from the list, but keeping it alive long enough).
| * policy: cleanup setting default_device/activating_deviceThomas Haller2017-09-081-32/+32
| | | | | | | | | | - _LOGt() whenever the properties change. - some minor refactoring
| * policy: don't re-lookup the best device during update_system_hostname()Thomas Haller2017-09-081-18/+12
| | | | | | | | | | | | | | | | | | We already track the best device as priv->default_device4 / priv->default_device6. Don't try to look it up again. If the cached values from @priv are invalid/outdated, that should be fixed instead. This was already introduced by commit 773c006a4c9d3162e9b371762dc59fd5948e4b43. But I don't think it should be done.
| * policy: always check for hostname from DHCPv6 in update_system_hostname()Thomas Haller2017-09-081-1/+3
| | | | | | | | | | There is no reason for if-else-if. If DHCPv4 doesn't provide a hostname (but we are doing DHCP), just check for DHCPv6.
| * policy: refactor setting hostname from DHCP in update_system_hostname()Thomas Haller2017-09-081-18/+14
| |
| * shared: add nm_g_object_ref_set() and nm_clear_g_object()Thomas Haller2017-09-081-3/+52
|/ | | | | | | | | | | | | | | | | | | | | | | | | | - nm_clear_g_object() is like g_clear_object() but: - it returns a boolean value, indicating that something was cleared. - it includes an nm_assert() to check that the pointer is still valid. - it uses typeof() instead of blindly casting the argument. - nm_g_object_ref_set() combines nm_clear_g_object() and resetting the pointer to a new object, including taking a reference. - also returns a boolean, indicating whether something changed. - it gets the order of operations right: first it increses the ref-count, before unrefing the old object. - like nm_clear_g_object() and nm_clear_g_free() it first sets the destination to NULL, instead of leaving a dangling pointer for the duraction of the unref/free call. - fix nm_clear_g_free() not to use a possibly dangling pointer. Striclty speaking, that is undefined behavior.
* shared: add nm_g_object_class_find_property_from_gtype() utilThomas Haller2017-09-073-3/+16
| | | | | | And relax the type for nm_auto_unref_gtypeclass macro. Like g_type_class_unref() itself, you usually don't use it with a GTypeClass base class, but some subtype like GObjectClass.
* dns: use 127.0.0.53 address in /etc/resolv.conf with systemd-resolvedThomas Haller2017-09-071-2/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=787378
* ifnet: ensure an error is always returned when add failsBeniamino Galvani2017-09-071-2/+7
| | | | | There are many places where the function can fail without returning an error, leading to a crash. Fix this.
* contrib/NM-log: don't run less with --quit-on-intr argumentThomas Haller2017-09-071-1/+1
| | | | | I find it annoying when ^C exits less and it prompts me to often do `NM-log | less -R` instead.
* contrib/NM-log: colorize warnings and errors in red (fix)Thomas Haller2017-09-071-3/+3
| | | | | Must not colorize the trailing space, otherwise the following " device" will no longer match.
* contrib/NM-log: colorize warnings and errors in redThomas Haller2017-09-071-1/+3
| | | | | | | | - remove "\r\n" line endings - colorize <warn> and <error> in red - extend matching the info levels to include the timestamp. This (intentionally) will no longer highlight messages from ModemManager, which don't include a timestamp.
* contrib/NM-log: improve script and make it sourceableThomas Haller2017-09-071-22/+36
| | | | | | | | | | - use "grep -a" so that grep doesn't refuse to work in binary input. - make the script source-able to only define the NM-colorize and NM-show-journal - In case the script is sourced, it also defines a NM-log function, which does the same as the script itself. - rename internal functions so that they have names starting with "NM" in case of sourcing.
* po: mark broken strings in Japanese translation as fuzzy (bgo#787382)Piotr Drąg2017-09-071-3/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=787382
* po: update Polish (pl) translation (bgo #787380)Piotr Drąg2017-09-071-2919/+935
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=787380
* vpn: merge branch 'th/vpn-route-bgo787370'Thomas Haller2017-09-076-72/+97
|\ | | | | | | | | | | Fix and improve determining the route to the external VPN gateway. https://bugzilla.gnome.org/show_bug.cgi?id=787370
| * vpn: only rely on `ip route get` to resolve route to external VPN gatewayThomas Haller2017-09-071-43/+23
| | | | | | | | | | | | | | | | | | | | Until recently, we would only consier the IP config of the parent device to determine the route to the external VPN gateway. We changed that, to additionally improve the guess by letting kernel resolve the route. Now, drop checking the parent's config entirely. The only thing that matters is the here and now runtime configuraion on the parent device. And for that we ask kernel to resolve the route.