"g_assert_cmpint (x, ==, y)" is nicer than "g_assert (x == y)",
because if it fails, it shows you the values of x and y in the assert
message. Likewise g_assert_cmpstr().
The "ifindex > 0" checks still just use g_assert(), since we don't
need to distinguish specific negative values there.
nm_setting_to_hash() would return NULL if the setting had entirely
default values, but this effectively meant that you could never have a
connection whose "connection type" setting (eg, NMSettingWired) had
all default values. (This ended up not usually being a problem in
practice because most such settings had at least one property with a
mandatory string value where the GObject property had a default value
of NULL.)
However, NMSettingGeneric will have no properties, so it would always
get stripped out when converting to a hash, invalidating the
connection. Fix that.
In some cases, callers don't need to distinguish, eg,
ip4-address-added from ip6-address-added, but just need to know what
device the event occurred on. Make this simpler by including the
ifindex as a separate explicit argument, allowing callers to just
ignore the struct part.
If a device becomes unmanaged or unavailable (eg, due to loss of carrier, becoming
unmanaged, rfkilled, supplicant crashing, etc), the ActiveConnection would simply
set state to UNKNOWN and the Manager wouldn't tear it down and remove it from the
ActiveConnections property list. Instead, these states should be treated the same
as if the device was deactivated cleanly so that the AC will accurately reflect
the device state and the Manager will clean the AC up.
Fixes comment #12 in:
https://bugzilla.gnome.org/show_bug.cgi?id=676285
If there are no slaves after the timeout, exit nmcli with an error, assuming
that NM is waiting for slaves to finish activation:
"(bondx) "IPv4 config waiting until slaves are ready"
"(bondx) "IPv6 config waiting until slaves are ready"
Which it does whenever the 'bonding' module gets loaded no matter
what name the user wants to give the new bond interface.
Ported nm-system fix from commit 7cc95d8, using system() to avoid
dependency on NM libs.
Automatic test included. You have to run 'rmmod bonding' before testing
to ensure that the module is not already inserted. Second run without
rmmod always succeeds.
Some distributions (Debian and Ubuntu in particular) will soon use systemd's
logind, but not its init part. Check for a recent enough "libsystemd-login"
version instead of "systemd", as suspend/resume and inhibitors are all in
logind.
https://bugzilla.gnome.org/show_bug.cgi?id=698947
DocBook is not my favorite thing in the world, but it's
<lots-of-emphasis>far</lots-of-emphasis> saner than troff. Some style
parts cribbed from systemd.
This is preparatory work for actually improving the content of the
man pages.
get_virtual_iface_name() returns an allocated interface name which
we must free; that wasn't being done when attempting to find the
interface for which a virtual interface needs to be created. Also
throw in a cleanup for the given-device-doesn't-exist case just to
make it clearer when the interface name is freed.
When 'connection' and 'new_connection' arguments are the same object make the
function no-op and simply return true. Otherwise 'connection's settings are
removed, making it invalid.
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
If a SOURCES variable changes, we need to recheck the generated files,
since a file may have been removed from SOURCES, but still be
referenced in a previously-generated -enum-types.c file, etc. So make
these generated files depend on Makefile.
Also, update spacing of silent rules to match current automake.
The various need_secrets() implementation do allocate a fresh GPtrArray, but
add static strings to them without dup'ing. Thus callers must _not_ free the
array elements, only the array itself. Adjust documentation and annotations
accordingly.
Also adjust the corresponding comment in the goi-list-connections.py example.
https://bugzilla.gnome.org/show_bug.cgi?id=698175
Use the correct annotation for vfuncs, so that NMClient.SecretAgent becomes
introspectable.
Use "self" as the first argument of the vfuncs in their declarations, to match
the actual name in nm-secret-agent.c. This avoids warnings from g-ir-scanner.
https://bugzilla.gnome.org/show_bug.cgi?id=698184
Convenience function to replace settings in one conneciton with settings
from another, without having to go through the nm_connection_to_hash()
steps, which are just inefficient and kinda pointless.