| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
robust against bugs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
| |
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>
|
|
|
|
| |
NMConnection
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This partly undoes commit 6cb6d3972558bb89cbb83ac1b87595dc33ed665a.
Merging the two header files was wrong because they serve a different purpose:
1) nm-utils-private.h: this is for stuff that is used accross
modules *inside* libnm-util. No symbols are exported and hence
including this file outside of libnm-util/ is wrong.
2) nm-utils-internal.h: (pre 6cb6d397, this was named nm-util-private.h)
This header contains functionality that is used by other components
*inside* the source tree, for example NM-core. It can be included,
and libnm-util.so will export symbols for it. However, it is not part
of the documented (stable) API, and other projects outside of
NetworkManager should not use it and not rely on a stable API.
However, we still have to provide ABI backward compatibility for
the exported functions.
Note, that it removes the trick using NMUtilsPrivateData to export
internal functions. Instead export the internal functions directly,
but give them the commont prefix nm_internal_*().
Even for the NMUtilsPrivateData provided functions we must preserve ABI
and functional backward compatibility. So the only advantage of using
the struct is that we can retire exported symbols. However, we still have
to provide the functionality and binary interface.
This doesn't give us significantly more flexibility when retiring
internal functions, so just export them directly. Since internal
functions share a distingished name prefix, this is acceptable.
nm_utils_get_private() is still available not to break ABI.
The naming convention for internally exported function is the prefix
nm_internal_* -- instead of nm_*.
Note, that nm-utils-internal.h serves two different purposes:
2a) provide special access to internal functionality of libnm-util.
This use is discouraged in general because the library should expose
useful functions as public API and library users inside the source
tree should not be special.
One use of this is NetworkManager core (which is a special user
because it implements server-side) or testing.
2b) share general utility code between components of NetworkManager.
This is for general purpose functions that are needed *inside*
libnm-util, but that are useful to other components. In this case,
the other components already link against libnm-util, so it makes
sense to reuse code.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since previous commit dafe51e8819c31ef6c0a7e901e43e821e229650f,
the gtk-doc is no longer ignored. However, the angle brackets
add invalid XML characters to ./docs/libnm-glib/xml/nm-client.xml
This breaks the build.
make[3]: Entering directory `./NetworkManager/docs/libnm-glib'
DOC Scanning header files
DOC Introspecting gobjects
DOC Building HTML
../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: NMActiveConnection line 1109 and para
</para></refsect2>
^
../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: para line 1107 and refsect2
</para></refsect2>
^
../xml/nm-client.xml:1211: parser error : Opening and ending tag mismatch: refsect2 line 1104 and refsect1
</refsect1>
^
../xml/nm-client.xml:1262: parser error : Opening and ending tag mismatch: refsect1 line 1095 and refentry
</refentry>
^
../xml/nm-client.xml:1263: parser error : Premature end of data in tag refentry line 7
^
../libnm-glib-docs.xml:67: element include: XInclude error : could not load ../xml/nm-client.xml, and no fallback was found
make[3]: *** [html-build.stamp] Error 6
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
| |
Some libnm-glib object properties were only documented in the
GParamSpec strings, not via gtk-doc comments, so they became
undocumented when the paramspec strings went away. Fix that.
(Also fix incorrect gtk-doc syntax with several NMClient properties.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When SELinux is disabled, getfscreatecon() fails leaving se_ctx_prev undefined
and then later freecon (se_ctx_prev) fails with a crash. Initializing
se_ctx_prev to NULL fixes the crash. (It is fine to pass NULL context to
setfscreatecon()).
Testcase:
1) Enable ifcfg-rh plugin in /etc/NetworkManger/NetworkManger.conf
plugins=ifcfg-rh
2) Edit /etc/sysconfig/selinux to contain
SELINUX=disabled
3) Reboot
4) Set hostname via nmcli, nmtui or D-Bus SaveHostname() call
5) NM crashes
https://bugzilla.redhat.com/show_bug.cgi?id=1122826
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
If no APN is specified, passing "" to ModemManager indicates that
the connection should use the default subscription APN, which the
modem and the network determine themselves. This doesn't work
with all modems and operators, but in that case the user can
specify the APN.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In commit 215306f5 [1], NetworkManager was changed to require an APN for GSM
connections; previously, an omitted APN was taken as "use the default APN
for this device".
ModemManager supports this behaviour with an empty APN string; older
NetworkManager versions support this behaviour with no APN in the
settings. Choose the older NM behaviour, for backwards compatibility.
[1] commit 215306f5a1e4dc38ec02a484c31470bb048d668b
Author: Dan Williams <dcbw@redhat.com>
Date: Mon Jan 10 23:39:12 2011 -0600
core: add AddAndActivate D-Bus method
Given connection details, complete the connection as well as possible
using the given specific object and device, add it to system
settings, and activate it all in one method.
Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
https://bugzilla.gnome.org/show_bug.cgi?id=729665
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With WWAN, the DHCP is all done in modem firmware, and never started
until we know we have a successful packet connection to the network.
Which means the modem firmware already knows the IP details and
is ready to provide them. Furthermore, since the DHCP is done on
what is essentially a reliable, wired point-to-point link, we don't
have to waste time with retransmits for dropped packets either.
|
| |
| |
| |
| |
| |
| |
| |
| | |
OtherConf implies the address has already been delivered via RA,
and possibly DNS too, meaning our IP configuration is already
good enough. If nothing on the network bothers to reply to our
DHCPv6 Information Requests, let's just run with the config
we already have instead of tearing down the whole device.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Avoid this error:
NetworkManager[25181]: <warn> (cdc-wdm1): Failed to connect 'T-Mobile Internet': Connection requested IPv4 but IPv4 is unsuported by the modem.
NetworkManager[25181]: <info> (cdc-wdm1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28]
** (NetworkManager:25181): CRITICAL **: mm_modem_simple_disconnect: assertion 'MM_IS_MODEM_SIMPLE (self)' failed
self->priv->simple_iface is only valid if stage1/prepare actually
completes, so don't try to access it if stage1/prepare failed.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Child devices shouldn't be exposed as real NMDevices (yet) since the
configuration and life cycle is controlled by the parent. We already
do this if the ip_iface is known when the child device is added, but
PPP and other transient interfaces often show up just before we know
the parent's ip_iface.
|
| |
| |
| |
| |
| | |
Do it in one place (NMModem) so that NMDeviceBt takes advantage of
the same logic that NMDeviceModem used to use.
|
| |
| |
| |
| | |
https://bugzilla.gnome.org/show_bug.cgi?id=682623
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add an 'unknown' value; make the type an enum, and rename it since
this enum is private to NetworkManager and abstracts differences
in old and new MM.
We also need separate methods for IPv4 and IPv6 since they may not
use the same mechanism. For example, IPv4 may use DHCP but IPv6 may
require static configuration, based on what the modem firmware wants.
|
| |
| |
| |
| |
| |
| | |
Not all modems support IPv6, and to prevent some common failure
cases, make sure we don't try to use IPv6 when the modem doesn't
support it.
|
| |
| |
| |
| |
| |
| | |
Add support for IPv6 to the pppd plugin and return the interface identifiers
to NetworkManager. Use those to construct the IPv6LL addresses for the
PPP interface and the peer.
|