platform: sanitize a boolean property

Make sure NMPlatformGreProperties->path_mtu_discovery is always TRUE
or FALSE, even if the value from the kernel is "2" or "16" or
something. (This makes it consistent with what we do for other boolean
netlink properties.)
platform: fix macvlan flags checking

You can't do an #ifdef on an enum value, so we were actually never
requesting IFLA_MACVLAN_FLAGS.
platform: log warnings if macvlan/gre property reads fail
core: add nm_platform_link_refresh() function to refresh the libnl cache for links

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: fix waiting for bringing up/taking down device

This fixes a regression introduced in 5074898591ae99f79b0cc4872c3c7cf018abee82.
The while loop did only refetch the cached value (because the glib main loop
was blocked and only the cached device flags were checked).

Also, instead on relying of g_usleep(), wait until a maximum time of waiting
is expired. The duration of g_usleep() might not be very accurate.

Also, do no longer check the cached device state before setting the
device flag. The cache might be out of date, so we just set the flag.

https://bugzilla.gnome.org/show_bug.cgi?id=724363

Signed-off-by: Thomas Haller <thaller@redhat.com>
core: minor fix to ensure we call platform functions with positive ifindex

Actually, get_ip_ifindex() should always return 0 or > 0. Just in case,
be extra careful and modify the conditions.

Signed-off-by: Thomas Haller <thaller@redhat.com>
cli: allow resetting the connection.master to NULL

Without this patch, the following two commands fail:
  nmcli connection modify em1 connection.master
  nmcli connection modify em1 connection.master ""

Signed-off-by: Thomas Haller <thaller@redhat.com>
docs: use %TRUE, %FALSE macros instead of plain TRUE, FALSE values for gtkdoc
rdisc: fix invalid cast when printing addresses in config_changed()

Signed-off-by: Thomas Haller <thaller@redhat.com>
rdisc: print gateway for routes in rdisc debugging output

Signed-off-by: Thomas Haller <thaller@redhat.com>
platform: align debugging output in platform signals

Signed-off-by: Thomas Haller <thaller@redhat.com>
replace snprintf by g_snprintf

Use the glib wrapper for snprintf.

Signed-off-by: Thomas Haller <thaller@redhat.com>
trivial: fix whitespace

Signed-off-by: Thomas Haller <thaller@redhat.com>
platform: share the static buffer for platform to_string functions

Signed-off-by: Thomas Haller <thaller@redhat.com>
trivial: rename function in platform

To make the name analog to init_ip4_address, etc. which start with
init_*.

Signed-off-by: Thomas Haller <thaller@redhat.com>
settings: free memory in finalize(), not in dispose() in NMSecretAgent (rh #1061911)

Even if the code changed in master compared to the bug report, the issues would
still occur when we freed members in dispose.

https://bugzilla.redhat.com/show_bug.cgi?id=1061911
libnm-util: fix verify_identity() in '802-1x' setting

We need to return FALSE on error, otherwise we pile GErrors and assert in
nm_setting_verify().
platform: downgrade error logging about NLE_DUMP_INTR on event socket

Such a failure can happen easily, because we now request an initial dump
to get AF_INET6 addresses in order to check for extended ifa flags support.

This is not critical, so downgrade the error log.

Signed-off-by: Thomas Haller <thaller@redhat.com>
libnm-util: fix adding values to 'phase2-altsubject-matches'

It was mixed up with 'altsubject-matches'.
firewall: ignore UNKNOWN_INTERFACE errors

If the firewall didn't know about the interface, don't log errors
about it because there's nothing NM can do.  Also, sometimes NM
sends the not-IP interface, like when disconnecting WWAN when the
PPP interface is already gone.