| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Revert "cli: add nmc_property_set_int() function"
This reverts commit 5fccb0bdc98ef9f79172878ead2fb32bf363949f.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=580018
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
| |
Next we want to sort the array, g_slist_sort() is not guaranteed to be
stable, while g_ptr_array_sort() is. Also, sorting a GSList has
worse performance.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
nm_device_get_best_auto_connection() was only used at one place.
It's function is rather simple, it just iterated over a list finding
the first can_auto_connect() connection. At the very least, the name
was misleading, because it did not return the 'best', but the 'first'
connection.
Get rid of the function altogehter.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The autoconnect priority has (currently) only any relevance,
if the connection is autoconnect too.
The priority defaults to zero, with higher numbers meaning preferred.
Currently we limit the range from [0,1000], but still set the type
to int32. Later we might relax this restriction to allow for further
use.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
| |
The previous implementaiton of the compatibility wrapper failed
with clang when used inside a macro. This seems like a compiler
error not to ignore the deprecation. Workaround by refactoring
the g_type_ensure() wrapper.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
| |
For NMDeviceWifi and NMDeviceWimax, the printf format string for
nm_utils_complete_generic() was created based on ssid/nsp. Since
these input strings are untrusted, this is a serious bug.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
| |
The error was produced by:
msgfmt -vc ru.po
https://bugzilla.gnome.org/show_bug.cgi?id=735186
|
|
|
|
|
|
| |
nm_remote_settings_list_connections() ensures the connections are loaded first.
We check "help" commands before getting connections, because it is time
intensive action.
|
|
|
|
|
|
|
|
| |
It was broken by commit 57e802f3aa2aac8daba9a7a442a2393ab5888dba, which made
nmcli always return success.
For example:
$ nmcli con add type blabla
|
| |
|
|\
| |
| |
| |
| |
| | |
https://bugzilla.gnome.org/show_bug.cgi?id=696936
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When removing/replacing a NMSetting in an NMConnection, we have
to disconnect setting_changed_cb() from the "notify" signal.
Backport commit dfba4ce1e1c5bd0c1ae798bc538b5fab3e3faded from
libnm-core.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
verify() used to modify interface-name of the base settings. This is
discouraged, because verify() should not touch the connection.
For libnm-core we can change behavior and only modify the connection
in normalize().
Also, be more strict not to verify() sucessfully on invalid
interface-name.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
@all_settings
When calling nm_setting_verify() without providing any settings in @all_settings,
we assume that the setting on its own might be valid.
Only when checked together with all settings, we want to consider the setting
in the full context. nm_connection_verify() ensures to pass on a list of settings.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, NMSettingInfiniband:verify() silently modifies the
setting for invalid MTU. verify() should not do that.
For libnm-core we can change behavior and implement normalization
of MTU. This changes behavior for NMSettingInfiniband:verify() so
that MTU gets no longer fixed by verify() alone. Instead verify()
fails with a verification error.
Due the possibility to normalize the MTU, NM still can receive
invalid settings and fix it.
For libnm-core we don't change behavior, merely add a code comment.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
against bugs
We would expect that attempts to normalize a connection
are successful as verify() indicates. This way, a connection
is not modified if it cannot be fixed, and a connection will
be valid and modified after attempts to normalization.
However, there might be subtle, unexpected ways how this can fail.
For example, if NMSettingConnection:verify() detects a missing base type
setting, it returns NORMALIZABLE_ERROR if it finds a valid
NMSettingConnection:type. Normalization then adds an empty, default
setting. However, a new verify() might fail due to other reasons.
This would be a bug in NMSettingConnection:verify() which must not
indicate that it is able to normalize the connection, when it actually
is unable to do so.
Such bugs need fixing, but the code should be more robust to this case
because there might be complex, unanticipated situations.
Especially since NM relies on having a valid connection after normalize(),
so a strict error-out behavior is important.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| | |
type and slave-type
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| | |
nm-glib-compat.h
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nm_connection_normalize()
This undoes commit 9f8b7ff51dfd7cdb828fe5e7b50016c5587e8657
but the same functionality is now provided via normalize().
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nm_connection_normalize() can now detect the 'type' property
based on existing base settings.
It can also create a (default) base setting.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Now also verify the 'type' property regardless of existing
@all_settings.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
nm_connection_normalize() can now add the slave setting as needed. Remove
the duplicate functionality.
This undoes commit 664d64e0c04bd4b83137a682ff9a9881966f6f94
but the same functionality is now provided via normalize().
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some NMSettingConnection:slave-type types require a matching slave #NMSetting.
Add normalization of either the 'slave-type' property or the slave-setting.
Also be more strict in NMSettingConnection:verify() to enforce an
existing slave-setting depending on the slave-type.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NMSettingConnection:verify()
Partly it was already there. This makes NMSettingConnection:verify() stricter
then before, but validates the same as of NMConnection:_nm_connection_verify().
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
When removing/replacing a NMSetting in an NMConnection, we have
to disconnect setting_changed_cb() from the "notify" signal.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
_nm_connection_verify()
In general, we don't set errors if passing a completely invalid @self
pointer to a method. We usually also don't set the error argument
when asserting. So, just drop it.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is an utility function that can be called during verify()
to find an NMSetting from @all_settings.
This is especially useful for looking up the NMSettingConnection
which usually is present. So just get it quickly. In the unexpected
case that it is missing, it sets @error and we can return.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
At the end of reading the connection, reader calls nm_connection_normalize()
to normalize the connection. Normalization inplicitly verifies the
connection.
Doing a verify along the way is not needed and even harmful. Soon further
checks will be added that make verify() fail, but normalize()
can fix the connection. So, while reading, we might actually have
an invalid connection, that will be normalized as last step.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The new nm_connection_normalize() function allows to fixup an incomplete connection.
The keyfile reader should call normalize on a connection, so that we can implement
common normalizations there instead of inside the settings plugin.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| | |
Needed in the next commit when we have to normalize the connection
before comparing.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The recent change c88b832ce9510bdcb2df2bf7e02b1ded88154581 allows for
missing 'id' and 'uuid' entries. Further make the keyfile reader
more accepting, by creating a missing NMSettingConnection.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| | |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
As NM_SETTING_SECRET_FLAGS_ALL is used in libnm/nm-vpn-plugin-utils.c,
it is exposed as internal API and should be declared in
nm-core-internal.h.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
"nm-core-internal.h"
As this flag is used by NM-core, move it to nm-core-internal.h
header file.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a header file to expose private utility functions from libnm-core
that can be used by NetworkManager (core) and libnm.so. The header
is also used to give privileged access to libnm-core. Since NM links
statically, these functions are not exported and not part of public ABI.
This also removes the NM_UTILS_PRIVATE_CALL() macro and libnm.so no
longer exports nm_utils_get_private().
Before, this functionality was partly declared in nm-utils-private.h.
This was wrong because nm-utils-private.h is for functionality
entirely private to libnm-core.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|