summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm/team: preserve unset priv->runner_tx_hash in _align_team_properties()th/libnm-team-fixesThomas Haller2019-03-243-7/+6
| | | | | There is a difference between an unset JSON array element and an empty one. Don't loose that information.
* libnm/team: check for changes to team:runner-tx-hash in _align_team_properties()Thomas Haller2019-03-241-7/+17
| | | | | We will need to emit property changed signals. For that we need to know whether the property changes. Compare it.
* libnm/team: add function to compare list of link-watchersThomas Haller2019-03-243-41/+44
|
* libnm/team: simplify handling in _nm_utils_team_config_set()Thomas Haller2019-03-241-23/+29
| | | | | | | | - use nm_auto_decref_json for "json_value" to indicate ownership transfer. - don't reuse variable json_element and json_link to construct watchers list. It's confusing. In general, use different variables for different purposes.
* libnm/team: indicate whether there were changes in _nm_utils_team_config_set()Thomas Haller2019-03-241-0/+2
|
* libnm/team: return early from _nm_utils_team_config_set()Thomas Haller2019-03-241-34/+23
|
* libnm/team: avoid assertions parsing JSON of invalid typeThomas Haller2019-03-241-5/+10
| | | | | | _nm_utils_team_config_get() determines the type based on the JSON content. Hence, the caller must validate that the returned GValue is of the expected type, or it will trigger an assertion/crash.
* libnm/team: fix memleaks in getting json valuesThomas Haller2019-03-241-29/+22
| | | | | | Use nm_auto*, it's almost always harder to get wrong, because ownership (and lifetime management of a variable, and what it points to) is more clearly expressed.
* libnm/team: minor coding style cleanupThomas Haller2019-03-242-19/+19
|
* libnm/team: fix crash with nm_setting_team_remove_runner_tx_hash_by_value() ↵Thomas Haller2019-03-241-6/+7
| | | | having no runner_tx_hash array
* shared: add _nm_utils_strv_cmp_n() and _nm_utils_strv_equal()Thomas Haller2019-03-245-25/+208
|
* shared/tests: add parentheses around arguments of NMTST_SWAP() macroThomas Haller2019-03-241-5/+6
|
* Revert "ovs-port: dissociate the link from the interface device on delete"Thomas Haller2019-03-241-7/+0
| | | | | | Revert this patch for now. It causes a crash and breaks CI tests. This reverts commit ee39f3ab79b3f615285ffbe2cece66ad1205d96a.
* ovs-port: dissociate the link from the interface device on deleteLubomir Rintel2019-03-221-0/+7
| | | | | | | | | | | | | Open vSwitch is the special kid on the block -- it likes to be in charge of the link lifetime and so we shouldn't be. This means that we shouldn't be attempting to remove the link: we'd just (gracefully) fail anyways. More importantly, this also means that we shouldn't care if we see the link go away. We may already be activating another connection and shouldn't alter the device state when OpenVSwitch decides to drop the old link. https://bugzilla.redhat.com/show_bug.cgi?id=1543557 https://github.com/NetworkManager/NetworkManager/pull/315
* merge: branch 'fg/checkpoint-devices-rh1578335-pt1'Francesco Giudici2019-03-223-15/+31
|\ | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1578335 https://github.com/NetworkManager/NetworkManager/pull/316
| * nm-checkpoint: save device ifname and track if it is softwarefg/checkpoint-devices-rh1578335-pt1Francesco Giudici2019-03-221-2/+7
| | | | | | | | | | | | | | This will be soon useful as we are going to drop the reference to the Device objs: so, when a checkpoint is created and a device disappear (hw removed or sw device deleted) we will be able to correctly perform the rollback.
| * nm-checkpoint: skip unmanage state check on unrealized devicesFrancesco Giudici2019-03-221-1/+1
| | | | | | | | | | The "activate" label is used only for unrealized software devices that should be recreated. Move the label to skip useless checks.
| * nm-checkpoint: emit signal on the Devices property when requiredFrancesco Giudici2019-03-221-6/+18
| | | | | | | | | | | | that is: when a Device gets unexported from DBus. In this way we will allow "Devices" property to be rechecked on get() returning an up-to-date "Devices" property value.
| * dbus-utils: don't return paths if they are in the process of being unexportedFrancesco Giudici2019-03-221-1/+1
| |
| * nm-checkpoint: remove duplicate commentFrancesco Giudici2019-03-221-1/+0
| | | | | | | | Fixes: 5fb65b7f9634 ('checkpoint: let each checkpoint schedule its own timeout')
| * trivial: fix grouping of empty GClosure arg in g_signal_new()Francesco Giudici2019-03-221-4/+4
|/
* platform/tests: workaround test failure for routing rules with older kernelsThomas Haller2019-03-201-0/+2
| | | | | | | | | | | | | | # NetworkManager-MESSAGE: <warn> [1553100541.6609] platform-linux: do-add-rule: failure 17 (File exists) >>> failing... errno=-17, rule=[routing-rule,0xe9c540,1,+alive,+visible; [6] 4294967295: from all suppress_prefixlen 3 none goto-target 2955537847] 0: from all to 73.165.79.8/2 iif nm-test-device 178 0: from all 109 0: from all tos 0x13 lookup 10004 suppress_prefixlength 0 none 0: from all none 4294967295: not from all none test:ERROR:../src/platform/tests/test-route.c:1607:test_rule: assertion failed (r == 0): (-17 == 0) Possibly fixed by https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c8f4e6dc30996bff806285730a0bb4e714d3d52
* platform/tests: skip rule tests if not all features could be testedThomas Haller2019-03-201-0/+21
|
* platform/tests: print more information when routing rule test is about to failThomas Haller2019-03-201-1/+18
|
* settings: remove READMELubomir Rintel2019-03-202-34/+0
| | | | It is out of date and doesn't seem to serve any real purpose.
* contrib/rpm: drop --with-libnm-glib from build_cleanLubomir Rintel2019-03-201-1/+0
| | | | It does nothing now.
* all: goodbye libnm-glibLubomir Rintel2019-03-19214-74760/+11
| | | | | | | | | | | | | | | | | | | | | | | This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
* Revert "wwan/device-modem: don't enter available state until registered"Lubomir Rintel2019-03-181-7/+6
| | | | | | | | This is wrong -- we may want to start activating before device is registered if it the SIM needs unlocking with a PIN code that's included in the connection. This reverts commit 2e8f43e379c61d79b6dd1b27ee1d9cb950447ad5.
* contrib/checkpatch: avoid command injection in checkpatch.pl scriptThomas Haller2019-03-181-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | The capture variables, $1, etc, are not valid unless the match succeeded, and they're not cleared, either. $ git checkout -B C origin/master && \ echo XXXXX > f.txt && \ git add f.txt && \ git commit -m 'this commit does something()' Branch 'C' set up to track remote branch 'master' from 'origin'. Reset branch 'C' Your branch is up to date with 'origin/master'. sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `git log --abbrev=12 --pretty=format:"%h ('%s')" -1 does something() 2>/dev/null' >>> VALIDATE "a169a98e14 this commit does something()" (commit message):4: Commit 'does something()' does not seem to exist: > Subject: [PATCH] this commit does something() (commit message):4: Refer to the commit id properly: : > Subject: [PATCH] this commit does something() The patch does not validate.
* release: bump version to 1.17.1-dev after 1.16.0 release1.17.1-devThomas Haller2019-03-1526-274/+3175
|\ | | | | | | | | | | | | | | | | | | After 1.16.0 is released, merge it back into master so that 1.16.0 is part of the history of master. That means, $ git log --first-parent master will also traverse 1.16.0 and 1.16-rc*. Also bump the micro version to 1.17.1-dev to indicate that this is after 1.16.0 is out.
| * device/wifi: fix handling static WEP connections in ↵Thomas Haller2019-03-151-3/+3
| | | | | | | | | | | | act_stage4_ip_config_timeout() Fixes: 5e71f016057a ('device: merge stage3 and stage4 ip-config function for IPv4 and IPv6')
| * libnm: fix dns-configuration property typeBeniamino Galvani2019-03-151-8/+3
| | | | | | | | | | | | Fixes: a8d600525643 ('libnm: implement support for DNS manager properties') https://bugzilla.redhat.com/show_bug.cgi?id=1689055
| * platform/tests: adjust probabilities for generating randomized rulesThomas Haller2019-03-151-97/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The routing-rule tests generate a number of routing rules and tries to add and delete them. For that, _rule_create_random() sets random fields of the rule. Note that especially interesting are rules that leave most fields unset (at zero), because they trigger kernel issues rh#1686075 and rh#1685816. But a rule has many fields, so in order to generate rules that have most fields unset, we need to use low probabilities when rolling the dice for setting a field. Otherwise, most rules end up with several fields set and don't reproduce the kernel issue (especially the test failed to hit rh#1686075).
| * platform/tests: workaround FIB_RULE_INVERT of rules for kernel issue rh#1686075Thomas Haller2019-03-151-0/+4
| | | | | | | | Fixes: b8398b9e7948 ('platform: add NMPRulesManager for syncing routing rules')
| * libnm-core: fix types of nm_auto() macros for NMSockAddrEndpoint and ↵Thomas Haller2019-03-131-2/+2
| | | | | | | | NMWireGuardPeer
| * libnm-core: fix type of argument for nm_utils_inet_ntop_dup()Thomas Haller2019-03-131-1/+1
| | | | | | | | Fixes: 898f7a56655d ('libnm: add internal API nm_utils_inet*_ntop_dup()')
| * core: merge branch 'th/routing-rule-pt1'Thomas Haller2019-03-1320-265/+3141
| |\ | | | | | | | | | https://github.com/NetworkManager/NetworkManager/pull/306
| | * platform: add NMPRulesManager for syncing routing rulesth/routing-rule-pt1Thomas Haller2019-03-138-75/+895
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Routing rules are unlike addresses or routes not tied to an interface. NetworkManager thinks in terms of connection profiles. That works well for addresses and routes, as one profile configures addresses and routes for one device. For example, when activating a profile on a device, the configuration does not interfere with the addresses/routes of other devices. That is not the case for routing rules, which are global, netns-wide entities. When one connection profile specifies rules, then this per-device configuration must be merged with the global configuration. And when a device disconnects later, the rules must be removed. Add a new NMPRulesManager API to track/untrack routing rules. Devices can register/add there the routing rules they require. And the sync method will apply the configuration. This is be implemented on top of NMPlatform's caching API.
| | * platform/tests: add tests for handling policy routing rulesThomas Haller2019-03-132-0/+796
| | |
| | * platform: add routing-rule add/delete netlink functionsThomas Haller2019-03-134-11/+200
| | |
| | * platform: add support for routing-rule objects and cache them in platformThomas Haller2019-03-136-26/+874
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add and implement NMPlatformRoutingRule types and let the platform cache handle rules. Rules are special in two ways: - they don't have an ifindex. That makes them different from all other currently existing NMPlatform* types, which have an "ifindex" field and "implement" NMPlatformObjWithIfindex. - they have an address family, but contrary to addresses and routes, there is only one NMPlatformRoutingRule object to handle both address families. Both of these points require some special considerations. Kernel treats routing-rules quite similar to routes. That is, kernel allows to add different rules/routes, as long as they differ in certain fields. These "fields" make up the identity of the rules/routes. But in practice, it's not defined which fields contribute to the identity of these objects. That makes using the netlink API very hard. For example, when kernel gains support for a new attribute which NetworkManager does not know yet, then users can add two rules/routes that look the same to NetworkManager. That can easily result in cache inconsistencies. Another problem is, that older kernel versions may not yet support all fields, which NetworkManager (and newer kernels) considers for identity. The older kernel will not simply reject netlink messages with these unknown keys, instead it will proceed adding the route/rule without it. That means, the added route/rule will have a different identity than what NetworkManager intended to add.
| | * platform: separate the refresh-type from the object typeThomas Haller2019-03-133-114/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is a directy one to one relation between - DELAYED_ACTION_TYPE_REFRESH_ALL_* - REFRESH_ALL_TYPE_* - NMP_OBJECT_TYPE_* For IP addresses, routes and routing policy rules, when we request a refresh-all (NLM_F_DUMP), we want to specify the address family. For addresses and routes that is currently solved by having two sets of NMPObject types, for each address family one. I think that is cumbersome because the implementations of both address families are quite similar. By implementing both families as different object types, we have a lot of duplicate code and it's hard to see where the families actually differ. It would be better to have only one NMPObject type, but then when we "refresh-all" such types, we still want to be able to dump all (AF_UNSPEC) or only a particular address family (AF_INET, AF_INET6). Decouple REFRESH_ALL_TYPE_* from NMP_OBJECT_TYPE_* to make that possible.
| | * platform/trivial: rename enum DELAYED_ACTION_IDX_REFRESH_ALL_* to ↵Thomas Haller2019-03-131-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REFRESH_ALL_TYPE_* While these numbers are strongly related to DELAYED_ACTION_TYPE_REFRESH_ALL_*, they differ in their meaning. These are the refresh-all-types that we support. While some of the delayed-actions are indeed for refresh-all, they are not the same thing. Rename the enum.
| | * platform: drop unused nm_platform_refresh_all()Thomas Haller2019-03-133-26/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is unused. It would require redesign to work with future changes, and since it's unused, just drop it. The long reasoning is: Currently, a refresh-all is tied to an NMPObjectType. However, with NMPObjectRoutingRule (for policy-routing-rules) that will no longer be the case. That is because NMPObjectRoutingRule will be one object type for AF_INET and AF_INET6. Contrary to IPv4 addresses and routes, where there are two sets of NMPObject types. The reason is, that it's preferable to treat IPv4 and IPv6 objects similarly, that is: as the same type with an address family property. That also follows netlink, which uses RTM_GET* messages for both address families, and the address family is expressed inside the message. But then an API like nm_platform_refresh_all() makes little sense, it would require at least an addr_family argument. But since the API is unused, just drop it.
| | * platform: suppress unnecessary logging in do_request_all_no_delayed_actions()Thomas Haller2019-03-131-3/+8
| | | | | | | | | | | | | | | When we refresh all links, we clear all flags to refresh a specific link. However, only log a message if there was anything to clear.
| | * platform: add NULL check in inline nmp_object_unref() functionThomas Haller2019-03-131-2/+4
| | | | | | | | | | | | | | | | | | This allows the compiler to see that this function does nothing for %NULL. That is not so unusual, as we use nm_auto_nmpobj to free objects. Often the compiler can see that these pointers are %NULL.
| | * platform: add NMPlatformObjWithIfindex helper structure for handling ↵Thomas Haller2019-03-138-47/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMPObject types Until now, all implemented NMPObject types have an ifindex field (from links, addresses, routes, qdisc to tfilter). The NMPObject structure contains a union of all available types, that makes it easier to down-case from an NMPObject pointer to the actual content. The "object" field of NMPObject of type NMPlatformObject is the lowest common denominator. We will add NMPlatformRoutingRules (for policy routing rules). That type won't have an ifindex field. Hence, drop the "ifindex" field from NMPlatformObject type. But also add a new type NMPlatformObjWithIfindex, that can represent all types that have an ifindex.
| | * platform: move nmp_class_from_type() to header to allow inliningThomas Haller2019-03-132-12/+13
| | |
| | * platform: drop unnecessary casts from NMP_OBJECT_CAST_*() macrosThomas Haller2019-03-131-7/+7
| | | | | | | | | | | | | | | It's wrong to cast here. The caller must always provide an NMPObject pointer.
| | * platform: unify IPv4 and IPv6 variables for NMPlatformVTableRouteThomas Haller2019-03-132-23/+30
| | |