The handling for announcing links was broken resulting in
duplicate link-added signals from platform.
Co-Authored-By: Thomas Haller <thaller@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
When adding a link, the Linux platform implementation raises the
link-changed signal synchronously. Fix the fake platform to behave identically
and also fix all the tests.
This also fixes the Linux platform tests for the most part because now the
test functions (and fake platform) behave like the Linux system
implementation.
https://bugzilla.gnome.org/show_bug.cgi?id=706293
Co-Authored-By: Thomas Haller <thaller@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Interpret environment variable NMTST_DEBUG which allows
to specify 'sudo-cmd=CMD'. If the test program calls
nmtst_reexec_sudo(), it will `exec CMD "$0" "$@"`.
Signed-off-by: Thomas Haller <thaller@redhat.com>
'inline' is needed to avoid compiler warnings about unused
functions.
Marking them only as 'inline' was simply wrong and leads to
linker errors when including the header in different translation
units.
By making them "inline static" we also don't need to foward declare the
function prototype to avoid another compiler warning.
Signed-off-by: Thomas Haller <thaller@redhat.com>
When receiving updated VPN IP configuration from the helper after the
initial connect event, the library overwrites the already initialized
GValue fields by calling g_value_init() again. This is an error and causes
the following warning:
(nm-openvpn-service:27645): GLib-GObject-WARNING **: gvalue.c:183: cannot initialize GValue with type gchararray, the value has already been initialized as gchararray
Signed-off-by: Thomas Haller <thaller@redhat.com>
ipv4.never-default, ipv4.may-fail, and ipv6.privacy were marked
INFERRABLE, but NMIP4Config / NMIP6Config didn't actually infer them,
so they could cause connections to not match themselves after a
restart.
(Found while debugging https://bugzilla.redhat.com/show_bug.cgi?id=1086237,
though this is not actually the problem there.)
Related: rh#1086237
Firewalld call addInterface() fails with ZONE_CONFLICT if the interface
is already part of another zone. This complicates the code in NM,
because we would have to keep better track of the zone in which the
interface currently is. Which might be quite difficult because
the zone might be changed from an external program (so we would have
to monitor the firewall configuration and work around potential races).
A better and simpler fix is to simply always use the changeZone() call.
This will do the right thing, regardless if the interface is already part
of a zone or not.
https://bugzilla.redhat.com/show_bug.cgi?id=1103782
Signed-off-by: Thomas Haller <thaller@redhat.com>
The firewalld removeInterface call fails with ZONE_CONFLICT when
removing an interface from a wrong zone. This can happen, when the
connection gets modified, while being active (which is related to
bgo#724041).
By not specifying any zone, we remove the interface from the zone
where it currently is added. This behavior was introduced in upstream
firewalld with commit cc3101ab70a3997228be7bc9f45a069c7fccfa36, March 2012,
r0_2_3-1.
This is the behavior we actually want and we don't have to keep proper track
of the current zone.
https://bugzilla.redhat.com/show_bug.cgi?id=1103782
Signed-off-by: Thomas Haller <thaller@redhat.com>
Renames
readline_x() to nmc_readline()
gen_func_basic() to nmc_rl_gen_func_basic()
The commit doesn't change functionality, only moves and renames the functions,
so that they can be used in other places too.
NmtMacEntry would allow you to input 1 character more than it should
have. Fix that.
Also, the code to insert ":"s automatically was bumping against some
weirdness in NmtNewtEntry that made it so that the ":" didn't get
displayed until you typed one more character after the one where it
got inserted. Hack around that by manually requesting a redraw.
https://bugzilla.gnome.org/show_bug.cgi?id=731160