all: merge branch 'th/find-backports-fixes'

This commit is contained in:
Thomas Haller 2020-09-09 08:50:48 +02:00
commit cd313a0e32
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
25 changed files with 166 additions and 64 deletions

View file

@ -325,7 +325,7 @@ static GSList *form_stack;
static GSource *keypress_source;
static gboolean
nmt_newt_form_keypress_callback (int fd,
nmt_newt_form_keypress_callback (GIOChannel *channel,
GIOCondition condition,
gpointer user_data)
{

View file

@ -9,6 +9,15 @@
<interface name="org.freedesktop.NetworkManager.WifiP2PPeer">
<annotation name="org.gtk.GDBus.C.Name" value="Wifi_P2P_Peer"/>
<!--
Name:
Device name.
Since: 1.16
-->
<property name="Name" type="s" access="read"/>
<!--
Flags:

View file

@ -108,6 +108,16 @@ static const BondDefault defaults[] = {
/*****************************************************************************/
static int
_atoi (const char *value)
{
int v;
v = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXINT, -1);
nm_assert (v >= 0);
return v;
};
/**
* nm_setting_bond_get_num_options:
* @setting: the #NMSettingBond
@ -663,21 +673,26 @@ verify (NMSetting *setting, NMConnection *connection, GError **error)
}
if (miimon == 0) {
/* updelay and downdelay can only be used with miimon */
if (g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_UPDELAY)) {
gpointer delayopt;
/* updelay and downdelay need miimon to be enabled to be valid */
delayopt = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_UPDELAY);
if (delayopt && _atoi (delayopt) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("'%s' option requires '%s' option to be set"),
_("'%s' option requires '%s' option to be enabled"),
NM_SETTING_BOND_OPTION_UPDELAY, NM_SETTING_BOND_OPTION_MIIMON);
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
return FALSE;
}
if (g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_DOWNDELAY)) {
delayopt = g_hash_table_lookup (priv->options, NM_SETTING_BOND_OPTION_DOWNDELAY);
if (delayopt && _atoi (delayopt) > 0) {
g_set_error (error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("'%s' option requires '%s' option to be set"),
_("'%s' option requires '%s' option to be enabled"),
NM_SETTING_BOND_OPTION_DOWNDELAY, NM_SETTING_BOND_OPTION_MIIMON);
g_prefix_error (error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS);
return FALSE;

View file

@ -5814,7 +5814,7 @@ fail:
gboolean
nm_utils_is_json_object (const char *str, GError **error)
{
json_t *json;
nm_auto_decref_json json_t *json = NULL;
json_error_t jerror;
g_return_val_if_fail (!error || !*error, FALSE);
@ -5851,7 +5851,6 @@ nm_utils_is_json_object (const char *str, GError **error)
return FALSE;
}
json_decref (json);
return TRUE;
}
@ -6355,7 +6354,7 @@ _nm_utils_team_link_watchers_from_variant (GVariant *value)
} else {
if (!g_variant_lookup (watcher_var, "target-host", "&s", &target_host))
goto next;
if (!g_variant_lookup (watcher_var, "init_wait", "i", &val1))
if (!g_variant_lookup (watcher_var, "init-wait", "i", &val1))
val1 = 0;
if (!g_variant_lookup (watcher_var, "interval", "i", &val2))
val2 = 0;

View file

@ -590,6 +590,15 @@ test_bond_verify (void)
test_verify_options (TRUE,
"mode", "802.3ad",
"ad_actor_system", "ae:00:11:33:44:55");
test_verify_options (TRUE,
"mode", "0",
"miimon", "0",
"updelay", "0",
"downdelay", "0");
test_verify_options (TRUE,
"mode", "0",
"downdelay", "0",
"updelay", "0");
}
static void

View file

@ -303,12 +303,13 @@ prepare_scan_options (GVariant *options)
else {
g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
g_variant_iter_init (&iter, options);
while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
while (g_variant_iter_loop (&iter, "{&sv}", &key, &value))
{
// FIXME: verify options here?
g_variant_builder_add (&builder, "{sv}", key, value);
}
variant = g_variant_builder_end (&builder);
nm_g_variant_unref_floating (options);
}
return variant;
}
@ -324,7 +325,7 @@ _device_wifi_request_scan (NMDeviceWifi *device,
g_return_val_if_fail (NM_IS_DEVICE_WIFI (device), FALSE);
variant = prepare_scan_options (options);
variant = prepare_scan_options (g_steal_pointer (&options));
ret = nmdbus_device_wifi_call_request_scan_sync (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,
variant,
@ -414,10 +415,10 @@ request_scan_cb (GObject *source,
static void
_device_wifi_request_scan_async (NMDeviceWifi *device,
GVariant *options,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
GVariant *options,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (device);
RequestScanInfo *info;
@ -436,6 +437,8 @@ _device_wifi_request_scan_async (NMDeviceWifi *device,
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
g_simple_async_result_complete_in_idle (simple);
g_object_unref (simple);
if (options)
nm_g_variant_unref_floating (options);
return;
}
@ -443,7 +446,7 @@ _device_wifi_request_scan_async (NMDeviceWifi *device,
info->device = device;
info->simple = simple;
variant = prepare_scan_options (options);
variant = prepare_scan_options (g_steal_pointer (&options));
priv->scan_info = info;
nmdbus_device_wifi_call_request_scan (NM_DEVICE_WIFI_GET_PRIVATE (device)->proxy,

View file

@ -1141,7 +1141,7 @@ activate_failed_cb (GObject *object,
NMActiveConnection *ac;
GError *error = NULL;
ac = nm_client_activate_connection_finish (client, result, &error);
ac = nm_client_add_and_activate_connection_finish (client, result, &error);
g_assert (ac == NULL);
g_assert_error (error, NM_CLIENT_ERROR, NM_CLIENT_ERROR_OBJECT_CREATION_FAILED);
g_clear_error (&error);

View file

@ -232,6 +232,14 @@ NM_AUTO_DEFINE_FCN0 (GError *, gs_local_free_error, g_error_free)
#define gs_unref_keyfile nm_auto(gs_local_keyfile_unref)
NM_AUTO_DEFINE_FCN0 (GKeyFile *, gs_local_keyfile_unref, g_key_file_unref)
/**
* gs_free_option_context:
*
* Call g_option_context_free() on a variable location when it goes out of scope.
*/
#define gs_free_option_context nm_auto(gs_local_option_context)
NM_AUTO_DEFINE_FCN0 (GOptionContext *, gs_local_option_context, g_option_context_free);
/*****************************************************************************/
#include "nm-glib.h"

View file

@ -2095,6 +2095,17 @@ nm_utils_buf_utf8safe_escape_bytes (GBytes *bytes, NMUtilsStrUtf8SafeFlags flags
return nm_utils_buf_utf8safe_escape (p, l, flags, to_free);
}
char *
nm_utils_buf_utf8safe_escape_cp (gconstpointer buf, gssize buflen, NMUtilsStrUtf8SafeFlags flags)
{
const char *s_const;
char *s;
s_const = nm_utils_buf_utf8safe_escape (buf, buflen, flags, &s);
nm_assert (!s || s == s_const);
return s ?: g_strdup (s_const);
}
/*****************************************************************************/
const char *

View file

@ -860,6 +860,7 @@ typedef enum {
} NMUtilsStrUtf8SafeFlags;
const char *nm_utils_buf_utf8safe_escape (gconstpointer buf, gssize buflen, NMUtilsStrUtf8SafeFlags flags, char **to_free);
char *nm_utils_buf_utf8safe_escape_cp (gconstpointer buf, gssize buflen, NMUtilsStrUtf8SafeFlags flags);
const char *nm_utils_buf_utf8safe_escape_bytes (GBytes *bytes, NMUtilsStrUtf8SafeFlags flags, char **to_free);
gconstpointer nm_utils_buf_utf8safe_unescape (const char *str, gsize *out_len, gpointer *to_free);

View file

@ -550,6 +550,9 @@ ip_ifindex_changed_cb (NMModem *modem, GParamSpec *pspec, gpointer user_data)
{
NMDevice *device = NM_DEVICE (user_data);
if (!nm_device_is_activating (device))
return;
if (!nm_device_set_ip_ifindex (device,
nm_modem_get_ip_ifindex (modem))) {
nm_device_state_changed (device,

View file

@ -188,7 +188,6 @@ acd_event (GIOChannel *source, GIOCondition condition, gpointer data)
AddressInfo *info;
gboolean emit_probe_terminated = FALSE;
char address_str[INET_ADDRSTRLEN];
gs_free char *hwaddr_str = NULL;
int r;
if (n_acd_dispatch (self->acd))
@ -197,6 +196,7 @@ acd_event (GIOChannel *source, GIOCondition condition, gpointer data)
while ( !n_acd_pop_event (self->acd, &event)
&& event) {
char to_string_buffer[ACD_EVENT_TO_STRING_BUF_SIZE];
gs_free char *hwaddr_str = NULL;
gboolean check_probing_done = FALSE;
switch (event->event) {

View file

@ -13390,7 +13390,7 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo
return TRUE;
/* A for-user-request, is effectively the same as pretending
* that user-dbus flag is cleared. */
* that user-explicit flag is cleared. */
mask |= NM_UNMANAGED_USER_EXPLICIT;
flags &= ~NM_UNMANAGED_USER_EXPLICIT;
}
@ -13442,6 +13442,9 @@ _get_managed_by_flags(NMUnmanagedFlags flags, NMUnmanagedFlags mask, gboolean fo
* nm_device_get_managed:
* @self: the #NMDevice
* @for_user_request: whether to check the flags for an explicit user-request
* Setting this to %TRUE has the same effect as if %NM_UNMANAGED_USER_EXPLICIT
* unmanaged flag would be unset (meaning: explicitly not-unmanaged).
* If this parameter is %TRUE, the device can only appear more managed.
*
* Whether the device is unmanaged according to the unmanaged flags.
*
@ -14011,13 +14014,17 @@ _nm_device_check_connection_available (NMDevice *self,
return FALSE;
}
if (state < NM_DEVICE_STATE_UNAVAILABLE) {
if (!nm_device_get_managed (self, TRUE)) {
if (!nm_device_get_managed (self, FALSE)) {
if (nm_device_get_managed (self, FALSE)) {
/* device is managed, both for user-requests and non-user-requests alike. */
} else {
if (!nm_device_get_managed (self, TRUE)) {
/* device is strictly unmanaged by authoritative unmanaged reasons. */
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_UNMANAGED_DEVICE,
"device is strictly unmanaged");
return FALSE;
}
if (!NM_FLAGS_HAS (flags, _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST_OVERRULE_UNMANAGED)) {
/* device could be managed for an explict user-request, but this is not such a request. */
nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_UNMANAGED_DEVICE,
"device is currently unmanaged");
return FALSE;

View file

@ -400,6 +400,23 @@ lldp_neighbor_equal (LldpNeighbor *a, LldpNeighbor *b)
if (!nm_streq (a->attrs[attr_id].v_string, b->attrs[attr_id].v_string))
return FALSE;
break;
case LLDP_ATTR_TYPE_VARDICT:
if (!g_variant_equal (a->attrs[attr_id].v_variant, b->attrs[attr_id].v_variant))
return FALSE;
break;
case LLDP_ATTR_TYPE_ARRAY_OF_VARDICTS: {
NMCListElem *itr_a, *itr_b;
if (c_list_length (&a->attrs[attr_id].v_variant_list) != c_list_length (&b->attrs[attr_id].v_variant_list))
return FALSE;
itr_b = c_list_first_entry (&b->attrs[attr_id].v_variant_list, NMCListElem, lst);
c_list_for_each_entry (itr_a, &a->attrs[attr_id].v_variant_list, lst) {
if (!g_variant_equal (itr_a->data, itr_b->data))
return FALSE;
itr_b = c_list_entry (&itr_b->lst, NMCListElem, lst);
}
break;
}
default:
nm_assert (a->attrs[attr_id].attr_type == LLDP_ATTR_TYPE_NONE);
break;
@ -532,7 +549,8 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
case SD_LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME:
case SD_LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED:
case SD_LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT:
neigh->chassis_id = g_strndup ((const char *) chassis_id, chassis_id_len);
neigh->chassis_id = nm_utils_buf_utf8safe_escape_cp (chassis_id, chassis_id_len, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL | NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII)
?: g_new0 (char, 1);
break;
case SD_LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS:
neigh->chassis_id = nm_utils_hwaddr_ntoa (chassis_id, chassis_id_len);
@ -548,7 +566,8 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
case SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME:
case SD_LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED:
case SD_LLDP_PORT_SUBTYPE_PORT_COMPONENT:
neigh->port_id = strndup ((char *) port_id, port_id_len);
neigh->port_id = nm_utils_buf_utf8safe_escape_cp (port_id, port_id_len, NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_CTRL | NM_UTILS_STR_UTF8_SAFE_FLAG_ESCAPE_NON_ASCII)
?: g_new0 (char, 1);
break;
case SD_LLDP_PORT_SUBTYPE_MAC_ADDRESS:
neigh->port_id = nm_utils_hwaddr_ntoa (port_id, port_id_len);

View file

@ -90,7 +90,7 @@ main (int argc, char *argv[])
{ G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining, NULL, NULL },
{ NULL }
};
GOptionContext *option_context;
gs_free_option_context GOptionContext *option_context = NULL;
GError *error = NULL;
int errsv;

View file

@ -245,7 +245,7 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
/* DNS information */
ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_RDNSS) {
static struct in6_addr *addr;
struct in6_addr *addr;
int addr_index;
ndp_msg_opt_rdnss_for_each_addr (addr, addr_index, msg, offset) {
@ -274,7 +274,7 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
NMNDiscDNSDomain dns_domain = {
.domain = domain,
.timestamp = now,
.lifetime = ndp_msg_opt_rdnss_lifetime (msg, offset),
.lifetime = ndp_msg_opt_dnssl_lifetime (msg, offset),
};
/* Pad the lifetime somewhat to give a bit of slack in cases

View file

@ -1006,7 +1006,9 @@ parent_state_cb (NMActiveConnection *parent_ac,
return;
unwatch_parent (self, TRUE);
g_signal_emit (self, signals[PARENT_ACTIVE], 0, parent_ac);
if (parent_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED)
g_signal_emit (self, signals[PARENT_ACTIVE], 0, parent_ac);
}
static void

View file

@ -618,6 +618,8 @@ _iovec_set_string (struct iovec *iov, const char *str)
_iovec_set (iov, str, strlen (str));
}
#define _iovec_set_string_literal(iov, str) _iovec_set ((iov), ""str"", NM_STRLEN (str))
_nm_printf (3, 4)
static void
_iovec_set_format (struct iovec *iov, gpointer *iov_free, const char *format, ...)
@ -737,8 +739,7 @@ _nm_log_impl (const char *file,
case LOG_BACKEND_JOURNAL:
{
gint64 now, boottime;
#define _NUM_MAX_FIELDS_SYSLOG_FACILITY 10
struct iovec iov_data[12 + _NUM_MAX_FIELDS_SYSLOG_FACILITY];
struct iovec iov_data[15];
struct iovec *iov = iov_data;
gpointer iov_free_data[5];
gpointer *iov_free = iov_free_data;
@ -753,12 +754,10 @@ _nm_log_impl (const char *file,
_iovec_set_format_a (iov++, 30, "SYSLOG_PID=%ld", (long) getpid ());
{
const LogDesc *diter;
int i_domain = _NUM_MAX_FIELDS_SYSLOG_FACILITY;
const char *s_domain_1 = NULL;
NMLogDomain dom_all = domain;
NMLogDomain dom = dom_all & cur_log_state[level];
for (diter = &domain_desc[0]; diter->name; diter++) {
for (diter = &domain_desc[0]; dom_all != 0 && diter->name; diter++) {
if (!NM_FLAGS_ANY (dom_all, diter->num))
continue;
@ -776,23 +775,14 @@ _nm_log_impl (const char *file,
g_string_append_c (s_domain_all, ',');
g_string_append (s_domain_all, diter->name);
}
if (NM_FLAGS_ANY (dom, diter->num)) {
if (i_domain > 0) {
/* SYSLOG_FACILITY is specified multiple times for each domain that is actually enabled. */
_iovec_set_format_str_a (iov++, 30, "SYSLOG_FACILITY=%s", diter->name);
i_domain--;
}
dom &= ~diter->num;
}
if (!dom && !dom_all)
break;
}
if (s_domain_all)
_iovec_set (iov++, s_domain_all->str, s_domain_all->len);
else
_iovec_set_format_str_a (iov++, 30, "NM_LOG_DOMAINS=%s", s_domain_1);
}
G_STATIC_ASSERT_EXPR (LOG_FAC (LOG_DAEMON) == 3);
_iovec_set_string_literal (iov++, "SYSLOG_FACILITY=3");
_iovec_set_format_str_a (iov++, 15, "NM_LOG_LEVEL=%s", level_desc[level].name);
if (func)
_iovec_set_format (iov++, iov_free++, "CODE_FUNC=%s", func);
@ -907,7 +897,7 @@ nm_log_handler (const char *log_domain,
"MESSAGE=%s%s", gl.imm.prefix, message ?: "",
syslog_identifier_full (gl.imm.syslog_identifier),
"SYSLOG_PID=%ld", (long) getpid (),
"SYSLOG_FACILITY=GLIB",
"SYSLOG_FACILITY=3",
"GLIB_DOMAIN=%s", log_domain ?: "",
"GLIB_LEVEL=%d", (int) (level & G_LOG_LEVEL_MASK),
"TIMESTAMP_MONOTONIC=%lld.%06lld", (long long) (now / NM_UTILS_NS_PER_SECOND), (long long) ((now % NM_UTILS_NS_PER_SECOND) / 1000),

View file

@ -4875,6 +4875,27 @@ _new_active_connection (NMManager *self,
device);
}
static gboolean
active_connection_master_changed (NMActiveConnection *ac)
{
NMConnection *applied, *connection;
NMSettingsConnection *settings;
NMSettingConnection *s_con1, *s_con2;
applied = nm_active_connection_get_applied_connection (ac);
settings = nm_active_connection_get_settings_connection (ac);
connection = nm_settings_connection_get_connection (settings);
if (applied == connection)
return FALSE;
s_con1 = nm_connection_get_setting_connection (applied);
s_con2 = nm_connection_get_setting_connection (connection);
return !nm_streq0 (nm_setting_connection_get_master (s_con1),
nm_setting_connection_get_master (s_con2));
}
static void
_internal_activation_auth_done (NMManager *self,
NMActiveConnection *active,
@ -4884,6 +4905,7 @@ _internal_activation_auth_done (NMManager *self,
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (self);
NMActiveConnection *ac;
gs_free_error GError *error = NULL;
NMActivationReason reason;
nm_assert (NM_IS_ACTIVE_CONNECTION (active));
@ -4895,13 +4917,20 @@ _internal_activation_auth_done (NMManager *self,
* We also check this earlier, but there we may fail to detect a duplicate
* if the existing active connection was undergoing authorization.
*/
if (NM_IN_SET (nm_active_connection_get_activation_reason (active), NM_ACTIVATION_REASON_EXTERNAL,
NM_ACTIVATION_REASON_ASSUME,
NM_ACTIVATION_REASON_AUTOCONNECT)) {
reason = nm_active_connection_get_activation_reason (active);
if (NM_IN_SET (reason, NM_ACTIVATION_REASON_EXTERNAL,
NM_ACTIVATION_REASON_ASSUME,
NM_ACTIVATION_REASON_AUTOCONNECT,
NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES)) {
c_list_for_each_entry (ac, &priv->active_connections_lst_head, active_connections_lst) {
if ( nm_active_connection_get_device (ac) == nm_active_connection_get_device (active)
&& nm_active_connection_get_settings_connection (ac) == nm_active_connection_get_settings_connection (active)
&& nm_active_connection_get_state (ac) <= NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
if ( reason == NM_ACTIVATION_REASON_AUTOCONNECT_SLAVES
&& active_connection_master_changed (ac))
break;
g_set_error (&error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE,

View file

@ -1626,16 +1626,6 @@ static const NMDBusInterfaceInfoExtended interface_info_agent_manager = {
),
.handle = impl_agent_manager_register_with_capabilities,
),
NM_DEFINE_DBUS_METHOD_INFO_EXTENDED (
NM_DEFINE_GDBUS_METHOD_INFO_INIT (
"RegisterWithCapabilities",
.in_args = NM_DEFINE_GDBUS_ARG_INFOS (
NM_DEFINE_GDBUS_ARG_INFO ("identifier", "s"),
NM_DEFINE_GDBUS_ARG_INFO ("capabilities", "u"),
),
),
.handle = impl_agent_manager_register_with_capabilities,
),
NM_DEFINE_DBUS_METHOD_INFO_EXTENDED (
NM_DEFINE_GDBUS_METHOD_INFO_INIT (
"Unregister",

View file

@ -838,8 +838,7 @@ parse_route_line (const char *line,
.int_base_16 = TRUE,
.ignore = (addr_family != AF_INET), },
[PARSE_LINE_ATTR_ROUTE_ONLINK] = { .key = NM_IP_ROUTE_ATTRIBUTE_ONLINK,
.type = PARSE_LINE_TYPE_FLAG,
.ignore = (addr_family != AF_INET), },
.type = PARSE_LINE_TYPE_FLAG, },
[PARSE_LINE_ATTR_ROUTE_WINDOW] = { .key = NM_IP_ROUTE_ATTRIBUTE_WINDOW,
.type = PARSE_LINE_TYPE_UINT32_WITH_LOCK, },
[PARSE_LINE_ATTR_ROUTE_CWND] = { .key = NM_IP_ROUTE_ATTRIBUTE_CWND,
@ -1613,7 +1612,7 @@ make_ip4_setting (shvarFile *ifcfg,
g_object_set (s_ip4,
NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME, svGetValueBoolean (ifcfg, "DHCP_SEND_HOSTNAME", TRUE),
NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXINT32, 0),
NM_SETTING_IP_CONFIG_DHCP_TIMEOUT, (int) svGetValueInt64 (ifcfg, "IPV4_DHCP_TIMEOUT", 10, 0, G_MAXINT32, 0),
NULL);
nm_clear_g_free (&value);
@ -2302,7 +2301,7 @@ make_tc_setting (shvarFile *ifcfg)
NMTCTfilter *tfilter = NULL;
gs_free char *value_to_free = NULL;
const char *value = NULL;
GError *local = NULL;
gs_free_error GError *local = NULL;
value = svGetValueStr (ifcfg, numbered_tag (tag, "FILTER", i), &value_to_free);
if (!value)

View file

@ -1949,6 +1949,8 @@ write_connection_setting (NMSettingConnection *s_con, shvarFile *ifcfg)
svSetValueStr (ifcfg, "BRIDGE", NULL);
svSetValueStr (ifcfg, "TEAM_MASTER_UUID", NULL);
svSetValueStr (ifcfg, "TEAM_MASTER", NULL);
svSetValueStr (ifcfg, "OVS_PORT_UUID", NULL);
svSetValueStr (ifcfg, "OVS_PORT", NULL);
master = nm_setting_connection_get_master (s_con);
if (master) {

View file

@ -1421,6 +1421,13 @@ svWriteFile (shvarFile *s, int mode, GError **error)
return FALSE;
}
f = fdopen (tmpfd, "w");
if (!f) {
errsv = errno;
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errsv),
"Internal error writing file '%s': %s",
s->fileName, nm_strerror_native (errsv));
return FALSE;
}
fseek (f, 0, SEEK_SET);
c_list_for_each (current, &s->lst_head) {
const shvarLine *line = c_list_entry (current, shvarLine, lst);

View file

@ -849,8 +849,8 @@ nm_supplicant_config_add_setting_wireless_security (NMSupplicantConfig *self,
}
}
/* Don't try to enable PMF on non-WPA networks */
if (!NM_IN_STRSET (key_mgmt, "wpa-eap", "wpa-psk"))
/* Don't try to enable PMF on non-WPA/SAE networks */
if (!NM_IN_STRSET (key_mgmt, "wpa-eap", "wpa-psk", "sae"))
pmf = NM_SETTING_WIRELESS_SECURITY_PMF_DISABLE;
/* Check if we actually support PMF */

View file

@ -431,7 +431,6 @@ test_wifi_sae_psk (const char *psk)
NMTST_EXPECT_NM_INFO ("Config: added 'proto' value 'RSN'");
NMTST_EXPECT_NM_INFO ("Config: added 'pairwise' value 'TKIP CCMP'");
NMTST_EXPECT_NM_INFO ("Config: added 'group' value 'TKIP CCMP'");
NMTST_EXPECT_NM_INFO ("Config: added 'ieee80211w' value '0'");
config_dict = build_supplicant_config (connection, 1500, 0, TRUE, TRUE);
g_test_assert_expected_messages ();