| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
Just create a NMLinuxPlatform instance and unref it again.
This already connects to netlink and fetches all objects.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Switch platform caching implementation. Instead of caching libnl
objects, cache our own types.
Don't remove yet the now obsolete functions.
Advantage:
* Performance
- as we now cache our native NMPlatformObject instances, we no longer
have to convert libnl objects every time we access the platform
cache.
- for most cases, access is now O(1) because we can lookup the object
in a hash table. Note that ip4_address_get_all() still has to
create a copy of the result, but that can be later improved by
exposing the cached objects directly.
* We cache our own native types and have full control over them. We
cannot extend the libnl objects, which has many short-commings:
- _rtnl_addr_hack_lifetimes_rel_to_abs() to convert the timestamps
to absolute values (and back).
- hack_empty_master_iff_lower_up() would modify the internal flag,
but it looses the original value. That means, we can only hack
the state before putting a link into the cache, but we cannot revert
that change, when a slave in the cache changes state.
That was previously solved by always refetching the master when
a slave changed. Now we can re-evaluate the connected state
(DELAYED_ACTION_TYPE_MASTER_CONNECTED).
- we implement functions like equality, to-string as most suitable
for us. Before we needed hacks like nm_nl_object_diff(),
nm_nl_cache_search(), route_search_cache().
- we can extend our objects with exactly those properties we care,
and possibly additional properties that are not representable in
the libnl objects.
- In the future, we could expose the cached objects directly to users of
NMPlatform.
* Previous implementation did not order the refresh of objects but
called check_cache_items(). Now, those actions are delayed and
combined in an attempt to reduce the overall number of reloads.
Realize how expensive a check_cache_items() for addresses and routes
was: it would iterate all addresses/routes and call refresh_object().
The latter obtains a full dump of *all* objects again, and ignores
all but the needle.
Note that we probably still schedule some delayed actions that
are not needed.
Later we can optimize that further (related bug bgo #747985).
While some of these points could also have been implemented with
caching of libnl objects, that would have become hard to maintain.
https://bugzilla.gnome.org/show_bug.cgi?id=747981
|
|
|
|
|
| |
It is not yet used, only add new code beside the existing
implementation. It will be used later.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parts of the implementation is inside nm-linux-platform.c,
because it depends on utility functions from there.
NMPObject is a simple "object" implemenation around NMPlatformObject.
They are ref-counted and have a class-pointer. Several basic functions
like equality, hash, to-string are implemented.
NMPCache is can be used to store the NMPObject. Objects are indexed
via their primary id, but there is also multi-lookup via NMCacheId
and NMMultiIndex.
|
| |
|
| |
|
|
|
|
|
|
|
| |
A class to do efficient lookup for values based on a key.
One value can be referenced by multiple keys, and one
key can contain multiple values. Hence the name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NMRefString is a simple, refcounted, immutable string. Increasing/decreasing
the refcount does not affect const-ness.
It can be used just like a regular 'const char *' pointer. The only
difference is that you need different alloc/free functions.
It will be used for NMPlatformLink.udi field, which currently reuses the
internal value from the GUdevDevice instance. Later we need to keep our
own clone of that string, so let's make it ref-counted.
-- especially, because we create throw-away clones of link objects while
updating.
|
|
|
|
|
| |
The newer version of g_hash_table_replace() is neat, because it
saves an additional hash table lookup.
|
|
|
|
|
|
| |
Yes, I end up not using this function on the branch.
Maybe let's keep it, it might be useful -- until we bump
our glib requirements.
|
|
|
|
|
|
|
| |
Later we will need this flag to distinguish routes from kernel
that have source RTPROT_KERNEL.
This flag is still unused.
|
| |
|
| |
|
|
|
|
|
| |
I'd like to reuse this buffer for other to-string functions that
are platform related.
|
| |
|
|
|
|
|
| |
Later we will have a @is_in_netlink property. Rename it to have
a more specific name.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
We will later need the scope for NMPlatformIP4Route
because for route deletion with old netlink library,
we must explicitly set the scope of the route we
want to delete.
|
|
|
|
| |
Will be used later.
|
| |
|
|
|
|
|
|
|
| |
static variable
Whether we have support depends on the kernel, and is not
per NMLinuxPlatform instance.
|
|
|
|
| |
nmp_utils_mii_supports_carrier_detect()
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no general purpose file for platform utilities.
We only have nm-platform.h, which contains (mostly) functions
that operate on a NMPlatform instance (and that can be mocked
using NMFakePlatform).
Add a new file for independent utility functions. nm-platform-utils.c
should not call into functions having a NMPlatform instance, to
have them independent from platform caching and the platform
singleton.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
nm_platform_query_devices() would raise an 'added' signal
for all its links. That is bad style because it could
confuse other listeners for platform signals which don't
expect such artificial change signals.
The public API of NMPlatform already gives NMManager the ability
to 'pull' all the links and iterate them itself.
Before, nm_platform_query_devices() would also initialize udev
devices, so there was a more compelling reason for this function.
|
|
|
|
|
|
| |
We already populate the netlink cache in constructed(). No need
to wait with udev devices until nm_platform_query_devices(). Just
do it right away.
|
|
|
|
|
| |
Hard to debug failures, if we don't print where the failure
happens.
|
|
|
|
|
|
|
| |
Support accepting more then one signal at a time.
It is to be expected, that one change in platform raises
several signals. Extend the assertion helpers to express
that.
|
|
|
|
|
|
|
|
|
| |
Up to now, this code was correct. Later we will add another field
to NMPlatformIP4Route which causes the test to operate on
uninitialized data.
Instead of explicitly initializing the field, just clear the whole
struct.
|
|
|
|
|
|
|
|
|
|
|
|
| |
And nmtst_platform_ip6_routes_equal().
As already indicated by the comment, using memcmp() doesn't really work
here. It worked up to now, because the NMPlatformIP4Route structure has no
padding at the end.
If we would have a last 'guint8' member (as we will add later),
initializing an arry of routes on the stack would not clear the bytes
from the padding and the comparison using memcmp() would fail.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The VPN connection requests secrets a few times; first it retrieves
only system-owned secrets to see if they are sufficient (and thus
doesn't need to bother the user), then it retrieves existing agent
owned secrets (so the user doesn't get a popup), then finally if
those aren't sufficient it asks the user interactively.
But if there was some error retrieving system secrets, or if there
weren't any system secrets at all, don't fail the VPN connection.
Just go on and ask the user for the secrets.
|
|\
| |
| |
| |
| |
| |
| | |
Make the main.ignore-carrier configuration option reloadable
via our usual SIGHUP mechanism.
https://bugzilla.gnome.org/show_bug.cgi?id=748050
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now on SIGHUP, when reloading NetworkManager configuration, also reload
the ignore-carrier flag.
While a device is activated, the reload is ignored until the device
deactivates.
Maybe it would be simpler just not to cache ignore_carrer and let it
take effect immediately. But not caching ignore_carrer has the
additional downside that every call to is_available must check the
specs -- which in sum is potentially expensive for something that
almost never changes.
https://bugzilla.gnome.org/show_bug.cgi?id=748050
|
|/
|
|
|
|
|
|
| |
Only move the ignore-carrier option from NMConfig to
NMConfigData. The ignore-carrier option is still
immutable after startup.
https://bugzilla.gnome.org/show_bug.cgi?id=748050
|