All current users of NM_IN_SET() would rather use short-circuit evalation
(or don't care). It seems that doing it by default seems favorable.
The only downside is, that this might have somewhat unexpected behavior
to a user who expects a regular function (which would evaluate always
all arguments).
Fixes: 7860ef959a
The config-tests contain a NMTestDevice which derives from NMDevice.
However, for testing, it just skips the constructor and destructor of
NMDevice. This caused also the destructors of NMExportedObject to be skipped
and thus valgrind complained about leaked memory.
Fixes: 6fcc1deee0
Calling ethtool on a non-existing interface name, might cause
the loading of a kernel module. Avoid that, by checking first
whether such an interface exists.
https://bugzilla.redhat.com/show_bug.cgi?id=1247156
ethtool may cause the auto-loading of a kernel module for non-existing
interface-names. Avoid that by checking whether such an interface exists.
This is inherently racy.
Performing an ioctl on a non existent device may cause the automatic
load of a kernel module if the device name matches a module
alias. Check if the device actually exists before calling the ioctl.
For delete-events, we only need a shallow object with the key fields
set. That sufficies to lookup in the cache and find the object to
delete.
One other issue is that _nmp_vt_cmd_plobj_init_from_nl_link() and
link_extract_type() might call to ethtool for the already deleted
instance. Just avoid that.
https://bugzilla.redhat.com/show_bug.cgi?id=1247156
Move the check for a platform link before devtimeout_from_file(). The
check in the platform cache should be more performant and yield success
in most cases.
This can save reading and parsing the ifcfg-rh file.
If NIC related initialization takes a long time in udev processing, but we have
an ifindex from kernel, we still want to wait until udev is finished and the
device is really usable.
Check that by calling nm_platform_link_get_by_ifname() and checking @initialized,
which means udev is finished.
Based on a patch by t-nishimura@hf.jp.nec.com
Improved by thaller@redhat.comhttps://bugzilla.redhat.com/show_bug.cgi?id=1192633
Port the remaining parts of src/ to gdbus.
(Note that most of the individual commits on this branch do not
compile; they are split up for ease of comprehension, but all depend
on each other.)
https://bugzilla.gnome.org/show_bug.cgi?id=622927
Add --without-libnm-glib, for people who don't want to build the
legacy client libraries. When building with this option, dbus-glib and
libdbus are not required.
Port remaining bits to gdbus and remove stray dbus-glib references
Drop the dbus-glib version check from configure, since nothing depends
on new dbus-glib any more.
Move nm-dbus-glib-types.h and nm-gvaluearray-compat.h from include/ to
libnm-util/ since they are now only used by libnm-util and libnm-glib.
The existing code was somewhat confusing because it used
string->GValue hash tables in some places, and string->string hash
tables in other places. In the new version, the string->GValue hash
tables become GVariants, but the string->string hash tables stay as
hash tables, so you can tell them apart more easily.
Port NMExportedObject to gdbus, and make
nm_exported_object_class_add_interface() deal with generating D-Bus
skeleton objects and attaching signal handlers and property bindings
as needed to properly handle methods, signals, and properties.
Rename nm_manager_new() to nm_manager_setup(), and change the local
@singleton variable to @singleton_instance. (Also, add a local @self
variable inside nm_manager_setup().)
Also, make NMManager own NMSettings rather than having them both owned
by main().
NM was calling nm_bus_manager_start_service() to claim its bus name
before it exported any of its objects, but this didn't matter under
dbus-glib, because no client connections would be accepted until the
main loop was started later on, by which point we would have exported
everything.
But with gdbus, method calls are initially received in the gdbus
worker thread, which means that clients would be able to connect right
away and then be told that the expected interfaces don't exist.
So move the nm_bus_manager_start_service() call to occur after
creating NMSettings and NMManager (and, indirectly, NMAgentManager).
This requires splitting out the slow parts of nm_settings_new() into a
new nm_settings_start(), so that we can create and export it first,
and then read the connections, etc afterward. (Likewise, there were
still a few potentially-slow bits in nm_manager_new() which are now
moved into nm_manager_start().)
NMManager was failing to initialize if there was only a private bus,
despite the fact that this is exactly the use case that the private
bus was added for.
The only other potentially-failing code in nm_manager_new() was adding
prop_filter to the D-Bus connection, but this can't really fail, so
just assert that it doesn't. And now, nm_manager_new() always
succeeds, so update the caller for that.
If !HAVE_LIBAUDIT then sizeof(NMAuditManagerPrivate) was 0, which
upset g_type_class_add_private(). (It's also not valid C.)
Fix things up so that NMAuditManagerPrivate as a whole only exists if
HAVE_LIBAUDIT.
During merge_and_apply(), we merge several NMIPxConfig into a new
@composite. For 'ignore-auto-routes' and 'ignore-auto-dns', we want to
prevent certain routes/dns-settings to be merged.
But it is wrong to reject settings from all partial configs.
For example, especially ext_ipx_config and vpn_ipx_config contain
routes that we still must merge and preserve.
This was recently changed by 79630c11e5
and previously by ab6548c62134518ba2871306397e7fb9c84260ca. But it was
wrong for a long time already.
Also note, that nm_ip4_config_merge() now also ignores NIS, WINS, and
dns-options.
https://bugzilla.gnome.org/show_bug.cgi?id=752546
Fixes: 79630c11e5
The new flags are not yet used, so there is no change in functionality.
The flags NM_IP_CONFIG_MERGE_NO_ROUTES and NM_IP_CONFIG_MERGE_NO_DNS go
together with the 'ignore-auto-routes' and 'ignore-auto-dns' setting.
Note that for IPv4, NM_IP_CONFIG_MERGE_NO_DNS also ignores NIS, WINS, and dns-options.
This is different from current other places that handle 'ignore-auto-dns'
and only care about nameservers, domains, and searches.
If linklocal6_start() finds that the device already has an IPv6
link-local address and returns NM_ACT_STAGE_RETURN_FINISH, we don't
need to fill @out_config with an empty configuration. A non-NULL
@out_config is required only for ret = NM_ACT_STAGE_RETURN_SUCCESS.
Fixes: 396dc2b3b4
The default SELinux policy on current RHEL and Fedora distributions
does not allow for NetworkManager to use audit. Hence, unless the user
changes the SELinux policy it will not work.
Disable auditing by default, but have it compiled so that the user can
enable it via "NetworkManager.conf".