diff options
| author | Michael Biebl <biebl@debian.org> | 2025-08-01 19:15:13 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2025-08-01 19:15:13 +0200 |
| commit | 7e9091a5960f67a84787c03153324915220e4816 (patch) | |
| tree | dc743de962532932ebc3b4ed3a36ddd093d97d68 /src | |
| parent | 582eb4472a0f3375042afb9026cbeb50e058a27d (diff) | |
New upstream version 1.54.0 upstream/1.54.0
Diffstat (limited to 'src')
140 files changed, 6005 insertions, 3070 deletions
diff --git a/src/contrib/nm-vpn-editor-plugin-call.h b/src/contrib/nm-vpn-editor-plugin-call.h index 2f3eb074..2f6820af 100644 --- a/src/contrib/nm-vpn-editor-plugin-call.h +++ b/src/contrib/nm-vpn-editor-plugin-call.h @@ -11,7 +11,7 @@ * * This uses the NMVpnEditorPluginVT and allows a user (nm-applet) * to directly communicate with a VPN plugin using API that is newer - * then the current libnm version. That is, it allows to call to a VPN + * then the current libnm version. That is, it allows a user to call to a VPN * plugin bypassing libnm. */ #include <NetworkManager.h> diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c index 6c9e2f3d..32df3d6d 100644 --- a/src/core/NetworkManagerUtils.c +++ b/src/core/NetworkManagerUtils.c @@ -1509,7 +1509,6 @@ nm_utils_ip_route_attribute_to_platform(int addr_family, GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITCWND, r->initcwnd, UINT32, uint32, 0); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITRWND, r->initrwnd, UINT32, uint32, 0); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_MTU, r->mtu, UINT32, uint32, 0); - GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_RTO_MIN, r->rto_min, UINT32, uint32, 0); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_QUICKACK, r->quickack, BOOLEAN, boolean, FALSE); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW, r->lock_window, BOOLEAN, boolean, FALSE); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND, r->lock_cwnd, BOOLEAN, boolean, FALSE); @@ -1518,6 +1517,18 @@ nm_utils_ip_route_attribute_to_platform(int addr_family, GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_MTU, r->lock_mtu, BOOLEAN, boolean, FALSE); GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_ADVMSS, r->lock_mss, BOOLEAN, boolean, FALSE); + { + GVariant *_variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_RTO_MIN); + + if (_variant && g_variant_is_of_type(_variant, G_VARIANT_TYPE_UINT32)) { + r->rto_min = g_variant_get_uint32(_variant); + r->rto_min_set = TRUE; + } else { + r->rto_min = 0; + r->rto_min_set = FALSE; + } + } + if ((variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_SRC)) && g_variant_is_of_type(variant, G_VARIANT_TYPE_STRING)) { if (inet_pton(addr_family, g_variant_get_string(variant, NULL), &addr) == 1) { diff --git a/src/core/devices/nm-device-bond.c b/src/core/devices/nm-device-bond.c index 53b32466..673d2361 100644 --- a/src/core/devices/nm-device-bond.c +++ b/src/core/devices/nm-device-bond.c @@ -137,13 +137,13 @@ _set_bond_attr(NMDevice *device, const char *attr, const char *value) return ret; } -#define _set_bond_attr_take(device, attr, value) \ - G_STMT_START \ - { \ - gs_free char *_tmp = (value); \ - \ - _set_bond_attr(device, NM_SETTING_BOND_OPTION_ARP_IP_TARGET, _tmp); \ - } \ +#define _set_bond_attr_take(device, attr, value) \ + G_STMT_START \ + { \ + gs_free char *_tmp = (value); \ + \ + _set_bond_attr(device, attr, _tmp); \ + } \ G_STMT_END #define _set_bond_attr_printf(device, attr, fmt, ...) \ @@ -902,7 +902,7 @@ reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_ne mode = _nm_setting_bond_mode_from_string(value); g_return_if_fail(mode != NM_BOND_MODE_UNKNOWN); - /* Below we set only the bond options that kernel allows to modify + /* Below we set only the bond options that the kernel allows modifying * while keeping the bond interface up */ set_bond_arp_ip_targets(device, s_bond); diff --git a/src/core/devices/nm-device-bridge.c b/src/core/devices/nm-device-bridge.c index 7c34fde0..45cdd83f 100644 --- a/src/core/devices/nm-device-bridge.c +++ b/src/core/devices/nm-device-bridge.c @@ -735,6 +735,11 @@ merge_bridge_vlan_default_pvid(NMPlatformBridgeVlan *vlans, guint *num_vlans, gu gboolean has_pvid = FALSE; guint i; + if (default_pvid == 0) { + /* default_pvid=0 means that the default PVID is disabled. No need to merge it. */ + return vlans; + } + for (i = 0; i < *num_vlans; i++) { if (vlans[i].pvid) { has_pvid = TRUE; diff --git a/src/core/devices/nm-device-hsr.c b/src/core/devices/nm-device-hsr.c index 8156fa77..59454ee3 100644 --- a/src/core/devices/nm-device-hsr.c +++ b/src/core/devices/nm-device-hsr.c @@ -94,8 +94,10 @@ update_properties(NMDevice *device) CHECK_PROPERTY_CHANGED(multicast_spec, PROP_MULTICAST_SPEC); CHECK_PROPERTY_CHANGED(prp, PROP_PRP); - if (!nm_ether_addr_equal(&priv->props.supervision_address, &props->supervision_address)) + if (!nm_ether_addr_equal(&priv->props.supervision_address, &props->supervision_address)) { + priv->props.supervision_address = props->supervision_address; _notify(self, PROP_SUPERVISION_ADDRESS); + } g_object_thaw_notify((GObject *) device); } diff --git a/src/core/devices/nm-device-tun.c b/src/core/devices/nm-device-tun.c index faab86d0..b277c378 100644 --- a/src/core/devices/nm-device-tun.c +++ b/src/core/devices/nm-device-tun.c @@ -242,12 +242,14 @@ create_and_realize(NMDevice *device, g_return_val_if_reached(FALSE); } - owner = _nm_utils_ascii_str_to_int64(nm_setting_tun_get_owner(s_tun), 10, 0, G_MAXINT32, -1); + owner = + _nm_utils_ascii_str_to_int64(nm_setting_tun_get_owner(s_tun), 10, 0, G_MAXUINT32 - 1, -1); if (owner != -1) { props.owner_valid = TRUE; props.owner = owner; } - group = _nm_utils_ascii_str_to_int64(nm_setting_tun_get_group(s_tun), 10, 0, G_MAXINT32, -1); + group = + _nm_utils_ascii_str_to_int64(nm_setting_tun_get_group(s_tun), 10, 0, G_MAXUINT32 - 1, -1); if (group != -1) { props.group_valid = TRUE; props.group = group; @@ -278,7 +280,7 @@ _same_og(const char *str, gboolean og_valid, guint32 og_num) { gint64 v; - v = _nm_utils_ascii_str_to_int64(str, 10, 0, G_MAXINT32, -1); + v = _nm_utils_ascii_str_to_int64(str, 10, 0, G_MAXUINT32 - 1, -1); return (!og_valid && (v == (gint64) -1)) || (og_valid && (((guint32) v) == og_num)); } diff --git a/src/core/devices/nm-device-vrf.c b/src/core/devices/nm-device-vrf.c index 7dfd6504..6d272a95 100644 --- a/src/core/devices/nm-device-vrf.c +++ b/src/core/devices/nm-device-vrf.c @@ -235,7 +235,7 @@ attach_port(NMDevice *device, _LOGI(LOGD_DEVICE, "attached VRF port %s", port_iface); } else - _LOGI(LOGD_BOND, "VRF port %s was attached", port_iface); + _LOGI(LOGD_DEVICE, "VRF port %s was attached", port_iface); return TRUE; } diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 2f2f25a5..f6057e52 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -779,6 +779,7 @@ typedef struct _NMDevicePrivate { char *prop_ip_iface; /* IP interface D-Bus property */ GList *ping_operations; GSource *ping_timeout; + bool refresh_forwarding_done : 1; } NMDevicePrivate; G_DEFINE_ABSTRACT_TYPE(NMDevice, nm_device, NM_TYPE_DBUS_OBJECT) @@ -880,6 +881,7 @@ static void device_ifindex_changed_cb(NMManager *manager, NMDevice *device_chang static gboolean device_link_changed(gpointer user_data); static gboolean _get_maybe_ipv6_disabled(NMDevice *self); static void deactivate_ready(NMDevice *self, NMDeviceStateReason reason); +static void carrier_disconnected_action_cancel(NMDevice *self); /*****************************************************************************/ @@ -1414,6 +1416,26 @@ _prop_get_connection_mdns(NMDevice *self) NM_SETTING_CONNECTION_MDNS_DEFAULT); } +static gboolean +_prop_get_sriov_preserve_on_down(NMDevice *self, NMSettingSriov *s_sriov) +{ + NMSriovPreserveOnDown preserve; + + g_return_val_if_fail(NM_IS_DEVICE(self), FALSE); + g_return_val_if_fail(NM_IS_SETTING_SRIOV(s_sriov), FALSE); + + preserve = nm_setting_sriov_get_preserve_on_down(s_sriov); + if (NM_IN_SET(preserve, NM_SRIOV_PRESERVE_ON_DOWN_NO, NM_SRIOV_PRESERVE_ON_DOWN_YES)) + return preserve; + + return nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA, + NM_CON_DEFAULT("sriov.preserve-on-down"), + self, + NM_SRIOV_PRESERVE_ON_DOWN_NO, + NM_SRIOV_PRESERVE_ON_DOWN_YES, + NM_SRIOV_PRESERVE_ON_DOWN_NO); +} + static NMSettingConnectionLlmnr _prop_get_connection_llmnr(NMDevice *self) { @@ -2109,6 +2131,33 @@ _prop_get_ipvx_dhcp_send_hostname(NMDevice *self, int addr_family) return send_hostname_v2; } +NMSettingIPConfigForwarding +nm_device_get_ipv4_forwarding(NMDevice *self) +{ + NMSettingIPConfig *s_ip; + NMSettingIPConfigForwarding forwarding; + + g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_IP_CONFIG_FORWARDING_AUTO); + + s_ip = nm_device_get_applied_setting(self, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip) + forwarding = nm_setting_ip_config_get_forwarding(s_ip); + else + forwarding = NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT; + + if (forwarding == NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT) { + forwarding = + nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA, + NM_CON_DEFAULT("ipv4.forwarding"), + self, + NM_SETTING_IP_CONFIG_FORWARDING_NO, + NM_SETTING_IP_CONFIG_FORWARDING_AUTO, + NM_SETTING_IP_CONFIG_FORWARDING_AUTO); + } + + return forwarding; +} + static gboolean _prop_get_connection_ip_ping_addresses_require_all(NMDevice *self, NMSettingConnection *s_con) { @@ -2717,7 +2766,7 @@ _ethtool_features_set(NMDevice *self, if (nm_setting_ethtool_init_features(s_ethtool, ethtool_state->requested) == 0) return; - features = nm_platform_ethtool_get_link_features(platform, ethtool_state->ifindex); + features = nm_platform_ethtool_get_features(platform, ethtool_state->ifindex); if (!features) { _LOGW(LOGD_DEVICE, "ethtool: failure setting offload features (cannot read features)"); return; @@ -2836,9 +2885,9 @@ _ethtool_coalesce_set(NMDevice *self, continue; if (!has_old) { - if (!nm_platform_ethtool_get_link_coalesce(platform, - ethtool_state->ifindex, - &coalesce_old)) { + if (!nm_platform_ethtool_get_coalesce(platform, + ethtool_state->ifindex, + &coalesce_old)) { _LOGW(LOGD_DEVICE, "ethtool: failure getting coalesce settings (cannot read)"); return; } @@ -2917,7 +2966,7 @@ _ethtool_ring_set(NMDevice *self, nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_UINT32)); if (!has_old) { - if (!nm_platform_ethtool_get_link_ring(platform, ethtool_state->ifindex, &ring_old)) { + if (!nm_platform_ethtool_get_ring(platform, ethtool_state->ifindex, &ring_old)) { _LOGW(LOGD_DEVICE, "ethtool: failure setting ring options (cannot read existing setting)"); return; @@ -3013,9 +3062,9 @@ _ethtool_channels_set(NMDevice *self, nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_UINT32)); if (!has_old) { - if (!nm_platform_ethtool_get_link_channels(platform, - ethtool_state->ifindex, - &channels_old)) { + if (!nm_platform_ethtool_get_channels(platform, + ethtool_state->ifindex, + &channels_old)) { _LOGW(LOGD_DEVICE, "ethtool: failure setting channels options (cannot read existing setting)"); return; @@ -3132,7 +3181,7 @@ _ethtool_pause_set(NMDevice *self, nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_BOOLEAN)); if (!has_old) { - if (!nm_platform_ethtool_get_link_pause(platform, ethtool_state->ifindex, &pause_old)) { + if (!nm_platform_ethtool_get_pause(platform, ethtool_state->ifindex, &pause_old)) { _LOGW(LOGD_DEVICE, "ethtool: failure setting pause options (cannot read " "existing setting)"); @@ -3218,7 +3267,7 @@ _ethtool_eee_set(NMDevice *self, nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_BOOLEAN)); if (!has_old) { - if (!nm_platform_ethtool_get_link_eee(platform, ethtool_state->ifindex, &eee_old)) { + if (!nm_platform_ethtool_get_eee(platform, ethtool_state->ifindex, &eee_old)) { _LOGW(LOGD_DEVICE, "ethtool: failure setting eee options (cannot read " "existing setting)"); @@ -3729,7 +3778,7 @@ nm_device_assume_state_reset(NMDevice *self) /*****************************************************************************/ -static char * +char * nm_device_sysctl_ip_conf_get(NMDevice *self, int addr_family, const char *property) { const char *ifname; @@ -4993,6 +5042,10 @@ _set_ifindex(NMDevice *self, int ifindex, gboolean is_ip_ifindex) ip_ifindex_new = nm_device_get_ip_ifindex(self); + /* the ifindex changed; forget about any carrier change event for + * the previous ifindex */ + carrier_disconnected_action_cancel(self); + if (priv->l3cfg) { if (ip_ifindex_new <= 0 || ip_ifindex_new != nm_l3cfg_get_ifindex(priv->l3cfg)) { const NML3ConfigData *l3cd_old; @@ -6584,11 +6637,15 @@ concheck_update_state(NMDevice *self, _notify(self, IS_IPv4 ? PROP_IP4_CONNECTIVITY : PROP_IP6_CONNECTIVITY); - if (priv->state == NM_DEVICE_STATE_ACTIVATED && !nm_device_managed_type_is_external(self)) + /* State change could've affected the route metrics (removed the penalty + * once FULL connectivity is reached), redo the L3 configuration. */ + if (priv->state > NM_DEVICE_STATE_IP_CONFIG && priv->state < NM_DEVICE_STATE_DEACTIVATING + && !nm_device_managed_type_is_external(self)) { _dev_l3_register_l3cds(self, priv->l3cfg, TRUE, NM_TERNARY_DEFAULT); + } } -static const char * +const char * nm_device_get_effective_ip_config_method(NMDevice *self, int addr_family) { NMDeviceClass *klass; @@ -7725,9 +7782,7 @@ device_link_changed(gpointer user_data) * tagged for carrier ignore) ensure that when the carrier appears we * renew DHCP leases and such. */ - if (priv->state == NM_DEVICE_STATE_ACTIVATED) { - nm_device_update_dynamic_ip_setup(self, "interface got carrier"); - } + nm_device_update_dynamic_ip_setup(self, "interface got carrier"); } if (update_unmanaged_specs) @@ -8974,7 +9029,7 @@ nm_device_port_notify_attach_as_port(NMDevice *self, gboolean success) priv->is_attached = TRUE; - _notify(priv->controller, PROP_CONTROLLER); + _notify(self, PROP_CONTROLLER); nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->controller)->ports_variant, g_variant_unref); @@ -9053,7 +9108,7 @@ nm_device_port_notify_release(NMDevice *self, priv->is_attached = FALSE; - _notify(priv->controller, PROP_CONTROLLER); + _notify(self, PROP_CONTROLLER); nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->controller)->ports_variant, g_variant_unref); nm_gobject_notify_together(priv->controller, PROP_PORTS, PROP_SLAVES); @@ -9521,7 +9576,7 @@ nm_device_generate_connection(NMDevice *self, NM_SETTING_CONNECTION_ID, ifname, NM_SETTING_CONNECTION_AUTOCONNECT, - FALSE, + TRUE, NM_SETTING_CONNECTION_INTERFACE_NAME, ifname, NM_SETTING_CONNECTION_TIMESTAMP, @@ -11335,6 +11390,13 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d switch (notify_data->notify_type) { case NM_DHCP_CLIENT_NOTIFY_TYPE_PREFIX_DELEGATED: nm_assert(!IS_IPv4); + if (notify_data->prefix_delegated.prefix->plen == 0 + || notify_data->prefix_delegated.prefix->plen > 64) { + _LOGW_ipdhcp(addr_family, + "ignoring invalid prefix-delegation with length %u", + notify_data->prefix_delegated.prefix->plen); + return; + } /* Just re-emit. The device just contributes the prefix to the * pool in NMPolicy, which decides about subnet allocation * on the shared devices. */ @@ -13073,6 +13135,13 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family) goto out_devip; if (IS_IPv4) { + NMSettingIPConfigForwarding ipv4_forwarding = nm_device_get_ipv4_forwarding(self); + + if (NM_IN_SET(ipv4_forwarding, + NM_SETTING_IP_CONFIG_FORWARDING_NO, + NM_SETTING_IP_CONFIG_FORWARDING_YES)) { + nm_device_sysctl_ip_conf_set(self, AF_INET, "forwarding", ipv4_forwarding ? "1" : "0"); + } priv->ipll_data_4.v4.mode = _prop_get_ipv4_link_local(self); if (priv->ipll_data_4.v4.mode == NM_SETTING_IP4_LL_ENABLED) _dev_ipll4_start(self); @@ -13369,7 +13438,8 @@ activate_stage3_ip_config(NMDevice *self) * IPv6LL if this is not an assumed connection, since assumed connections * will already have IPv6 set up. */ - if (!nm_device_managed_type_is_external_or_assume(self)) + if ((priv->state <= NM_DEVICE_STATE_IP_CONFIG || priv->ip_data_6.do_reapply) + && !nm_device_managed_type_is_external_or_assume(self)) _dev_addrgenmode6_set(self, NM_IN6_ADDR_GEN_MODE_NONE); /* Re-enable IPv6 on the interface */ @@ -13505,19 +13575,6 @@ _dev_ipshared4_init(NMDevice *self) } if (nm_platform_sysctl_get_int32(nm_device_get_platform(self), - NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_forward"), - -1) - == 1) { - /* nothing to do. */ - } else if (!nm_platform_sysctl_set(nm_device_get_platform(self), - NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_forward"), - "1")) { - errsv = errno; - _LOGW_ipshared(AF_INET, "error enabling IPv4 forwarding: %s", nm_strerror_native(errsv)); - return FALSE; - } - - if (nm_platform_sysctl_get_int32(nm_device_get_platform(self), NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_dynaddr"), -1) == 1) { @@ -13994,13 +14051,18 @@ can_reapply_change(NMDevice *self, goto out_fail; } - if (NM_IN_STRSET(setting_name, - NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME, - NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME) - && NM_DEVICE_GET_CLASS(self)->can_reapply_change_ovs_external_ids) { - /* TODO: this means, you cannot reapply changes to the external-ids for - * OVS system interfaces. */ - return TRUE; + if (nm_streq(setting_name, NM_SETTING_BRIDGE_PORT_SETTING_NAME)) { + return nm_device_hash_check_invalid_keys(diffs, + NM_SETTING_BRIDGE_PORT_SETTING_NAME, + error, + NM_SETTING_BRIDGE_PORT_VLANS); + } + + if (nm_streq(setting_name, NM_SETTING_SRIOV_SETTING_NAME)) { + return nm_device_hash_check_invalid_keys(diffs, + NM_SETTING_SRIOV_SETTING_NAME, + error, + NM_SETTING_SRIOV_PRESERVE_ON_DOWN); } out_fail: @@ -16851,6 +16913,8 @@ _cleanup_generic_post(NMDevice *self, NMDeviceStateReason reason, CleanupType cl priv->v4_route_table_all_sync_before = FALSE; priv->v6_route_table_all_sync_before = FALSE; + priv->refresh_forwarding_done = FALSE; + priv->mtu_force_set_done = FALSE; priv->needs_ip6_subnet = FALSE; @@ -16896,6 +16960,7 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu NMDevicePrivate *priv; NMDeviceClass *klass = NM_DEVICE_GET_CLASS(self); int ifindex; + gint32 default_forwarding_v4; g_return_if_fail(NM_IS_DEVICE(self)); @@ -16918,6 +16983,17 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu nm_device_sysctl_ip_conf_set(self, AF_INET6, "use_tempaddr", "0"); } + /* Restoring the device's forwarding to the sysctl default is necessary because + * `refresh_forwarding()` only updates forwarding on activated devices. */ + default_forwarding_v4 = nm_platform_sysctl_get_int32( + nm_device_get_platform(self), + NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/conf/default/forwarding"), + 0); + nm_device_sysctl_ip_conf_set(self, + AF_INET, + "forwarding", + default_forwarding_v4 == 1 ? "1" : "0"); + /* Call device type-specific deactivation */ if (klass->deactivate) klass->deactivate(self); @@ -17437,7 +17513,8 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason, } if (priv->ifindex > 0 - && (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))) { + && (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV)) + && (!_prop_get_sriov_preserve_on_down(self, s_sriov))) { priv->sriov_reset_pending++; sriov_op_queue(self, 0, @@ -17492,7 +17569,8 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason, nm_settings_connection_update_timestamp(sett_conn, (guint64) 0); if (priv->ifindex > 0 - && (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))) { + && (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV)) + && (!_prop_get_sriov_preserve_on_down(self, s_sriov))) { priv->sriov_reset_pending++; sriov_op_queue(self, 0, @@ -18613,7 +18691,7 @@ hostname_dns_lookup_callback(GObject *source, GAsyncResult *result, gpointer use gboolean valid; resolver->hostname = g_steal_pointer(&output); - valid = nm_utils_validate_hostname(resolver->hostname); + valid = nm_sd_dns_name_is_valid(resolver->hostname); _LOGD(LOGD_DNS, "hostname-from-dns: ipv%c resolver %s: lookup successful for %s, result %s%s%s%s", @@ -18858,6 +18936,19 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean return nm_assert_unreachable_val(NULL); } +gboolean +nm_device_get_refresh_forwarding_done(NMDevice *self) +{ + return NM_DEVICE_GET_PRIVATE(self)->refresh_forwarding_done; +} + +void +nm_device_set_refresh_forwarding_done(NMDevice *self, gboolean is_refresh_forwarding_done) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self); + priv->refresh_forwarding_done = is_refresh_forwarding_done; +} + /*****************************************************************************/ static const char * diff --git a/src/core/devices/nm-device.h b/src/core/devices/nm-device.h index 9b051ab4..9a663c2a 100644 --- a/src/core/devices/nm-device.h +++ b/src/core/devices/nm-device.h @@ -209,8 +209,6 @@ typedef struct _NMDeviceClass { bool act_stage1_prepare_set_hwaddr_ethernet : 1; - bool can_reapply_change_ovs_external_ids : 1; - bool allow_autoconnect_on_external : 1; NMRfkillType rfkill_type : 4; @@ -854,4 +852,14 @@ void nm_routing_rules_sync(NMConnection *applied_connection, NMDevice *self, NMNetns *netns); +NMSettingIPConfigForwarding nm_device_get_ipv4_forwarding(NMDevice *self); + +const char *nm_device_get_effective_ip_config_method(NMDevice *self, int addr_family); + +char *nm_device_sysctl_ip_conf_get(NMDevice *self, int addr_family, const char *property); + +gboolean nm_device_get_refresh_forwarding_done(NMDevice *self); + +void nm_device_set_refresh_forwarding_done(NMDevice *self, gboolean is_refresh_forwarding_done); + #endif /* __NETWORKMANAGER_DEVICE_H__ */ diff --git a/src/core/devices/nm-lldp-listener.c b/src/core/devices/nm-lldp-listener.c index e08b379a..5c90911f 100644 --- a/src/core/devices/nm-lldp-listener.c +++ b/src/core/devices/nm-lldp-listener.c @@ -310,7 +310,7 @@ format_string(const guint8 *data, gsize len, gboolean allow_trim, char **out_to_ if (len == 0) return NULL; - if (memchr(data, len, '\0')) + if (memchr(data, '\0', len)) return NULL; return nm_utils_buf_utf8safe_escape(data, diff --git a/src/core/devices/ovs/nm-device-ovs-bridge.c b/src/core/devices/ovs/nm-device-ovs-bridge.c index c9b1f4c6..c9736eeb 100644 --- a/src/core/devices/ovs/nm-device-ovs-bridge.c +++ b/src/core/devices/ovs/nm-device-ovs-bridge.c @@ -162,6 +162,11 @@ can_reapply_change(NMDevice *device, NM_SETTING_OVS_BRIDGE_STP_ENABLE); } + if (NM_IN_STRSET(setting_name, + NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME, + NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME)) + return TRUE; + return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error); } @@ -194,16 +199,15 @@ nm_device_ovs_bridge_class_init(NMDeviceOvsBridgeClass *klass) device_class->connection_type_check_compatible = NM_SETTING_OVS_BRIDGE_SETTING_NAME; device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(); - device_class->is_controller = TRUE; - device_class->get_type_description = get_type_description; - device_class->create_and_realize = create_and_realize; - device_class->unrealize = unrealize; - device_class->get_generic_capabilities = get_generic_capabilities; - device_class->act_stage3_ip_config = act_stage3_ip_config; - device_class->ready_for_ip_config = ready_for_ip_config; - device_class->attach_port = attach_port; - device_class->detach_port = detach_port; - device_class->can_reapply_change = can_reapply_change; - device_class->can_reapply_change_ovs_external_ids = TRUE; - device_class->reapply_connection = nm_device_ovs_reapply_connection; + device_class->is_controller = TRUE; + device_class->get_type_description = get_type_description; + device_class->create_and_realize = create_and_realize; + device_class->unrealize = unrealize; + device_class->get_generic_capabilities = get_generic_capabilities; + device_class->act_stage3_ip_config = act_stage3_ip_config; + device_class->ready_for_ip_config = ready_for_ip_config; + device_class->attach_port = attach_port; + device_class->detach_port = detach_port; + device_class->can_reapply_change = can_reapply_change; + device_class->reapply_connection = nm_device_ovs_reapply_connection; } diff --git a/src/core/devices/ovs/nm-device-ovs-interface.c b/src/core/devices/ovs/nm-device-ovs-interface.c index 512aa5c3..922ed345 100644 --- a/src/core/devices/ovs/nm-device-ovs-interface.c +++ b/src/core/devices/ovs/nm-device-ovs-interface.c @@ -16,6 +16,8 @@ #include "nm-setting-ovs-bridge.h" #include "nm-setting-ovs-interface.h" #include "nm-setting-ovs-port.h" +#include "nm-setting-ovs-external-ids.h" +#include "nm-setting-ovs-other-config.h" #define _NMLOG_DEVICE_TYPE NMDeviceOvsInterface #include "devices/nm-device-logging.h" @@ -631,6 +633,28 @@ can_update_from_platform_link(NMDevice *device, const NMPlatformLink *plink) return !plink || nm_device_get_state(device) != NM_DEVICE_STATE_DEACTIVATING; } +static gboolean +can_reapply_change(NMDevice *device, + const char *setting_name, + NMSetting *s_old, + NMSetting *s_new, + GHashTable *diffs, + GError **error) +{ + NMDeviceClass *device_class = NM_DEVICE_CLASS(nm_device_ovs_interface_parent_class); + + if (NM_IN_STRSET(setting_name, + NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME, + NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME)) { + /* TODO: it's currently not possible to reapply those settings on OVS + * system interfaces because they have type != "ovs-interface" (e.g. + * "ethernet") */ + return TRUE; + } + + return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error); +} + /*****************************************************************************/ static void @@ -696,21 +720,21 @@ nm_device_ovs_interface_class_init(NMDeviceOvsInterfaceClass *klass) device_class->connection_type_check_compatible = NM_SETTING_OVS_INTERFACE_SETTING_NAME; device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(NM_LINK_TYPE_OPENVSWITCH); - device_class->can_auto_connect = can_auto_connect; - device_class->can_update_from_platform_link = can_update_from_platform_link; - device_class->deactivate = deactivate; - device_class->deactivate_async = deactivate_async; - device_class->get_type_description = get_type_description; - device_class->create_and_realize = create_and_realize; - device_class->get_generic_capabilities = get_generic_capabilities; - device_class->is_available = is_available; - device_class->check_connection_compatible = check_connection_compatible; - device_class->link_changed = link_changed; - device_class->act_stage3_ip_config = act_stage3_ip_config; - device_class->ready_for_ip_config = ready_for_ip_config; - device_class->can_unmanaged_external_down = can_unmanaged_external_down; - device_class->set_platform_mtu = set_platform_mtu; - device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired; - device_class->can_reapply_change_ovs_external_ids = TRUE; - device_class->reapply_connection = nm_device_ovs_reapply_connection; + device_class->can_auto_connect = can_auto_connect; + device_class->can_update_from_platform_link = can_update_from_platform_link; + device_class->deactivate = deactivate; + device_class->deactivate_async = deactivate_async; + device_class->get_type_description = get_type_description; + device_class->create_and_realize = create_and_realize; + device_class->get_generic_capabilities = get_generic_capabilities; + device_class->is_available = is_available; + device_class->check_connection_compatible = check_connection_compatible; + device_class->link_changed = link_changed; + device_class->act_stage3_ip_config = act_stage3_ip_config; + device_class->ready_for_ip_config = ready_for_ip_config; + device_class->can_unmanaged_external_down = can_unmanaged_external_down; + device_class->set_platform_mtu = set_platform_mtu; + device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired; + device_class->can_reapply_change = can_reapply_change; + device_class->reapply_connection = nm_device_ovs_reapply_connection; } diff --git a/src/core/devices/ovs/nm-device-ovs-port.c b/src/core/devices/ovs/nm-device-ovs-port.c index e9928548..0e3ef92c 100644 --- a/src/core/devices/ovs/nm-device-ovs-port.c +++ b/src/core/devices/ovs/nm-device-ovs-port.c @@ -16,6 +16,8 @@ #include "nm-setting-connection.h" #include "nm-setting-ovs-port.h" #include "nm-setting-ovs-interface.h" +#include "nm-setting-ovs-external-ids.h" +#include "nm-setting-ovs-other-config.h" #include "nm-setting-wired.h" #define _NMLOG_DEVICE_TYPE NMDeviceOvsPort @@ -279,6 +281,11 @@ can_reapply_change(NMDevice *device, NM_SETTING_OVS_PORT_TRUNKS); } + if (NM_IN_STRSET(setting_name, + NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME, + NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME)) + return TRUE; + return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error); } @@ -311,15 +318,14 @@ nm_device_ovs_port_class_init(NMDeviceOvsPortClass *klass) device_class->connection_type_check_compatible = NM_SETTING_OVS_PORT_SETTING_NAME; device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(); - device_class->is_controller = TRUE; - device_class->get_type_description = get_type_description; - device_class->create_and_realize = create_and_realize; - device_class->get_generic_capabilities = get_generic_capabilities; - device_class->act_stage3_ip_config = act_stage3_ip_config; - device_class->ready_for_ip_config = ready_for_ip_config; - device_class->attach_port = attach_port; - device_class->detach_port = detach_port; - device_class->can_reapply_change = can_reapply_change; - device_class->can_reapply_change_ovs_external_ids = TRUE; - device_class->reapply_connection = nm_device_ovs_reapply_connection; + device_class->is_controller = TRUE; + device_class->get_type_description = get_type_description; + device_class->create_and_realize = create_and_realize; + device_class->get_generic_capabilities = get_generic_capabilities; + device_class->act_stage3_ip_config = act_stage3_ip_config; + device_class->ready_for_ip_config = ready_for_ip_config; + device_class->attach_port = attach_port; + device_class->detach_port = detach_port; + device_class->can_reapply_change = can_reapply_change; + device_class->reapply_connection = nm_device_ovs_reapply_connection; } diff --git a/src/core/devices/ovs/nm-ovs-factory.c b/src/core/devices/ovs/nm-ovs-factory.c index 2ca1a0b5..4084356f 100644 --- a/src/core/devices/ovs/nm-ovs-factory.c +++ b/src/core/devices/ovs/nm-ovs-factory.c @@ -75,9 +75,6 @@ new_device_from_type(const char *name, NMDeviceType device_type) const char *type_desc; NMLinkType link_type = NM_LINK_TYPE_NONE; - if (nm_manager_get_device(NM_MANAGER_GET, name, device_type)) - return NULL; - if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE) { type = NM_TYPE_DEVICE_OVS_INTERFACE; type_desc = "Open vSwitch Interface"; @@ -89,6 +86,7 @@ new_device_from_type(const char *name, NMDeviceType device_type) type = NM_TYPE_DEVICE_OVS_BRIDGE; type_desc = "Open vSwitch Bridge"; } else { + _LOGT(name, NULL, "Unrecognized link type: %d", device_type); return NULL; } @@ -125,6 +123,11 @@ ovsdb_device_added(NMOvsdb *ovsdb, return; } + if (nm_manager_get_device(NM_MANAGER_GET, name, device_type)) { + _LOGT(name, NULL, "Device already registered with manager, skipping."); + return; + } + device = new_device_from_type(name, device_type); if (!device) return; @@ -288,23 +291,31 @@ create_device(NMDeviceFactory *self, { NMDeviceType device_type = NM_DEVICE_TYPE_UNKNOWN; const char *connection_type = NULL; + const char *connection_uuid = NULL; if (g_strcmp0(iface, "ovs-system") == 0) { *out_ignore = TRUE; return NULL; } - if (connection) + if (connection) { connection_type = nm_connection_get_connection_type(connection); + connection_uuid = nm_connection_get_uuid(connection); + } - if (plink) + if (plink) { + _LOGD(iface, connection_uuid, "creating OVS interface (from a platform link)"); device_type = NM_DEVICE_TYPE_OVS_INTERFACE; - else if (g_strcmp0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME) == 0) + } else if (nm_streq0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME)) { + _LOGD(iface, connection_uuid, "creating OVS interface (from setting)"); device_type = NM_DEVICE_TYPE_OVS_INTERFACE; - else if (g_strcmp0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME) == 0) + } else if (nm_streq0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME)) { + _LOGD(iface, connection_uuid, "creating OVS port (from setting)"); device_type = NM_DEVICE_TYPE_OVS_PORT; - else if (g_strcmp0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME) == 0) + } else if (nm_streq0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) { + _LOGD(iface, connection_uuid, "creating OVS bridge (from setting)"); device_type = NM_DEVICE_TYPE_OVS_BRIDGE; + } return new_device_from_type(iface, device_type); } diff --git a/src/core/devices/ovs/nm-ovsdb.c b/src/core/devices/ovs/nm-ovsdb.c index 2dbc842a..164bfd35 100644 --- a/src/core/devices/ovs/nm-ovsdb.c +++ b/src/core/devices/ovs/nm-ovsdb.c @@ -900,15 +900,17 @@ _insert_interface(json_t *params, s_ovs_patch = nm_connection_get_setting_ovs_patch(interface); if (s_ovs_dpdk) { - const char *devargs; - guint32 n_rxq; - guint32 n_rxq_desc; - guint32 n_txq_desc; + const char *devargs; + guint32 n_rxq; + guint32 n_rxq_desc; + guint32 n_txq_desc; + NMSettingOvsDpdkLscInterrupt lsc_int; devargs = nm_setting_ovs_dpdk_get_devargs(s_ovs_dpdk); n_rxq = nm_setting_ovs_dpdk_get_n_rxq(s_ovs_dpdk); n_rxq_desc = nm_setting_ovs_dpdk_get_n_rxq_desc(s_ovs_dpdk); n_txq_desc = nm_setting_ovs_dpdk_get_n_txq_desc(s_ovs_dpdk); + lsc_int = nm_setting_ovs_dpdk_get_lsc_interrupt(s_ovs_dpdk); dpdk_array = json_array(); @@ -930,6 +932,17 @@ _insert_interface(json_t *params, json_pack("[s,s]", "n_txq_desc", nm_sprintf_buf(sbuf, "%u", n_txq_desc))); } + switch (lsc_int) { + case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE: + break; + case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_ENABLED: + json_array_append_new(dpdk_array, json_pack("[s,s]", "dpdk-lsc-interrupt", "true")); + break; + case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_DISABLED: + json_array_append_new(dpdk_array, json_pack("[s,s]", "dpdk-lsc-interrupt", "false")); + break; + } + json_array_append_new(options, dpdk_array); } else if (s_ovs_patch) { @@ -1374,88 +1387,113 @@ _delete_interface(NMOvsdb *self, json_t *params, const char *ifname) nm_auto_decref_json json_t *bridges = NULL; nm_auto_decref_json json_t *new_bridges = NULL; gboolean bridges_changed; - gboolean ports_changed; - gboolean interfaces_changed; - int pi; - int ii; bridges = json_array(); new_bridges = json_array(); bridges_changed = FALSE; + /* Loop over all bridges */ g_hash_table_iter_init(&iter, priv->bridges); while (g_hash_table_iter_next(&iter, (gpointer) &ovs_bridge, NULL)) { - nm_auto_decref_json json_t *ports = NULL; - nm_auto_decref_json json_t *new_ports = NULL; + nm_auto_decref_json json_t *ports = NULL; + nm_auto_decref_json json_t *new_ports = NULL; + guint num_nm_ports = 0; + gboolean ports_changed = FALSE; + int pi; - ports = json_array(); - new_ports = json_array(); - ports_changed = FALSE; + ports = json_array(); + new_ports = json_array(); + /* Add the bridge UUID to the list of known bridges for the "expect" condition */ json_array_append_new(bridges, json_pack("[s,s]", "uuid", ovs_bridge->bridge_uuid)); + if (!ovs_bridge->connection_uuid) { + /* Externally created, don't touch it */ + json_array_append_new(new_bridges, json_pack("[s,s]", "uuid", ovs_bridge->bridge_uuid)); + continue; + } + + /* Loop over all bridge's ports */ for (pi = 0; pi < ovs_bridge->ports->len; pi++) { - nm_auto_decref_json json_t *interfaces = NULL; - nm_auto_decref_json json_t *new_interfaces = NULL; + nm_auto_decref_json json_t *interfaces = NULL; + nm_auto_decref_json json_t *new_interfaces = NULL; + guint num_nm_interfaces = 0; + gboolean interfaces_changed = FALSE; + int ii; interfaces = json_array(); new_interfaces = json_array(); port_uuid = g_ptr_array_index(ovs_bridge->ports, pi); ovs_port = g_hash_table_lookup(priv->ports, &port_uuid); + /* Add the port UUID to the list of known bridge port for the "expect" condition */ json_array_append_new(ports, json_pack("[s,s]", "uuid", port_uuid)); - interfaces_changed = FALSE; - if (!ovs_port) { /* This would be a violation of ovsdb's reference integrity (a bug). */ _LOGW("Unknown port '%s' in bridge '%s'", port_uuid, ovs_bridge->bridge_uuid); continue; } + /* Loop over all port's interfaces */ for (ii = 0; ii < ovs_port->interfaces->len; ii++) { interface_uuid = g_ptr_array_index(ovs_port->interfaces, ii); ovs_interface = g_hash_table_lookup(priv->interfaces, &interface_uuid); + /* Add the interface UUID to the list of known port interfaces for the "expect" condition */ json_array_append_new(interfaces, json_pack("[s,s]", "uuid", interface_uuid)); if (ovs_interface) { if (nm_streq(ovs_interface->name, ifname)) { - /* skip the interface */ + /* We are deleting this interface, don't count it */ interfaces_changed = TRUE; continue; } + if (ovs_interface->connection_uuid) + num_nm_interfaces++; } else { /* This would be a violation of ovsdb's reference integrity (a bug). */ _LOGW("Unknown interface '%s' in port '%s'", interface_uuid, port_uuid); } + /* Add the interface to the list of new interfaces to set on the port */ json_array_append_new(new_interfaces, json_pack("[s,s]", "uuid", interface_uuid)); } - if (json_array_size(new_interfaces) == 0) { + if (num_nm_interfaces == 0) { + /* The port no longer has any NM interface. Don't add it to "new_ports" and set + * ports_changed=TRUE, so that it will be deleted. */ ports_changed = TRUE; } else { if (interfaces_changed) { + /* An interface needs to be deleted from this port */ _expect_port_interfaces(params, ovs_port->name, interfaces); _set_port_interfaces(params, ovs_port->name, new_interfaces); } + /* The port is still alive */ json_array_append_new(new_ports, json_pack("[s,s]", "uuid", port_uuid)); + if (ovs_port->connection_uuid) + num_nm_ports++; } } - if (json_array_size(new_ports) == 0) { + if (num_nm_ports == 0) { + /* The bridge no longer has any NM port. Don't add it to "new_bridges" and set + * bridges_changed=TRUE, so that it will be deleted. */ bridges_changed = TRUE; } else { if (ports_changed) { + /* A port needs to be deleted from this bridge */ _expect_bridge_ports(params, ovs_bridge->name, ports); _set_bridge_ports(params, ovs_bridge->name, new_ports); } + /* The bridge is still alive */ json_array_append_new(new_bridges, json_pack("[s,s]", "uuid", ovs_bridge->bridge_uuid)); } } if (bridges_changed) { + /* A port needs to be deleted from this bridge */ _expect_ovs_bridges(params, priv->db_uuid, bridges); _set_ovs_bridges(params, priv->db_uuid, new_bridges); } @@ -2211,7 +2249,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg) ovs_bridge->connection_uuid, ""), (strtmp1 = _strdict_to_string(ovs_bridge->external_ids)), - (strtmp2 = _strdict_to_string(ovs_bridge->external_ids))); + (strtmp2 = _strdict_to_string(ovs_bridge->other_config))); } } else { gs_free char *strtmp1 = NULL; diff --git a/src/core/dhcp/nm-dhcp-options.c b/src/core/dhcp/nm-dhcp-options.c index ce03c607..30cfd8e6 100644 --- a/src/core/dhcp/nm-dhcp-options.c +++ b/src/core/dhcp/nm-dhcp-options.c @@ -68,7 +68,7 @@ const NMDhcpOption _nm_dhcp_option_dhcp4_options[] = { REQ(NM_DHCP_OPTION_DHCP4_ARP_CACHE_TIMEOUT, "arp_cache_timeout", FALSE), REQ(NM_DHCP_OPTION_DHCP4_IEEE802_3_ENCAPSULATION, "ieee802_3_encapsulation", FALSE), REQ(NM_DHCP_OPTION_DHCP4_DEFAULT_TCP_TTL, "default_tcp_ttl", FALSE), - REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_INTERVAL, "tcp_keepalive_internal", FALSE), + REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_INTERVAL, "tcp_keepalive_interval", FALSE), REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_GARBAGE, "tcp_keepalive_garbage", FALSE), REQ(NM_DHCP_OPTION_DHCP4_VENDOR_SPECIFIC, "vendor_encapsulated_options", FALSE), REQ(NM_DHCP_OPTION_DHCP4_NETBIOS_NAMESERVER, "netbios_name_servers", FALSE), diff --git a/src/core/dhcp/nm-dhcp-systemd.c b/src/core/dhcp/nm-dhcp-systemd.c index e1761523..b570f7e5 100644 --- a/src/core/dhcp/nm-dhcp-systemd.c +++ b/src/core/dhcp/nm-dhcp-systemd.c @@ -395,7 +395,7 @@ ip6_start(NMDhcpClient *client, const struct in6_addr *ll_addr, GError **error) prefix_delegation = FALSE; if (client_config->v6.needed_prefixes > 0) { if (client_config->v6.needed_prefixes > 1) { - /* FIXME: systemd-networkd API only allows to request a + /* FIXME: systemd-networkd API only allows requesting a * single prefix */ _LOGW("dhcp-client6: only one prefix request is supported"); } diff --git a/src/core/dhcp/nm-dhcp-utils.c b/src/core/dhcp/nm-dhcp-utils.c index 15293fa3..949d8720 100644 --- a/src/core/dhcp/nm-dhcp-utils.c +++ b/src/core/dhcp/nm-dhcp-utils.c @@ -1224,7 +1224,7 @@ lease_option_print_domain_name(const uint8_t *cache, } case 0xC0: /* back pointer */ { - size_t offset = (c & 0x3F) << 16; + size_t offset = (c & 0x3F) << 8; /* * The offset is given as two bytes (in big endian), where the diff --git a/src/core/dhcp/tests/test-dhcp-utils.c b/src/core/dhcp/tests/test-dhcp-utils.c index b81523e1..de1be653 100644 --- a/src/core/dhcp/tests/test-dhcp-utils.c +++ b/src/core/dhcp/tests/test-dhcp-utils.c @@ -239,6 +239,76 @@ test_parse_search_list(void) g_assert_cmpint(g_strv_length(domains), ==, 1); g_assert_cmpstr(domains[0], ==, "okay"); g_strfreev(domains); + + /* Test that the message compression works when the offset uses both bytes */ + data = (guint8[]) { + /* clang-format off */ + /* offset 0 */ + 0x3e, + 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a', + 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a', + 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a', + 'a','a','a','a','a','a','a','a','a','a','a','a','a','a', + 0x00, + /* offset 0x40 */ + 0x3e, + 'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b', + 'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b', + 'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b', + 'b','b','b','b','b','b','b','b','b','b','b','b','b','b', + 0x00, + /* offset 0x80 */ + 0x3e, + 'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c', + 'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c', + 'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c', + 'c','c','c','c','c','c','c','c','c','c','c','c','c','c', + 0x00, + /* offset 0xc0 */ + 0x3e, + 'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d', + 'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d', + 'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d', + 'd','d','d','d','d','d','d','d','d','d','d','d','d','d', + 0x00, + /* offset 0x100 */ + 0x3e, + 'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e', + 'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e', + 'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e', + 'e','e','e','e','e','e','e','e','e','e','e','e','e','e', + 0x00, + /* offset 0x140 */ + 0x06, 'f','o','o','b','a','r', 0x03, 'c', 'o', 'm', 0x00, + 0x04, 't', 'e', 's', 't', 0xc1, 0x40, /* back pointer to offset 0x140*/ + /* clang-format on */ + }; + + domains = nm_dhcp_lease_data_parse_search_list(data, + 0x153, + "eth0", + AF_INET, + NM_DHCP_OPTION_DHCP4_DOMAIN_SEARCH_LIST); + g_assert(domains); + g_assert_cmpint(g_strv_length(domains), ==, 7); + g_assert_cmpstr(domains[0], + ==, + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); + g_assert_cmpstr(domains[1], + ==, + "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); + g_assert_cmpstr(domains[2], + ==, + "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"); + g_assert_cmpstr(domains[3], + ==, + "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"); + g_assert_cmpstr(domains[4], + ==, + "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"); + g_assert_cmpstr(domains[5], ==, "foobar.com"); + g_assert_cmpstr(domains[6], ==, "test.foobar.com"); + g_strfreev(domains); } static void diff --git a/src/core/dns/nm-dns-dnsconfd.c b/src/core/dns/nm-dns-dnsconfd.c index c17fb9cf..3789caf8 100644 --- a/src/core/dns/nm-dns-dnsconfd.c +++ b/src/core/dns/nm-dns-dnsconfd.c @@ -368,7 +368,8 @@ server_builder_append_base(GVariantBuilder *argument_builder, const char *address_string, const char *const *routing_domains, const char *const *search_domains, - const char *ca) + const char *ca, + int priority) { NMDnsServer dns_server; gsize addr_size; @@ -392,6 +393,12 @@ server_builder_append_base(GVariantBuilder *argument_builder, "{sv}", "name", g_variant_new("s", dns_server.servername)); + if (dns_server.port != NM_DNS_PORT_UNDEFINED) { + g_variant_builder_add(argument_builder, + "{sv}", + "port", + g_variant_new("i", dns_server.port)); + } if (routing_domains) { g_variant_builder_add(argument_builder, "{sv}", @@ -407,6 +414,9 @@ server_builder_append_base(GVariantBuilder *argument_builder, if (ca) { g_variant_builder_add(argument_builder, "{sv}", "ca", g_variant_new("s", ca)); } + /* dnsconfd defines priority as bigger number equals bigger priority, while NM + * uses the exact opposite, thus use -priority */ + g_variant_builder_add(argument_builder, "{sv}", "priority", g_variant_new("i", -priority)); return TRUE; } @@ -443,7 +453,8 @@ parse_global_config(const NMGlobalDnsConfig *global_config, servers[j], routing_domains, searches, - *ca)) { + *ca, + NM_DNS_PRIORITY_DEFAULT_NORMAL)) { g_variant_builder_close(argument_builder); } } @@ -560,7 +571,7 @@ dnsconfd_start_done(GObject *source_object, GAsyncResult *res, gpointer user_dat g_dbus_error_strip_remote_error(error); _LOGW("failed to start Dnsconfd %s", error->message); } else { - _LOGT("succesfully started Dnsconfd"); + _LOGT("successfully started Dnsconfd"); } /* No update maybe changed or state change, as this is handled by the name owner callbacks @@ -628,6 +639,7 @@ parse_all_interface_config(GVariantBuilder *argument_builder, NMDnsConfigIPData *ip_data; const char *const *dns_server_strings; guint nameserver_count; + int priority; const char *ifname; gboolean explicit_default = is_default_interface_explicit(ip_data_lst_head); @@ -648,6 +660,9 @@ parse_all_interface_config(GVariantBuilder *argument_builder, gather_interface_domains(ip_data, explicit_default, &routing_domains, &search_domains); get_networks(ip_data, &networks); + if (!nm_l3_config_data_get_dns_priority(ip_data->l3cd, ip_data->addr_family, &priority)) { + priority = NM_DNS_PRIORITY_DEFAULT_NORMAL; + } for (guint i = 0; i < nameserver_count; i++) { if (server_builder_append_base(argument_builder, @@ -655,7 +670,8 @@ parse_all_interface_config(GVariantBuilder *argument_builder, dns_server_strings[i], routing_domains, search_domains, - ca)) { + ca, + priority)) { server_builder_append_interface_info(argument_builder, ifname, networks); } } diff --git a/src/core/ndisc/nm-lndp-ndisc.c b/src/core/ndisc/nm-lndp-ndisc.c index 33e9ebf3..f0de2fd5 100644 --- a/src/core/ndisc/nm-lndp-ndisc.c +++ b/src/core/ndisc/nm-lndp-ndisc.c @@ -218,10 +218,22 @@ receive_ra(struct ndp *ndp, struct ndp_msg *msg, gpointer user_data) /* Address */ if (r_plen == 64 && ndp_msg_opt_prefix_flag_auto_addr_conf(msg, offset)) { - const guint32 valid_time = ndp_msg_opt_prefix_valid_time(msg, offset); - const guint32 preferred_time = - NM_MIN(ndp_msg_opt_prefix_preferred_time(msg, offset), valid_time); - const NMNDiscAddress address = { + const guint32 valid_time = ndp_msg_opt_prefix_valid_time(msg, offset); + const guint32 preferred_time = ndp_msg_opt_prefix_preferred_time(msg, offset); + NMNDiscAddress address; + + /* + * RFC 4862 Section 5.5.3 states: + * c) If the preferred lifetime is greater than the valid lifetime, + * silently ignore the Prefix Information option. A node MAY wish to + * log a system management error in this case. + */ + if (preferred_time > valid_time) { + _LOGW("skipping PIO - preferred lifetime > valid lifetime"); + continue; + } + + address = (NMNDiscAddress) { .address = r_network, .expiry_msec = _nm_ndisc_lifetime_to_expiry(now_msec, valid_time), .expiry_preferred_msec = _nm_ndisc_lifetime_to_expiry(now_msec, preferred_time), diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c index ad2edd8d..1a2bf480 100644 --- a/src/core/ndisc/nm-ndisc.c +++ b/src/core/ndisc/nm-ndisc.c @@ -1490,7 +1490,7 @@ clean_addresses(NMNDisc *ndisc, gint64 now_msec, NMNDiscConfigMap *changed, gint g_array_set_size(rdata->addresses, j); } - if (_array_set_size_max(rdata->gateways, priv->config.max_addresses)) + if (_array_set_size_max(rdata->addresses, priv->config.max_addresses)) *changed |= NM_NDISC_CONFIG_ADDRESSES; } @@ -1830,7 +1830,7 @@ _config_init(NMNDiscConfig *config, const NMNDiscConfig *src) nm_assert(config); g_return_if_fail(src); - /* we only allow to set @config if it was cleared (or is not yet initialized). */ + /* we only allow one to set @config if it was cleared (or is not yet initialized). */ nm_assert(!config->l3cfg); nm_assert(!config->ifname); nm_assert(!config->network_id); diff --git a/src/core/nm-bond-manager.c b/src/core/nm-bond-manager.c index 116cb737..abaab7d4 100644 --- a/src/core/nm-bond-manager.c +++ b/src/core/nm-bond-manager.c @@ -916,21 +916,21 @@ nm_bond_manager_send_arp(int bond_ifindex, if (announce_fdb) { /* if we are announcing the FDB we do a RARP, we don't set the * source/dest IPv4 address */ - int ifindexes[] = {bridge_ifindex, bond_ifindex}; - int i; - gs_free NMEtherAddr **fdb_addrs = NULL; + int ifindexes[] = {bridge_ifindex, bond_ifindex}; + int i; + nm_auto_freev NMEtherAddr **fdb_addrs = NULL; - fdb_addrs = nm_linux_platform_get_link_fdb_table(platform, ifindexes, 2); + fdb_addrs = nm_linux_platform_get_bridge_fdb(platform, ifindexes, 2); /* we want to send a Reverse ARP (RARP) packet */ data.op = htons(ARP_OP_RARP); i = 0; while (fdb_addrs[i] != NULL) { NMEtherAddr *tmp_hwaddr = fdb_addrs[i]; + memcpy(data.s_hw_addr, tmp_hwaddr, ETH_ALEN); memcpy(data.d_hw_addr, tmp_hwaddr, ETH_ALEN); memcpy(data.s_addr, tmp_hwaddr, ETH_ALEN); - g_free(tmp_hwaddr); if (sendto(sockfd, &data, sizeof(data), 0, (struct sockaddr *) &addr, sizeof(addr)) < 0) return FALSE; i++; diff --git a/src/core/nm-core-utils.c b/src/core/nm-core-utils.c index 895a9917..d3c2eb21 100644 --- a/src/core/nm-core-utils.c +++ b/src/core/nm-core-utils.c @@ -4642,13 +4642,13 @@ get_max_rate_vht_80_ss3(int mcs) case 5: return 702000000; case 6: - return 0; + return 0; /* invalid */ case 7: return 877500000; case 8: - return 105300000; + return 1053000000; case 9: - return 117000000; + return 1170000000; } return 0; } @@ -4732,7 +4732,7 @@ get_max_rate_vht_160_ss3(int mcs) case 8: return 2106000000; case 9: - return 0; + return 0; /* invalid */ } return 0; } @@ -5417,7 +5417,7 @@ again: if ((g = g_atomic_int_get(&g_static)) == -1) { gid_t g2; - g2 = geteuid(); + g2 = getegid(); g = g2; nm_assert(g == g2); nm_assert(g >= 0); diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index 70867ff7..20623145 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -1419,6 +1419,9 @@ _check_and_add_domain(GPtrArray **p_arr, const char *domain) if (domain[0] == '.' || strstr(domain, "..")) return FALSE; + if (!g_utf8_validate(domain, -1, NULL)) + return FALSE; + len = strlen(domain); if (domain[len - 1] == '.') { copy = g_strndup(domain, len - 1); diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index a9aa506d..1797cd0f 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -2294,7 +2294,7 @@ _l3_acd_data_timeout_schedule(AcdData *acd_data, gint64 timeout_msec) * expect timeouts in certain states. * * That means, scheduling a timeout is only correct if we are in a certain - * state, which allows to handle timeouts. This assert checks for that to + * state, which allows one to handle timeouts. This assert checks for that to * ensure we don't call a timeout in an unexpected state. */ nm_assert(NM_IN_SET(acd_data->info.state, NM_L3_ACD_ADDR_STATE_PROBING, @@ -2751,9 +2751,8 @@ handle_init: goto handle_start_defending; } - acd_data->probing_timestamp_msec = (*p_now_msec); - acd_data->probing_timeout_msec = acd_timeout_msec; - log_reason = "retry probing on timeout"; + acd_data->probing_timeout_msec = acd_timeout_msec; + log_reason = "retry probing on timeout"; goto handle_start_probing; } @@ -3050,7 +3049,7 @@ handle_start_probing: if (!acd_data->nacd_probe) { _LOGT_acd(acd_data, "probing currently %snot possible (timeout %u msec; %s, %s)", - orig_state == NM_L3_ACD_ADDR_STATE_INIT ? "" : " still", + orig_state == NM_L3_ACD_ADDR_STATE_INIT ? "" : "still ", acd_data->probing_timeout_msec, failure_reason, log_reason); diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c index a861b2fe..fce37071 100644 --- a/src/core/nm-manager.c +++ b/src/core/nm-manager.c @@ -478,7 +478,9 @@ _version_info_get(void) * Each of the array's elements has 32 bits. This means that capabilities * with index 0-31 goes to element #1, with index 32-63 to element #2, * with index 64-95 to element #3 and so on. */ - 1 << NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE, + (1 << NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE) + | (1 << NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING) + | (1 << NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN), }; return nm_g_variant_new_au(arr, G_N_ELEMENTS(arr)); @@ -4250,6 +4252,7 @@ add: case NM_LINK_TYPE_OLPC_MESH: case NM_LINK_TYPE_TEAM: case NM_LINK_TYPE_WIFI: + case NM_LINK_TYPE_OPENVSWITCH: _LOGI(LOGD_PLATFORM, "(%s): '%s' plugin not available; creating generic device", plink->name, @@ -4689,16 +4692,10 @@ found_better: if (nm_g_hash_table_contains(exclude_devices, device)) continue; - /* During startup, NM performs a cleanup of the ovsdb to remove previous entries. - * Before the device is suitable for the connection, it must have ovsdb->ready set - * to TRUE. Performing this check in all kind of interfaces is too agressive and leads - * to race conditions, e.g when a non-virtual bond port gets a carrier, preventing the - * device to be a good candidate for the connection. */ - if (nm_device_get_device_type(device) == NM_DEVICE_TYPE_OVS_INTERFACE - && !nm_device_is_available(device, - for_user_request - ? NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST - : NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) + if (!nm_device_is_available(device, + for_user_request + ? NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST + : NM_DEVICE_CHECK_DEV_AVAILABLE_NONE)) continue; /* determine the priority of this device. Currently, this priority is independent diff --git a/src/core/nm-netns.c b/src/core/nm-netns.c index 57dbe9c5..f481bc36 100644 --- a/src/core/nm-netns.c +++ b/src/core/nm-netns.c @@ -75,7 +75,7 @@ typedef struct { /* Indexes the watcher handles. */ GHashTable *watcher_idx; - /* An index of WatcherByTag. It allows to lookup watcher handles by tag. + /* An index of WatcherByTag. It allows one to lookup watcher handles by tag. * Handles without tag are not indexed. */ GHashTable *watcher_by_tag_idx; diff --git a/src/core/nm-policy.c b/src/core/nm-policy.c index 33073e4a..fbcee40d 100644 --- a/src/core/nm-policy.c +++ b/src/core/nm-policy.c @@ -18,6 +18,7 @@ #include "NetworkManagerUtils.h" #include "devices/nm-device.h" #include "devices/nm-device-factory.h" +#include "devices/nm-device-private.h" #include "dns/nm-dns-manager.h" #include "nm-act-request.h" #include "nm-auth-utils.h" @@ -97,7 +98,6 @@ typedef struct { bool updating_dns : 1; GArray *ip6_prefix_delegations; /* pool of ip6 prefixes delegated to all devices */ - } NMPolicyPrivate; struct _NMPolicy { @@ -155,17 +155,15 @@ static gboolean hostname_retry_cb(gpointer user_data); typedef struct { NMPlatformIP6Address prefix; - NMDevice *device; /* The requesting ("uplink") device */ - guint64 next_subnet; /* Cache of the next subnet number to be - * assigned from this prefix */ - GHashTable *subnets; /* ifindex -> NMPlatformIP6Address */ + NMDevice *device; /* The requesting ("uplink") device */ + GHashTable *map_subnet_id_to_ifindex; /* (guint64 *) subnet_id -> int ifindex */ + GHashTable *map_ifindex_to_subnet; /* int ifindex -> (NMPlatformIP6Address *) prefix */ } IP6PrefixDelegation; static void -_clear_ip6_subnet(gpointer key, gpointer value, gpointer user_data) +clear_ip6_subnet(int ifindex, NMPlatformIP6Address *subnet) { - NMPlatformIP6Address *subnet = value; - NMDevice *device = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, GPOINTER_TO_INT(key)); + NMDevice *device = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, ifindex); if (device) { /* We can not remove a subnet we already started announcing. @@ -177,6 +175,12 @@ _clear_ip6_subnet(gpointer key, gpointer value, gpointer user_data) } static void +clear_ip6_subnet_entry(gpointer key, gpointer value, gpointer user_data) +{ + clear_ip6_subnet(GPOINTER_TO_INT(key), value); +} + +static void clear_ip6_prefix_delegation(gpointer data) { IP6PrefixDelegation *delegation = data; @@ -187,8 +191,9 @@ clear_ip6_prefix_delegation(gpointer data) nm_inet6_ntop(&delegation->prefix.address, sbuf), delegation->prefix.plen); - g_hash_table_foreach(delegation->subnets, _clear_ip6_subnet, NULL); - g_hash_table_destroy(delegation->subnets); + g_hash_table_foreach(delegation->map_ifindex_to_subnet, clear_ip6_subnet_entry, NULL); + g_hash_table_destroy(delegation->map_ifindex_to_subnet); + g_hash_table_destroy(delegation->map_subnet_id_to_ifindex); } static void @@ -215,46 +220,112 @@ expire_ip6_delegations(NMPolicy *self) static gboolean ip6_subnet_from_delegation(IP6PrefixDelegation *delegation, NMDevice *device) { - NMPlatformIP6Address *subnet; - int ifindex = nm_device_get_ifindex(device); - char sbuf[NM_INET_ADDRSTRLEN]; - - subnet = g_hash_table_lookup(delegation->subnets, GINT_TO_POINTER(ifindex)); - if (!subnet) { - /* Check for out-of-prefixes condition. */ - if (delegation->next_subnet >= (1 << (64 - delegation->prefix.plen))) { - _LOGD(LOGD_IP6, - "ipv6-pd: no more prefixes in %s/%d", - nm_inet6_ntop(&delegation->prefix.address, sbuf), - delegation->prefix.plen); - return FALSE; + NMPlatformIP6Address *subnet; + int ifindex = nm_device_get_ifindex(device); + char sbuf[NM_INET_ADDRSTRLEN]; + NMSettingPrefixDelegation *s_pd; + gint64 wanted_subnet_id = -1; + guint64 num_subnets; + guint64 old_subnet_id; + + nm_assert(delegation->prefix.plen > 0 && delegation->prefix.plen <= 64); + + s_pd = nm_device_get_applied_setting(device, NM_TYPE_SETTING_PREFIX_DELEGATION); + if (s_pd) { + wanted_subnet_id = nm_setting_prefix_delegation_get_subnet_id(s_pd); + } + + /* Try to use the cached subnet assigned to the interface */ + subnet = g_hash_table_lookup(delegation->map_ifindex_to_subnet, GINT_TO_POINTER(ifindex)); + if (subnet) { + old_subnet_id = nm_ip6_addr_get_subnet_id(&subnet->address, delegation->prefix.plen); + if (wanted_subnet_id != -1 && wanted_subnet_id != old_subnet_id) { + /* The device had a subnet assigned before, but now wants a + * different subnet-id. Release the old subnet and continue below + * to get a new one. */ + clear_ip6_subnet(ifindex, subnet); + subnet = NULL; + g_hash_table_remove(delegation->map_ifindex_to_subnet, GINT_TO_POINTER(ifindex)); + g_hash_table_remove(delegation->map_subnet_id_to_ifindex, &old_subnet_id); + } else { + goto subnet_found; } + } - /* Allocate a new subnet. */ - subnet = g_slice_new0(NMPlatformIP6Address); - g_hash_table_insert(delegation->subnets, GINT_TO_POINTER(ifindex), subnet); + /* Check for out-of-prefixes condition */ + num_subnets = 1 << (64 - delegation->prefix.plen); + if (nm_g_hash_table_size(delegation->map_subnet_id_to_ifindex) >= num_subnets) { + _LOGD(LOGD_IP6, + "ipv6-pd: no more prefixes in %s/%u", + nm_inet6_ntop(&delegation->prefix.address, sbuf), + delegation->prefix.plen); + return FALSE; + } + + /* Try to honor the "prefix-delegation.subnet-id" property */ + if (wanted_subnet_id >= 0) { + gpointer value; + NMDevice *other_device; + + if (g_hash_table_lookup_extended(delegation->map_subnet_id_to_ifindex, + &wanted_subnet_id, + NULL, + &value)) { + other_device = nm_manager_get_device_by_ifindex(NM_MANAGER_GET, GPOINTER_TO_INT(value)); + _LOGW(LOGD_IP6, + "ipv6-pd: subnet-id 0x%" G_GINT64_MODIFIER + "x wanted by device %s is already in use by " + "device %s (ifindex %d)", + (guint64) wanted_subnet_id, + nm_device_get_iface(device), + other_device ? nm_device_get_ip_iface(other_device) : NULL, + GPOINTER_TO_INT(value)); + wanted_subnet_id = -1; + } + } + + /* If we don't have a subnet-id yet, find the first one available */ + if (wanted_subnet_id < 0) { + guint64 i; - subnet->plen = 64; - subnet->address.s6_addr32[0] = - delegation->prefix.address.s6_addr32[0] | htonl(delegation->next_subnet >> 32); - subnet->address.s6_addr32[1] = - delegation->prefix.address.s6_addr32[1] | htonl(delegation->next_subnet); + for (i = 0; i < num_subnets; i++) { + if (!g_hash_table_lookup_extended(delegation->map_subnet_id_to_ifindex, + &i, + NULL, + NULL)) { + wanted_subnet_id = (gint64) i; + break; + } + } - /* Out subnet pool management is pretty unsophisticated. We only add - * the subnets and index them by ifindex. That keeps the implementation - * simple and the dead entries make it easy to reuse the same subnet on - * subsequent activations. On the other hand they may waste the subnet - * space. */ - delegation->next_subnet++; + if (wanted_subnet_id < 0) { + /* We already verified that there are available subnets, this should not happen */ + return nm_assert_unreachable_val(FALSE); + } } + /* Allocate a new subnet */ + subnet = g_slice_new0(NMPlatformIP6Address); + g_hash_table_insert(delegation->map_ifindex_to_subnet, GINT_TO_POINTER(ifindex), subnet); + g_hash_table_insert(delegation->map_subnet_id_to_ifindex, + nm_memdup(&wanted_subnet_id, sizeof(guint64)), + GINT_TO_POINTER(ifindex)); + + subnet->plen = 64; + subnet->address.s6_addr32[0] = + delegation->prefix.address.s6_addr32[0] | htonl(wanted_subnet_id >> 32); + subnet->address.s6_addr32[1] = + delegation->prefix.address.s6_addr32[1] | htonl(wanted_subnet_id); + +subnet_found: subnet->timestamp = delegation->prefix.timestamp; subnet->lifetime = delegation->prefix.lifetime; subnet->preferred = delegation->prefix.preferred; _LOGD(LOGD_IP6, - "ipv6-pd: %s allocated from a /%d prefix on %s", + "ipv6-pd: %s/64 (subnet-id 0x%" G_GINT64_MODIFIER "x) allocated from a /%d prefix on %s", nm_inet6_ntop(&subnet->address, sbuf), + (guint64) wanted_subnet_id, delegation->prefix.plen, nm_device_get_iface(device)); @@ -345,8 +416,9 @@ device_ip6_prefix_delegated(NMDevice *device, if (i == priv->ip6_prefix_delegations->len) { /* Allocate a delegation for new prefix. */ delegation = nm_g_array_append_new(priv->ip6_prefix_delegations, IP6PrefixDelegation); - delegation->subnets = g_hash_table_new(nm_direct_hash, NULL); - delegation->next_subnet = 0; + delegation->map_subnet_id_to_ifindex = + g_hash_table_new_full(nm_puint64_hash, nm_puint64_equal, g_free, NULL); + delegation->map_ifindex_to_subnet = g_hash_table_new(nm_direct_hash, NULL); } delegation->device = device; @@ -960,7 +1032,7 @@ update_system_hostname(NMPolicy *self, const char *msg, gboolean reset_retry_int /* Try a persistent hostname first */ configured_hostname = nm_hostname_manager_get_static_hostname(priv->hostname_manager); - if (configured_hostname && nm_utils_is_specific_hostname(configured_hostname)) { + if (configured_hostname && nm_utils_is_not_empty_hostname(configured_hostname)) { _set_hostname(self, configured_hostname, "from system configuration", FALSE); priv->dhcp_hostname = FALSE; return; @@ -2012,6 +2084,65 @@ unblock_autoconnect_for_ports_for_sett_conn(NMPolicy *self, NMSettingsConnection } static void +refresh_forwarding(NMPolicy *self, NMDevice *device, gboolean is_activated_shared_device) +{ + NMActiveConnection *ac; + NMDevice *tmp_device; + NMPolicyPrivate *priv = NM_POLICY_GET_PRIVATE(self); + const CList *tmp_lst; + gboolean any_shared_active = false; + gint32 default_forwarding_v4; + const char *new_value = NULL; + + /* FIXME: This implementation is still inefficient because refresh_forwarding() + * is called every time a device goes up or down, requiring a full scan of all + * active connections to determine if any shared connection is active. */ + nm_manager_for_each_active_connection (priv->manager, ac, tmp_lst) { + NMSettingIPConfig *s_ip; + NMDevice *to_device = nm_active_connection_get_device(ac); + + if (to_device) { + s_ip = nm_device_get_applied_setting(to_device, NM_TYPE_SETTING_IP4_CONFIG); + if (s_ip) { + if (nm_streq0(nm_device_get_effective_ip_config_method(to_device, AF_INET), + NM_SETTING_IP4_CONFIG_METHOD_SHARED)) { + any_shared_active = true; + break; + } + } + } + } + + default_forwarding_v4 = nm_platform_sysctl_get_int32( + NM_PLATFORM_GET, + NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/conf/default/forwarding"), + 0); + + new_value = any_shared_active ? "1" : (default_forwarding_v4 ? "1" : "0"); + + nm_manager_for_each_device (priv->manager, tmp_device, tmp_lst) { + NMDeviceState state; + NMSettingIPConfigForwarding ipv4_forwarding; + + state = nm_device_get_state(tmp_device); + if (state != NM_DEVICE_STATE_ACTIVATED) + continue; + + ipv4_forwarding = nm_device_get_ipv4_forwarding(tmp_device); + + if (ipv4_forwarding == NM_SETTING_IP_CONFIG_FORWARDING_AUTO + || (device == tmp_device && is_activated_shared_device)) { + gs_free char *sysctl_value = NULL; + + sysctl_value = nm_device_sysctl_ip_conf_get(tmp_device, AF_INET, "forwarding"); + + if (!nm_streq0(sysctl_value, new_value)) + nm_device_sysctl_ip_conf_set(tmp_device, AF_INET, "forwarding", new_value); + } + } +} + +static void activate_port_or_children_connections(NMPolicy *self, NMDevice *device, gboolean activate_children_connections_only) @@ -2155,8 +2286,9 @@ device_state_changed(NMDevice *device, NMPolicyPrivate *priv = user_data; NMPolicy *self = _PRIV_TO_SELF(priv); NMActiveConnection *ac; - NMSettingsConnection *sett_conn = nm_device_get_settings_connection(device); - NMSettingConnection *s_con = NULL; + NMSettingsConnection *sett_conn = nm_device_get_settings_connection(device); + NMSettingConnection *s_con = NULL; + gboolean is_activated_shared_device = FALSE; switch (nm_device_state_reason_check(reason)) { case NM_DEVICE_STATE_REASON_GSM_SIM_PIN_REQUIRED: @@ -2211,8 +2343,10 @@ device_state_changed(NMDevice *device, con_v = nm_settings_connection_get_last_secret_agent_version_id(sett_conn); if (con_v == 0 || con_v == nm_agent_manager_get_agent_version_id(priv->agent_mgr)) { _LOGD(LOGD_DEVICE, - "block-autoconnect: connection '%s' now blocked from autoconnect due to " - "no secrets", + "block-autoconnect: connection[" NM_HASH_OBFUSCATE_PTR_FMT + "] (%s) now blocked from " + "autoconnect due to no secrets", + NM_HASH_OBFUSCATE_PTR(sett_conn), nm_settings_connection_get_id(sett_conn)); nm_settings_connection_autoconnect_blocked_reason_set( sett_conn, @@ -2230,10 +2364,10 @@ device_state_changed(NMDevice *device, * be marked as blocked when it fails with dependency-failed. */ _LOGD(LOGD_DEVICE, - "block-autoconnect: connection[%p] (%s) now blocked from autoconnect due to " - "failed " - "dependency", - sett_conn, + "block-autoconnect: connection[" NM_HASH_OBFUSCATE_PTR_FMT + "] (%s) now blocked " + "from autoconnect due to failed dependency", + NM_HASH_OBFUSCATE_PTR(sett_conn), nm_settings_connection_get_id(sett_conn)); nm_manager_devcon_autoconnect_blocked_reason_set( priv->manager, @@ -2255,20 +2389,25 @@ device_state_changed(NMDevice *device, /* blocked */ } else if (tries != NM_AUTOCONNECT_RETRIES_FOREVER) { _LOGD(LOGD_DEVICE, - "autoconnect: connection[%p] (%s): failed to autoconnect; %u tries left", - sett_conn, + "autoconnect: connection[" NM_HASH_OBFUSCATE_PTR_FMT "] (%s): failed to " + "autoconnect; %u tries left", + NM_HASH_OBFUSCATE_PTR(sett_conn), nm_settings_connection_get_id(sett_conn), tries - 1u); _connection_autoconnect_retries_set(self, device, sett_conn, tries - 1u); } else { _LOGD(LOGD_DEVICE, - "autoconnect: connection[%p] (%s) failed to autoconnect; infinite tries " - "left", - sett_conn, + "autoconnect: connection[" NM_HASH_OBFUSCATE_PTR_FMT "] (%s) failed to " + "autoconnect; infinite tries left", + NM_HASH_OBFUSCATE_PTR(sett_conn), nm_settings_connection_get_id(sett_conn)); } } } + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_ACTIVATED: if (nm_device_get_device_type(device) == NM_DEVICE_TYPE_OVS_INTERFACE) { @@ -2301,11 +2440,20 @@ device_state_changed(NMDevice *device, update_system_hostname(self, "routing and dns", TRUE); nm_dns_manager_end_updates(priv->dns_manager, __func__); + is_activated_shared_device = + nm_streq0(nm_device_get_effective_ip_config_method(device, AF_INET), + NM_SETTING_IP4_CONFIG_METHOD_SHARED); + refresh_forwarding(self, device, is_activated_shared_device); + nm_device_set_refresh_forwarding_done(device, FALSE); break; case NM_DEVICE_STATE_UNMANAGED: case NM_DEVICE_STATE_UNAVAILABLE: if (old_state > NM_DEVICE_STATE_DISCONNECTED) update_routing_and_dns(self, FALSE, device); + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_DEACTIVATING: if (sett_conn) { @@ -2341,6 +2489,10 @@ device_state_changed(NMDevice *device, } } ip6_remove_device_prefix_delegations(self, device); + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_DISCONNECTED: g_signal_handlers_disconnect_by_func(device, device_dns_lookup_done, self); @@ -2357,6 +2509,10 @@ device_state_changed(NMDevice *device, /* Device is now available for auto-activation */ nm_policy_device_recheck_auto_activate_schedule(self, device); + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_PREPARE: @@ -2372,6 +2528,10 @@ device_state_changed(NMDevice *device, g_object_weak_unref(G_OBJECT(ac), pending_ac_gone, self); g_object_unref(self); } + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_IP_CONFIG: /* We must have secrets if we got here. */ @@ -2382,6 +2542,10 @@ device_state_changed(NMDevice *device, sett_conn, NM_SETTINGS_AUTOCONNECT_BLOCKED_REASON_FAILED, FALSE); + if (!nm_device_get_refresh_forwarding_done(device)) { + refresh_forwarding(self, device, FALSE); + nm_device_set_refresh_forwarding_done(device, TRUE); + } break; case NM_DEVICE_STATE_SECONDARIES: if (sett_conn) diff --git a/src/core/platform/nm-fake-platform.c b/src/core/platform/nm-fake-platform.c index 10c69f63..e0d51b70 100644 --- a/src/core/platform/nm-fake-platform.c +++ b/src/core/platform/nm-fake-platform.c @@ -117,7 +117,7 @@ ip6_address_delete(NMPlatform *platform, int ifindex, struct in6_addr addr, guin const int _dirfd = (dirfd); \ const char *const _path = (path); \ \ - g_assert(_path &&_path[0]); \ + g_assert(_path && _path[0]); \ g_assert(!strstr(_path, "/../")); \ if (_dirfd < 0) { \ g_assert(!_pathid); \ diff --git a/src/core/platform/tests/test-common.c b/src/core/platform/tests/test-common.c index 26f8b26b..91445b30 100644 --- a/src/core/platform/tests/test-common.c +++ b/src/core/platform/tests/test-common.c @@ -1356,7 +1356,7 @@ nmtstp_check_platform_full(NMPlatform *platform, guint32 obj_type_flags, gboolea /* For IPv4, it also does not reliably always work. This may * be a bug we want to fix. For now, ignore the check. * - * a) Kernel can wrongly allow to configure the same route twice. + * a) Kernel can wrongly allow one to configure the same route twice. * That means, the same route is visible in `ip route` output, * meaning, it would be added twice to the platform cache. * At least due to that problem, may the weak-id not be properly sorted. @@ -1364,7 +1364,7 @@ nmtstp_check_platform_full(NMPlatform *platform, guint32 obj_type_flags, gboolea * a bug of kernel allowing to configure the exact same route twice. * * b) See https://bugzilla.redhat.com/show_bug.cgi?id=2162315 which is - * a bug where kernel does allow to configure single-hop routes that differ by + * a bug where kernel does allow one to configure single-hop routes that differ by * their next-hop weight, but on the netlink API those routes look the same. * * Due to a) and b), the platform cache may contain only one instance diff --git a/src/core/platform/tests/test-link.c b/src/core/platform/tests/test-link.c index 4cadfe4d..fab6bd2e 100644 --- a/src/core/platform/tests/test-link.c +++ b/src/core/platform/tests/test-link.c @@ -15,6 +15,7 @@ #include "libnm-base/nm-ethtool-base.h" #include "libnm-platform/nmp-object.h" #include "libnm-platform/nmp-netns.h" +#include "libnm-platform/nmp-ethtool-ioctl.h" #include "libnm-platform/nm-platform-utils.h" #include "test-common.h" @@ -2725,6 +2726,66 @@ test_link_set_properties(void) /*****************************************************************************/ static void +test_link_get_bridge_fdb(void) +{ + const NMPlatformLink *link; + nm_auto_freev NMEtherAddr **addrs = NULL; + int ifindex[2]; + guint8 expected[][6] = { + {0x00, 0x99, 0x00, 0x00, 0x00, 0x01}, + {0x00, 0x99, 0x00, 0x00, 0x00, 0x02}, + {0x00, 0x99, 0x00, 0x00, 0x00, 0x03}, + {0x00, 0x99, 0x00, 0x00, 0x00, 0x05}, + }; + guint i; + guint j; + + ifindex[0] = + nmtstp_link_bridge_add(NULL, -1, "br-test-1", &nm_platform_lnk_bridge_default)->ifindex; + ifindex[1] = + nmtstp_link_bridge_add(NULL, -1, "br-test-2", &nm_platform_lnk_bridge_default)->ifindex; + + link = nmtstp_link_get(NULL, ifindex[0], "br-test-1"); + g_assert(link); + link = nmtstp_link_get(NULL, ifindex[1], "br-test-2"); + g_assert(link); + + nmtstp_run_command_check("bridge fdb add dev br-test-1 00:99:00:00:00:01"); + nmtstp_run_command_check("bridge fdb add dev br-test-1 00:99:00:00:00:02"); + nmtstp_run_command_check("bridge fdb add dev br-test-1 00:99:00:00:00:03"); + nmtstp_run_command_check("bridge fdb add dev br-test-2 00:99:00:00:00:01"); + nmtstp_run_command_check("bridge fdb add dev br-test-2 00:99:00:00:00:05"); + + addrs = nm_linux_platform_get_bridge_fdb(NM_PLATFORM_GET, ifindex, 2); + g_assert(addrs); + + /* Check for expected entries */ + for (i = 0; i < G_N_ELEMENTS(expected); i++) { + gboolean found = FALSE; + + for (j = 0; addrs[j]; j++) { + if (memcmp(addrs[j], expected[i], ETH_ALEN) == 0) { + found = TRUE; + break; + } + } + g_assert(found); + } + + /* No dupes */ + for (i = 0; addrs[i]; i++) { + for (j = i + 1; addrs[j]; j++) { + g_assert_cmpint(memcmp(addrs[i], addrs[j], ETH_ALEN), !=, 0); + } + } + + nmtstp_link_delete(NULL, -1, ifindex[0], "br-test-1", TRUE); + nmtstp_link_delete(NULL, -1, ifindex[1], "br-test-2", TRUE); +} + +/*****************************************************************************/ + +static void test_create_many_links_do(guint n_devices) { gint64 time, start_time = nm_utils_get_monotonic_timestamp_nsec(); @@ -3183,10 +3244,10 @@ test_netns_general(gpointer fixture, gconstpointer test_data) * Work around that and skip asserts that are known to fail. */ ethtool_support = nmtstp_run_command("ethtool -i dummy1_ > /dev/null") == 0; if (ethtool_support) { - g_assert(nmp_utils_ethtool_get_driver_info( + g_assert(nmp_ethtool_ioctl_get_driver_info( nmtstp_link_get_typed(platform_1, 0, "dummy1_", NM_LINK_TYPE_DUMMY)->ifindex, &driver_info)); - g_assert(nmp_utils_ethtool_get_driver_info( + g_assert(nmp_ethtool_ioctl_get_driver_info( nmtstp_link_get_typed(platform_1, 0, "dummy2a", NM_LINK_TYPE_DUMMY)->ifindex, &driver_info)); g_assert_cmpint(nmtstp_run_command("ethtool -i dummy1_ > /dev/null"), ==, 0); @@ -3197,10 +3258,10 @@ test_netns_general(gpointer fixture, gconstpointer test_data) g_assert(nm_platform_netns_push(platform_2, &netns_tmp)); if (ethtool_support) { - g_assert(nmp_utils_ethtool_get_driver_info( + g_assert(nmp_ethtool_ioctl_get_driver_info( nmtstp_link_get_typed(platform_2, 0, "dummy1_", NM_LINK_TYPE_DUMMY)->ifindex, &driver_info)); - g_assert(nmp_utils_ethtool_get_driver_info( + g_assert(nmp_ethtool_ioctl_get_driver_info( nmtstp_link_get_typed(platform_2, 0, "dummy2b", NM_LINK_TYPE_DUMMY)->ifindex, &driver_info)); g_assert_cmpint(nmtstp_run_command("ethtool -i dummy1_ > /dev/null"), ==, 0); @@ -4031,7 +4092,7 @@ test_ethtool_features_get(void) _LOGT(">>> ethtool-features-get RUN %u (do-set=%s", i_run, do_set ? "set" : "reset"); - features = nmp_utils_ethtool_get_features(IFINDEX); + features = nmp_ethtool_ioctl_get_features(IFINDEX); g_ptr_array_add(gfree_keeper, features); ethtool_features_dump(features); @@ -4044,7 +4105,7 @@ test_ethtool_features_get(void) features = gfree_keeper->pdata[i_run * 2 - 1]; } - nmp_utils_ethtool_set_features(IFINDEX, features, requested, do_set); + nmp_ethtool_ioctl_set_features(IFINDEX, features, requested, do_set); } } @@ -4105,6 +4166,8 @@ _nmtstp_setup_tests(void) test_software_detect_add("/link/software/detect/wireguard/1", NM_LINK_TYPE_WIREGUARD, 1); test_software_detect_add("/link/software/detect/wireguard/2", NM_LINK_TYPE_WIREGUARD, 2); + g_test_add_func("/link/get-bridge-fdb", test_link_get_bridge_fdb); + g_test_add_func("/link/software/vlan/set-xgress", test_vlan_set_xgress); g_test_add_func("/link/set-properties", test_link_set_properties); diff --git a/src/core/platform/tests/test-route.c b/src/core/platform/tests/test-route.c index a05362f2..f8f7070b 100644 --- a/src/core/platform/tests/test-route.c +++ b/src/core/platform/tests/test-route.c @@ -640,22 +640,23 @@ test_ip4_route_options(gconstpointer test_data) switch (TEST_IDX) { case 1: rts_add[rts_n++] = ((NMPlatformIP4Route) { - .ifindex = IFINDEX, - .rt_source = NM_IP_CONFIG_SOURCE_USER, - .network = nmtst_inet4_from_string("172.16.1.0"), - .plen = 24, - .metric = 20, - .tos = 0x28, - .window = 10000, - .cwnd = 16, - .initcwnd = 30, - .initrwnd = 50, - .mtu = 1350, - .lock_cwnd = TRUE, - .mss = 1300, - .quickack = TRUE, - .rto_min = 1000, - .n_nexthops = 1, + .ifindex = IFINDEX, + .rt_source = NM_IP_CONFIG_SOURCE_USER, + .network = nmtst_inet4_from_string("172.16.1.0"), + .plen = 24, + .metric = 20, + .tos = 0x28, + .window = 10000, + .cwnd = 16, + .initcwnd = 30, + .initrwnd = 50, + .mtu = 1350, + .lock_cwnd = TRUE, + .mss = 1300, + .quickack = TRUE, + .rto_min = 1000, + .rto_min_set = TRUE, + .n_nexthops = 1, }); break; case 2: diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index d64052cb..1e2e2d92 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -1439,7 +1439,7 @@ next:; : "")); break; case PARSE_LINE_TYPE_FLAG: - /* NOTE: the flag (for "onlink") only allows to explicitly set "TRUE". + /* NOTE: the flag (for "onlink") only allows setting "TRUE" explicitly. * There is no way to express an explicit "FALSE" setting * of this attribute, hence, the file format cannot encode * that configuration. */ diff --git a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 6e0411c6..39cbddc5 100644 --- a/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/core/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -3769,7 +3769,7 @@ nms_ifcfg_rh_writer_write_connection(NMConnection *connection, * * FIXME: a much better solution might be, to re-read the connection only based * on the in-memory representation of what we collected above. But the reader - * does not yet allow to inject the configuration. */ + * does not yet allow one to inject the configuration. */ if (out_reread || out_reread_same) { gs_unref_object NMConnection *reread = NULL; gboolean reread_same = FALSE; diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index ea978a98..2f3035ef 100644 --- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -255,8 +255,8 @@ _assert_expected_content(NMConnection *connection, const char *filename, const c GError *_error = NULL; \ gboolean _success; \ \ - g_assert(_ifcfg_dir &&_ifcfg_dir[0]); \ - g_assert(_filename &&_filename[0]); \ + g_assert(_ifcfg_dir && _ifcfg_dir[0]); \ + g_assert(_filename && _filename[0]); \ \ _success = nms_ifcfg_rh_writer_write_connection(_connection, \ _ifcfg_dir, \ @@ -9533,12 +9533,10 @@ test_svUnescape(void) .exp = v_expected, \ .can_concat = !!v_expected, \ } -#define V2(v_value, v_expected) \ - { \ - .val = "" v_value "", \ - .exp = v_expected, \ - .can_concat = TRUE, \ - .needs_ascii_separator = TRUE, \ +#define V2(v_value, v_expected) \ + { \ + .val = "" v_value "", .exp = v_expected, .can_concat = TRUE, \ + .needs_ascii_separator = TRUE, \ } const UnescapeTestData data_full[] = { V1("", ""), diff --git a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c index 6b6913c5..df5dfd40 100644 --- a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c +++ b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c @@ -61,7 +61,7 @@ check_ip_route(NMSettingIPConfig *config, gs_free_error GError *_error = NULL; \ NMConnection *_connection; \ \ - g_assert(full_filename &&full_filename[0] == '/'); \ + g_assert(full_filename && full_filename[0] == '/'); \ \ _connection = \ nms_keyfile_reader_from_file(full_filename, \ diff --git a/src/core/supplicant/nm-supplicant-interface.c b/src/core/supplicant/nm-supplicant-interface.c index d5f56dcd..514b7c0d 100644 --- a/src/core/supplicant/nm-supplicant-interface.c +++ b/src/core/supplicant/nm-supplicant-interface.c @@ -3082,7 +3082,7 @@ _signal_handle(NMSupplicantInterface *self, const char *status; const char *parameter; - if (g_variant_is_of_type(parameters, G_VARIANT_TYPE("(ss)"))) + if (!g_variant_is_of_type(parameters, G_VARIANT_TYPE("(ss)"))) return; g_variant_get(parameters, "(&s&s)", &status, ¶meter); diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver index faa872d7..ad05a4e2 100644 --- a/src/libnm-client-impl/libnm.ver +++ b/src/libnm-client-impl/libnm.ver @@ -1979,6 +1979,11 @@ global: nm_sriov_eswitch_mode_get_type; } libnm_1_44_0; +libnm_1_46_8 { + #nm_ethtool_optname_is_fec@libnm_1_46_8; + #nm_setting_ethtool_fec_mode_get_type@libnm_1_46_8; +} libnm_1_46_0; + libnm_1_48_0 { global: nm_setting_connection_down_on_poweroff_get_type; @@ -2003,12 +2008,22 @@ global: nm_setting_802_1x_get_openssl_ciphers; } libnm_1_46_0; +libnm_1_48_18 { + #nm_ethtool_optname_is_fec@libnm_1_48_18; + #nm_setting_ethtool_fec_mode_get_type@libnm_1_48_18; +} libnm_1_48_0; + libnm_1_50_0 { global: nm_setting_wireless_channel_width_get_type; nm_setting_wireless_get_channel_width; } libnm_1_48_0; +libnm_1_50_4 { + #nm_ethtool_optname_is_fec@libnm_1_50_4; + #nm_setting_ethtool_fec_mode_get_type@libnm_1_50_4; +} libnm_1_50_0; + libnm_1_52_0 { global: nm_device_ipvlan_get_mode; @@ -2048,3 +2063,16 @@ global: nm_setting_ethtool_fec_mode_get_type; nm_ethtool_optname_is_fec; } libnm_1_50_0; + +libnm_1_54_0 { +global: + nm_setting_ip_config_forwarding_get_type; + nm_setting_ip_config_get_forwarding; + nm_setting_ovs_dpdk_get_lsc_interrupt; + nm_setting_ovs_dpdk_lsc_interrupt_get_type; + nm_setting_prefix_delegation_get_subnet_id; + nm_setting_prefix_delegation_get_type; + nm_setting_prefix_delegation_new; + nm_setting_sriov_get_preserve_on_down; + nm_sriov_preserve_on_down_get_type; +} libnm_1_52_0; diff --git a/src/libnm-client-impl/meson.build b/src/libnm-client-impl/meson.build index e50e8fbd..b4936629 100644 --- a/src/libnm-client-impl/meson.build +++ b/src/libnm-client-impl/meson.build @@ -209,7 +209,6 @@ if enable_introspection 'LD_LIBRARY_PATH=' + ld_library_path, python_path, gen_gir_cmd, - '--lib-path', meson.current_build_dir(), '--gir', libnm_gir[0], '--output', '@OUTPUT@', '--target', name diff --git a/src/libnm-client-impl/nm-client.c b/src/libnm-client-impl/nm-client.c index fc30cd06..13343cbf 100644 --- a/src/libnm-client-impl/nm-client.c +++ b/src/libnm-client-impl/nm-client.c @@ -59,6 +59,7 @@ #include "nm-object-private.h" #include "nm-remote-connection.h" #include "nm-utils.h" +#include "nm-setting-ethtool.h" #include "nm-vpn-connection.h" /*****************************************************************************/ @@ -7684,7 +7685,7 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps } else { NMClientInstanceFlags flags = v_uint; - /* After object construction, we only allow to toggle certain flags and + /* After object construction, we only allow one to toggle certain flags and * ignore all other flags. */ if ((priv->instance_flags ^ flags) @@ -8204,7 +8205,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_settings = NML_DBUS_META_IFACE_IN _priv.settings.connections, nm_remote_connection_get_type, .notify_changed_ao = _property_ao_notify_changed_connections_cb, - .check_nmobj_visible_fcn = (gboolean(*)(GObject *)) nm_remote_connection_get_visible), + .check_nmobj_visible_fcn = (gboolean (*)(GObject *)) nm_remote_connection_get_visible), NML_DBUS_META_PROPERTY_INIT_S("Hostname", PROP_HOSTNAME, NMClient, @@ -9314,3 +9315,27 @@ NM_BACKPORT_SYMBOL(libnm_1_30_8, (address)); NM_BACKPORT_SYMBOL(libnm_1_30_8, NMIPRoute *, nm_ip_route_dup, (NMIPRoute * route), (route)); + +NM_BACKPORT_SYMBOL(libnm_1_46_8, + gboolean, + nm_ethtool_optname_is_fec, + (const char *optname), + (optname)); + +NM_BACKPORT_SYMBOL(libnm_1_46_8, GType, nm_setting_ethtool_fec_mode_get_type, (void), ()); + +NM_BACKPORT_SYMBOL(libnm_1_48_18, + gboolean, + nm_ethtool_optname_is_fec, + (const char *optname), + (optname)); + +NM_BACKPORT_SYMBOL(libnm_1_48_18, GType, nm_setting_ethtool_fec_mode_get_type, (void), ()); + +NM_BACKPORT_SYMBOL(libnm_1_50_4, + gboolean, + nm_ethtool_optname_is_fec, + (const char *optname), + (optname)); + +NM_BACKPORT_SYMBOL(libnm_1_50_4, GType, nm_setting_ethtool_fec_mode_get_type, (void), ()); diff --git a/src/libnm-client-impl/nm-device.c b/src/libnm-client-impl/nm-device.c index f9d7329b..1712efa5 100644 --- a/src/libnm-client-impl/nm-device.c +++ b/src/libnm-client-impl/nm-device.c @@ -2376,7 +2376,7 @@ nm_device_is_software(NMDevice *device) * settings with or %NULL to reuse existing * @version_id: zero or the expected version id of the applied connection. * If specified and the version id mismatches, the call fails without - * modification. This allows to catch concurrent accesses. + * modification. This allows one to catch concurrent accesses. * @flags: always set this to zero * @cancellable: a #GCancellable, or %NULL * @error: location for a #GError, or %NULL @@ -2430,7 +2430,7 @@ nm_device_reapply(NMDevice *device, * settings with or %NULL to reuse existing * @version_id: zero or the expected version id of the applied * connection. If specified and the version id mismatches, the call - * fails without modification. This allows to catch concurrent + * fails without modification. This allows one to catch concurrent * accesses. * @flags: always set this to zero * @cancellable: a #GCancellable, or %NULL diff --git a/src/libnm-client-public/NetworkManager.h b/src/libnm-client-public/NetworkManager.h index 3608168f..9e9a4eb8 100644 --- a/src/libnm-client-public/NetworkManager.h +++ b/src/libnm-client-public/NetworkManager.h @@ -59,6 +59,7 @@ #include "nm-setting-ovs-port.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" +#include "nm-setting-prefix-delegation.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" #include "nm-setting-sriov.h" diff --git a/src/libnm-client-public/nm-autoptr.h b/src/libnm-client-public/nm-autoptr.h index 0f6e59c4..f4321ad3 100644 --- a/src/libnm-client-public/nm-autoptr.h +++ b/src/libnm-client-public/nm-autoptr.h @@ -104,6 +104,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingOvsPatch, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingOvsPort, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingPpp, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingPppoe, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingPrefixDelegation, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingProxy, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingSerial, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingSriov, g_object_unref) diff --git a/src/libnm-client-test/nm-test-utils-impl.c b/src/libnm-client-test/nm-test-utils-impl.c index 36d18c50..ce93548e 100644 --- a/src/libnm-client-test/nm-test-utils-impl.c +++ b/src/libnm-client-test/nm-test-utils-impl.c @@ -611,7 +611,7 @@ nmtstc_context_object_new_valist(GType gtype, sync = TRUE; inside_loop = FALSE; } else { - /* The caller allows to iterate the main context. On that point, + /* The caller allows one to iterate the main context. On that point, * we can both use the synchronous and the asynchronous initialization, * both should yield the same result. Choose one randomly. */ sync = nmtst_get_rand_bool(); diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.c b/src/libnm-core-aux-intern/nm-libnm-core-utils.c index 5e7b90a4..94aa42bc 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.c +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.c @@ -749,9 +749,7 @@ nm_dns_uri_parse(int addr_family, const char *str, NMDnsServer *dns) if (!str) return FALSE; - *dns = (NMDnsServer) { - .port = -1, - }; + *dns = (NMDnsServer) {0}; if (NM_STR_HAS_PREFIX(str, "dns+tls://")) { dns->scheme = NM_DNS_URI_SCHEME_TLS; @@ -816,8 +814,8 @@ nm_dns_uri_parse(int addr_family, const char *str, NMDnsServer *dns) end++; if (*end == ':') { end++; - dns->port = _nm_utils_ascii_str_to_int64(end, 10, 0, 65535, G_MAXINT32); - if (dns->port == G_MAXINT32) + dns->port = _nm_utils_ascii_str_to_int64(end, 10, 1, 65535, 0); + if (dns->port == 0) return FALSE; } } else if (addr_family != AF_INET6) { @@ -831,8 +829,8 @@ nm_dns_uri_parse(int addr_family, const char *str, NMDnsServer *dns) if (port) { addr = nm_strndup_a(100, addr_port, port - addr_port, &addr_heap); port++; - dns->port = _nm_utils_ascii_str_to_int64(port, 10, 0, 65535, G_MAXINT32); - if (dns->port == G_MAXINT32) + dns->port = _nm_utils_ascii_str_to_int64(port, 10, 1, 65535, 0); + if (dns->port == 0) return FALSE; } } else { @@ -885,7 +883,7 @@ nm_dns_uri_parse_plain(int addr_family, const char *str, char *out_addrstr, NMIP } return TRUE; case NM_DNS_URI_SCHEME_UDP: - if (dns.port != -1 && dns.port != 53) + if (dns.port != NM_DNS_PORT_UNDEFINED && dns.port != 53) return FALSE; if (dns.interface[0]) return FALSE; @@ -929,9 +927,9 @@ nm_dns_uri_normalize(int addr_family, const char *str, char **out_free) nm_inet_ntop(dns.addr_family, &dns.addr, addrstr); - if (dns.port != -1) { - nm_assert(dns.port >= 0 && dns.port <= 65535); - g_snprintf(portstr, sizeof(portstr), "%d", dns.port); + if (dns.port != NM_DNS_PORT_UNDEFINED) { + nm_assert(dns.port >= 1 && dns.port <= 65535); + g_snprintf(portstr, sizeof(portstr), "%" G_GUINT16_FORMAT, dns.port); } switch (dns.scheme) { @@ -955,15 +953,15 @@ nm_dns_uri_normalize(int addr_family, const char *str, char **out_free) ret = g_strconcat(addrstr, "#", dns.servername, NULL); break; case NM_DNS_URI_SCHEME_UDP: - if (dns.interface[0] || dns.port != -1) { + if (dns.interface[0] || dns.port != NM_DNS_PORT_UNDEFINED) { ret = g_strdup_printf("dns+udp://%s%s%s%s%s%s%s", dns.addr_family == AF_INET6 ? "[" : "", addrstr, dns.interface[0] ? "%" : "", dns.interface[0] ? dns.interface : "", dns.addr_family == AF_INET6 ? "]" : "", - dns.port != -1 ? ":" : "", - dns.port != -1 ? portstr : ""); + dns.port != NM_DNS_PORT_UNDEFINED ? ":" : "", + dns.port != NM_DNS_PORT_UNDEFINED ? portstr : ""); break; } ret = g_strdup_printf("%s%s%s", addrstr, dns.servername ? "#" : "", dns.servername ?: ""); @@ -975,8 +973,8 @@ nm_dns_uri_normalize(int addr_family, const char *str, char **out_free) dns.interface[0] ? "%%" : "", dns.interface[0] ? dns.interface : "", dns.addr_family == AF_INET6 ? "]" : "", - dns.port != -1 ? ":" : "", - dns.port != -1 ? portstr : "", + dns.port != NM_DNS_PORT_UNDEFINED ? ":" : "", + dns.port != NM_DNS_PORT_UNDEFINED ? portstr : "", dns.servername ? "#" : "", dns.servername ?: ""); break; diff --git a/src/libnm-core-aux-intern/nm-libnm-core-utils.h b/src/libnm-core-aux-intern/nm-libnm-core-utils.h index 9d1637a2..eeb720d9 100644 --- a/src/libnm-core-aux-intern/nm-libnm-core-utils.h +++ b/src/libnm-core-aux-intern/nm-libnm-core-utils.h @@ -319,13 +319,15 @@ typedef enum { NM_DNS_URI_SCHEME_TLS, } NMDnsUriScheme; +#define NM_DNS_PORT_UNDEFINED 0 + typedef struct { NMIPAddr addr; const char *servername; char interface[NM_IFNAMSIZ]; NMDnsUriScheme scheme; int addr_family; - int port; + guint16 port; } NMDnsServer; gboolean nm_dns_uri_parse(int addr_family, const char *str, NMDnsServer *out_dns); diff --git a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in index e0ce4ac4..c764f535 100644 --- a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in +++ b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in @@ -1712,6 +1712,10 @@ dbus-type="as" gprop-type="GStrv" /> + <property name="forwarding" + dbus-type="i" + gprop-type="gint" + /> <property name="gateway" dbus-type="s" gprop-type="gchararray" @@ -1867,6 +1871,10 @@ dbus-type="as" gprop-type="GStrv" /> + <property name="forwarding" + dbus-type="i" + gprop-type="gint" + /> <property name="gateway" dbus-type="s" gprop-type="gchararray" @@ -2120,6 +2128,10 @@ dbus-type="s" gprop-type="gchararray" /> + <property name="lsc-interrupt" + dbus-type="i" + gprop-type="gint" + /> <property name="n-rxq" dbus-type="u" gprop-type="guint" @@ -2303,6 +2315,14 @@ gprop-type="gchararray" /> </setting> + <setting name="prefix-delegation" + gtype="NMSettingPrefixDelegation" + > + <property name="subnet-id" + dbus-type="x" + gprop-type="gint64" + /> + </setting> <setting name="proxy" gtype="NMSettingProxy" > @@ -2366,6 +2386,10 @@ dbus-type="i" gprop-type="gint" /> + <property name="preserve-on-down" + dbus-type="i" + gprop-type="gint" + /> <property name="total-vfs" dbus-type="u" gprop-type="guint" diff --git a/src/libnm-core-impl/meson.build b/src/libnm-core-impl/meson.build index e068d6bd..610e2279 100644 --- a/src/libnm-core-impl/meson.build +++ b/src/libnm-core-impl/meson.build @@ -41,6 +41,7 @@ libnm_core_settings_sources = files( 'nm-setting-ovs-port.c', 'nm-setting-ppp.c', 'nm-setting-pppoe.c', + 'nm-setting-prefix-delegation.c', 'nm-setting-proxy.c', 'nm-setting-serial.c', 'nm-setting-sriov.c', diff --git a/src/libnm-core-impl/nm-connection.c b/src/libnm-core-impl/nm-connection.c index 61a20a13..0fbadfb8 100644 --- a/src/libnm-core-impl/nm-connection.c +++ b/src/libnm-core-impl/nm-connection.c @@ -3359,6 +3359,8 @@ nm_connection_get_virtual_device_description(NMConnection *connection) display_type = _("TUN/TAP"); else if (nm_streq(type, NM_SETTING_VETH_SETTING_NAME)) display_type = _("Veth"); + else if (nm_streq(type, NM_SETTING_LOOPBACK_SETTING_NAME)) + display_type = _("Loopback"); if (!iface || !display_type) return NULL; diff --git a/src/libnm-core-impl/nm-keyfile.c b/src/libnm-core-impl/nm-keyfile.c index e4559e3c..f8f735e9 100644 --- a/src/libnm-core-impl/nm-keyfile.c +++ b/src/libnm-core-impl/nm-keyfile.c @@ -1684,7 +1684,7 @@ nm_keyfile_detect_unqualified_path_scheme(const char *base_dir, const char *const _bin = (bin); \ const gsize _bin_len = (bin_len); \ \ - nm_assert(_bin &&_bin_len > 0); \ + nm_assert(_bin && _bin_len > 0); \ \ (_bin_len > NM_STRLEN(scheme) + 1 && _bin[_bin_len - 1] == '\0' \ && memcmp(_bin, scheme, NM_STRLEN(scheme)) == 0); \ diff --git a/src/libnm-core-impl/nm-meta-setting-base-impl.c b/src/libnm-core-impl/nm-meta-setting-base-impl.c index b9dcf34f..52af9ad2 100644 --- a/src/libnm-core-impl/nm-meta-setting-base-impl.c +++ b/src/libnm-core-impl/nm-meta-setting-base-impl.c @@ -51,6 +51,7 @@ #include "nm-setting-ovs-port.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" +#include "nm-setting-prefix-delegation.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" #include "nm-setting-tc-config.h" @@ -484,6 +485,13 @@ const NMMetaSettingInfo nm_meta_setting_infos[] = { .setting_name = NM_SETTING_PPP_SETTING_NAME, .get_setting_gtype = nm_setting_ppp_get_type, }, + [NM_META_SETTING_TYPE_PREFIX_DELEGATION] = + { + .meta_type = NM_META_SETTING_TYPE_PREFIX_DELEGATION, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_PREFIX_DELEGATION_SETTING_NAME, + .get_setting_gtype = nm_setting_prefix_delegation_get_type, + }, [NM_META_SETTING_TYPE_PROXY] = { .meta_type = NM_META_SETTING_TYPE_PROXY, @@ -698,6 +706,7 @@ const NMMetaSettingType nm_meta_setting_types_by_priority[] = { NM_META_SETTING_TYPE_HOSTNAME, NM_META_SETTING_TYPE_IP4_CONFIG, NM_META_SETTING_TYPE_IP6_CONFIG, + NM_META_SETTING_TYPE_PREFIX_DELEGATION, NM_META_SETTING_TYPE_PROXY, NM_META_SETTING_TYPE_TC_CONFIG, diff --git a/src/libnm-core-impl/nm-setting-bond.c b/src/libnm-core-impl/nm-setting-bond.c index 60ae0294..7204df48 100644 --- a/src/libnm-core-impl/nm-setting-bond.c +++ b/src/libnm-core-impl/nm-setting-bond.c @@ -1118,7 +1118,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, _("'%s' option is only valid with mode '%s'"), - NM_SETTING_BOND_OPTION_LACP_RATE, + NM_SETTING_BOND_OPTION_LACP_ACTIVE, "802.3ad"); g_prefix_error(error, "%s.%s: ", NM_SETTING_BOND_SETTING_NAME, NM_SETTING_BOND_OPTIONS); return FALSE; diff --git a/src/libnm-core-impl/nm-setting-connection.c b/src/libnm-core-impl/nm-setting-connection.c index 4a910c7f..4829dcdc 100644 --- a/src/libnm-core-impl/nm-setting-connection.c +++ b/src/libnm-core-impl/nm-setting-connection.c @@ -2533,7 +2533,7 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass) * NMSettingConnection:stable-id: * * This represents the identity of the connection used for various purposes. - * It allows to configure multiple profiles to share the identity. Also, + * It allows configuring multiple profiles to share the identity. Also, * the stable-id can contain placeholders that are substituted dynamically and * deterministically depending on the context. * diff --git a/src/libnm-core-impl/nm-setting-infiniband.c b/src/libnm-core-impl/nm-setting-infiniband.c index 24e5807a..b70247c1 100644 --- a/src/libnm-core-impl/nm-setting-infiniband.c +++ b/src/libnm-core-impl/nm-setting-infiniband.c @@ -212,6 +212,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) NM_CONNECTION_ERROR_INVALID_PROPERTY, _("Must specify a P_Key if specifying parent")); g_prefix_error(error, "%s: ", NM_SETTING_INFINIBAND_PARENT); + return FALSE; } } diff --git a/src/libnm-core-impl/nm-setting-ip-config.c b/src/libnm-core-impl/nm-setting-ip-config.c index 1ec97029..ad95eb1a 100644 --- a/src/libnm-core-impl/nm-setting-ip-config.c +++ b/src/libnm-core-impl/nm-setting-ip-config.c @@ -4009,7 +4009,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMSettingIPConfig, PROP_DHCP_SEND_RELEASE, PROP_ROUTED_DNS, PROP_SHARED_DHCP_RANGE, - PROP_SHARED_DHCP_LEASE_TIME, ); + PROP_SHARED_DHCP_LEASE_TIME, + PROP_FORWARDING, ); G_DEFINE_ABSTRACT_TYPE(NMSettingIPConfig, nm_setting_ip_config, NM_TYPE_SETTING) @@ -5559,6 +5560,22 @@ nm_setting_ip_config_get_shared_dhcp_lease_time(NMSettingIPConfig *setting) return NM_SETTING_IP_CONFIG_GET_PRIVATE(setting)->shared_dhcp_lease_time; } +/** + * nm_setting_ip_config_get_forwarding: + * @setting: the #NMSettingIPConfig + * + * Returns: the #NMSettingIPConfig:forwarding property of the setting + * + * Since: 1.54 + **/ +NMSettingIPConfigForwarding +nm_setting_ip_config_get_forwarding(NMSettingIPConfig *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_IP_CONFIG(setting), NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT); + + return NM_SETTING_IP_CONFIG_GET_PRIVATE(setting)->forwarding; +} + static gboolean verify_label(const char *label) { @@ -6337,6 +6354,13 @@ _nm_sett_info_property_override_create_array_ip_config(int addr_family) .direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(gint32, NMSettingIPConfigPrivate, shared_dhcp_lease_time)); + _nm_properties_override_gobj( + properties_override, + obj_properties[PROP_FORWARDING], + &nm_sett_info_propert_type_direct_enum, + .direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(int, NMSettingIPConfigPrivate, forwarding), + .direct_data.enum_gtype = NM_TYPE_SETTING_IP_CONFIG_FORWARDING); + return properties_override; } @@ -7120,6 +7144,33 @@ nm_setting_ip_config_class_init(NMSettingIPConfigClass *klass) NM_SETTING_IP_CONFIG_ROUTED_DNS_DEFAULT, G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); + /** + * NMSettingIPConfig:forwarding: + * + * Whether to configure sysctl interface-specific forwarding. When enabled, the interface + * will act as a router to forward the packet from one interface to another. When set to + * %NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT, the value from global configuration is used; + * if no global default is defined, %NM_SETTING_IP_CONFIG_FORWARDING_AUTO will be used. + * The #NMSettingIPConfig:forwarding property is ignored when #NMSettingIPConfig:method + * is set to "shared", because forwarding is always enabled in this case. + * The accepted values are: + * %NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT: use global default. + * %NM_SETTING_IP_CONFIG_FORWARDING_NO: disabled. + * %NM_SETTING_IP_CONFIG_FORWARDING_YES: enabled. + * %NM_SETTING_IP_CONFIG_FORWARDING_AUTO: enable if any shared connection is active, + * use kernel default otherwise. + * + * Since: 1.54 + */ + obj_properties[PROP_FORWARDING] = + g_param_spec_int(NM_SETTING_IP_CONFIG_FORWARDING, + "", + "", + NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT, + NM_SETTING_IP_CONFIG_FORWARDING_AUTO, + NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT, + G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); + /** * NMSettingIPConfig:dhcp-send-hostname-v2: * diff --git a/src/libnm-core-impl/nm-setting-ipvlan.c b/src/libnm-core-impl/nm-setting-ipvlan.c index fafa37b6..0468e31f 100644 --- a/src/libnm-core-impl/nm-setting-ipvlan.c +++ b/src/libnm-core-impl/nm-setting-ipvlan.c @@ -156,6 +156,19 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } } + if (!NM_IN_SET(priv->mode, + NM_SETTING_IPVLAN_MODE_L2, + NM_SETTING_IPVLAN_MODE_L3, + NM_SETTING_IPVLAN_MODE_L3S)) { + g_set_error(error, + NM_CONNECTION_ERROR, + NM_CONNECTION_ERROR_INVALID_PROPERTY, + _("unsupported mode %u"), + priv->mode); + g_prefix_error(error, "%s.%s: ", NM_SETTING_IPVLAN_SETTING_NAME, NM_SETTING_IPVLAN_MODE); + return FALSE; + } + if (priv->private_flag && priv->vepa) { g_set_error(error, NM_CONNECTION_ERROR, diff --git a/src/libnm-core-impl/nm-setting-match.c b/src/libnm-core-impl/nm-setting-match.c index 255283fc..dc743b15 100644 --- a/src/libnm-core-impl/nm-setting-match.c +++ b/src/libnm-core-impl/nm-setting-match.c @@ -309,9 +309,10 @@ nm_setting_match_clear_kernel_command_lines(NMSettingMatch *setting) * @setting: the #NMSettingMatch * @length: (out) (optional): the length of the returned interface names array. * - * Returns all the interface names. + * Returns all the kernel command line arguments. * - * Returns: (transfer none) (array length=length): the configured interface names. + * Returns: (transfer none) (array length=length): the configured kernel command + * line arguments. * * Since: 1.26 **/ @@ -344,7 +345,7 @@ nm_setting_match_get_num_drivers(NMSettingMatch *setting) /** * nm_setting_match_get_driver: * @setting: the #NMSettingMatch - * @idx: index number of the DNS search domain to return + * @idx: index number of the driver to return * * Since 1.46, access at index "len" is allowed and returns NULL. * @@ -443,7 +444,7 @@ nm_setting_match_clear_drivers(NMSettingMatch *setting) /** * nm_setting_match_get_drivers: * @setting: the #NMSettingMatch - * @length: (out) (optional): the length of the returned interface names array. + * @length: (out) (optional): the length of the returned drivers array. * * Returns all the drivers. * diff --git a/src/libnm-core-impl/nm-setting-ovs-dpdk.c b/src/libnm-core-impl/nm-setting-ovs-dpdk.c index 53931f46..3f5cbe11 100644 --- a/src/libnm-core-impl/nm-setting-ovs-dpdk.c +++ b/src/libnm-core-impl/nm-setting-ovs-dpdk.c @@ -22,7 +22,11 @@ /*****************************************************************************/ -NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_DEVARGS, PROP_N_RXQ, PROP_N_RXQ_DESC, PROP_N_TXQ_DESC, ); +NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_DEVARGS, + PROP_N_RXQ, + PROP_N_RXQ_DESC, + PROP_N_TXQ_DESC, + PROP_LSC_INTERRUPT, ); /** * NMSettingOvsDpdk: @@ -36,6 +40,7 @@ struct _NMSettingOvsDpdk { guint32 n_rxq; guint32 n_rxq_desc; guint32 n_txq_desc; + int lsc_interrupt; }; struct _NMSettingOvsDpdkClass { @@ -110,6 +115,22 @@ nm_setting_ovs_dpdk_get_n_txq_desc(NMSettingOvsDpdk *self) return self->n_txq_desc; } +/** + * nm_setting_ovs_dpdk_get_lsc_interrupt: + * @self: the #NMSettingOvsDpdk + * + * Returns: the #NMSettingOvsDpdk:lsc-interrupt property of the setting + * + * Since: 1.54 + **/ +NMSettingOvsDpdkLscInterrupt +nm_setting_ovs_dpdk_get_lsc_interrupt(NMSettingOvsDpdk *self) +{ + g_return_val_if_fail(NM_IS_SETTING_OVS_DPDK(self), NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE); + + return self->lsc_interrupt; +} + /*****************************************************************************/ static gboolean @@ -257,6 +278,29 @@ nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass) NMSettingOvsDpdk, n_txq_desc); + /** + * NMSettingOvsDpdk:lsc-interrupt: + * + * Configures the Link State Change (LSC) detection mode for the OVS DPDK interface. + * When set to %NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE, NetworkManager doesn't + * change the default value configured by Open vSwitch. + * %NM_SETTING_OVS_DPDK_LSC_INTERRUPT_ENABLED enables interrupts. + * %NM_SETTING_OVS_DPDK_LSC_INTERRUPT_DISABLED disables interrupts, thus setting the + * interface in poll mode. + * + * Since: 1.54 + **/ + _nm_setting_property_define_direct_enum(properties_override, + obj_properties, + NM_SETTING_OVS_DPDK_LSC_INTERRUPT, + PROP_LSC_INTERRUPT, + NM_TYPE_SETTING_OVS_DPDK_LSC_INTERRUPT, + NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE, + NM_SETTING_PARAM_NONE, + NULL, + NMSettingOvsDpdk, + lsc_interrupt); + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); _nm_setting_class_commit(setting_class, diff --git a/src/libnm-core-impl/nm-setting-ovs-external-ids.c b/src/libnm-core-impl/nm-setting-ovs-external-ids.c index 9acdae6c..22448e68 100644 --- a/src/libnm-core-impl/nm-setting-ovs-external-ids.c +++ b/src/libnm-core-impl/nm-setting-ovs-external-ids.c @@ -20,7 +20,7 @@ * SECTION:nm-setting-ovs-external-ids * @short_description: External-IDs for OVS database * - * The #NMSettingOvsExternalIDs object is a #NMSetting subclass that allow to + * The #NMSettingOvsExternalIDs object is a #NMSetting subclass that allows one to * configure external ids for OVS. **/ diff --git a/src/libnm-core-impl/nm-setting-ovs-other-config.c b/src/libnm-core-impl/nm-setting-ovs-other-config.c index 46d991d4..392fc46b 100644 --- a/src/libnm-core-impl/nm-setting-ovs-other-config.c +++ b/src/libnm-core-impl/nm-setting-ovs-other-config.c @@ -19,8 +19,8 @@ * SECTION:nm-setting-ovs-other-config * @short_description: Other-config settings for OVS * - * The #NMSettingOvsOtherConfig object is a #NMSetting subclass that allows to - * configure other_config settings for OVS. See also "other_config" in the + * The #NMSettingOvsOtherConfig object is a #NMSetting subclass that specifies + * "other_config" settings for OVS. See also "other_config" in the * "ovs-vswitchd.conf.db" manual for the keys that OVS supports. **/ diff --git a/src/libnm-core-impl/nm-setting-prefix-delegation.c b/src/libnm-core-impl/nm-setting-prefix-delegation.c new file mode 100644 index 00000000..100d3153 --- /dev/null +++ b/src/libnm-core-impl/nm-setting-prefix-delegation.c @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#include "libnm-core-impl/nm-default-libnm-core.h" + +#include "nm-setting-prefix-delegation.h" + +#include "nm-connection-private.h" +#include "nm-setting-connection.h" +#include "nm-setting-private.h" + +/** + * SECTION:nm-setting-prefix-delegation + * @short_description: Describes connection properties related to IPv6 prefix delegation + * + * The #NMSettingPrefixDelegation object is a #NMSetting subclass that describes the + * configuration of downstream interfaces using IPv6 prefix delegation. + **/ + +/*****************************************************************************/ + +NM_GOBJECT_PROPERTIES_DEFINE_BASE(PROP_SUBNET_ID, ); + +/** + * NMSettingPrefixDelegation: + * + * IPv6 prefix delegation settings + * + * Since: 1.54 + */ +struct _NMSettingPrefixDelegation { + NMSetting parent; + gint64 subnet_id; +}; + +struct _NMSettingPrefixDelegationClass { + NMSettingClass parent; +}; + +G_DEFINE_TYPE(NMSettingPrefixDelegation, nm_setting_prefix_delegation, NM_TYPE_SETTING) + +/*****************************************************************************/ + +/** + * nm_setting_prefix_delegation_get_subnet_id: + * @setting: the #NMSettingPrefixDelegation + * + * Returns: the subnet ID for prefix delegation + * + * Since: 1.54 + **/ +gint64 +nm_setting_prefix_delegation_get_subnet_id(NMSettingPrefixDelegation *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_PREFIX_DELEGATION(setting), 0); + + return setting->subnet_id; +} + +/*****************************************************************************/ + +static void +nm_setting_prefix_delegation_init(NMSettingPrefixDelegation *setting) +{} + +/** + * nm_setting_prefix_delegation_new: + * + * Creates a new #NMSettingPrefixDelegation object with default values. + * + * Returns: (transfer full): the new empty #NMSettingPrefixDelegation object + * + * Since: 1.54 + **/ +NMSetting * +nm_setting_prefix_delegation_new(void) +{ + return g_object_new(NM_TYPE_SETTING_PREFIX_DELEGATION, NULL); +} + +static void +nm_setting_prefix_delegation_class_init(NMSettingPrefixDelegationClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + NMSettingClass *setting_class = NM_SETTING_CLASS(klass); + GArray *properties_override = _nm_sett_info_property_override_create_array(); + + object_class->get_property = _nm_setting_property_get_property_direct; + object_class->set_property = _nm_setting_property_set_property_direct; + + /** + * NMSettingPrefixDelegation:subnet-id: + * + * The subnet ID to use on the interface from the prefix delegation received via + * an upstream interface. Set to a value between 0 and 0xffffffff (2^32 - 1) + * to indicate a specific subnet ID; or set to -1 to automatically choose + * an available subnet ID. + * + * Since: 1.54 + **/ + _nm_setting_property_define_direct_int64(properties_override, + obj_properties, + NM_SETTING_PREFIX_DELEGATION_SUBNET_ID, + PROP_SUBNET_ID, + -1, + G_MAXUINT32, + -1, + NM_SETTING_PARAM_NONE, + NMSettingPrefixDelegation, + subnet_id); + + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); + + _nm_setting_class_commit(setting_class, + NM_META_SETTING_TYPE_PREFIX_DELEGATION, + NULL, + properties_override, + 0); +} diff --git a/src/libnm-core-impl/nm-setting-private.h b/src/libnm-core-impl/nm-setting-private.h index ba838364..8ee770f4 100644 --- a/src/libnm-core-impl/nm-setting-private.h +++ b/src/libnm-core-impl/nm-setting-private.h @@ -193,6 +193,7 @@ typedef struct { int replace_local_rule; int dhcp_send_release; int routed_dns; + int forwarding; int dhcp_send_hostname_v2; gint32 required_timeout; gint32 dad_timeout; @@ -555,7 +556,7 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p * * _nm_setting_get_private(setting, sett_info, property_info->direct_offset) * - * which allows to generically handle the property operations (like get, set, compare). + * which allows one to generically handle the property operations (like get, set, compare). */ #define _nm_setting_property_define_direct_boolean(properties_override, \ diff --git a/src/libnm-core-impl/nm-setting-sriov.c b/src/libnm-core-impl/nm-setting-sriov.c index 4dc61d82..d6be0ec1 100644 --- a/src/libnm-core-impl/nm-setting-sriov.c +++ b/src/libnm-core-impl/nm-setting-sriov.c @@ -22,6 +22,7 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMSettingSriov, PROP_TOTAL_VFS, PROP_VFS, + PROP_PRESERVE_ON_DOWN, PROP_AUTOPROBE_DRIVERS, PROP_ESWITCH_MODE, PROP_ESWITCH_INLINE_MODE, @@ -39,6 +40,7 @@ struct _NMSettingSriov { GPtrArray *vfs; int autoprobe_drivers; guint32 total_vfs; + int preserve_on_down; int eswitch_mode; int eswitch_inline_mode; int eswitch_encap_mode; @@ -827,6 +829,22 @@ nm_setting_sriov_clear_vfs(NMSettingSriov *setting) } /** + * nm_setting_sriov_get_preserve_on_down: + * @setting: the #NMSettingSriov + * + * Returns: the value contained in the #NMSettingSriov:preserve-on-down property. + * + * Since: 1.54 + */ +NMSriovPreserveOnDown +nm_setting_sriov_get_preserve_on_down(NMSettingSriov *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_SRIOV(setting), NM_SRIOV_PRESERVE_ON_DOWN_DEFAULT); + + return setting->preserve_on_down; +} + +/** * nm_setting_sriov_get_autoprobe_drivers: * @setting: the #NMSettingSriov * @@ -1462,6 +1480,35 @@ nm_setting_sriov_class_init(NMSettingSriovClass *klass) NMSettingSriov, eswitch_encap_mode); + /** + * NMSettingSriov:preserve-on-down + * + * This controls whether NetworkManager preserves the SR-IOV parameters set on + * the device when the connection is deactivated, or whether it resets them to + * their default value. The SR-IOV parameters are those specified in this setting + * (the "sriov" setting), like the number of VFs to create, the eswitch + * configuration, etc. + * + * If set to %NM_SRIOV_PRESERVE_ON_DOWN_NO, NetworkManager resets the SR-IOV + * parameters when the connection is deactivated. When set to + * %NM_SRIOV_PRESERVE_ON_DOWN_YES, NetworkManager preserves those parameters + * on the device. If the value is %NM_SRIOV_PRESERVE_ON_DOWN_DEFAULT, NetworkManager + * looks up a global default value in the configuration; in case no such value is + * defined, it uses %NM_SRIOV_PRESERVE_ON_DOWN_NO as fallback. + * + * Since: 1.54 + */ + _nm_setting_property_define_direct_enum(properties_override, + obj_properties, + NM_SETTING_SRIOV_PRESERVE_ON_DOWN, + PROP_PRESERVE_ON_DOWN, + NM_TYPE_SRIOV_PRESERVE_ON_DOWN, + NM_SRIOV_PRESERVE_ON_DOWN_DEFAULT, + NM_SETTING_PARAM_FUZZY_IGNORE, + NULL, + NMSettingSriov, + preserve_on_down); + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); _nm_setting_class_commit(setting_class, diff --git a/src/libnm-core-impl/nm-setting-tun.c b/src/libnm-core-impl/nm-setting-tun.c index 05460104..cac0f10b 100644 --- a/src/libnm-core-impl/nm-setting-tun.c +++ b/src/libnm-core-impl/nm-setting-tun.c @@ -166,7 +166,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } if (priv->owner) { - if (_nm_utils_ascii_str_to_int64(priv->owner, 10, 0, G_MAXINT32, -1) == -1) { + if (_nm_utils_ascii_str_to_int64(priv->owner, 10, 0, G_MAXUINT32 - 1, -1) == -1) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, @@ -178,7 +178,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error) } if (priv->group) { - if (_nm_utils_ascii_str_to_int64(priv->group, 10, 0, G_MAXINT32, -1) == -1) { + if (_nm_utils_ascii_str_to_int64(priv->group, 10, 0, G_MAXUINT32 - 1, -1) == -1) { g_set_error(error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, diff --git a/src/libnm-core-impl/nm-setting-user.c b/src/libnm-core-impl/nm-setting-user.c index 8c2a9942..69f73a8d 100644 --- a/src/libnm-core-impl/nm-setting-user.c +++ b/src/libnm-core-impl/nm-setting-user.c @@ -15,7 +15,7 @@ * SECTION:nm-setting-user * @short_description: Describes user properties * - * The #NMSettingUser object is a #NMSetting subclass that allow to attach + * The #NMSettingUser object is a #NMSetting subclass that allows one to attach * arbitrary user data to #NMConnection objects. **/ diff --git a/src/libnm-core-impl/nm-setting-wired.c b/src/libnm-core-impl/nm-setting-wired.c index e02c0a06..b80d0142 100644 --- a/src/libnm-core-impl/nm-setting-wired.c +++ b/src/libnm-core-impl/nm-setting-wired.c @@ -1575,7 +1575,7 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass) * * With #NMSettingWired:cloned-mac-address setting "random" or "stable", * by default all bits of the MAC address are scrambled and a locally-administered, - * unicast MAC address is created. This property allows to specify that certain bits + * unicast MAC address is created. This property allows one to specify that certain bits * are fixed. Note that the least significant bit of the first MAC address will * always be unset to create a unicast MAC address. * diff --git a/src/libnm-core-impl/nm-setting-wireless.c b/src/libnm-core-impl/nm-setting-wireless.c index be08fa8c..1c5486bf 100644 --- a/src/libnm-core-impl/nm-setting-wireless.c +++ b/src/libnm-core-impl/nm-setting-wireless.c @@ -1886,7 +1886,7 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass) * * With #NMSettingWireless:cloned-mac-address setting "random" or "stable", * by default all bits of the MAC address are scrambled and a locally-administered, - * unicast MAC address is created. This property allows to specify that certain bits + * unicast MAC address is created. This property allows one to specify that certain bits * are fixed. Note that the least significant bit of the first MAC address will * always be unset to create a unicast MAC address. * diff --git a/src/libnm-core-impl/nm-utils.c b/src/libnm-core-impl/nm-utils.c index 6528b5fb..6d5df98c 100644 --- a/src/libnm-core-impl/nm-utils.c +++ b/src/libnm-core-impl/nm-utils.c @@ -1345,7 +1345,7 @@ nm_utils_ip4_dns_from_variant(GVariant *value) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip4_dns_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip4_dns_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (type utf8): a %NULL-terminated array of IP address @@ -1467,9 +1467,9 @@ nm_utils_ip4_addresses_from_variant(GVariant *value, char **out_gateway) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip4_addresses_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip4_addresses_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. It also - * allows to parse the address-labels at the same time than the addresses. + * allows one to parse the address-labels at the same time than the addresses. * * The labels need to be processed at the same time than the addresses, inside * this function, because if there are invalid addresses they are filtered out, @@ -1648,7 +1648,7 @@ nm_utils_ip4_routes_from_variant(GVariant *value) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip4_routes_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip4_routes_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (element-type NMIPRoute): a newly allocated @@ -1799,7 +1799,7 @@ nm_utils_ip6_dns_from_variant(GVariant *value) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip6_dns_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip6_dns_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (type utf8): a %NULL-terminated array of IP address @@ -1942,7 +1942,7 @@ nm_utils_ip6_addresses_from_variant(GVariant *value, char **out_gateway) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip6_addresses_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip6_addresses_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (element-type NMIPAddress): a newly allocated @@ -2124,7 +2124,7 @@ nm_utils_ip6_routes_from_variant(GVariant *value) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip6_routes_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip6_routes_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (element-type NMIPRoute): a newly allocated @@ -2315,7 +2315,7 @@ nm_utils_ip_addresses_from_variant(GVariant *value, int family) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip_addresses_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip_addresses_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (element-type NMIPAddress): a newly allocated @@ -2493,7 +2493,7 @@ nm_utils_ip_routes_from_variant(GVariant *value, int family) * @strict: whether to parse in strict mode or best-effort mode * @error: the error location * - * Like #nm_utils_ip_routes_from_variant, but allows to parse in strict mode. In + * Like #nm_utils_ip_routes_from_variant, but allows one to parse in strict mode. In * strict mode, parsing is aborted on first error and %NULL is returned. * * Returns: (transfer full) (element-type NMIPRoute): a newly allocated diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index d581fc79..43e73c3d 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -4099,6 +4099,7 @@ test_connection_diff_a_only(void) {NM_SETTING_IP_CONFIG_ROUTED_DNS, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_IP_CONFIG_SHARED_DHCP_RANGE, NM_SETTING_DIFF_RESULT_IN_A}, {NM_SETTING_IP_CONFIG_SHARED_DHCP_LEASE_TIME, NM_SETTING_DIFF_RESULT_IN_A}, + {NM_SETTING_IP_CONFIG_FORWARDING, NM_SETTING_DIFF_RESULT_IN_A}, {NULL, NM_SETTING_DIFF_RESULT_UNKNOWN}, }}, }; @@ -8679,11 +8680,9 @@ test_nm_utils_ascii_str_to_int64(void) static void test_nm_utils_strstrdictkey(void) { -#define _VALUES_STATIC(_v1, _v2) \ - { \ - .v1 = _v1, \ - .v2 = _v2, \ - .v_static = _nm_utils_strstrdictkey_static(_v1, _v2), \ +#define _VALUES_STATIC(_v1, _v2) \ + { \ + .v1 = _v1, .v2 = _v2, .v_static = _nm_utils_strstrdictkey_static(_v1, _v2), \ } const struct { const char *v1; @@ -11455,32 +11454,32 @@ static void test_dns_uri_parse(void) { /* clang-format off */ - t_dns_1("dns+tls://8.8.8.8", INET, TLS, "8.8.8.8", -1, NULL, NULL); - t_dns_1("dns+tls://8.8.8.8", INET, TLS, "8.8.8.8", -1, NULL, NULL); - t_dns_1("dns+tls://1.2.3.4#name", INET, TLS, "1.2.3.4", -1, "name", NULL); - t_dns_1("dns+tls://1.2.3.4#a.b.c", INET, TLS, "1.2.3.4", -1, "a.b.c", NULL); - t_dns_1("dns+tls://1.2.3.4:53", INET, TLS, "1.2.3.4", 53, NULL, NULL); - t_dns_1("dns+tls://1.2.3.4:53#foobar", INET, TLS, "1.2.3.4", 53, "foobar", NULL); - t_dns_1("dns+tls://192.168.120.250:99", INET, TLS, "192.168.120.250", 99, NULL, NULL); - t_dns_1("dns+udp://8.8.8.8:65535", INET, UDP, "8.8.8.8", 65535, NULL, NULL); - - t_dns_1("dns+udp://[fd01::1]", INET6, UDP, "fd01::1", -1, NULL, NULL); - t_dns_1("dns+tls://[fd01::2]:5353", INET6, UDP, "fd01::2", 5353, NULL, NULL); - t_dns_1("dns+tls://[::1]#name", INET6, UDP, "::1", -1, "name", NULL); - t_dns_1("dns+tls://[::2]:65535#name", INET6, UDP, "::2", 65535, "name", NULL); - t_dns_1("dns+udp://[::ffff:1.2.3.4]", INET6, UDP, "::ffff:1.2.3.4", -1, NULL, NULL); - t_dns_1("dns+tls://[fe80::1%eth0]", INET6, UDP, "fe80::1", -1, NULL, "eth0"); - t_dns_1("dns+tls://[fe80::2%en1]:53#a", INET6, UDP, "fe80::2", 53, "a", "en1"); - t_dns_1("dns+tls://[fe80::1%en3456789012345]", INET6, UDP, "fe80::1", -1, NULL, "en3456789012345"); - - t_dns_1("1.2.3.4", INET, NONE, "1.2.3.4", -1, NULL, NULL); - t_dns_1("1.2.3.4#foo", INET, NONE, "1.2.3.4", -1, "foo", NULL); - t_dns_1("1::#x", INET6, NONE, "1::", -1, "x", NULL); - t_dns_1("1::0#x", INET6, NONE, "1::", -1, "x", NULL); - t_dns_1("192.168.0.1", INET, NONE, "192.168.0.1", -1, NULL, NULL); - t_dns_1("192.168.0.1#tst.com", INET, NONE, "192.168.0.1", -1, "tst.com", NULL); - t_dns_1("fe80::18", INET6, NONE, "fe80::18", -1, NULL, NULL); - t_dns_1("fe80::18#foo.com", INET6, NONE, "fe80::18", -1, "foo.com", NULL); + t_dns_1("dns+tls://8.8.8.8", INET, TLS, "8.8.8.8", 0, NULL, NULL); + t_dns_1("dns+tls://8.8.8.8", INET, TLS, "8.8.8.8", 0, NULL, NULL); + t_dns_1("dns+tls://1.2.3.4#name", INET, TLS, "1.2.3.4", 0, "name", NULL); + t_dns_1("dns+tls://1.2.3.4#a.b.c", INET, TLS, "1.2.3.4", 0, "a.b.c", NULL); + t_dns_1("dns+tls://1.2.3.4:53", INET, TLS, "1.2.3.4", 53, NULL, NULL); + t_dns_1("dns+tls://1.2.3.4:53#foobar", INET, TLS, "1.2.3.4", 53, "foobar", NULL); + t_dns_1("dns+tls://192.168.120.250:99", INET, TLS, "192.168.120.250", 99, NULL, NULL); + t_dns_1("dns+udp://8.8.8.8:65535", INET, UDP, "8.8.8.8", 65535, NULL, NULL); + + t_dns_1("dns+udp://[fd01::1]", INET6, UDP, "fd01::1", 0, NULL, NULL); + t_dns_1("dns+tls://[fd01::2]:5353", INET6, UDP, "fd01::2", 5353, NULL, NULL); + t_dns_1("dns+tls://[::1]#name", INET6, UDP, "::1", 0, "name", NULL); + t_dns_1("dns+tls://[::2]:65535#name", INET6, UDP, "::2", 65535, "name", NULL); + t_dns_1("dns+udp://[::ffff:1.2.3.4]", INET6, UDP, "::ffff:1.2.3.4", 0, NULL, NULL); + t_dns_1("dns+tls://[fe80::1%eth0]", INET6, UDP, "fe80::1", 0, NULL, "eth0"); + t_dns_1("dns+tls://[fe80::2%en1]:53#a", INET6, UDP, "fe80::2", 53, "a", "en1"); + t_dns_1("dns+tls://[fe80::1%en3456789012345]", INET6, UDP, "fe80::1", 0, NULL, "en3456789012345"); + + t_dns_1("1.2.3.4", INET, NONE, "1.2.3.4", 0, NULL, NULL); + t_dns_1("1.2.3.4#foo", INET, NONE, "1.2.3.4", 0, "foo", NULL); + t_dns_1("1::#x", INET6, NONE, "1::", 0, "x", NULL); + t_dns_1("1::0#x", INET6, NONE, "1::", 0, "x", NULL); + t_dns_1("192.168.0.1", INET, NONE, "192.168.0.1", 0, NULL, NULL); + t_dns_1("192.168.0.1#tst.com", INET, NONE, "192.168.0.1", 0, "tst.com", NULL); + t_dns_1("fe80::18", INET6, NONE, "fe80::18", 0, NULL, NULL); + t_dns_1("fe80::18#foo.com", INET6, NONE, "fe80::18", 0, "foo.com", NULL); /* clang-format on */ t_dns_0("http://8.8.8.8"); /* unsupported schema */ diff --git a/src/libnm-core-intern/nm-core-internal.h b/src/libnm-core-intern/nm-core-internal.h index aa96c526..8b23dd44 100644 --- a/src/libnm-core-intern/nm-core-internal.h +++ b/src/libnm-core-intern/nm-core-internal.h @@ -58,6 +58,7 @@ #include "nm-setting-ovs-port.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" +#include "nm-setting-prefix-delegation.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" #include "nm-setting-sriov.h" diff --git a/src/libnm-core-intern/nm-meta-setting-base-impl.h b/src/libnm-core-intern/nm-meta-setting-base-impl.h index c03285eb..d1535e5e 100644 --- a/src/libnm-core-intern/nm-meta-setting-base-impl.h +++ b/src/libnm-core-intern/nm-meta-setting-base-impl.h @@ -143,6 +143,7 @@ typedef enum _nm_packed { NM_META_SETTING_TYPE_OVS_PORT, NM_META_SETTING_TYPE_PPP, NM_META_SETTING_TYPE_PPPOE, + NM_META_SETTING_TYPE_PREFIX_DELEGATION, NM_META_SETTING_TYPE_PROXY, NM_META_SETTING_TYPE_SERIAL, NM_META_SETTING_TYPE_SRIOV, diff --git a/src/libnm-core-public/meson.build b/src/libnm-core-public/meson.build index 97888467..086801d9 100644 --- a/src/libnm-core-public/meson.build +++ b/src/libnm-core-public/meson.build @@ -46,6 +46,7 @@ libnm_core_headers = files( 'nm-setting-ovs-port.h', 'nm-setting-ppp.h', 'nm-setting-pppoe.h', + 'nm-setting-prefix-delegation.h', 'nm-setting-proxy.h', 'nm-setting-serial.h', 'nm-setting-sriov.h', diff --git a/src/libnm-core-public/nm-core-types.h b/src/libnm-core-public/nm-core-types.h index a0d6bc82..617d6b74 100644 --- a/src/libnm-core-public/nm-core-types.h +++ b/src/libnm-core-public/nm-core-types.h @@ -52,6 +52,7 @@ typedef struct _NMSettingOvsPatch NMSettingOvsPatch; typedef struct _NMSettingOvsPort NMSettingOvsPort; typedef struct _NMSettingPpp NMSettingPpp; typedef struct _NMSettingPppoe NMSettingPppoe; +typedef struct _NMSettingPrefixDelegation NMSettingPrefixDelegation; typedef struct _NMSettingProxy NMSettingProxy; typedef struct _NMSettingSerial NMSettingSerial; typedef struct _NMSettingSriov NMSettingSriov; diff --git a/src/libnm-core-public/nm-dbus-interface.h b/src/libnm-core-public/nm-dbus-interface.h index d6267610..78241193 100644 --- a/src/libnm-core-public/nm-dbus-interface.h +++ b/src/libnm-core-public/nm-dbus-interface.h @@ -99,6 +99,10 @@ * on connection down. * https://issues.redhat.com/browse/RHEL-66262 * https://issues.redhat.com/browse/RHEL-67324 + * @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports + * configuring per-device IPv4 sysctl forwarding setting. Since: 1.54. + * @NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN: NetworkManager supports the + * "sriov.preserve-on-down" property. Since: 1.54 * * The numeric values represent the bit index of the capability. These capabilities * can be queried in the "VersionInfo" D-Bus property. @@ -106,7 +110,9 @@ * Since: 1.42 */ typedef enum { - NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE = 0, + NM_VERSION_INFO_CAPABILITY_SYNC_ROUTE_WITH_TABLE = 0, + NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING = 1, + NM_VERSION_INFO_CAPABILITY_SRIOV_PRESERVE_ON_DOWN = 2, } NMVersionInfoCapability; /** @@ -1014,7 +1020,7 @@ typedef enum { * checkpoints is allowed, however, if an older checkpoint * that references overlapping devices gets rolled back, it will * automatically destroy this checkpoint during rollback. This - * allows to create several overlapping checkpoints in parallel, + * allows one to create several overlapping checkpoints in parallel, * and rollback to them at will. With the special case that * rolling back to an older checkpoint will invalidate all * overlapping younger checkpoints. This opts-in that the diff --git a/src/libnm-core-public/nm-setting-ip-config.h b/src/libnm-core-public/nm-setting-ip-config.h index f0a29f14..625b941f 100644 --- a/src/libnm-core-public/nm-setting-ip-config.h +++ b/src/libnm-core-public/nm-setting-ip-config.h @@ -53,6 +53,27 @@ typedef enum { NM_SETTING_IP_CONFIG_ROUTED_DNS_YES = 1, } NMSettingIPConfigRoutedDns; +/** + * NMSettingIPConfigForwarding: + * @NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT: use the global default value + * @NM_SETTING_IP_CONFIG_FORWARDING_NO: disable forwarding + * @NM_SETTING_IP_CONFIG_FORWARDING_YES: enable forwarding + * @NM_SETTING_IP_CONFIG_FORWARDING_AUTO: enable forwarding if any shared + * connection is active, use kernel default otherwise + * + * #NMSettingIPConfigForwarding indicates whether to configure sysctl + * interface-specific forwarding. When enabled, the interface will act + * as a router to forward the packet from one interface to another. + * + * Since: 1.54 + */ +typedef enum { + NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT = -1, + NM_SETTING_IP_CONFIG_FORWARDING_NO = 0, + NM_SETTING_IP_CONFIG_FORWARDING_YES = 1, + NM_SETTING_IP_CONFIG_FORWARDING_AUTO = 2, +} NMSettingIPConfigForwarding; + typedef struct NMIPAddress NMIPAddress; GType nm_ip_address_get_type(void); @@ -364,6 +385,7 @@ char *nm_ip_routing_rule_to_string(const NMIPRoutingRule *self, #define NM_SETTING_IP_CONFIG_ROUTED_DNS "routed-dns" #define NM_SETTING_IP_CONFIG_SHARED_DHCP_RANGE "shared-dhcp-range" #define NM_SETTING_IP_CONFIG_SHARED_DHCP_LEASE_TIME "shared-dhcp-lease-time" +#define NM_SETTING_IP_CONFIG_FORWARDING "forwarding" /* these are not real GObject properties. */ #define NM_SETTING_IP_CONFIG_ROUTING_RULES "routing-rules" @@ -542,6 +564,8 @@ NM_AVAILABLE_IN_1_52 const char *nm_setting_ip_config_get_shared_dhcp_range(NMSettingIPConfig *setting); NM_AVAILABLE_IN_1_52 int nm_setting_ip_config_get_shared_dhcp_lease_time(NMSettingIPConfig *setting); +NM_AVAILABLE_IN_1_54 +NMSettingIPConfigForwarding nm_setting_ip_config_get_forwarding(NMSettingIPConfig *setting); G_END_DECLS diff --git a/src/libnm-core-public/nm-setting-ovs-dpdk.h b/src/libnm-core-public/nm-setting-ovs-dpdk.h index 0578ab2c..0883dced 100644 --- a/src/libnm-core-public/nm-setting-ovs-dpdk.h +++ b/src/libnm-core-public/nm-setting-ovs-dpdk.h @@ -27,13 +27,31 @@ G_BEGIN_DECLS #define NM_SETTING_OVS_DPDK_SETTING_NAME "ovs-dpdk" -#define NM_SETTING_OVS_DPDK_DEVARGS "devargs" -#define NM_SETTING_OVS_DPDK_N_RXQ "n-rxq" -#define NM_SETTING_OVS_DPDK_N_RXQ_DESC "n-rxq-desc" -#define NM_SETTING_OVS_DPDK_N_TXQ_DESC "n-txq-desc" +#define NM_SETTING_OVS_DPDK_DEVARGS "devargs" +#define NM_SETTING_OVS_DPDK_N_RXQ "n-rxq" +#define NM_SETTING_OVS_DPDK_N_RXQ_DESC "n-rxq-desc" +#define NM_SETTING_OVS_DPDK_N_TXQ_DESC "n-txq-desc" +#define NM_SETTING_OVS_DPDK_LSC_INTERRUPT "lsc-interrupt" typedef struct _NMSettingOvsDpdkClass NMSettingOvsDpdkClass; +/** + * NMSettingOvsDpdkLscInterrupt: + * @NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE: leave the value set to Open vSwitch default + * @NM_SETTING_OVS_DPDK_LSC_INTERRUPT_DISABLED: interrupt disabled (poll mode) + * @NM_SETTING_OVS_DPDK_LSC_INTERRUPT_ENABLED: interrupt enabled + * + * #NMSettingOvsDpdkLscInterrupt indicates whether the interface uses interrupts + * or poll mode for Link State Change (LSC) detection on the OVS DPDK interface. + * + * Since: 1.54 + */ +typedef enum { + NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE = -1, + NM_SETTING_OVS_DPDK_LSC_INTERRUPT_DISABLED = 0, + NM_SETTING_OVS_DPDK_LSC_INTERRUPT_ENABLED = 1, +} NMSettingOvsDpdkLscInterrupt; + NM_AVAILABLE_IN_1_20 GType nm_setting_ovs_dpdk_get_type(void); NM_AVAILABLE_IN_1_20 @@ -47,6 +65,8 @@ NM_AVAILABLE_IN_1_42 guint32 nm_setting_ovs_dpdk_get_n_rxq_desc(NMSettingOvsDpdk *self); NM_AVAILABLE_IN_1_42 guint32 nm_setting_ovs_dpdk_get_n_txq_desc(NMSettingOvsDpdk *self); +NM_AVAILABLE_IN_1_54 +NMSettingOvsDpdkLscInterrupt nm_setting_ovs_dpdk_get_lsc_interrupt(NMSettingOvsDpdk *self); G_END_DECLS diff --git a/src/libnm-core-public/nm-setting-prefix-delegation.h b/src/libnm-core-public/nm-setting-prefix-delegation.h new file mode 100644 index 00000000..5361d7c6 --- /dev/null +++ b/src/libnm-core-public/nm-setting-prefix-delegation.h @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#ifndef __NM_SETTING_PREFIX_DELEGATION_H__ +#define __NM_SETTING_PREFIX_DELEGATION_H__ + +#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only <NetworkManager.h> can be included directly." +#endif + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_PREFIX_DELEGATION (nm_setting_prefix_delegation_get_type()) +#define NM_SETTING_PREFIX_DELEGATION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_PREFIX_DELEGATION, NMSettingVrf)) +#define NM_SETTING_PREFIX_DELEGATION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_PREFIX_DELEGATIONCONFIG, NMSettingVrfClass)) +#define NM_IS_SETTING_PREFIX_DELEGATION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_PREFIX_DELEGATION)) +#define NM_IS_SETTING_PREFIX_DELEGATION_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_PREFIX_DELEGATION)) +#define NM_SETTING_PREFIX_DELEGATION_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_PREFIX_DELEGATION, NMSettingVrfClass)) + +#define NM_SETTING_PREFIX_DELEGATION_SETTING_NAME "prefix-delegation" + +#define NM_SETTING_PREFIX_DELEGATION_SUBNET_ID "subnet-id" + +typedef struct _NMSettingPrefixDelegationClass NMSettingPrefixDelegationClass; + +NM_AVAILABLE_IN_1_54 +GType nm_setting_prefix_delegation_get_type(void); +NM_AVAILABLE_IN_1_54 +NMSetting *nm_setting_prefix_delegation_new(void); +NM_AVAILABLE_IN_1_54 +gint64 nm_setting_prefix_delegation_get_subnet_id(NMSettingPrefixDelegation *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_PREFIX_DELEGATION_H__ */ diff --git a/src/libnm-core-public/nm-setting-sriov.h b/src/libnm-core-public/nm-setting-sriov.h index affccc48..60c5005c 100644 --- a/src/libnm-core-public/nm-setting-sriov.h +++ b/src/libnm-core-public/nm-setting-sriov.h @@ -28,6 +28,7 @@ G_BEGIN_DECLS #define NM_SETTING_SRIOV_TOTAL_VFS "total-vfs" #define NM_SETTING_SRIOV_VFS "vfs" +#define NM_SETTING_SRIOV_PRESERVE_ON_DOWN "preserve-on-down" #define NM_SETTING_SRIOV_AUTOPROBE_DRIVERS "autoprobe-drivers" #define NM_SETTING_SRIOV_ESWITCH_MODE "eswitch-mode" #define NM_SETTING_SRIOV_ESWITCH_INLINE_MODE "eswitch-inline-mode" @@ -57,6 +58,22 @@ typedef enum { } NMSriovVFVlanProtocol; /** + * NMSriovPreserveOnDown: + * @NM_SRIOV_PRESERVE_ON_DOWN_DEFAULT: use the default value + * @NM_SRIOV_PRESERVE_ON_DOWN_NO: reset the SR-IOV parameters when the + * connection is deactivated + * @NM_SRIOV_PRESERVE_ON_DOWN_YES: preserve the SR-IOV parameters set on + * the device when the connection is deactivated + * + * Since: 1.54 + */ +typedef enum { + NM_SRIOV_PRESERVE_ON_DOWN_DEFAULT = -1, + NM_SRIOV_PRESERVE_ON_DOWN_NO = 0, + NM_SRIOV_PRESERVE_ON_DOWN_YES = 1, +} NMSriovPreserveOnDown; + +/** * NMSriovEswitchMode: * @NM_SRIOV_ESWITCH_MODE_PRESERVE: don't modify current eswitch mode * @NM_SRIOV_ESWITCH_MODE_LEGACY: use legacy SRIOV @@ -123,6 +140,8 @@ NM_AVAILABLE_IN_1_14 gboolean nm_setting_sriov_remove_vf_by_index(NMSettingSriov *setting, guint index); NM_AVAILABLE_IN_1_14 void nm_setting_sriov_clear_vfs(NMSettingSriov *setting); +NM_AVAILABLE_IN_1_54 +NMSriovPreserveOnDown nm_setting_sriov_get_preserve_on_down(NMSettingSriov *setting); NM_AVAILABLE_IN_1_14 NMTernary nm_setting_sriov_get_autoprobe_drivers(NMSettingSriov *setting); NM_AVAILABLE_IN_1_46 diff --git a/src/libnm-core-public/nm-version-macros.h.in b/src/libnm-core-public/nm-version-macros.h.in index d204c4df..4c4772d2 100644 --- a/src/libnm-core-public/nm-version-macros.h.in +++ b/src/libnm-core-public/nm-version-macros.h.in @@ -77,6 +77,7 @@ #define NM_VERSION_1_48 (NM_ENCODE_VERSION(1, 48, 0)) #define NM_VERSION_1_50 (NM_ENCODE_VERSION(1, 50, 0)) #define NM_VERSION_1_52 (NM_ENCODE_VERSION(1, 52, 0)) +#define NM_VERSION_1_54 (NM_ENCODE_VERSION(1, 54, 0)) /* For releases, NM_API_VERSION is equal to NM_VERSION. * diff --git a/src/libnm-core-public/nm-version.h b/src/libnm-core-public/nm-version.h index 6f7e42f3..33daf65f 100644 --- a/src/libnm-core-public/nm-version.h +++ b/src/libnm-core-public/nm-version.h @@ -425,6 +425,20 @@ #define NM_AVAILABLE_IN_1_52 #endif +#if NM_VERSION_MIN_REQUIRED >= NM_VERSION_1_54 +#define NM_DEPRECATED_IN_1_54 G_DEPRECATED +#define NM_DEPRECATED_IN_1_54_FOR(f) G_DEPRECATED_FOR(f) +#else +#define NM_DEPRECATED_IN_1_54 +#define NM_DEPRECATED_IN_1_54_FOR(f) +#endif + +#if NM_VERSION_MAX_ALLOWED < NM_VERSION_1_54 +#define NM_AVAILABLE_IN_1_54 G_UNAVAILABLE(1, 54) +#else +#define NM_AVAILABLE_IN_1_54 +#endif + /* * Synchronous API for calling D-Bus in libnm is deprecated. See * https://networkmanager.dev/docs/libnm/latest/usage.html#sync-api diff --git a/src/libnm-glib-aux/nm-dbus-aux.c b/src/libnm-glib-aux/nm-dbus-aux.c index 1be4047e..27bcf651 100644 --- a/src/libnm-glib-aux/nm-dbus-aux.c +++ b/src/libnm-glib-aux/nm-dbus-aux.c @@ -459,7 +459,7 @@ _bus_get_cb(GObject *source, GAsyncResult *result, gpointer user_data) * * This calls g_bus_get(), but iterates the current (thread-default) GMainContext * until the response is ready. As such, it's similar to g_bus_get_sync(), - * but it allows to cancel the operation (without having multiple threads). + * but it allows one to cancel the operation (without having multiple threads). * * Returns: (transfer full): the new #GDBusConnection or %NULL on error. */ diff --git a/src/libnm-glib-aux/nm-dedup-multi.c b/src/libnm-glib-aux/nm-dedup-multi.c index c80b17ce..973a7d13 100644 --- a/src/libnm-glib-aux/nm-dedup-multi.c +++ b/src/libnm-glib-aux/nm-dedup-multi.c @@ -149,7 +149,7 @@ _entry_unpack(const NMDedupMultiEntry *entry, nm_assert(NM_IN_SET(*out_lookup_head, FALSE, TRUE)); ASSERT_idx_type(*out_idx_type); - /* for lookup of the head, we allow to omit object, but only + /* for lookup of the head, we allow one to omit object, but only * if the idx_type does not partition the objects. Otherwise, we * require a obj to compare. */ nm_assert(!*out_lookup_head || (*out_obj || !(*out_idx_type)->klass->idx_obj_partition_equal)); diff --git a/src/libnm-glib-aux/nm-dedup-multi.h b/src/libnm-glib-aux/nm-dedup-multi.h index ebc5d0a1..b548b2a5 100644 --- a/src/libnm-glib-aux/nm-dedup-multi.h +++ b/src/libnm-glib-aux/nm-dedup-multi.h @@ -221,7 +221,7 @@ struct _NMDedupMultiHeadEntry { static inline gconstpointer nm_dedup_multi_entry_get_obj(const NMDedupMultiEntry *entry) { - /* convenience method that allows to skip the %NULL check on + /* convenience method that allows one to skip the %NULL check on * @entry. Think of the NULL-conditional operator ?. of C# */ return entry ? entry->obj : NULL; } diff --git a/src/libnm-glib-aux/nm-hash-utils.c b/src/libnm-glib-aux/nm-hash-utils.c index 973422a1..7f25e9ac 100644 --- a/src/libnm-glib-aux/nm-hash-utils.c +++ b/src/libnm-glib-aux/nm-hash-utils.c @@ -190,6 +190,27 @@ nm_pint_equal(gconstpointer a, gconstpointer b) return s1 == s2 || (s1 && s2 && *s1 == *s2); } +/* GHashFunc for GHashTable keys that are a pointer to a guint64 */ +guint +nm_puint64_hash(gconstpointer p) +{ + const guint64 *s = p; + + if (!s) + return nm_hash_static(298377461u); + return nm_hash_val(1208815757u, *s); +} + +/* GEqualFunc for GHashTable keys that are a pointer to a guint64 */ +gboolean +nm_puint64_equal(gconstpointer a, gconstpointer b) +{ + const guint64 *s1 = a; + const guint64 *s2 = a; + + return s1 == s2 || (s1 && s2 && *s1 == *s2); +} + guint nm_pdirect_hash(gconstpointer p) { diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index 6d7cc271..9fbcbdb3 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -212,10 +212,10 @@ nm_hash_update_str(NMHashState *state, const char *str) /* Like nm_hash_update_str(), but restricted to arrays only. nm_hash_update_str() only works * with a @str argument that cannot be NULL. If you have a string pointer, that is never NULL, use * nm_hash_update() instead. */ -#define nm_hash_update_strarr(state, str) \ - (_Generic(&(str), \ - const char(*)[sizeof(str)]: nm_hash_update_str((state), (str)), \ - char(*)[sizeof(str)]: nm_hash_update_str((state), (str)))) +#define nm_hash_update_strarr(state, str) \ + (_Generic(&(str), \ + const char (*)[sizeof(str)]: nm_hash_update_str((state), (str)), \ + char (*)[sizeof(str)]: nm_hash_update_str((state), (str)))) #else #define nm_hash_update_strarr(state, str) nm_hash_update_str((state), (str)) #endif @@ -224,7 +224,7 @@ guint nm_hash_ptr(gconstpointer ptr); #define nm_direct_hash nm_hash_ptr guint nm_hash_str(const char *str); -#define nm_str_hash ((guint(*)(gconstpointer str)) nm_hash_str) +#define nm_str_hash ((guint (*)(gconstpointer str)) nm_hash_str) #define nm_hash_vals(static_seed, ...) \ ({ \ @@ -266,6 +266,9 @@ gboolean nm_pstr_equal(gconstpointer a, gconstpointer b); guint nm_pint_hash(gconstpointer p); gboolean nm_pint_equal(gconstpointer a, gconstpointer b); +guint nm_puint64_hash(gconstpointer p); +gboolean nm_puint64_equal(gconstpointer a, gconstpointer b); + G_STATIC_ASSERT(sizeof(int) == sizeof(guint32)); #define nm_puint32_hash nm_pint_hash #define nm_puint32_equal nm_pint_equal diff --git a/src/libnm-glib-aux/nm-inet-utils.c b/src/libnm-glib-aux/nm-inet-utils.c index 2ee73ad5..f4f418cf 100644 --- a/src/libnm-glib-aux/nm-inet-utils.c +++ b/src/libnm-glib-aux/nm-inet-utils.c @@ -238,6 +238,42 @@ nm_ip6_addr_clear_host_address(struct in6_addr *dst, const struct in6_addr *src, return dst; } +/** + * nm_ip6_addr_get_subnet_id: + * @addr: the IPv6 address + * @plen: the prefix length + * + * Given an IPv6 address and a prefix length, returns the subnet ID, + * defined as follows: + * + * | plen bits | (64 - plen) bits | 64 bits | + * +-----------------+------------------+-------------------------------+ + * | prefix | subnet ID | interface ID | + * +-----------------+------------------+-------------------------------+ + * + * The prefix length must be a value between 0 and 64. + */ +guint64 +nm_ip6_addr_get_subnet_id(struct in6_addr *addr, guint8 plen) +{ + int nbits = 64 - plen; + guint64 res = 0; + guint64 tmp; + guint64 i; + + g_return_val_if_fail(addr, 0); + g_return_val_if_fail(plen <= 64, 0); + + for (i = 0; i < 2 && nbits > 0; i++, nbits -= 32) { + tmp = htonl(addr->s6_addr32[1 - i]); + tmp = tmp & ((1ULL << NM_MIN(32U, (guint) nbits)) - 1); + tmp = tmp << (32 * i); + res += tmp; + } + + return res; +} + int nm_ip6_addr_same_prefix_cmp(const struct in6_addr *addr_a, const struct in6_addr *addr_b, diff --git a/src/libnm-glib-aux/nm-inet-utils.h b/src/libnm-glib-aux/nm-inet-utils.h index 489d21dd..999519f8 100644 --- a/src/libnm-glib-aux/nm-inet-utils.h +++ b/src/libnm-glib-aux/nm-inet-utils.h @@ -218,6 +218,8 @@ nm_ip4_addr_clear_host_address(in_addr_t addr, guint32 plen) const struct in6_addr * nm_ip6_addr_clear_host_address(struct in6_addr *dst, const struct in6_addr *src, guint32 plen); +guint64 nm_ip6_addr_get_subnet_id(struct in6_addr *addr, guint8 plen); + /*****************************************************************************/ static inline int diff --git a/src/libnm-glib-aux/nm-macros-internal.h b/src/libnm-glib-aux/nm-macros-internal.h index 151e7a4f..940e8c30 100644 --- a/src/libnm-glib-aux/nm-macros-internal.h +++ b/src/libnm-glib-aux/nm-macros-internal.h @@ -1021,6 +1021,22 @@ nm_g_variant_equal(GVariant *a, GVariant *b) /*****************************************************************************/ +#if defined(__GNUC__) && (__GNUC__ >= 12) +#define _NM_BACKPORT_SYMBOL_IMPL(version, \ + return_type, \ + orig_func, \ + versioned_func, \ + args_typed, \ + args) \ + return_type versioned_func args_typed; \ + \ + __attribute__((__symver__( \ + G_STRINGIFY(orig_func) "@" G_STRINGIFY(version)))) return_type versioned_func args_typed \ + { \ + return orig_func args; \ + } \ + return_type orig_func args_typed; +#else #define _NM_BACKPORT_SYMBOL_IMPL(version, \ return_type, \ orig_func, \ @@ -1035,6 +1051,7 @@ nm_g_variant_equal(GVariant *a, GVariant *b) return_type orig_func args_typed; \ __asm__(".symver " G_STRINGIFY(versioned_func) ", " G_STRINGIFY(orig_func) "@" G_STRINGIFY( \ version)) +#endif #define NM_BACKPORT_SYMBOL(version, return_type, func, args_typed, args) \ _NM_BACKPORT_SYMBOL_IMPL(version, return_type, func, _##func##_##version, args_typed, args) diff --git a/src/libnm-glib-aux/nm-shared-utils.c b/src/libnm-glib-aux/nm-shared-utils.c index db730b28..e39831c6 100644 --- a/src/libnm-glib-aux/nm-shared-utils.c +++ b/src/libnm-glib-aux/nm-shared-utils.c @@ -2898,7 +2898,7 @@ nm_utils_buf_utf8safe_unescape(const char *str, * * Depending on @flags, valid UTF-8 characters are not escaped at all * (except the escape character '\\'). This is the difference to g_strescape(), - * which escapes all non-ASCII characters. This allows to pass on + * which escapes all non-ASCII characters. This allows one to pass on * valid UTF-8 characters as-is and can be directly shown to the user * as UTF-8 -- with exception of the backslash escape character, * invalid UTF-8 sequences, and other (depending on @flags). @@ -3113,7 +3113,7 @@ nm_utils_str_utf8safe_unescape(const char *str, NMUtilsStrUtf8SafeFlags flags, c * * Depending on @flags, valid UTF-8 characters are not escaped at all * (except the escape character '\\'). This is the difference to g_strescape(), - * which escapes all non-ASCII characters. This allows to pass on + * which escapes all non-ASCII characters. This allows one to pass on * valid UTF-8 characters as-is and can be directly shown to the user * as UTF-8 -- with exception of the backslash escape character, * invalid UTF-8 sequences, and other (depending on @flags). @@ -6004,8 +6004,8 @@ nm_utils_is_localhost(const char *name) return FALSE; } -gboolean -nm_utils_is_specific_hostname(const char *name) +static gboolean +_nm_utils_check_hostname(const char *name, bool allow_localhost) { if (nm_str_is_empty(name)) return FALSE; @@ -6016,7 +6016,7 @@ nm_utils_is_specific_hostname(const char *name) return FALSE; } - if (nm_utils_is_localhost(name)) + if (!allow_localhost && nm_utils_is_localhost(name)) return FALSE; /* FIXME: properly validate the hostname, like systemd's hostname_is_valid() */ @@ -6024,6 +6024,18 @@ nm_utils_is_specific_hostname(const char *name) return TRUE; } +gboolean +nm_utils_is_specific_hostname(const char *name) +{ + return _nm_utils_check_hostname(name, FALSE); +} + +gboolean +nm_utils_is_not_empty_hostname(const char *name) +{ + return _nm_utils_check_hostname(name, TRUE); +} + /*****************************************************************************/ typedef struct { diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 4fa538e2..1fca6015 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -2143,7 +2143,7 @@ nm_g_ptr_array_pdata(const GPtrArray *arr) * must agree with the owner-ship semantics of @func. * * This is a replacement for g_ptr_array_copy(), which is not available - * before glib 2.62. Since GPtrArray does not allow to access the internal + * before glib 2.62. Since GPtrArray does not allow one to access the internal * element_free_func, we cannot add a compatibility implementation of g_ptr_array_copy() * as the caller must provide the correct element_free_func. * @@ -3419,6 +3419,7 @@ char *_nm_utils_format_variant_attributes(GHashTable *a gboolean nm_utils_is_localhost(const char *name); gboolean nm_utils_is_specific_hostname(const char *name); +gboolean nm_utils_is_not_empty_hostname(const char *name); struct passwd; diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h index feb86301..98b3f3d0 100644 --- a/src/libnm-glib-aux/nm-test-utils.h +++ b/src/libnm-glib-aux/nm-test-utils.h @@ -1504,7 +1504,7 @@ _nmtst_main_loop_quit_on_notify(GObject *object, GParamSpec *pspec, gpointer use (timeout_msec), \ (poll_msec), \ condition)) \ - g_assert(FALSE &&#condition); \ + g_assert(FALSE && #condition); \ } \ G_STMT_END diff --git a/src/libnm-glib-aux/tests/test-shared-general.c b/src/libnm-glib-aux/tests/test-shared-general.c index 2f09a549..931c25c6 100644 --- a/src/libnm-glib-aux/tests/test-shared-general.c +++ b/src/libnm-glib-aux/tests/test-shared-general.c @@ -398,6 +398,53 @@ test_nm_ip4_addr_netmask_from_prefix(void) /*****************************************************************************/ static void +test_nm_ip6_addr_get_subnet_id(void) +{ +#define check_subnet_id(_addrstr, _plen, _subnet_id) \ + { \ + struct in6_addr addr; \ + \ + addr = nmtst_inet6_from_string(_addrstr); \ + g_assert_cmpint(nm_ip6_addr_get_subnet_id(&addr, _plen), ==, _subnet_id); \ + } + + check_subnet_id("aaaa:bbbb:cccc:ffff::", 64, 0); + check_subnet_id("aaaa:bbbb:cccc:fffe::", 63, 0); + check_subnet_id("aaaa:bbbb:cccc:ffff::", 63, 1); + check_subnet_id("aaaa:bbbb:cccc:fffc::", 62, 0); + check_subnet_id("aaaa:bbbb:cccc:fffd::", 62, 1); + check_subnet_id("aaaa:bbbb:cccc:fffe::", 62, 2); + check_subnet_id("aaaa:bbbb:cccc:ffff::", 62, 3); + check_subnet_id("aaaa:bbbb:cccc:fff8::", 61, 0); + check_subnet_id("aaaa:bbbb:cccc:ffff::", 61, 7); + check_subnet_id("aaaa:bbbb:cccc:fff0::", 60, 0); + check_subnet_id("aaaa:bbbb:cccc:fff2::", 60, 2); + check_subnet_id("aaaa:bbbb:cccc:ffff::", 60, 15); + check_subnet_id("aaaa:bbbb:cccc:0000::", 48, 0); + check_subnet_id("aaaa:bbbb:cccc:f000::", 48, 61440); + check_subnet_id("aaaa:bbbb:cccc:ffff::", 48, 65535); + check_subnet_id("aaaa:bbbb:cccc:0000::", 46, 0); + check_subnet_id("aaaa:bbbb:cccc:0001::", 46, 1); + check_subnet_id("aaaa:bbbb:ccce:5555::", 46, 152917); + check_subnet_id("aaaa:bbbb:0000:0000::", 32, 0); + check_subnet_id("aaaa:bbbb:0000:0001::", 32, 1); + check_subnet_id("aaaa:bbbb:0001:0001::", 32, 65537); + check_subnet_id("aaaa:bbbb:ffff:ffff::", 32, 0xffffffff); + check_subnet_id("aaaa:bbb8:0000:0000::", 30, 0); + check_subnet_id("aaaa:bbb8:0000:0001::", 30, 1); + check_subnet_id("aaaa:bbb8:0001:0001::", 30, 65537); + check_subnet_id("aaaa:bbbb:0000:0000::", 30, 0x300000000ULL); + check_subnet_id("aaaa:bbbb:0001:0001::", 30, 0x300010001ULL); + check_subnet_id("aaaa:bbbb:0001:0001::", 8, 0xAABBBB00010001ULL); + check_subnet_id("abaa:bbbb:0001:0001::", 7, 0x1AABBBB00010001ULL); + check_subnet_id("abaa:bbbb:0001:0001::", 0, 0xABAABBBB00010001ULL); + check_subnet_id("abaa:bbbb:0001:0001:5555:5555:5555:5555", 0, 0xABAABBBB00010001ULL); + check_subnet_id("::", 0, 0); +} + +/*****************************************************************************/ + +static void test_unaligned(void) { int shift; @@ -2864,6 +2911,7 @@ main(int argc, char **argv) g_test_add_func("/general/test_nm_ip4_addr_is_loopback", test_nm_ip4_addr_is_loopback); g_test_add_func("/general/test_nm_ip4_addr_netmask_from_prefix", test_nm_ip4_addr_netmask_from_prefix); + g_test_add_func("/general/test_nm_ip6_addr_get_subnet_id", test_nm_ip6_addr_get_subnet_id); g_test_add_func("/general/test_unaligned", test_unaligned); g_test_add_func("/general/test_strv_cmp", test_strv_cmp); g_test_add_func("/general/test_strstrip_avoid_copy", test_strstrip_avoid_copy); diff --git a/src/libnm-log-core/nm-logging.c b/src/libnm-log-core/nm-logging.c index a2bd2a27..019bcf09 100644 --- a/src/libnm-log-core/nm-logging.c +++ b/src/libnm-log-core/nm-logging.c @@ -641,7 +641,7 @@ _nm_printf(3, 4) static void _iovec_set_format(struct iovec *iov, { \ const char *_str_arg = (str_arg); \ \ - nm_assert(_str_arg &&strlen(_str_arg) < (max_str_len)); \ + nm_assert(_str_arg && strlen(_str_arg) < (max_str_len)); \ _iovec_set_format_a((iov), (max_str_len), format, str_arg); \ } \ G_STMT_END diff --git a/src/libnm-platform/devlink/nm-devlink.c b/src/libnm-platform/devlink/nm-devlink.c index f06697cf..97749cda 100644 --- a/src/libnm-platform/devlink/nm-devlink.c +++ b/src/libnm-platform/devlink/nm-devlink.c @@ -14,6 +14,7 @@ #include "libnm-platform/nm-netlink.h" #include "libnm-platform/nm-platform.h" #include "libnm-platform/nm-platform-utils.h" +#include "libnm-platform/nmp-ethtool-ioctl.h" #define _NMLOG_PREFIX_NAME "devlink" #define _NMLOG_DOMAIN LOGD_PLATFORM | LOGD_DEVICE @@ -118,7 +119,7 @@ nm_devlink_get_dev_identifier(NMDevlink *self, char **out_bus, char **out_addr, return FALSE; } - if (!nmp_utils_ethtool_get_driver_info(self->ifindex, ðtool_driver_info)) { + if (!nmp_ethtool_ioctl_get_driver_info(self->ifindex, ðtool_driver_info)) { g_set_error(error, NM_UTILS_ERROR, NM_UTILS_ERROR_UNKNOWN, diff --git a/src/libnm-platform/meson.build b/src/libnm-platform/meson.build index 7b6ad042..35015b02 100644 --- a/src/libnm-platform/meson.build +++ b/src/libnm-platform/meson.build @@ -12,6 +12,8 @@ libnm_platform = static_library( 'nmp-netns.c', 'nmp-object.c', 'nmp-plobj.c', + 'nmp-ethtool.c', + 'nmp-ethtool-ioctl.c', 'devlink/nm-devlink.c', 'wifi/nm-wifi-utils-nl80211.c', 'wifi/nm-wifi-utils.c', diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index 24109568..d45893fe 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -41,6 +41,8 @@ #include "libnm-platform/nm-netlink.h" #include "libnm-platform/nm-platform-utils.h" #include "libnm-platform/nmp-netns.h" +#include "libnm-platform/nmp-ethtool.h" +#include "libnm-platform/nmp-ethtool-ioctl.h" #include "libnm-platform/devlink/nm-devlink.h" #include "libnm-platform/wifi/nm-wifi-utils-wext.h" #include "libnm-platform/wifi/nm-wifi-utils.h" @@ -1320,7 +1322,7 @@ _linktype_get_type(NMPlatform *platform, NMPUtilsEthtoolDriverInfo driver_info; /* Fallback OVS detection for kernel <= 3.16 */ - if (nmp_utils_ethtool_get_driver_info(ifindex, &driver_info)) { + if (nmp_ethtool_ioctl_get_driver_info(ifindex, &driver_info)) { if (nm_streq(driver_info.driver, "openvswitch")) return NM_LINK_TYPE_OPENVSWITCH; @@ -4037,14 +4039,15 @@ _new_from_nl_route(const struct nlmsghdr *nlh, gboolean id_only, ParseNlmsgIter NMPlatformIP4RtNextHop *v4_nh_extra_nexthops = v4_nh_extra_nexthops_stack; guint v4_nh_extra_alloc = G_N_ELEMENTS(v4_nh_extra_nexthops_stack); guint32 mss; - guint32 window = 0; - guint32 cwnd = 0; - guint32 initcwnd = 0; - guint32 initrwnd = 0; - guint32 mtu = 0; - guint32 rto_min = 0; - guint32 lock = 0; - gboolean quickack = FALSE; + guint32 window = 0; + guint32 cwnd = 0; + guint32 initcwnd = 0; + guint32 initrwnd = 0; + guint32 mtu = 0; + guint32 rto_min = 0; + guint32 lock = 0; + gboolean quickack = FALSE; + gboolean rto_min_set = FALSE; nm_assert((parse_nlmsg_iter->iter_more && parse_nlmsg_iter->ip6_route.next_multihop > 0) || (!parse_nlmsg_iter->iter_more && parse_nlmsg_iter->ip6_route.next_multihop == 0)); @@ -4290,8 +4293,10 @@ rta_multipath_done: initrwnd = nla_get_u32(mtb[RTAX_INITRWND]); if (mtb[RTAX_MTU]) mtu = nla_get_u32(mtb[RTAX_MTU]); - if (mtb[RTAX_RTO_MIN]) - rto_min = nla_get_u32(mtb[RTAX_RTO_MIN]); + if (mtb[RTAX_RTO_MIN] && NM_FLAGS_HAS(lock, 1U << RTAX_RTO_MIN)) { + rto_min = nla_get_u32(mtb[RTAX_RTO_MIN]); + rto_min_set = TRUE; + } if (mtb[RTAX_QUICKACK]) quickack = !!nla_get_u32(mtb[RTAX_QUICKACK]); } @@ -4362,6 +4367,7 @@ rta_multipath_done: obj->ip_route.initcwnd = initcwnd; obj->ip_route.initrwnd = initrwnd; obj->ip_route.rto_min = rto_min; + obj->ip_route.rto_min_set = rto_min_set; obj->ip_route.quickack = quickack; obj->ip_route.mtu = mtu; obj->ip_route.lock_window = NM_FLAGS_HAS(lock, 1 << RTAX_WINDOW); @@ -5634,12 +5640,19 @@ nla_put_failure: static guint32 ip_route_get_lock_flag(const NMPlatformIPRoute *route) { - return (((guint32) route->lock_window) << RTAX_WINDOW) - | (((guint32) route->lock_cwnd) << RTAX_CWND) - | (((guint32) route->lock_initcwnd) << RTAX_INITCWND) - | (((guint32) route->lock_initrwnd) << RTAX_INITRWND) - | (((guint32) route->lock_mtu) << RTAX_MTU) - | (((guint32) route->lock_mss) << RTAX_ADVMSS); + guint32 ret; + + ret = (((guint32) route->lock_window) << RTAX_WINDOW) + | (((guint32) route->lock_cwnd) << RTAX_CWND) + | (((guint32) route->lock_initcwnd) << RTAX_INITCWND) + | (((guint32) route->lock_initrwnd) << RTAX_INITRWND) + | (((guint32) route->lock_mtu) << RTAX_MTU) + | (((guint32) route->lock_mss) << RTAX_ADVMSS); + + /* the rto-min value is ignored by kernel unless the lock flag is set */ + ret |= (((guint32) route->rto_min_set) << RTAX_RTO_MIN); + + return ret; } static gboolean @@ -5803,7 +5816,7 @@ _nl_msg_new_route(uint16_t nlmsg_type, uint16_t nlmsg_flags, const NMPObject *ob NLA_PUT_U32(msg, RTAX_INITRWND, obj->ip_route.initrwnd); if (obj->ip_route.mtu) NLA_PUT_U32(msg, RTAX_MTU, obj->ip_route.mtu); - if (obj->ip_route.rto_min) + if (obj->ip_route.rto_min_set) NLA_PUT_U32(msg, RTAX_RTO_MIN, obj->ip_route.rto_min); if (obj->ip_route.quickack) NLA_PUT_U32(msg, RTAX_QUICKACK, obj->ip_route.quickack); @@ -6130,7 +6143,7 @@ nla_put_failure: const int _dirfd = (dirfd); \ const char *const _path = (path); \ \ - nm_assert(_path &&_path[0]); \ + nm_assert(_path && _path[0]); \ g_assert(!strstr(_path, "/../")); \ if (_dirfd < 0) { \ nm_assert(!_pathid); \ @@ -6138,7 +6151,7 @@ nla_put_failure: nm_assert(NM_STR_HAS_PREFIX(_path, "/proc/sys/") || NM_STR_HAS_PREFIX(_path, "/sys/") \ || NM_STR_HAS_PREFIX(_path, "/proc/net")); \ } else { \ - nm_assert(_pathid &&_pathid[0] && _pathid[0] != '/'); \ + nm_assert(_pathid && _pathid[0] && _pathid[0] != '/'); \ nm_assert(_path[0] != '/'); \ } \ } \ @@ -7562,7 +7575,7 @@ cache_on_change(NMPlatform *platform, NM_LINK_TYPE_IP6GRETAP, NM_LINK_TYPE_INFINIBAND, NM_LINK_TYPE_MACVLAN, - NM_LINK_TYPE_MACVLAN, + NM_LINK_TYPE_MACVTAP, NM_LINK_TYPE_SIT, NM_LINK_TYPE_TUN, NM_LINK_TYPE_VLAN, @@ -8955,8 +8968,8 @@ link_supports_carrier_detect(NMPlatform *platform, int ifindex) * us whether the device actually supports carrier detection in the first * place. We assume any device that does implements one of these two APIs. */ - return nmp_utils_ethtool_supports_carrier_detect(ifindex) - || nmp_utils_mii_supports_carrier_detect(ifindex); + return nmp_ethtool_ioctl_supports_carrier_detect(ifindex) + || nmp_mii_ioctl_supports_carrier_detect(ifindex); } static gboolean @@ -8974,7 +8987,7 @@ link_supports_vlans(NMPlatform *platform, int ifindex) if (!nm_platform_netns_push(platform, &netns)) return FALSE; - return nmp_utils_ethtool_supports_vlans(ifindex); + return nmp_ethtool_ioctl_supports_vlans(ifindex); } static gboolean @@ -9052,7 +9065,7 @@ link_get_permanent_address_ethtool(NMPlatform *platform, int ifindex, NMPLinkAdd if (!nm_platform_netns_push(platform, &netns)) return FALSE; - if (!nmp_utils_ethtool_get_permanent_address(ifindex, buffer, &len)) + if (!nmp_ethtool_ioctl_get_permanent_address(ifindex, buffer, &len)) return FALSE; nm_assert(len <= _NM_UTILS_HWADDR_LEN_MAX); memcpy(out_address->data, buffer, len); @@ -9195,7 +9208,7 @@ sriov_async_finish_err(SriovAsyncState *async_state, GError *error) g_object_unref(async_state->platform); g_object_unref(async_state->cancellable); g_free(async_state); - g_free(error); + nm_g_error_free(error); } static void @@ -10380,7 +10393,7 @@ link_get_wake_on_lan(NMPlatform *platform, int ifindex) return FALSE; if (type == NM_LINK_TYPE_ETHERNET) - return nmp_utils_ethtool_get_wake_on_lan(ifindex); + return nmp_ethtool_ioctl_get_wake_on_lan(ifindex); else if (type == NM_LINK_TYPE_WIFI) { WIFI_GET_WIFI_DATA(wifi_data, platform, ifindex, FALSE); @@ -10405,7 +10418,7 @@ link_get_driver_info(NMPlatform *platform, if (!nm_platform_netns_push(platform, &netns)) return FALSE; - if (!nmp_utils_ethtool_get_driver_info(ifindex, &driver_info)) + if (!nmp_ethtool_ioctl_get_driver_info(ifindex, &driver_info)) return FALSE; NM_SET_OUT(out_driver_name, g_strdup(driver_info.driver)); NM_SET_OUT(out_driver_version, g_strdup(driver_info.version)); @@ -10465,7 +10478,7 @@ parse_fdb_cb(const struct nl_msg *msg, void *arg) } NMEtherAddr ** -nm_linux_platform_get_link_fdb_table(NMPlatform *platform, int *ifindexes, guint ifindexes_len) +nm_linux_platform_get_bridge_fdb(NMPlatform *platform, int *ifindexes, guint ifindexes_len) { int nle; struct nl_sock *sk = NULL; @@ -11820,6 +11833,74 @@ mptcp_addrs_dump(NMPlatform *platform) /*****************************************************************************/ +static gboolean +ethtool_get_pause(NMPlatform *platform, int ifindex, NMEthtoolPauseState *pause) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_get_pause(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + pause); +} + +static gboolean +ethtool_set_pause(NMPlatform *platform, int ifindex, const NMEthtoolPauseState *pause) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_set_pause(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + pause); +} + +static gboolean +ethtool_get_eee(NMPlatform *platform, int ifindex, NMEthtoolEEEState *eee) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_get_eee(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + eee); +} + +static gboolean +ethtool_set_eee(NMPlatform *platform, int ifindex, const NMEthtoolEEEState *eee) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_set_eee(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + eee); +} + +static gboolean +ethtool_get_ring(NMPlatform *platform, int ifindex, NMEthtoolRingState *ring) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_get_ring(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + ring); +} + +static gboolean +ethtool_set_ring(NMPlatform *platform, int ifindex, const NMEthtoolRingState *ring) +{ + NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE(platform); + + return nmp_ethtool_set_ring(priv->sk_genl_sync, + genl_get_family_id(platform, NMP_GENL_FAMILY_TYPE_ETHTOOL), + ifindex, + ring); +} + +/*****************************************************************************/ + static void cache_update_link_udev(NMPlatform *platform, int ifindex, struct udev_device *udevice) { @@ -12317,4 +12398,11 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass) platform_class->genl_get_family_id = genl_get_family_id; platform_class->mptcp_addr_update = mptcp_addr_update; platform_class->mptcp_addrs_dump = mptcp_addrs_dump; + + platform_class->ethtool_set_pause = ethtool_set_pause; + platform_class->ethtool_get_pause = ethtool_get_pause; + platform_class->ethtool_set_eee = ethtool_set_eee; + platform_class->ethtool_get_eee = ethtool_get_eee; + platform_class->ethtool_set_ring = ethtool_set_ring; + platform_class->ethtool_get_ring = ethtool_get_ring; } diff --git a/src/libnm-platform/nm-linux-platform.h b/src/libnm-platform/nm-linux-platform.h index 3f591b7f..c7f1b17a 100644 --- a/src/libnm-platform/nm-linux-platform.h +++ b/src/libnm-platform/nm-linux-platform.h @@ -26,7 +26,7 @@ GType nm_linux_platform_get_type(void); struct _NMDedupMultiIndex; NMEtherAddr ** -nm_linux_platform_get_link_fdb_table(NMPlatform *platform, int *ifindexes, guint ifindexes_len); +nm_linux_platform_get_bridge_fdb(NMPlatform *platform, int *ifindexes, guint ifindexes_len); NMPlatform *nm_linux_platform_new(struct _NMDedupMultiIndex *multi_idx, gboolean log_with_ptr, diff --git a/src/libnm-platform/nm-platform-utils.c b/src/libnm-platform/nm-platform-utils.c index 15aac11c..d35ff6fe 100644 --- a/src/libnm-platform/nm-platform-utils.c +++ b/src/libnm-platform/nm-platform-utils.c @@ -12,14 +12,12 @@ #include <unistd.h> #include <sys/ioctl.h> #include <linux/sockios.h> -#include <linux/mii.h> #include <linux/if.h> #include <linux/version.h> #include <linux/rtnetlink.h> #include <fcntl.h> #include <libudev.h> -#include "libnm-base/nm-ethtool-base.h" #include "libnm-log-core/nm-logging.h" #include "libnm-glib-aux/nm-time-utils.h" @@ -60,1453 +58,6 @@ NM_UTILS_LOOKUP_STR_DEFINE(nm_platform_link_duplex_type_to_string, NM_UTILS_LOOKUP_STR_ITEM(NM_PLATFORM_LINK_DUPLEX_FULL, "full"), NM_UTILS_LOOKUP_STR_ITEM(NM_PLATFORM_LINK_DUPLEX_HALF, "half"), ); -/*****************************************************************************/ - -typedef struct { - int fd; - const int ifindex; - char ifname[IFNAMSIZ]; -} SocketHandle; - -#define SOCKET_HANDLE_INIT(_ifindex) \ - { \ - .fd = -1, \ - .ifindex = (_ifindex), \ - } - -static void -_nm_auto_socket_handle(SocketHandle *shandle) -{ - if (shandle->fd >= 0) - nm_close(shandle->fd); -} - -#define nm_auto_socket_handle nm_auto(_nm_auto_socket_handle) - -/*****************************************************************************/ - -typedef enum { - IOCTL_CALL_DATA_TYPE_NONE, - IOCTL_CALL_DATA_TYPE_IFRDATA, - IOCTL_CALL_DATA_TYPE_IFRU, -} IoctlCallDataType; - -static int -_ioctl_call(const char *log_ioctl_type, - const char *log_subtype, - unsigned long int ioctl_request, - int ifindex, - int *inout_fd, - char *inout_ifname, - IoctlCallDataType edata_type, - gpointer edata, - gsize edata_size, - struct ifreq *out_ifreq) -{ - nm_auto_close int fd_close = -1; - int fd; - int r; - gpointer edata_backup = NULL; - gs_free gpointer edata_backup_free = NULL; - guint try_count; - char known_ifnames[2][IFNAMSIZ]; - const char *failure_reason = NULL; - struct ifreq ifr; - - nm_assert(ifindex > 0); - nm_assert(NM_IN_SET(edata_type, - IOCTL_CALL_DATA_TYPE_NONE, - IOCTL_CALL_DATA_TYPE_IFRDATA, - IOCTL_CALL_DATA_TYPE_IFRU)); - nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_NONE || edata_size == 0); - nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_IFRDATA || edata_size > 0); - nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_IFRU - || (edata_size > 0 && edata_size <= sizeof(ifr.ifr_ifru))); - nm_assert(edata_size == 0 || edata); - - /* open a file descriptor (or use the one provided). */ - if (inout_fd && *inout_fd >= 0) - fd = *inout_fd; - else { - fd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); - if (fd < 0) { - r = -NM_ERRNO_NATIVE(errno); - failure_reason = "failed creating socket or ioctl"; - goto out; - } - if (inout_fd) - *inout_fd = fd; - else - fd_close = fd; - } - - /* resolve the ifindex to name (or use the one provided). */ - if (inout_ifname && inout_ifname[0]) - nm_utils_ifname_cpy(known_ifnames[0], inout_ifname); - else { - if (!nmp_utils_if_indextoname(ifindex, known_ifnames[0])) { - failure_reason = "cannot resolve ifindex"; - r = -ENODEV; - goto out; - } - if (inout_ifname) - nm_utils_ifname_cpy(inout_ifname, known_ifnames[0]); - } - - /* we might need to retry the request. Backup edata so that we can - * restore it on retry. */ - if (edata_size > 0) - edata_backup = nm_memdup_maybe_a(500, edata, edata_size, &edata_backup_free); - - try_count = 0; - -again: -{ - const char *ifname = known_ifnames[try_count % 2]; - - nm_assert(ifindex > 0); - nm_assert(ifname && nm_utils_ifname_valid_kernel(ifname, NULL)); - nm_assert(fd >= 0); - - memset(&ifr, 0, sizeof(ifr)); - nm_utils_ifname_cpy(ifr.ifr_name, ifname); - if (edata_type == IOCTL_CALL_DATA_TYPE_IFRDATA) - ifr.ifr_data = edata; - else if (edata_type == IOCTL_CALL_DATA_TYPE_IFRU) - memcpy(&ifr.ifr_ifru, edata, NM_MIN(edata_size, sizeof(ifr.ifr_ifru))); - - if (ioctl(fd, ioctl_request, &ifr) < 0) { - r = -NM_ERRNO_NATIVE(errno); - nm_log_trace(LOGD_PLATFORM, - "%s[%d]: %s, %s: failed: %s", - log_ioctl_type, - ifindex, - log_subtype, - ifname, - nm_strerror_native(-r)); - } else { - r = 0; - nm_log_trace(LOGD_PLATFORM, - "%s[%d]: %s, %s: success", - log_ioctl_type, - ifindex, - log_subtype, - ifname); - } -} - - try_count++; - - /* resolve the name again to see whether the ifindex still has the same name. */ - if (!nmp_utils_if_indextoname(ifindex, known_ifnames[try_count % 2])) { - /* we could not find the ifindex again. Probably the device just got - * removed. - * - * In both cases we return the error code we got from ioctl above. - * Either it failed because the device was gone already or it still - * managed to complete the call. In both cases, the error code is good. */ - failure_reason = - "cannot resolve ifindex after ioctl call. Probably the device was just removed"; - goto out; - } - - /* check whether the ifname changed in the meantime. If yes, would render the result - * invalid. Note that this cannot detect every race regarding renames, for example: - * - * - if_indextoname(#10) gives eth0 - * - rename(#10) => eth0_tmp - * - rename(#11) => eth0 - * - ioctl(eth0) (wrongly fetching #11, formerly eth1) - * - rename(#11) => eth_something - * - rename(#10) => eth0 - * - if_indextoname(#10) gives eth0 - */ - if (!nm_streq(known_ifnames[0], known_ifnames[1])) { - gboolean retry; - - /* we detected a possible(!) rename. - * - * For getters it's straight forward to just retry the call. - * - * For setters we also always retry. If our previous call operated on the right device, - * calling it again should have no bad effect (just setting the same thing more than once). - * - * The only potential bad thing is if there was a race involving swapping names, and we just - * set the ioctl option on the wrong device. But then the bad thing already happenned and - * we cannot detect it (nor do anything about it). At least, we can retry and set the - * option on the right interface. */ - retry = (try_count < 5); - - nm_log_trace(LOGD_PLATFORM, - "%s[%d]: %s: rename detected from \"%s\" to \"%s\". %s", - log_ioctl_type, - ifindex, - log_subtype, - known_ifnames[(try_count - 1) % 2], - known_ifnames[try_count % 2], - retry ? "Retry" : "No retry"); - if (inout_ifname) - nm_utils_ifname_cpy(inout_ifname, known_ifnames[try_count % 2]); - if (retry) { - if (edata_size > 0) - memcpy(edata, edata_backup, edata_size); - goto again; - } - } - -out: - if (failure_reason) { - nm_log_trace(LOGD_PLATFORM, - "%s[%d]: %s: %s: %s", - log_ioctl_type, - ifindex, - log_subtype, - failure_reason, - r < 0 ? nm_strerror_native(-r) : "assume success"); - } - if (r >= 0) - NM_SET_OUT(out_ifreq, ifr); - return r; -} - -/****************************************************************************** - * ethtool - *****************************************************************************/ - -static NM_UTILS_ENUM2STR_DEFINE(_ethtool_cmd_to_string, - guint32, - NM_UTILS_ENUM2STR(ETHTOOL_GCOALESCE, "ETHTOOL_GCOALESCE"), - NM_UTILS_ENUM2STR(ETHTOOL_GDRVINFO, "ETHTOOL_GDRVINFO"), - NM_UTILS_ENUM2STR(ETHTOOL_GFEATURES, "ETHTOOL_GFEATURES"), - NM_UTILS_ENUM2STR(ETHTOOL_GLINK, "ETHTOOL_GLINK"), - NM_UTILS_ENUM2STR(ETHTOOL_GLINKSETTINGS, "ETHTOOL_GLINKSETTINGS"), - NM_UTILS_ENUM2STR(ETHTOOL_GPERMADDR, "ETHTOOL_GPERMADDR"), - NM_UTILS_ENUM2STR(ETHTOOL_GRINGPARAM, "ETHTOOL_GRINGPARAM"), - NM_UTILS_ENUM2STR(ETHTOOL_GPAUSEPARAM, "ETHTOOL_GPAUSEPARAM"), - NM_UTILS_ENUM2STR(ETHTOOL_GSET, "ETHTOOL_GSET"), - NM_UTILS_ENUM2STR(ETHTOOL_GSSET_INFO, "ETHTOOL_GSSET_INFO"), - NM_UTILS_ENUM2STR(ETHTOOL_GSTATS, "ETHTOOL_GSTATS"), - NM_UTILS_ENUM2STR(ETHTOOL_GSTRINGS, "ETHTOOL_GSTRINGS"), - NM_UTILS_ENUM2STR(ETHTOOL_GWOL, "ETHTOOL_GWOL"), - NM_UTILS_ENUM2STR(ETHTOOL_SCOALESCE, "ETHTOOL_SCOALESCE"), - NM_UTILS_ENUM2STR(ETHTOOL_SFEATURES, "ETHTOOL_SFEATURES"), - NM_UTILS_ENUM2STR(ETHTOOL_SLINKSETTINGS, "ETHTOOL_SLINKSETTINGS"), - NM_UTILS_ENUM2STR(ETHTOOL_SRINGPARAM, "ETHTOOL_SRINGPARAM"), - NM_UTILS_ENUM2STR(ETHTOOL_SPAUSEPARAM, "ETHTOOL_SPAUSEPARAM"), - NM_UTILS_ENUM2STR(ETHTOOL_SSET, "ETHTOOL_SSET"), - NM_UTILS_ENUM2STR(ETHTOOL_SWOL, "ETHTOOL_SWOL"), ); - -static const char * -_ethtool_edata_to_string(gpointer edata, gsize edata_size, char *sbuf, gsize sbuf_len) -{ - nm_assert(edata); - nm_assert(edata_size >= sizeof(guint32)); - nm_assert((((intptr_t) edata) % _nm_alignof(guint32)) == 0); - - return _ethtool_cmd_to_string(*((guint32 *) edata), sbuf, sbuf_len); -} - -/*****************************************************************************/ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) -#define ethtool_cmd_speed(pedata) ((pedata)->speed) - -#define ethtool_cmd_speed_set(pedata, speed) \ - G_STMT_START \ - { \ - (pedata)->speed = (guint16) (speed); \ - } \ - G_STMT_END -#endif - -static int -_ethtool_call_handle(SocketHandle *shandle, gpointer edata, gsize edata_size) -{ - char sbuf[50]; - - return _ioctl_call("ethtool", - _ethtool_edata_to_string(edata, edata_size, sbuf, sizeof(sbuf)), - SIOCETHTOOL, - shandle->ifindex, - &shandle->fd, - shandle->ifname, - IOCTL_CALL_DATA_TYPE_IFRDATA, - edata, - edata_size, - NULL); -} - -static int -_ethtool_call_once(int ifindex, gpointer edata, gsize edata_size) -{ - char sbuf[50]; - - return _ioctl_call("ethtool", - _ethtool_edata_to_string(edata, edata_size, sbuf, sizeof(sbuf)), - SIOCETHTOOL, - ifindex, - NULL, - NULL, - IOCTL_CALL_DATA_TYPE_IFRDATA, - edata, - edata_size, - NULL); -} - -/*****************************************************************************/ - -static struct ethtool_gstrings * -ethtool_get_stringset(SocketHandle *shandle, int stringset_id) -{ - struct { - struct ethtool_sset_info info; - guint32 sentinel; - } sset_info = { - .info.cmd = ETHTOOL_GSSET_INFO, - .info.reserved = 0, - .info.sset_mask = (1ULL << stringset_id), - }; - const guint32 *pdata; - gs_free struct ethtool_gstrings *gstrings = NULL; - gsize gstrings_len; - guint32 i, len; - - if (_ethtool_call_handle(shandle, &sset_info, sizeof(sset_info)) < 0) - return NULL; - if (!sset_info.info.sset_mask) - return NULL; - - pdata = (guint32 *) sset_info.info.data; - - len = *pdata; - - gstrings_len = sizeof(*gstrings) + (len * ETH_GSTRING_LEN); - gstrings = g_malloc0(gstrings_len); - gstrings->cmd = ETHTOOL_GSTRINGS; - gstrings->string_set = stringset_id; - gstrings->len = len; - if (gstrings->len > 0) { - if (_ethtool_call_handle(shandle, gstrings, gstrings_len) < 0) - return NULL; - for (i = 0; i < gstrings->len; i++) { - /* ensure NUL terminated */ - gstrings->data[i * ETH_GSTRING_LEN + (ETH_GSTRING_LEN - 1)] = '\0'; - } - } - - return g_steal_pointer(&gstrings); -} - -static int -ethtool_gstrings_find(const struct ethtool_gstrings *gstrings, const char *needle) -{ - guint32 i; - - /* ethtool_get_stringset() always ensures NUL terminated strings at ETH_GSTRING_LEN. - * that means, we cannot possibly request longer names. */ - nm_assert(needle && strlen(needle) < ETH_GSTRING_LEN); - - for (i = 0; i < gstrings->len; i++) { - if (nm_streq((char *) &gstrings->data[i * ETH_GSTRING_LEN], needle)) - return i; - } - return -1; -} - -static int -ethtool_get_stringset_index(SocketHandle *shandle, int stringset_id, const char *needle) -{ - gs_free struct ethtool_gstrings *gstrings = NULL; - - /* ethtool_get_stringset() always ensures NUL terminated strings at ETH_GSTRING_LEN. - * that means, we cannot possibly request longer names. */ - nm_assert(needle && strlen(needle) < ETH_GSTRING_LEN); - - gstrings = ethtool_get_stringset(shandle, stringset_id); - if (gstrings) - return ethtool_gstrings_find(gstrings, needle); - return -1; -} - -/*****************************************************************************/ - -static const NMEthtoolFeatureInfo _ethtool_feature_infos[_NM_ETHTOOL_ID_FEATURE_NUM] = { -#define ETHT_FEAT(eid, ...) \ - { \ - .ethtool_id = eid, \ - .n_kernel_names = NM_NARG(__VA_ARGS__), \ - .kernel_names = ((const char *const[]) {__VA_ARGS__}), \ - } - - /* the order does only matter for one thing: if it happens that more than one NMEthtoolID - * reference the same kernel-name, then the one that is mentioned *later* will win in - * case these NMEthtoolIDs are set. That mostly only makes sense for ethtool-ids which - * refer to multiple features ("feature-tso"), while also having more specific ids - * ("feature-tx-tcp-segmentation"). */ - - /* names from ethtool utility, which are aliases for multiple features. */ - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_SG, "tx-scatter-gather", "tx-scatter-gather-fraglist"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TSO, - "tx-tcp-segmentation", - "tx-tcp-ecn-segmentation", - "tx-tcp-mangleid-segmentation", - "tx-tcp6-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX, - "tx-checksum-ipv4", - "tx-checksum-ip-generic", - "tx-checksum-ipv6", - "tx-checksum-fcoe-crc", - "tx-checksum-sctp"), - - /* names from ethtool utility, which are aliases for one feature. */ - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_GRO, "rx-gro"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_GSO, "tx-generic-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_LRO, "rx-lro"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_NTUPLE, "rx-ntuple-filter"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX, "rx-checksum"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RXHASH, "rx-hashing"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RXVLAN, "rx-vlan-hw-parse"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TXVLAN, "tx-vlan-hw-insert"), - - /* names of features, as known by kernel. */ - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_ESP_HW_OFFLOAD, "esp-hw-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_ESP_TX_CSUM_HW_OFFLOAD, "esp-tx-csum-hw-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_FCOE_MTU, "fcoe-mtu"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_HIGHDMA, "highdma"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_HW_TC_OFFLOAD, "hw-tc-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_L2_FWD_OFFLOAD, "l2-fwd-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_LOOPBACK, "loopback"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_MACSEC_HW_OFFLOAD, "macsec-hw-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_ALL, "rx-all"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_FCS, "rx-fcs"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_GRO_HW, "rx-gro-hw"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_GRO_LIST, "rx-gro-list"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_UDP_GRO_FORWARDING, "rx-udp-gro-forwarding"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD, "rx-udp_tunnel-port-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_FILTER, "rx-vlan-filter"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_FILTER, "rx-vlan-stag-filter"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_HW_PARSE, "rx-vlan-stag-hw-parse"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_RECORD, "tls-hw-record"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_RX_OFFLOAD, "tls-hw-rx-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_TX_OFFLOAD, "tls-hw-tx-offload"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_FCOE_CRC, "tx-checksum-fcoe-crc"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV4, "tx-checksum-ipv4"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV6, "tx-checksum-ipv6"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IP_GENERIC, "tx-checksum-ip-generic"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_SCTP, "tx-checksum-sctp"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_ESP_SEGMENTATION, "tx-esp-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_FCOE_SEGMENTATION, "tx-fcoe-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GRE_CSUM_SEGMENTATION, "tx-gre-csum-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GRE_SEGMENTATION, "tx-gre-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_LIST, "tx-gso-list"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_PARTIAL, "tx-gso-partial"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_ROBUST, "tx-gso-robust"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_IPXIP4_SEGMENTATION, "tx-ipxip4-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_IPXIP6_SEGMENTATION, "tx-ipxip6-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_NOCACHE_COPY, "tx-nocache-copy"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER, "tx-scatter-gather"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER_FRAGLIST, "tx-scatter-gather-fraglist"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCTP_SEGMENTATION, "tx-sctp-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP6_SEGMENTATION, "tx-tcp6-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_ECN_SEGMENTATION, "tx-tcp-ecn-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_MANGLEID_SEGMENTATION, "tx-tcp-mangleid-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_SEGMENTATION, "tx-tcp-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TUNNEL_REMCSUM_SEGMENTATION, - "tx-tunnel-remcsum-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_SEGMENTATION, "tx-udp-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION, "tx-udp_tnl-csum-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_SEGMENTATION, "tx-udp_tnl-segmentation"), - ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_VLAN_STAG_HW_INSERT, "tx-vlan-stag-hw-insert"), -}; - -/* the number of kernel features that we handle. It essentially is the sum of all - * kernel_names. So, all ethtool-ids that reference exactly one kernel-name - * (_NM_ETHTOOL_ID_FEATURE_NUM) + some extra, for ethtool-ids that are aliases - * for multiple kernel-names. */ -#define N_ETHTOOL_KERNEL_FEATURES (((guint) _NM_ETHTOOL_ID_FEATURE_NUM) + 8u) - -static void -_ASSERT_ethtool_feature_infos(void) -{ -#if NM_MORE_ASSERTS > 10 - guint i, k, n; - bool found[_NM_ETHTOOL_ID_FEATURE_NUM] = {}; - - G_STATIC_ASSERT_EXPR(G_N_ELEMENTS(_ethtool_feature_infos) == _NM_ETHTOOL_ID_FEATURE_NUM); - - n = 0; - for (i = 0; i < G_N_ELEMENTS(_ethtool_feature_infos); i++) { - NMEthtoolFeatureState kstate; - const NMEthtoolFeatureInfo *inf = &_ethtool_feature_infos[i]; - - g_assert(inf->ethtool_id >= _NM_ETHTOOL_ID_FEATURE_FIRST); - g_assert(inf->ethtool_id <= _NM_ETHTOOL_ID_FEATURE_LAST); - g_assert(inf->n_kernel_names > 0); - - for (k = 0; k < i; k++) - g_assert(inf->ethtool_id != _ethtool_feature_infos[k].ethtool_id); - - g_assert(!found[_NM_ETHTOOL_ID_FEATURE_AS_IDX(inf->ethtool_id)]); - found[_NM_ETHTOOL_ID_FEATURE_AS_IDX(inf->ethtool_id)] = TRUE; - - kstate.idx_kernel_name = inf->n_kernel_names - 1; - g_assert((guint) kstate.idx_kernel_name == (guint) (inf->n_kernel_names - 1)); - - n += inf->n_kernel_names; - for (k = 0; k < inf->n_kernel_names; k++) { - const char *name = inf->kernel_names[k]; - - g_assert(!nm_strv_contains(inf->kernel_names, k, name)); - - /* these offload features are only informational and cannot be set from user-space - * (NETIF_F_NEVER_CHANGE). We should not track them in _ethtool_feature_infos. */ - g_assert(!nm_streq(name, "netns-local")); - g_assert(!nm_streq(name, "tx-lockless")); - g_assert(!nm_streq(name, "vlan-challenged")); - } - } - - for (i = 0; i < _NM_ETHTOOL_ID_FEATURE_NUM; i++) - g_assert(found[i]); - - g_assert(n == N_ETHTOOL_KERNEL_FEATURES); -#endif -} - -static NMEthtoolFeatureStates * -ethtool_get_features(SocketHandle *shandle) -{ - gs_free NMEthtoolFeatureStates *states = NULL; - gs_free struct ethtool_gstrings *ss_features = NULL; - - _ASSERT_ethtool_feature_infos(); - - ss_features = ethtool_get_stringset(shandle, ETH_SS_FEATURES); - if (!ss_features) - return NULL; - - if (ss_features->len > 0) { - gs_free struct ethtool_gfeatures *gfeatures_free = NULL; - struct ethtool_gfeatures *gfeatures; - gsize gfeatures_len; - guint idx; - const NMEthtoolFeatureState *states_list0 = NULL; - const NMEthtoolFeatureState *const *states_plist0 = NULL; - guint states_plist_n = 0; - - gfeatures_len = sizeof(struct ethtool_gfeatures) - + (NM_DIV_ROUND_UP(ss_features->len, 32u) * sizeof(gfeatures->features[0])); - gfeatures = nm_malloc0_maybe_a(300, gfeatures_len, &gfeatures_free); - gfeatures->cmd = ETHTOOL_GFEATURES; - gfeatures->size = NM_DIV_ROUND_UP(ss_features->len, 32u); - if (_ethtool_call_handle(shandle, gfeatures, gfeatures_len) < 0) - return NULL; - - for (idx = 0; idx < G_N_ELEMENTS(_ethtool_feature_infos); idx++) { - const NMEthtoolFeatureInfo *info = &_ethtool_feature_infos[idx]; - guint idx_kernel_name; - - for (idx_kernel_name = 0; idx_kernel_name < info->n_kernel_names; idx_kernel_name++) { - NMEthtoolFeatureState *kstate; - const char *kernel_name = info->kernel_names[idx_kernel_name]; - int i_feature; - guint i_block; - guint32 i_flag; - - i_feature = ethtool_gstrings_find(ss_features, kernel_name); - if (i_feature < 0) - continue; - - i_block = ((guint) i_feature) / 32u; - i_flag = (guint32) (1u << (((guint) i_feature) % 32u)); - - if (!states) { - states = g_malloc0( - sizeof(NMEthtoolFeatureStates) - + (N_ETHTOOL_KERNEL_FEATURES * sizeof(NMEthtoolFeatureState)) - + ((N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)) - * sizeof(NMEthtoolFeatureState *))); - states_list0 = &states->states_list[0]; - states_plist0 = (gpointer) &states_list0[N_ETHTOOL_KERNEL_FEATURES]; - states->n_ss_features = ss_features->len; - } - - nm_assert(states->n_states < N_ETHTOOL_KERNEL_FEATURES); - kstate = (NMEthtoolFeatureState *) &states_list0[states->n_states]; - states->n_states++; - - kstate->info = info; - kstate->idx_ss_features = i_feature; - kstate->idx_kernel_name = idx_kernel_name; - kstate->available = !!(gfeatures->features[i_block].available & i_flag); - kstate->requested = !!(gfeatures->features[i_block].requested & i_flag); - kstate->active = !!(gfeatures->features[i_block].active & i_flag); - kstate->never_changed = !!(gfeatures->features[i_block].never_changed & i_flag); - - nm_assert(states_plist_n - < N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)); - - if (!states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)]) - states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)] = - &states_plist0[states_plist_n]; - ((const NMEthtoolFeatureState **) states_plist0)[states_plist_n] = kstate; - states_plist_n++; - } - - if (states && states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)]) { - nm_assert(states_plist_n - < N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)); - nm_assert(!states_plist0[states_plist_n]); - states_plist_n++; - } - } - } - - return g_steal_pointer(&states); -} - -NMEthtoolFeatureStates * -nmp_utils_ethtool_get_features(int ifindex) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - NMEthtoolFeatureStates *features; - - g_return_val_if_fail(ifindex > 0, 0); - - features = ethtool_get_features(&shandle); - - if (!features) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting features", - ifindex, - "get-features"); - return NULL; - } - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel features", - ifindex, - "get-features"); - return features; -} - -static const char * -_ethtool_feature_state_to_string(char *buf, - gsize buf_size, - const NMEthtoolFeatureState *s, - const char *prefix) -{ - int l; - - l = g_snprintf(buf, - buf_size, - "%s %s%s", - prefix ?: "", - ONOFF(s->active), - (!s->available || s->never_changed) - ? ", [fixed]" - : ((s->requested != s->active) - ? (s->requested ? ", [requested on]" : ", [requested off]") - : "")); - nm_assert(l < buf_size); - return buf; -} - -gboolean -nmp_utils_ethtool_set_features( - int ifindex, - const NMEthtoolFeatureStates *features, - const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, - gboolean do_set /* or reset */) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - gs_free struct ethtool_sfeatures *sfeatures_free = NULL; - struct ethtool_sfeatures *sfeatures; - gsize sfeatures_len; - int r; - guint i, j; - struct { - const NMEthtoolFeatureState *f_state; - NMOptionBool requested; - } set_states[N_ETHTOOL_KERNEL_FEATURES]; - guint set_states_n = 0; - gboolean success = TRUE; - - g_return_val_if_fail(ifindex > 0, 0); - g_return_val_if_fail(features, 0); - g_return_val_if_fail(requested, 0); - - nm_assert(features->n_states <= N_ETHTOOL_KERNEL_FEATURES); - - for (i = 0; i < _NM_ETHTOOL_ID_FEATURE_NUM; i++) { - const NMEthtoolFeatureState *const *states_indexed; - - if (requested[i] == NM_OPTION_BOOL_DEFAULT) - continue; - - if (!(states_indexed = features->states_indexed[i])) { - if (do_set) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: set feature %s: skip (not found)", - ifindex, - "set-features", - nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname); - success = FALSE; - } - continue; - } - - for (j = 0; states_indexed[j]; j++) { - const NMEthtoolFeatureState *s = states_indexed[j]; - char sbuf[255]; - - if (set_states_n >= G_N_ELEMENTS(set_states)) - g_return_val_if_reached(FALSE); - - if (s->never_changed) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: %s feature %s (%s): %s, %s (skip feature marked as " - "never changed)", - ifindex, - "set-features", - do_set ? "set" : "reset", - nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname, - s->info->kernel_names[s->idx_kernel_name], - ONOFF(do_set ? requested[i] == NM_OPTION_BOOL_TRUE : s->active), - _ethtool_feature_state_to_string(sbuf, - sizeof(sbuf), - s, - do_set ? " currently:" : " before:")); - continue; - } - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: %s feature %s (%s): %s, %s", - ifindex, - "set-features", - do_set ? "set" : "reset", - nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname, - s->info->kernel_names[s->idx_kernel_name], - ONOFF(do_set ? requested[i] == NM_OPTION_BOOL_TRUE : s->active), - _ethtool_feature_state_to_string(sbuf, - sizeof(sbuf), - s, - do_set ? " currently:" : " before:")); - - if (do_set && (!s->available || s->never_changed) - && (s->active != (requested[i] == NM_OPTION_BOOL_TRUE))) { - /* we request to change a flag which kernel reported as fixed. - * While the ethtool operation will silently succeed, mark the request - * as failure. */ - success = FALSE; - } - - set_states[set_states_n].f_state = s; - set_states[set_states_n].requested = requested[i]; - set_states_n++; - } - } - - if (set_states_n == 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: no feature requested", - ifindex, - "set-features"); - return TRUE; - } - - sfeatures_len = - sizeof(struct ethtool_sfeatures) - + (NM_DIV_ROUND_UP(features->n_ss_features, 32U) * sizeof(sfeatures->features[0])); - sfeatures = nm_malloc0_maybe_a(300, sfeatures_len, &sfeatures_free); - sfeatures->cmd = ETHTOOL_SFEATURES; - sfeatures->size = NM_DIV_ROUND_UP(features->n_ss_features, 32U); - - for (i = 0; i < set_states_n; i++) { - const NMEthtoolFeatureState *s = set_states[i].f_state; - guint i_block; - guint32 i_flag; - gboolean is_requested; - - i_block = s->idx_ss_features / 32u; - i_flag = (guint32) (1u << (s->idx_ss_features % 32u)); - - sfeatures->features[i_block].valid |= i_flag; - - if (do_set) - is_requested = (set_states[i].requested == NM_OPTION_BOOL_TRUE); - else - is_requested = s->active; - - if (is_requested) - sfeatures->features[i_block].requested |= i_flag; - else - sfeatures->features[i_block].requested &= ~i_flag; - } - - r = _ethtool_call_handle(&shandle, sfeatures, sfeatures_len); - if (r < 0) { - success = FALSE; - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting features (%s)", - ifindex, - "set-features", - nm_strerror_native(-r)); - return FALSE; - } - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: %s", - ifindex, - "set-features", - success ? "successfully setting features" - : "at least some of the features were not successfully set"); - return success; -} - -gboolean -nmp_utils_ethtool_get_coalesce(int ifindex, NMEthtoolCoalesceState *coalesce) -{ - struct ethtool_coalesce eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(coalesce, FALSE); - - eth_data.cmd = ETHTOOL_GCOALESCE; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting coalesce settings", - ifindex, - "get-coalesce"); - return FALSE; - } - - *coalesce = (NMEthtoolCoalesceState) { - .s = { - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS)] = - eth_data.rx_coalesce_usecs, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES)] = - eth_data.rx_max_coalesced_frames, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_IRQ)] = - eth_data.rx_coalesce_usecs_irq, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_IRQ)] = - eth_data.rx_max_coalesced_frames_irq, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS)] = - eth_data.tx_coalesce_usecs, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES)] = - eth_data.tx_max_coalesced_frames, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_IRQ)] = - eth_data.tx_coalesce_usecs_irq, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_IRQ)] = - eth_data.tx_max_coalesced_frames_irq, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_STATS_BLOCK_USECS)] = - eth_data.stats_block_coalesce_usecs, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_RX)] = - eth_data.use_adaptive_rx_coalesce, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_TX)] = - eth_data.use_adaptive_tx_coalesce, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_LOW)] = - eth_data.pkt_rate_low, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_LOW)] = - eth_data.rx_coalesce_usecs_low, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_LOW)] = - eth_data.rx_max_coalesced_frames_low, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_LOW)] = - eth_data.tx_coalesce_usecs_low, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_LOW)] = - eth_data.tx_max_coalesced_frames_low, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_HIGH)] = - eth_data.pkt_rate_high, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_HIGH)] = - eth_data.rx_coalesce_usecs_high, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_HIGH)] = - eth_data.rx_max_coalesced_frames_high, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_HIGH)] = - eth_data.tx_coalesce_usecs_high, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_HIGH)] = - eth_data.tx_max_coalesced_frames_high, - [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_SAMPLE_INTERVAL)] = - eth_data.rate_sample_interval, - }}; - return TRUE; - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel coalesce settings", - ifindex, - "get-coalesce"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_set_coalesce(int ifindex, const NMEthtoolCoalesceState *coalesce) -{ - struct ethtool_coalesce eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(coalesce, FALSE); - - eth_data = (struct ethtool_coalesce) { - .cmd = ETHTOOL_SCOALESCE, - .rx_coalesce_usecs = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS)], - .rx_max_coalesced_frames = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES)], - .rx_coalesce_usecs_irq = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_IRQ)], - .rx_max_coalesced_frames_irq = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_IRQ)], - .tx_coalesce_usecs = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS)], - .tx_max_coalesced_frames = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES)], - .tx_coalesce_usecs_irq = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_IRQ)], - .tx_max_coalesced_frames_irq = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_IRQ)], - .stats_block_coalesce_usecs = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_STATS_BLOCK_USECS)], - .use_adaptive_rx_coalesce = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_RX)], - .use_adaptive_tx_coalesce = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_TX)], - .pkt_rate_low = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_LOW)], - .rx_coalesce_usecs_low = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_LOW)], - .rx_max_coalesced_frames_low = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_LOW)], - .tx_coalesce_usecs_low = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_LOW)], - .tx_max_coalesced_frames_low = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_LOW)], - .pkt_rate_high = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_HIGH)], - .rx_coalesce_usecs_high = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_HIGH)], - .rx_max_coalesced_frames_high = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_HIGH)], - .tx_coalesce_usecs_high = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_HIGH)], - .tx_max_coalesced_frames_high = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_HIGH)], - .rate_sample_interval = - coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_SAMPLE_INTERVAL)], - }; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting coalesce settings", - ifindex, - "set-coalesce"); - return FALSE; - } - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: set kernel coalesce settings", - ifindex, - "set-coalesce"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_get_ring(int ifindex, NMEthtoolRingState *ring) -{ - struct ethtool_ringparam eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(ring, FALSE); - - eth_data.cmd = ETHTOOL_GRINGPARAM; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting ring settings", - ifindex, - "get-ring"); - return FALSE; - } - - *ring = (NMEthtoolRingState) { - .rx_pending = eth_data.rx_pending, - .rx_jumbo_pending = eth_data.rx_jumbo_pending, - .rx_mini_pending = eth_data.rx_mini_pending, - .tx_pending = eth_data.tx_pending, - }; - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel ring settings", - ifindex, - "get-ring"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_set_ring(int ifindex, const NMEthtoolRingState *ring) -{ - struct ethtool_ringparam eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(ring, FALSE); - - eth_data = (struct ethtool_ringparam) { - .cmd = ETHTOOL_SRINGPARAM, - .rx_pending = ring->rx_pending, - .rx_jumbo_pending = ring->rx_jumbo_pending, - .rx_mini_pending = ring->rx_mini_pending, - .tx_pending = ring->tx_pending, - }; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting ring settings", - ifindex, - "set-ring"); - return FALSE; - } - - nm_log_trace(LOGD_PLATFORM, "ethtool[%d]: %s: set kernel ring settings", ifindex, "set-ring"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_get_channels(int ifindex, NMEthtoolChannelsState *channels) -{ - struct ethtool_channels eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(channels, FALSE); - - eth_data.cmd = ETHTOOL_GCHANNELS; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting channels settings", - ifindex, - "get-channels"); - return FALSE; - } - - *channels = (NMEthtoolChannelsState) { - .rx = eth_data.rx_count, - .tx = eth_data.tx_count, - .other = eth_data.other_count, - .combined = eth_data.combined_count, - }; - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel channels settings", - ifindex, - "get-channels"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_set_channels(int ifindex, const NMEthtoolChannelsState *channels) -{ - struct ethtool_channels eth_data; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(channels, FALSE); - - eth_data = (struct ethtool_channels) { - .cmd = ETHTOOL_SCHANNELS, - .rx_count = channels->rx, - .tx_count = channels->tx, - .other_count = channels->other, - .combined_count = channels->combined, - }; - - if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting channels settings", - ifindex, - "set-channels"); - return FALSE; - } - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: set kernel channels settings", - ifindex, - "set-channels"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_get_pause(int ifindex, NMEthtoolPauseState *pause) -{ - struct ethtool_pauseparam eth_data; - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(pause, FALSE); - - eth_data.cmd = ETHTOOL_GPAUSEPARAM; - if (_ethtool_call_handle(&shandle, ð_data, sizeof(struct ethtool_pauseparam)) != 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting pause settings", - ifindex, - "get-pause"); - return FALSE; - } - - *pause = (NMEthtoolPauseState) { - .autoneg = eth_data.autoneg == 1, - .rx = eth_data.rx_pause == 1, - .tx = eth_data.tx_pause == 1, - }; - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel pause settings", - ifindex, - "get-pause"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_get_eee(int ifindex, NMEthtoolEEEState *eee) -{ - struct ethtool_eee eth_data; - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(eee, FALSE); - - eth_data.cmd = ETHTOOL_GEEE; - if (_ethtool_call_handle(&shandle, ð_data, sizeof(struct ethtool_eee)) != 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting eee settings", - ifindex, - "get-eee"); - return FALSE; - } - - *eee = (NMEthtoolEEEState) { - .enabled = eth_data.eee_enabled == 1, - }; - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: retrieved kernel eee settings", - ifindex, - "get-eee"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_set_pause(int ifindex, const NMEthtoolPauseState *pause) -{ - struct ethtool_pauseparam eth_data; - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(pause, FALSE); - - eth_data = (struct ethtool_pauseparam) { - .cmd = ETHTOOL_SPAUSEPARAM, - .autoneg = pause->autoneg ? 1 : 0, - .rx_pause = pause->rx ? 1 : 0, - .tx_pause = pause->tx ? 1 : 0, - }; - - if (_ethtool_call_handle(&shandle, ð_data, sizeof(struct ethtool_pauseparam)) != 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting pause settings", - ifindex, - "set-pause"); - return FALSE; - } - nm_log_trace(LOGD_PLATFORM, "ethtool[%d]: %s: set kernel puase settings", ifindex, "set-pause"); - return TRUE; -} - -gboolean -nmp_utils_ethtool_set_eee(int ifindex, const NMEthtoolEEEState *eee) -{ - struct ethtool_eee eth_data; - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(eee, FALSE); - - eth_data.cmd = ETHTOOL_GEEE; - if (_ethtool_call_handle(&shandle, ð_data, sizeof(struct ethtool_eee)) != 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure getting eee settings", - ifindex, - "get-eee"); - return FALSE; - } - - eth_data.cmd = ETHTOOL_SEEE, eth_data.eee_enabled = eee->enabled ? 1 : 0; - - if (_ethtool_call_handle(&shandle, ð_data, sizeof(struct ethtool_eee)) != 0) { - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %s: failure setting eee settings", - ifindex, - "set-eee"); - return FALSE; - } - nm_log_trace(LOGD_PLATFORM, "ethtool[%d]: %s: set kernel eee settings", ifindex, "set-eee"); - return TRUE; -} -/*****************************************************************************/ - -gboolean -nmp_utils_ethtool_get_driver_info(int ifindex, NMPUtilsEthtoolDriverInfo *data) -{ - struct ethtool_drvinfo *drvinfo; - - G_STATIC_ASSERT_EXPR(sizeof(*data) == sizeof(*drvinfo)); - G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, driver) - == offsetof(struct ethtool_drvinfo, driver)); - G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, version) - == offsetof(struct ethtool_drvinfo, version)); - G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, fw_version) - == offsetof(struct ethtool_drvinfo, fw_version)); - G_STATIC_ASSERT_EXPR(sizeof(data->driver) == sizeof(drvinfo->driver)); - G_STATIC_ASSERT_EXPR(sizeof(data->version) == sizeof(drvinfo->version)); - G_STATIC_ASSERT_EXPR(sizeof(data->fw_version) == sizeof(drvinfo->fw_version)); - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(data, FALSE); - - drvinfo = (struct ethtool_drvinfo *) data; - *drvinfo = (struct ethtool_drvinfo) { - .cmd = ETHTOOL_GDRVINFO, - }; - return _ethtool_call_once(ifindex, drvinfo, sizeof(*drvinfo)) >= 0; -} - -gboolean -nmp_utils_ethtool_get_permanent_address(int ifindex, guint8 *buf, size_t *length) -{ - struct { - struct ethtool_perm_addr e; - guint8 _extra_data[_NM_UTILS_HWADDR_LEN_MAX + 1]; - } edata = { - .e.cmd = ETHTOOL_GPERMADDR, - .e.size = _NM_UTILS_HWADDR_LEN_MAX, - }; - const guint8 *pdata; - - guint i; - - g_return_val_if_fail(ifindex > 0, FALSE); - - if (_ethtool_call_once(ifindex, &edata, sizeof(edata)) < 0) - return FALSE; - - if (edata.e.size > _NM_UTILS_HWADDR_LEN_MAX) - return FALSE; - if (edata.e.size < 1) - return FALSE; - - pdata = (const guint8 *) edata.e.data; - - if (NM_IN_SET(pdata[0], 0, 0xFF)) { - /* Some drivers might return a permanent address of all zeros. - * Reject that (rh#1264024) - * - * Some drivers return a permanent address of all ones. Reject that too */ - for (i = 1; i < edata.e.size; i++) { - if (pdata[0] != pdata[i]) - goto not_all_0or1; - } - return FALSE; - } - -not_all_0or1: - memcpy(buf, pdata, edata.e.size); - *length = edata.e.size; - return TRUE; -} - -gboolean -nmp_utils_ethtool_supports_carrier_detect(int ifindex) -{ - struct ethtool_cmd edata = {.cmd = ETHTOOL_GLINK}; - - g_return_val_if_fail(ifindex > 0, FALSE); - - /* We ignore the result. If the ETHTOOL_GLINK call succeeded, then we - * assume the device supports carrier-detect, otherwise we assume it - * doesn't. - */ - return _ethtool_call_once(ifindex, &edata, sizeof(edata)) >= 0; -} - -gboolean -nmp_utils_ethtool_supports_vlans(int ifindex) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - gs_free struct ethtool_gfeatures *features_free = NULL; - struct ethtool_gfeatures *features; - gsize features_len; - int idx, block, bit, size; - - g_return_val_if_fail(ifindex > 0, FALSE); - - idx = ethtool_get_stringset_index(&shandle, ETH_SS_FEATURES, "vlan-challenged"); - if (idx < 0) { - nm_log_dbg(LOGD_PLATFORM, - "ethtool[%d]: vlan-challenged ethtool feature does not exist?", - ifindex); - return FALSE; - } - - block = idx / 32; - bit = idx % 32; - size = block + 1; - - features_len = sizeof(*features) + (size * sizeof(struct ethtool_get_features_block)); - features = nm_malloc0_maybe_a(300, features_len, &features_free); - features->cmd = ETHTOOL_GFEATURES; - features->size = size; - - if (_ethtool_call_handle(&shandle, features, features_len) < 0) - return FALSE; - - return !(features->features[block].active & (1 << bit)); -} - -int -nmp_utils_ethtool_get_peer_ifindex(int ifindex) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - gsize stats_len; - gs_free struct ethtool_stats *stats_free = NULL; - struct ethtool_stats *stats; - int peer_ifindex_stat; - - g_return_val_if_fail(ifindex > 0, 0); - - peer_ifindex_stat = ethtool_get_stringset_index(&shandle, ETH_SS_STATS, "peer_ifindex"); - if (peer_ifindex_stat < 0) { - nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: peer_ifindex stat does not exist?", ifindex); - return FALSE; - } - - stats_len = sizeof(*stats) + (peer_ifindex_stat + 1) * sizeof(guint64); - stats = nm_malloc0_maybe_a(300, stats_len, &stats_free); - stats->cmd = ETHTOOL_GSTATS; - stats->n_stats = peer_ifindex_stat + 1; - if (_ethtool_call_handle(&shandle, stats, stats_len) < 0) - return 0; - - return stats->data[peer_ifindex_stat]; -} - -gboolean -nmp_utils_ethtool_get_wake_on_lan(int ifindex) -{ - struct ethtool_wolinfo wol = { - .cmd = ETHTOOL_GWOL, - }; - - g_return_val_if_fail(ifindex > 0, FALSE); - - if (_ethtool_call_once(ifindex, &wol, sizeof(wol)) < 0) - return FALSE; - - return wol.wolopts != 0; -} - -gboolean -nmp_utils_ethtool_get_link_settings(int ifindex, - gboolean *out_autoneg, - guint32 *out_speed, - NMPlatformLinkDuplexType *out_duplex) -{ - struct ethtool_cmd edata = { - .cmd = ETHTOOL_GSET, - }; - - g_return_val_if_fail(ifindex > 0, FALSE); - - if (_ethtool_call_once(ifindex, &edata, sizeof(edata)) < 0) - return FALSE; - - NM_SET_OUT(out_autoneg, (edata.autoneg == AUTONEG_ENABLE)); - - if (out_speed) { - guint32 speed; - - speed = ethtool_cmd_speed(&edata); - if (speed == G_MAXUINT16 || speed == G_MAXUINT32) - speed = 0; - - *out_speed = speed; - } - - if (out_duplex) { - switch (edata.duplex) { - case DUPLEX_HALF: - *out_duplex = NM_PLATFORM_LINK_DUPLEX_HALF; - break; - case DUPLEX_FULL: - *out_duplex = NM_PLATFORM_LINK_DUPLEX_FULL; - break; - default: /* DUPLEX_UNKNOWN */ - *out_duplex = NM_PLATFORM_LINK_DUPLEX_UNKNOWN; - break; - } - } - - return TRUE; -} - -#define ADVERTISED_INVALID 0 - -static guint32 -get_baset_mode(guint32 speed, NMPlatformLinkDuplexType duplex) -{ - if (duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN) - return ADVERTISED_INVALID; - - if (duplex == NM_PLATFORM_LINK_DUPLEX_HALF) { - switch (speed) { - case 10: - return ADVERTISED_10baseT_Half; - case 100: - return ADVERTISED_100baseT_Half; - case 1000: - return ADVERTISED_1000baseT_Half; - default: - return ADVERTISED_INVALID; - } - } else { - switch (speed) { - case 10: - return ADVERTISED_10baseT_Full; - case 100: - return ADVERTISED_100baseT_Full; - case 1000: - return ADVERTISED_1000baseT_Full; - case 10000: - return ADVERTISED_10000baseT_Full; - default: - return ADVERTISED_INVALID; - } - } -} - -static gboolean -platform_link_duplex_type_to_native(NMPlatformLinkDuplexType duplex_type, guint8 *out_native) -{ - switch (duplex_type) { - case NM_PLATFORM_LINK_DUPLEX_HALF: - *out_native = DUPLEX_HALF; - return TRUE; - case NM_PLATFORM_LINK_DUPLEX_FULL: - *out_native = DUPLEX_FULL; - return TRUE; - case NM_PLATFORM_LINK_DUPLEX_UNKNOWN: - return FALSE; - default: - g_return_val_if_reached(FALSE); - } -} - const guint8 _nmp_link_mode_all_advertised_modes_bits[] = { ETHTOOL_LINK_MODE_10baseT_Half_BIT, ETHTOOL_LINK_MODE_10baseT_Full_BIT, @@ -1597,322 +148,6 @@ const guint32 _nmp_link_mode_all_advertised_modes[] = { 0x0ffffbffu, }; -static NMOptionBool -set_link_settings_new(SocketHandle *shandle, - gboolean autoneg, - guint32 speed, - NMPlatformLinkDuplexType duplex) -{ - struct ethtool_link_settings edata0; - gs_free struct ethtool_link_settings *edata = NULL; - gsize edata_size; - guint nwords; - guint i; - - edata0 = (struct ethtool_link_settings) { - .cmd = ETHTOOL_GLINKSETTINGS, - .link_mode_masks_nwords = 0, - }; - - /* perform the handshake to find the size of masks */ - if (_ethtool_call_handle(shandle, &edata0, sizeof(edata0)) < 0 - || edata0.link_mode_masks_nwords >= 0) { - /* new API not supported */ - return NM_OPTION_BOOL_DEFAULT; - } - - nwords = -edata0.link_mode_masks_nwords; - edata_size = sizeof(*edata) + sizeof(guint32) * nwords * 3; - edata = g_malloc0(edata_size); - edata->cmd = ETHTOOL_GLINKSETTINGS; - edata->link_mode_masks_nwords = nwords; - - /* retrieve first current settings */ - if (_ethtool_call_handle(shandle, edata, edata_size) < 0) - return FALSE; - - /* then change the needed ones */ - edata->cmd = ETHTOOL_SLINKSETTINGS; - - { - const guint32 *v_map_supported = &edata->link_mode_masks[0]; - guint32 *v_map_advertising = &edata->link_mode_masks[nwords]; - guint32 *v_map_lp_advertising = &edata->link_mode_masks[2 * nwords]; - - memcpy(v_map_advertising, v_map_supported, sizeof(guint32) * nwords); - (void) v_map_lp_advertising; - - if (speed != 0) { - guint32 mode; - - mode = get_baset_mode(speed, duplex); - - if (mode == ADVERTISED_INVALID) { - if (!autoneg) - goto set_autoneg; - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %uBASE-T %s duplex mode cannot be advertised", - shandle->ifindex, - speed, - nm_platform_link_duplex_type_to_string(duplex)); - return FALSE; - } - - if (!(v_map_supported[0] & mode)) { - if (!autoneg) - goto set_autoneg; - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: device does not support %uBASE-T %s duplex mode", - shandle->ifindex, - speed, - nm_platform_link_duplex_type_to_string(duplex)); - return FALSE; - } - - for (i = 0; i < (guint) G_N_ELEMENTS(_nmp_link_mode_all_advertised_modes); i++) - v_map_advertising[i] &= ~_nmp_link_mode_all_advertised_modes[i]; - v_map_advertising[0] |= mode; - } - } - -set_autoneg: - if (autoneg) - edata->autoneg = AUTONEG_ENABLE; - else { - edata->autoneg = AUTONEG_DISABLE; - - if (speed) - edata->speed = speed; - - platform_link_duplex_type_to_native(duplex, &edata->duplex); - } - - return _ethtool_call_handle(shandle, edata, edata_size) >= 0; -} - -gboolean -nmp_utils_ethtool_set_link_settings(int ifindex, - gboolean autoneg, - guint32 speed, - NMPlatformLinkDuplexType duplex) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - struct ethtool_cmd edata = { - .cmd = ETHTOOL_GSET, - }; - NMOptionBool ret; - - g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail((speed && duplex != NM_PLATFORM_LINK_DUPLEX_UNKNOWN) - || (!speed && duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN), - FALSE); - - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: set link: autoneg=%d, speed=%d, duplex=%s", - ifindex, - autoneg, - speed, - nm_platform_link_duplex_type_to_string(duplex)); - - ret = set_link_settings_new(&shandle, autoneg, speed, duplex); - if (ret != NM_OPTION_BOOL_DEFAULT) - return ret; - - /* new ETHTOOL_GLINKSETTINGS API not supported, fall back to GSET */ - - /* retrieve first current settings */ - if (_ethtool_call_handle(&shandle, &edata, sizeof(edata)) < 0) - return FALSE; - - /* then change the needed ones */ - edata.cmd = ETHTOOL_SSET; - - edata.advertising = edata.supported; - if (speed != 0) { - guint32 mode; - - mode = get_baset_mode(speed, duplex); - - if (mode == ADVERTISED_INVALID) { - if (!autoneg) - goto set_autoneg; - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: %uBASE-T %s duplex mode cannot be advertised", - ifindex, - speed, - nm_platform_link_duplex_type_to_string(duplex)); - return FALSE; - } - if (!(edata.supported & mode)) { - if (!autoneg) - goto set_autoneg; - nm_log_trace(LOGD_PLATFORM, - "ethtool[%d]: device does not support %uBASE-T %s duplex mode", - ifindex, - speed, - nm_platform_link_duplex_type_to_string(duplex)); - return FALSE; - } - edata.advertising &= ~_nmp_link_mode_all_advertised_modes[0]; - edata.advertising |= mode; - } - -set_autoneg: - if (autoneg) - edata.autoneg = AUTONEG_ENABLE; - else { - edata.autoneg = AUTONEG_DISABLE; - - if (speed) - ethtool_cmd_speed_set(&edata, speed); - - platform_link_duplex_type_to_native(duplex, &edata.duplex); - } - - return _ethtool_call_handle(&shandle, &edata, sizeof(edata)) >= 0; -} - -gboolean -nmp_utils_ethtool_set_wake_on_lan(int ifindex, - _NMSettingWiredWakeOnLan wol, - const char *wol_password) -{ - struct ethtool_wolinfo wol_info = { - .cmd = ETHTOOL_SWOL, - .wolopts = 0, - }; - - g_return_val_if_fail(ifindex > 0, FALSE); - - if (wol == _NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE) - return TRUE; - - nm_log_dbg(LOGD_PLATFORM, - "ethtool[%d]: setting Wake-on-LAN options 0x%x, password '%s'", - ifindex, - (unsigned) wol, - wol_password); - - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_PHY)) - wol_info.wolopts |= WAKE_PHY; - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST)) - wol_info.wolopts |= WAKE_UCAST; - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST)) - wol_info.wolopts |= WAKE_MCAST; - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST)) - wol_info.wolopts |= WAKE_BCAST; - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_ARP)) - wol_info.wolopts |= WAKE_ARP; - if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC)) - wol_info.wolopts |= WAKE_MAGIC; - - if (wol_password) { - if (!_nm_utils_hwaddr_aton_exact(wol_password, wol_info.sopass, ETH_ALEN)) { - nm_log_dbg(LOGD_PLATFORM, - "ethtool[%d]: couldn't parse Wake-on-LAN password '%s'", - ifindex, - wol_password); - return FALSE; - } - wol_info.wolopts |= WAKE_MAGICSECURE; - } - - return _ethtool_call_once(ifindex, &wol_info, sizeof(wol_info)) >= 0; -} - -gboolean -nmp_utils_ethtool_get_fec_mode(int ifindex, uint32_t *fec_mode) -{ - int r; - struct ethtool_fecparam fec_param = { - .cmd = ETHTOOL_GFECPARAM, - .fec = 0, - }; - - g_return_val_if_fail(ifindex > 0, FALSE); - - if (_ethtool_call_once(ifindex, &fec_param, sizeof(fec_param)) >= 0) { - nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: get FEC options 0x%x", ifindex, fec_param.fec); - *fec_mode = fec_param.fec; - return TRUE; - } else { - r = -NM_ERRNO_NATIVE(errno); - nm_log_dbg(LOGD_PLATFORM, - "ethtool[%d]: ETHTOOL_GFECPARAM failure get fec mode: (%s)", - ifindex, - nm_strerror_native(-r)); - return FALSE; - } -} - -gboolean -nmp_utils_ethtool_set_fec_mode(int ifindex, uint32_t fec_mode) -{ - struct ethtool_fecparam fec_param = { - .cmd = ETHTOOL_SFECPARAM, - .fec = fec_mode, - }; - - g_return_val_if_fail(ifindex > 0, FALSE); - - nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: setting FEC options 0x%x", ifindex, fec_mode); - - return _ethtool_call_once(ifindex, &fec_param, sizeof(fec_param)) >= 0; -} - -/****************************************************************************** - * mii - *****************************************************************************/ - -gboolean -nmp_utils_mii_supports_carrier_detect(int ifindex) -{ - nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); - int r; - struct ifreq ifr; - struct mii_ioctl_data *mii; - - g_return_val_if_fail(ifindex > 0, FALSE); - - r = _ioctl_call("mii", - "SIOCGMIIPHY", - SIOCGMIIPHY, - shandle.ifindex, - &shandle.fd, - shandle.ifname, - IOCTL_CALL_DATA_TYPE_NONE, - NULL, - 0, - &ifr); - if (r < 0) - return FALSE; - - /* If we can read the BMSR register, we assume that the card supports MII link detection */ - mii = (struct mii_ioctl_data *) &ifr.ifr_ifru; - mii->reg_num = MII_BMSR; - - r = _ioctl_call("mii", - "SIOCGMIIREG", - SIOCGMIIREG, - shandle.ifindex, - &shandle.fd, - shandle.ifname, - IOCTL_CALL_DATA_TYPE_IFRU, - mii, - sizeof(*mii), - &ifr); - if (r < 0) - return FALSE; - - mii = (struct mii_ioctl_data *) &ifr.ifr_ifru; - nm_log_trace(LOGD_PLATFORM, - "mii[%d,%s]: carrier-detect yes: SIOCGMIIREG result 0x%X", - ifindex, - shandle.ifname, - mii->val_out); - return TRUE; -} - /****************************************************************************** * udev *****************************************************************************/ diff --git a/src/libnm-platform/nm-platform-utils.h b/src/libnm-platform/nm-platform-utils.h index f47bcd49..4477d7ed 100644 --- a/src/libnm-platform/nm-platform-utils.h +++ b/src/libnm-platform/nm-platform-utils.h @@ -8,72 +8,17 @@ #include "libnm-base/nm-base.h" #include "libnm-platform/nmp-base.h" +#include "libnm-platform/nm-platform.h" /*****************************************************************************/ -const char *nmp_utils_ethtool_get_driver(int ifindex); -gboolean nmp_utils_ethtool_supports_carrier_detect(int ifindex); -gboolean nmp_utils_ethtool_supports_vlans(int ifindex); -int nmp_utils_ethtool_get_peer_ifindex(int ifindex); -gboolean nmp_utils_ethtool_get_wake_on_lan(int ifindex); -gboolean nmp_utils_ethtool_set_wake_on_lan(int ifindex, - _NMSettingWiredWakeOnLan wol, - const char *wol_password); - const char *nm_platform_link_duplex_type_to_string(NMPlatformLinkDuplexType duplex); extern const guint8 _nmp_link_mode_all_advertised_modes_bits[79]; extern const guint32 _nmp_link_mode_all_advertised_modes[3]; -gboolean nmp_utils_ethtool_get_link_settings(int ifindex, - gboolean *out_autoneg, - guint32 *out_speed, - NMPlatformLinkDuplexType *out_duplex); -gboolean nmp_utils_ethtool_set_link_settings(int ifindex, - gboolean autoneg, - guint32 speed, - NMPlatformLinkDuplexType duplex); - -gboolean nmp_utils_ethtool_get_permanent_address(int ifindex, guint8 *buf, size_t *length); - -gboolean nmp_utils_ethtool_get_driver_info(int ifindex, NMPUtilsEthtoolDriverInfo *data); - -NMEthtoolFeatureStates *nmp_utils_ethtool_get_features(int ifindex); - -gboolean nmp_utils_ethtool_set_features( - int ifindex, - const NMEthtoolFeatureStates *features, - const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, - gboolean do_set /* or reset */); - -gboolean nmp_utils_ethtool_get_coalesce(int ifindex, NMEthtoolCoalesceState *coalesce); - -gboolean nmp_utils_ethtool_set_coalesce(int ifindex, const NMEthtoolCoalesceState *coalesce); - -gboolean nmp_utils_ethtool_get_ring(int ifindex, NMEthtoolRingState *ring); - -gboolean nmp_utils_ethtool_set_ring(int ifindex, const NMEthtoolRingState *ring); - -gboolean nmp_utils_ethtool_get_channels(int ifindex, NMEthtoolChannelsState *channels); - -gboolean nmp_utils_ethtool_set_channels(int ifindex, const NMEthtoolChannelsState *channels); - -gboolean nmp_utils_ethtool_get_pause(int ifindex, NMEthtoolPauseState *pause); - -gboolean nmp_utils_ethtool_set_pause(int ifindex, const NMEthtoolPauseState *pause); - -gboolean nmp_utils_ethtool_get_eee(int ifindex, NMEthtoolEEEState *eee); - -gboolean nmp_utils_ethtool_set_eee(int ifindex, const NMEthtoolEEEState *eee); - -gboolean nmp_utils_ethtool_get_fec_mode(int ifindex, uint32_t *fec_mode); - -gboolean nmp_utils_ethtool_set_fec_mode(int ifindex, uint32_t fec_mode); - /*****************************************************************************/ -gboolean nmp_utils_mii_supports_carrier_detect(int ifindex); - struct udev_device; const char *nmp_utils_udev_get_driver(struct udev_device *udevice); diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index a8d34b71..fd966d2c 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -31,6 +31,7 @@ #include "libnm-log-core/nm-logging.h" #include "libnm-platform/nm-platform-utils.h" #include "libnm-platform/nmp-netns.h" +#include "libnm-platform/nmp-ethtool-ioctl.h" #include "libnm-udev-aux/nm-udev-utils.h" #include "nm-platform-private.h" #include "nmp-object.h" @@ -3230,7 +3231,7 @@ nm_platform_link_veth_get_properties(NMPlatform *self, int ifindex, int *out_pee if (!nm_platform_netns_push(self, &netns)) return FALSE; - peer_ifindex = nmp_utils_ethtool_get_peer_ifindex(plink->ifindex); + peer_ifindex = nmp_ethtool_ioctl_get_peer_ifindex(plink->ifindex); if (peer_ifindex <= 0) return FALSE; @@ -3561,7 +3562,7 @@ nm_platform_ethtool_set_wake_on_lan(NMPlatform *self, g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_wake_on_lan(ifindex, wol, wol_password); + return nmp_ethtool_ioctl_set_wake_on_lan(ifindex, wol, wol_password); } gboolean @@ -3575,7 +3576,7 @@ nm_platform_ethtool_set_link_settings(NMPlatform *self, g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_link_settings(ifindex, autoneg, speed, duplex); + return nmp_ethtool_ioctl_set_link_settings(ifindex, autoneg, speed, duplex); } gboolean @@ -3589,19 +3590,19 @@ nm_platform_ethtool_get_link_settings(NMPlatform *self, g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_get_link_settings(ifindex, out_autoneg, out_speed, out_duplex); + return nmp_ethtool_ioctl_get_link_settings(ifindex, out_autoneg, out_speed, out_duplex); } /*****************************************************************************/ NMEthtoolFeatureStates * -nm_platform_ethtool_get_link_features(NMPlatform *self, int ifindex) +nm_platform_ethtool_get_features(NMPlatform *self, int ifindex) { _CHECK_SELF_NETNS(self, klass, netns, NULL); g_return_val_if_fail(ifindex > 0, NULL); - return nmp_utils_ethtool_get_features(ifindex); + return nmp_ethtool_ioctl_get_features(ifindex); } gboolean @@ -3616,7 +3617,7 @@ nm_platform_ethtool_set_features( g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_features(ifindex, features, requested, do_set); + return nmp_ethtool_ioctl_set_features(ifindex, features, requested, do_set); } gboolean @@ -3626,7 +3627,7 @@ nm_platform_ethtool_get_fec_mode(NMPlatform *self, int ifindex, uint32_t *fec_mo g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_get_fec_mode(ifindex, fec_mode); + return nmp_ethtool_ioctl_get_fec_mode(ifindex, fec_mode); } gboolean @@ -3636,20 +3637,18 @@ nm_platform_ethtool_set_fec_mode(NMPlatform *self, int ifindex, uint32_t fec_mod g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_fec_mode(ifindex, fec_mode); + return nmp_ethtool_ioctl_set_fec_mode(ifindex, fec_mode); } gboolean -nm_platform_ethtool_get_link_coalesce(NMPlatform *self, - int ifindex, - NMEthtoolCoalesceState *coalesce) +nm_platform_ethtool_get_coalesce(NMPlatform *self, int ifindex, NMEthtoolCoalesceState *coalesce) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(coalesce, FALSE); - return nmp_utils_ethtool_get_coalesce(ifindex, coalesce); + return nmp_ethtool_ioctl_get_coalesce(ifindex, coalesce); } gboolean @@ -3661,18 +3660,18 @@ nm_platform_ethtool_set_coalesce(NMPlatform *self, g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_coalesce(ifindex, coalesce); + return nmp_ethtool_ioctl_set_coalesce(ifindex, coalesce); } gboolean -nm_platform_ethtool_get_link_ring(NMPlatform *self, int ifindex, NMEthtoolRingState *ring) +nm_platform_ethtool_get_ring(NMPlatform *self, int ifindex, NMEthtoolRingState *ring) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(ring, FALSE); - return nmp_utils_ethtool_get_ring(ifindex, ring); + return klass->ethtool_get_ring(self, ifindex, ring); } gboolean @@ -3681,21 +3680,20 @@ nm_platform_ethtool_set_ring(NMPlatform *self, int ifindex, const NMEthtoolRingS _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(ring, FALSE); - return nmp_utils_ethtool_set_ring(ifindex, ring); + return klass->ethtool_set_ring(self, ifindex, ring); } gboolean -nm_platform_ethtool_get_link_channels(NMPlatform *self, - int ifindex, - NMEthtoolChannelsState *channels) +nm_platform_ethtool_get_channels(NMPlatform *self, int ifindex, NMEthtoolChannelsState *channels) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(channels, FALSE); - return nmp_utils_ethtool_get_channels(ifindex, channels); + return nmp_ethtool_ioctl_get_channels(ifindex, channels); } gboolean @@ -3707,39 +3705,40 @@ nm_platform_ethtool_set_channels(NMPlatform *self, g_return_val_if_fail(ifindex > 0, FALSE); - return nmp_utils_ethtool_set_channels(ifindex, channels); + return nmp_ethtool_ioctl_set_channels(ifindex, channels); } gboolean -nm_platform_ethtool_get_link_pause(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause) +nm_platform_ethtool_get_pause(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); g_return_val_if_fail(pause, FALSE); - return nmp_utils_ethtool_get_pause(ifindex, pause); + return klass->ethtool_get_pause(self, ifindex, pause); } gboolean -nm_platform_ethtool_get_link_eee(NMPlatform *self, int ifindex, NMEthtoolEEEState *eee) +nm_platform_ethtool_set_pause(NMPlatform *self, int ifindex, const NMEthtoolPauseState *pause) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); - g_return_val_if_fail(eee, FALSE); + g_return_val_if_fail(pause, FALSE); - return nmp_utils_ethtool_get_eee(ifindex, eee); + return klass->ethtool_set_pause(self, ifindex, pause); } gboolean -nm_platform_ethtool_set_pause(NMPlatform *self, int ifindex, const NMEthtoolPauseState *pause) +nm_platform_ethtool_get_eee(NMPlatform *self, int ifindex, NMEthtoolEEEState *eee) { _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(eee, FALSE); - return nmp_utils_ethtool_set_pause(ifindex, pause); + return klass->ethtool_get_eee(self, ifindex, eee); } gboolean @@ -3748,8 +3747,9 @@ nm_platform_ethtool_set_eee(NMPlatform *self, int ifindex, const NMEthtoolEEESta _CHECK_SELF_NETNS(self, klass, netns, FALSE); g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(eee, FALSE); - return nmp_utils_ethtool_set_eee(ifindex, eee); + return klass->ethtool_set_eee(self, ifindex, eee); } /*****************************************************************************/ @@ -7315,8 +7315,9 @@ nm_platform_ip4_route_to_string_full(const NMPlatformIP4Route *route, route->lock_initrwnd ? "lock " : "", route->initrwnd) : "", - route->rto_min ? nm_sprintf_buf(str_rto_min, " rto_min %" G_GUINT32_FORMAT, route->rto_min) - : "", + route->rto_min_set + ? nm_sprintf_buf(str_rto_min, " rto_min %" G_GUINT32_FORMAT, route->rto_min) + : "", route->quickack ? " quickack 1" : "", route->mtu || route->lock_mtu ? nm_sprintf_buf(str_mtu, " mtu %s%" G_GUINT32_FORMAT, diff --git a/src/libnm-platform/nm-platform.h b/src/libnm-platform/nm-platform.h index 1c8a26b3..e4ccb9b1 100644 --- a/src/libnm-platform/nm-platform.h +++ b/src/libnm-platform/nm-platform.h @@ -89,7 +89,7 @@ typedef enum { * long as NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID differs. */ NM_PLATFORM_IP_ROUTE_CMP_TYPE_WEAK_ID, - /* compare two routes as kernel would allow to add them with + /* compare two routes as kernel would allow one to add them with * `ip route append`. In other words, kernel does not allow you to * add two routes (at the same time) which compare equal according * to NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID. @@ -314,6 +314,7 @@ guint _nm_platform_signal_id_get(NMPlatformSignalIdType signal_type); guint32 initrwnd; \ \ /* RTA_METRICS.RTAX_RTO_MIN (iproute2: rto_min) */ \ + /* Valid only when 'rto_min_set' is true. */ \ guint32 rto_min; \ \ /* RTA_METRICS.RTAX_MTU (iproute2: mtu) */ \ @@ -367,6 +368,10 @@ guint _nm_platform_signal_id_get(NMPlatformSignalIdType signal_type); /* RTA_METRICS.RTAX_QUICKACK (iproute2: quickack) */ \ bool quickack : 1; \ \ + /* RTA_METRICS.RTAX_RTO_MIN (iproute2: rto_min) */ \ + /* If true, the 'rto_min' value is valid. */ \ + bool rto_min_set : 1; \ + \ /* if TRUE, the "metric" field is interpreted as an offset that is added to a default * metric. For example, form a DHCP lease we don't know the actually used metric, because * that is determined by upper layers (the configuration). However, we have a default @@ -508,7 +513,7 @@ struct _NMPlatformIP6Route { * Kernel clears the host part of src/src_plen. * * src/src_plen is part of the ID of a route just like network/plen. That is, - * Not only `ip route append`, but also `ip route add` allows to add routes that only + * Not only `ip route append`, but also `ip route add` allows one to add routes that only * differ in their src/src_plen. */ struct in6_addr src; @@ -1341,6 +1346,12 @@ typedef struct { GPtrArray *(*mptcp_addrs_dump)(NMPlatform *self); + gboolean (*ethtool_get_pause)(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause); + gboolean (*ethtool_set_pause)(NMPlatform *self, int ifindex, const NMEthtoolPauseState *pause); + gboolean (*ethtool_get_eee)(NMPlatform *self, int ifindex, NMEthtoolEEEState *eee); + gboolean (*ethtool_set_eee)(NMPlatform *self, int ifindex, const NMEthtoolEEEState *eee); + gboolean (*ethtool_get_ring)(NMPlatform *self, int ifindex, NMEthtoolRingState *ring); + gboolean (*ethtool_set_ring)(NMPlatform *self, int ifindex, const NMEthtoolRingState *ring); } NMPlatformClass; /* NMPlatform signals @@ -2626,7 +2637,7 @@ gboolean nm_platform_ethtool_get_link_settings(NMPlatform *self, guint32 *out_speed, NMPlatformLinkDuplexType *out_duplex); -NMEthtoolFeatureStates *nm_platform_ethtool_get_link_features(NMPlatform *self, int ifindex); +NMEthtoolFeatureStates *nm_platform_ethtool_get_features(NMPlatform *self, int ifindex); gboolean nm_platform_ethtool_set_features( NMPlatform *self, int ifindex, @@ -2634,22 +2645,20 @@ gboolean nm_platform_ethtool_set_features( const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, gboolean do_set /* or reset */); -gboolean nm_platform_ethtool_get_link_coalesce(NMPlatform *self, - int ifindex, - NMEthtoolCoalesceState *coalesce); +gboolean +nm_platform_ethtool_get_coalesce(NMPlatform *self, int ifindex, NMEthtoolCoalesceState *coalesce); gboolean nm_platform_ethtool_set_coalesce(NMPlatform *self, int ifindex, const NMEthtoolCoalesceState *coalesce); -gboolean nm_platform_ethtool_get_link_ring(NMPlatform *self, int ifindex, NMEthtoolRingState *ring); +gboolean nm_platform_ethtool_get_ring(NMPlatform *self, int ifindex, NMEthtoolRingState *ring); gboolean nm_platform_ethtool_set_ring(NMPlatform *self, int ifindex, const NMEthtoolRingState *ring); -gboolean nm_platform_ethtool_get_link_channels(NMPlatform *self, - int ifindex, - NMEthtoolChannelsState *channels); +gboolean +nm_platform_ethtool_get_channels(NMPlatform *self, int ifindex, NMEthtoolChannelsState *channels); gboolean nm_platform_ethtool_set_channels(NMPlatform *self, int ifindex, @@ -2659,10 +2668,9 @@ gboolean nm_platform_ethtool_get_fec_mode(NMPlatform *self, int ifindex, uint32_ gboolean nm_platform_ethtool_set_fec_mode(NMPlatform *self, int ifindex, uint32_t fec_mode); -gboolean -nm_platform_ethtool_get_link_pause(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause); +gboolean nm_platform_ethtool_get_pause(NMPlatform *self, int ifindex, NMEthtoolPauseState *pause); -gboolean nm_platform_ethtool_get_link_eee(NMPlatform *self, int ifindex, NMEthtoolEEEState *eee); +gboolean nm_platform_ethtool_get_eee(NMPlatform *self, int ifindex, NMEthtoolEEEState *eee); gboolean nm_platform_ethtool_set_pause(NMPlatform *self, int ifindex, const NMEthtoolPauseState *pause); diff --git a/src/libnm-platform/nmp-ethtool-ioctl.c b/src/libnm-platform/nmp-ethtool-ioctl.c new file mode 100644 index 00000000..830b02f6 --- /dev/null +++ b/src/libnm-platform/nmp-ethtool-ioctl.c @@ -0,0 +1,1603 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#include "libnm-glib-aux/nm-default-glib-i18n-lib.h" + +#include "nmp-ethtool-ioctl.h" + +#include "libnm-platform/nm-platform.h" +#include "libnm-platform/nm-platform-utils.h" +#include "libnm-log-core/nm-logging.h" +#include "libnm-base/nm-ethtool-base.h" + +#include <linux/ethtool.h> +#include <linux/if.h> +#include <linux/mii.h> +#include <linux/sockios.h> +#include <linux/version.h> +#include <sys/ioctl.h> + +#define ONOFF(bool_val) ((bool_val) ? "on" : "off") + +/*****************************************************************************/ + +typedef struct { + int fd; + const int ifindex; + char ifname[IFNAMSIZ]; +} SocketHandle; + +#define SOCKET_HANDLE_INIT(_ifindex) \ + { \ + .fd = -1, \ + .ifindex = (_ifindex), \ + } + +static void +_nm_auto_socket_handle(SocketHandle *shandle) +{ + if (shandle->fd >= 0) + nm_close(shandle->fd); +} + +#define nm_auto_socket_handle nm_auto(_nm_auto_socket_handle) + +/*****************************************************************************/ + +typedef enum { + IOCTL_CALL_DATA_TYPE_NONE, + IOCTL_CALL_DATA_TYPE_IFRDATA, + IOCTL_CALL_DATA_TYPE_IFRU, +} IoctlCallDataType; + +static int +_ioctl_call(const char *log_ioctl_type, + const char *log_subtype, + unsigned long int ioctl_request, + int ifindex, + int *inout_fd, + char *inout_ifname, + IoctlCallDataType edata_type, + gpointer edata, + gsize edata_size, + struct ifreq *out_ifreq) +{ + nm_auto_close int fd_close = -1; + int fd; + int r; + gpointer edata_backup = NULL; + gs_free gpointer edata_backup_free = NULL; + guint try_count; + char known_ifnames[2][IFNAMSIZ]; + const char *failure_reason = NULL; + struct ifreq ifr; + + nm_assert(ifindex > 0); + nm_assert(NM_IN_SET(edata_type, + IOCTL_CALL_DATA_TYPE_NONE, + IOCTL_CALL_DATA_TYPE_IFRDATA, + IOCTL_CALL_DATA_TYPE_IFRU)); + nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_NONE || edata_size == 0); + nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_IFRDATA || edata_size > 0); + nm_assert(edata_type != IOCTL_CALL_DATA_TYPE_IFRU + || (edata_size > 0 && edata_size <= sizeof(ifr.ifr_ifru))); + nm_assert(edata_size == 0 || edata); + + /* open a file descriptor (or use the one provided). */ + if (inout_fd && *inout_fd >= 0) + fd = *inout_fd; + else { + fd = socket(PF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (fd < 0) { + r = -NM_ERRNO_NATIVE(errno); + failure_reason = "failed creating socket or ioctl"; + goto out; + } + if (inout_fd) + *inout_fd = fd; + else + fd_close = fd; + } + + /* resolve the ifindex to name (or use the one provided). */ + if (inout_ifname && inout_ifname[0]) + nm_utils_ifname_cpy(known_ifnames[0], inout_ifname); + else { + if (!nmp_utils_if_indextoname(ifindex, known_ifnames[0])) { + failure_reason = "cannot resolve ifindex"; + r = -ENODEV; + goto out; + } + if (inout_ifname) + nm_utils_ifname_cpy(inout_ifname, known_ifnames[0]); + } + + /* we might need to retry the request. Backup edata so that we can + * restore it on retry. */ + if (edata_size > 0) + edata_backup = nm_memdup_maybe_a(500, edata, edata_size, &edata_backup_free); + + try_count = 0; + +again: +{ + const char *ifname = known_ifnames[try_count % 2]; + + nm_assert(ifindex > 0); + nm_assert(ifname && nm_utils_ifname_valid_kernel(ifname, NULL)); + nm_assert(fd >= 0); + + memset(&ifr, 0, sizeof(ifr)); + nm_utils_ifname_cpy(ifr.ifr_name, ifname); + if (edata_type == IOCTL_CALL_DATA_TYPE_IFRDATA) + ifr.ifr_data = edata; + else if (edata_type == IOCTL_CALL_DATA_TYPE_IFRU) + memcpy(&ifr.ifr_ifru, edata, NM_MIN(edata_size, sizeof(ifr.ifr_ifru))); + + if (ioctl(fd, ioctl_request, &ifr) < 0) { + r = -NM_ERRNO_NATIVE(errno); + nm_log_trace(LOGD_PLATFORM, + "%s[%d]: %s, %s: failed: %s", + log_ioctl_type, + ifindex, + log_subtype, + ifname, + nm_strerror_native(-r)); + } else { + r = 0; + nm_log_trace(LOGD_PLATFORM, + "%s[%d]: %s, %s: success", + log_ioctl_type, + ifindex, + log_subtype, + ifname); + } +} + + try_count++; + + /* resolve the name again to see whether the ifindex still has the same name. */ + if (!nmp_utils_if_indextoname(ifindex, known_ifnames[try_count % 2])) { + /* we could not find the ifindex again. Probably the device just got + * removed. + * + * In both cases we return the error code we got from ioctl above. + * Either it failed because the device was gone already or it still + * managed to complete the call. In both cases, the error code is good. */ + failure_reason = + "cannot resolve ifindex after ioctl call. Probably the device was just removed"; + goto out; + } + + /* check whether the ifname changed in the meantime. If yes, would render the result + * invalid. Note that this cannot detect every race regarding renames, for example: + * + * - if_indextoname(#10) gives eth0 + * - rename(#10) => eth0_tmp + * - rename(#11) => eth0 + * - ioctl(eth0) (wrongly fetching #11, formerly eth1) + * - rename(#11) => eth_something + * - rename(#10) => eth0 + * - if_indextoname(#10) gives eth0 + */ + if (!nm_streq(known_ifnames[0], known_ifnames[1])) { + gboolean retry; + + /* we detected a possible(!) rename. + * + * For getters it's straight forward to just retry the call. + * + * For setters we also always retry. If our previous call operated on the right device, + * calling it again should have no bad effect (just setting the same thing more than once). + * + * The only potential bad thing is if there was a race involving swapping names, and we just + * set the ioctl option on the wrong device. But then the bad thing already happenned and + * we cannot detect it (nor do anything about it). At least, we can retry and set the + * option on the right interface. */ + retry = (try_count < 5); + + nm_log_trace(LOGD_PLATFORM, + "%s[%d]: %s: rename detected from \"%s\" to \"%s\". %s", + log_ioctl_type, + ifindex, + log_subtype, + known_ifnames[(try_count - 1) % 2], + known_ifnames[try_count % 2], + retry ? "Retry" : "No retry"); + if (inout_ifname) + nm_utils_ifname_cpy(inout_ifname, known_ifnames[try_count % 2]); + if (retry) { + if (edata_size > 0) + memcpy(edata, edata_backup, edata_size); + goto again; + } + } + +out: + if (failure_reason) { + nm_log_trace(LOGD_PLATFORM, + "%s[%d]: %s: %s: %s", + log_ioctl_type, + ifindex, + log_subtype, + failure_reason, + r < 0 ? nm_strerror_native(-r) : "assume success"); + } + if (r >= 0) + NM_SET_OUT(out_ifreq, ifr); + return r; +} + +/****************************************************************************** + * ethtool + *****************************************************************************/ + +static NM_UTILS_ENUM2STR_DEFINE(_ethtool_cmd_to_string, + guint32, + NM_UTILS_ENUM2STR(ETHTOOL_GCOALESCE, "ETHTOOL_GCOALESCE"), + NM_UTILS_ENUM2STR(ETHTOOL_GDRVINFO, "ETHTOOL_GDRVINFO"), + NM_UTILS_ENUM2STR(ETHTOOL_GFEATURES, "ETHTOOL_GFEATURES"), + NM_UTILS_ENUM2STR(ETHTOOL_GLINK, "ETHTOOL_GLINK"), + NM_UTILS_ENUM2STR(ETHTOOL_GLINKSETTINGS, "ETHTOOL_GLINKSETTINGS"), + NM_UTILS_ENUM2STR(ETHTOOL_GPERMADDR, "ETHTOOL_GPERMADDR"), + NM_UTILS_ENUM2STR(ETHTOOL_GRINGPARAM, "ETHTOOL_GRINGPARAM"), + NM_UTILS_ENUM2STR(ETHTOOL_GPAUSEPARAM, "ETHTOOL_GPAUSEPARAM"), + NM_UTILS_ENUM2STR(ETHTOOL_GSET, "ETHTOOL_GSET"), + NM_UTILS_ENUM2STR(ETHTOOL_GSSET_INFO, "ETHTOOL_GSSET_INFO"), + NM_UTILS_ENUM2STR(ETHTOOL_GSTATS, "ETHTOOL_GSTATS"), + NM_UTILS_ENUM2STR(ETHTOOL_GSTRINGS, "ETHTOOL_GSTRINGS"), + NM_UTILS_ENUM2STR(ETHTOOL_GWOL, "ETHTOOL_GWOL"), + NM_UTILS_ENUM2STR(ETHTOOL_SCOALESCE, "ETHTOOL_SCOALESCE"), + NM_UTILS_ENUM2STR(ETHTOOL_SFEATURES, "ETHTOOL_SFEATURES"), + NM_UTILS_ENUM2STR(ETHTOOL_SLINKSETTINGS, "ETHTOOL_SLINKSETTINGS"), + NM_UTILS_ENUM2STR(ETHTOOL_SRINGPARAM, "ETHTOOL_SRINGPARAM"), + NM_UTILS_ENUM2STR(ETHTOOL_SPAUSEPARAM, "ETHTOOL_SPAUSEPARAM"), + NM_UTILS_ENUM2STR(ETHTOOL_SSET, "ETHTOOL_SSET"), + NM_UTILS_ENUM2STR(ETHTOOL_SWOL, "ETHTOOL_SWOL"), ); + +static const char * +_ethtool_edata_to_string(gpointer edata, gsize edata_size, char *sbuf, gsize sbuf_len) +{ + nm_assert(edata); + nm_assert(edata_size >= sizeof(guint32)); + nm_assert((((intptr_t) edata) % _nm_alignof(guint32)) == 0); + + return _ethtool_cmd_to_string(*((guint32 *) edata), sbuf, sbuf_len); +} + +/*****************************************************************************/ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +#define ethtool_cmd_speed(pedata) ((pedata)->speed) + +#define ethtool_cmd_speed_set(pedata, speed) \ + G_STMT_START \ + { \ + (pedata)->speed = (guint16) (speed); \ + } \ + G_STMT_END +#endif + +static int +_ethtool_call_handle(SocketHandle *shandle, gpointer edata, gsize edata_size) +{ + char sbuf[50]; + + return _ioctl_call("ethtool", + _ethtool_edata_to_string(edata, edata_size, sbuf, sizeof(sbuf)), + SIOCETHTOOL, + shandle->ifindex, + &shandle->fd, + shandle->ifname, + IOCTL_CALL_DATA_TYPE_IFRDATA, + edata, + edata_size, + NULL); +} + +static int +_ethtool_call_once(int ifindex, gpointer edata, gsize edata_size) +{ + char sbuf[50]; + + return _ioctl_call("ethtool", + _ethtool_edata_to_string(edata, edata_size, sbuf, sizeof(sbuf)), + SIOCETHTOOL, + ifindex, + NULL, + NULL, + IOCTL_CALL_DATA_TYPE_IFRDATA, + edata, + edata_size, + NULL); +} + +/*****************************************************************************/ + +static struct ethtool_gstrings * +ethtool_get_stringset(SocketHandle *shandle, int stringset_id) +{ + struct { + struct ethtool_sset_info info; + guint32 sentinel; + } sset_info = { + .info.cmd = ETHTOOL_GSSET_INFO, + .info.reserved = 0, + .info.sset_mask = (1ULL << stringset_id), + }; + const guint32 *pdata; + gs_free struct ethtool_gstrings *gstrings = NULL; + gsize gstrings_len; + guint32 i, len; + + if (_ethtool_call_handle(shandle, &sset_info, sizeof(sset_info)) < 0) + return NULL; + if (!sset_info.info.sset_mask) + return NULL; + + pdata = (guint32 *) sset_info.info.data; + + len = *pdata; + + gstrings_len = sizeof(*gstrings) + (len * ETH_GSTRING_LEN); + gstrings = g_malloc0(gstrings_len); + gstrings->cmd = ETHTOOL_GSTRINGS; + gstrings->string_set = stringset_id; + gstrings->len = len; + if (gstrings->len > 0) { + if (_ethtool_call_handle(shandle, gstrings, gstrings_len) < 0) + return NULL; + for (i = 0; i < gstrings->len; i++) { + /* ensure NUL terminated */ + gstrings->data[i * ETH_GSTRING_LEN + (ETH_GSTRING_LEN - 1)] = '\0'; + } + } + + return g_steal_pointer(&gstrings); +} + +static int +ethtool_gstrings_find(const struct ethtool_gstrings *gstrings, const char *needle) +{ + guint32 i; + + /* ethtool_get_stringset() always ensures NUL terminated strings at ETH_GSTRING_LEN. + * that means, we cannot possibly request longer names. */ + nm_assert(needle && strlen(needle) < ETH_GSTRING_LEN); + + for (i = 0; i < gstrings->len; i++) { + if (nm_streq((char *) &gstrings->data[i * ETH_GSTRING_LEN], needle)) + return i; + } + return -1; +} + +static int +ethtool_get_stringset_index(SocketHandle *shandle, int stringset_id, const char *needle) +{ + gs_free struct ethtool_gstrings *gstrings = NULL; + + /* ethtool_get_stringset() always ensures NUL terminated strings at ETH_GSTRING_LEN. + * that means, we cannot possibly request longer names. */ + nm_assert(needle && strlen(needle) < ETH_GSTRING_LEN); + + gstrings = ethtool_get_stringset(shandle, stringset_id); + if (gstrings) + return ethtool_gstrings_find(gstrings, needle); + return -1; +} + +/*****************************************************************************/ + +static const NMEthtoolFeatureInfo _ethtool_feature_infos[_NM_ETHTOOL_ID_FEATURE_NUM] = { +#define ETHT_FEAT(eid, ...) \ + { \ + .ethtool_id = eid, \ + .n_kernel_names = NM_NARG(__VA_ARGS__), \ + .kernel_names = ((const char *const[]) {__VA_ARGS__}), \ + } + + /* the order does only matter for one thing: if it happens that more than one NMEthtoolID + * reference the same kernel-name, then the one that is mentioned *later* will win in + * case these NMEthtoolIDs are set. That mostly only makes sense for ethtool-ids which + * refer to multiple features ("feature-tso"), while also having more specific ids + * ("feature-tx-tcp-segmentation"). */ + + /* names from ethtool utility, which are aliases for multiple features. */ + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_SG, "tx-scatter-gather", "tx-scatter-gather-fraglist"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TSO, + "tx-tcp-segmentation", + "tx-tcp-ecn-segmentation", + "tx-tcp-mangleid-segmentation", + "tx-tcp6-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX, + "tx-checksum-ipv4", + "tx-checksum-ip-generic", + "tx-checksum-ipv6", + "tx-checksum-fcoe-crc", + "tx-checksum-sctp"), + + /* names from ethtool utility, which are aliases for one feature. */ + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_GRO, "rx-gro"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_GSO, "tx-generic-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_LRO, "rx-lro"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_NTUPLE, "rx-ntuple-filter"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX, "rx-checksum"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RXHASH, "rx-hashing"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RXVLAN, "rx-vlan-hw-parse"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TXVLAN, "tx-vlan-hw-insert"), + + /* names of features, as known by kernel. */ + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_ESP_HW_OFFLOAD, "esp-hw-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_ESP_TX_CSUM_HW_OFFLOAD, "esp-tx-csum-hw-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_FCOE_MTU, "fcoe-mtu"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_HIGHDMA, "highdma"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_HW_TC_OFFLOAD, "hw-tc-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_L2_FWD_OFFLOAD, "l2-fwd-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_LOOPBACK, "loopback"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_MACSEC_HW_OFFLOAD, "macsec-hw-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_ALL, "rx-all"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_FCS, "rx-fcs"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_GRO_HW, "rx-gro-hw"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_GRO_LIST, "rx-gro-list"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_UDP_GRO_FORWARDING, "rx-udp-gro-forwarding"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD, "rx-udp_tunnel-port-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_FILTER, "rx-vlan-filter"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_FILTER, "rx-vlan-stag-filter"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_HW_PARSE, "rx-vlan-stag-hw-parse"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_RECORD, "tls-hw-record"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_RX_OFFLOAD, "tls-hw-rx-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TLS_HW_TX_OFFLOAD, "tls-hw-tx-offload"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_FCOE_CRC, "tx-checksum-fcoe-crc"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV4, "tx-checksum-ipv4"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV6, "tx-checksum-ipv6"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IP_GENERIC, "tx-checksum-ip-generic"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_SCTP, "tx-checksum-sctp"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_ESP_SEGMENTATION, "tx-esp-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_FCOE_SEGMENTATION, "tx-fcoe-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GRE_CSUM_SEGMENTATION, "tx-gre-csum-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GRE_SEGMENTATION, "tx-gre-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_LIST, "tx-gso-list"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_PARTIAL, "tx-gso-partial"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_GSO_ROBUST, "tx-gso-robust"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_IPXIP4_SEGMENTATION, "tx-ipxip4-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_IPXIP6_SEGMENTATION, "tx-ipxip6-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_NOCACHE_COPY, "tx-nocache-copy"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER, "tx-scatter-gather"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER_FRAGLIST, "tx-scatter-gather-fraglist"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_SCTP_SEGMENTATION, "tx-sctp-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP6_SEGMENTATION, "tx-tcp6-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_ECN_SEGMENTATION, "tx-tcp-ecn-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_MANGLEID_SEGMENTATION, "tx-tcp-mangleid-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TCP_SEGMENTATION, "tx-tcp-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_TUNNEL_REMCSUM_SEGMENTATION, + "tx-tunnel-remcsum-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_SEGMENTATION, "tx-udp-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION, "tx-udp_tnl-csum-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_SEGMENTATION, "tx-udp_tnl-segmentation"), + ETHT_FEAT(NM_ETHTOOL_ID_FEATURE_TX_VLAN_STAG_HW_INSERT, "tx-vlan-stag-hw-insert"), +}; + +/* the number of kernel features that we handle. It essentially is the sum of all + * kernel_names. So, all ethtool-ids that reference exactly one kernel-name + * (_NM_ETHTOOL_ID_FEATURE_NUM) + some extra, for ethtool-ids that are aliases + * for multiple kernel-names. */ +#define N_ETHTOOL_KERNEL_FEATURES (((guint) _NM_ETHTOOL_ID_FEATURE_NUM) + 8u) + +static void +_ASSERT_ethtool_feature_infos(void) +{ +#if NM_MORE_ASSERTS > 10 + guint i, k, n; + bool found[_NM_ETHTOOL_ID_FEATURE_NUM] = {}; + + G_STATIC_ASSERT_EXPR(G_N_ELEMENTS(_ethtool_feature_infos) == _NM_ETHTOOL_ID_FEATURE_NUM); + + n = 0; + for (i = 0; i < G_N_ELEMENTS(_ethtool_feature_infos); i++) { + NMEthtoolFeatureState kstate; + const NMEthtoolFeatureInfo *inf = &_ethtool_feature_infos[i]; + + g_assert(inf->ethtool_id >= _NM_ETHTOOL_ID_FEATURE_FIRST); + g_assert(inf->ethtool_id <= _NM_ETHTOOL_ID_FEATURE_LAST); + g_assert(inf->n_kernel_names > 0); + + for (k = 0; k < i; k++) + g_assert(inf->ethtool_id != _ethtool_feature_infos[k].ethtool_id); + + g_assert(!found[_NM_ETHTOOL_ID_FEATURE_AS_IDX(inf->ethtool_id)]); + found[_NM_ETHTOOL_ID_FEATURE_AS_IDX(inf->ethtool_id)] = TRUE; + + kstate.idx_kernel_name = inf->n_kernel_names - 1; + g_assert((guint) kstate.idx_kernel_name == (guint) (inf->n_kernel_names - 1)); + + n += inf->n_kernel_names; + for (k = 0; k < inf->n_kernel_names; k++) { + const char *name = inf->kernel_names[k]; + + g_assert(!nm_strv_contains(inf->kernel_names, k, name)); + + /* these offload features are only informational and cannot be set from user-space + * (NETIF_F_NEVER_CHANGE). We should not track them in _ethtool_feature_infos. */ + g_assert(!nm_streq(name, "netns-local")); + g_assert(!nm_streq(name, "tx-lockless")); + g_assert(!nm_streq(name, "vlan-challenged")); + } + } + + for (i = 0; i < _NM_ETHTOOL_ID_FEATURE_NUM; i++) + g_assert(found[i]); + + g_assert(n == N_ETHTOOL_KERNEL_FEATURES); +#endif +} + +static NMEthtoolFeatureStates * +ethtool_get_features(SocketHandle *shandle) +{ + gs_free NMEthtoolFeatureStates *states = NULL; + gs_free struct ethtool_gstrings *ss_features = NULL; + + _ASSERT_ethtool_feature_infos(); + + ss_features = ethtool_get_stringset(shandle, ETH_SS_FEATURES); + if (!ss_features) + return NULL; + + if (ss_features->len > 0) { + gs_free struct ethtool_gfeatures *gfeatures_free = NULL; + struct ethtool_gfeatures *gfeatures; + gsize gfeatures_len; + guint idx; + const NMEthtoolFeatureState *states_list0 = NULL; + const NMEthtoolFeatureState *const *states_plist0 = NULL; + guint states_plist_n = 0; + + gfeatures_len = sizeof(struct ethtool_gfeatures) + + (NM_DIV_ROUND_UP(ss_features->len, 32u) * sizeof(gfeatures->features[0])); + gfeatures = nm_malloc0_maybe_a(300, gfeatures_len, &gfeatures_free); + gfeatures->cmd = ETHTOOL_GFEATURES; + gfeatures->size = NM_DIV_ROUND_UP(ss_features->len, 32u); + if (_ethtool_call_handle(shandle, gfeatures, gfeatures_len) < 0) + return NULL; + + for (idx = 0; idx < G_N_ELEMENTS(_ethtool_feature_infos); idx++) { + const NMEthtoolFeatureInfo *info = &_ethtool_feature_infos[idx]; + guint idx_kernel_name; + + for (idx_kernel_name = 0; idx_kernel_name < info->n_kernel_names; idx_kernel_name++) { + NMEthtoolFeatureState *kstate; + const char *kernel_name = info->kernel_names[idx_kernel_name]; + int i_feature; + guint i_block; + guint32 i_flag; + + i_feature = ethtool_gstrings_find(ss_features, kernel_name); + if (i_feature < 0) + continue; + + i_block = ((guint) i_feature) / 32u; + i_flag = (guint32) (1u << (((guint) i_feature) % 32u)); + + if (!states) { + states = g_malloc0( + sizeof(NMEthtoolFeatureStates) + + (N_ETHTOOL_KERNEL_FEATURES * sizeof(NMEthtoolFeatureState)) + + ((N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)) + * sizeof(NMEthtoolFeatureState *))); + states_list0 = &states->states_list[0]; + states_plist0 = (gpointer) &states_list0[N_ETHTOOL_KERNEL_FEATURES]; + states->n_ss_features = ss_features->len; + } + + nm_assert(states->n_states < N_ETHTOOL_KERNEL_FEATURES); + kstate = (NMEthtoolFeatureState *) &states_list0[states->n_states]; + states->n_states++; + + kstate->info = info; + kstate->idx_ss_features = i_feature; + kstate->idx_kernel_name = idx_kernel_name; + kstate->available = !!(gfeatures->features[i_block].available & i_flag); + kstate->requested = !!(gfeatures->features[i_block].requested & i_flag); + kstate->active = !!(gfeatures->features[i_block].active & i_flag); + kstate->never_changed = !!(gfeatures->features[i_block].never_changed & i_flag); + + nm_assert(states_plist_n + < N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)); + + if (!states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)]) + states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)] = + &states_plist0[states_plist_n]; + ((const NMEthtoolFeatureState **) states_plist0)[states_plist_n] = kstate; + states_plist_n++; + } + + if (states && states->states_indexed[_NM_ETHTOOL_ID_FEATURE_AS_IDX(info->ethtool_id)]) { + nm_assert(states_plist_n + < N_ETHTOOL_KERNEL_FEATURES + G_N_ELEMENTS(_ethtool_feature_infos)); + nm_assert(!states_plist0[states_plist_n]); + states_plist_n++; + } + } + } + + return g_steal_pointer(&states); +} + +NMEthtoolFeatureStates * +nmp_ethtool_ioctl_get_features(int ifindex) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + NMEthtoolFeatureStates *features; + + g_return_val_if_fail(ifindex > 0, 0); + + features = ethtool_get_features(&shandle); + + if (!features) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure getting features", + ifindex, + "get-features"); + return NULL; + } + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: retrieved kernel features", + ifindex, + "get-features"); + return features; +} + +static const char * +_ethtool_feature_state_to_string(char *buf, + gsize buf_size, + const NMEthtoolFeatureState *s, + const char *prefix) +{ + int l; + + l = g_snprintf(buf, + buf_size, + "%s %s%s", + prefix ?: "", + ONOFF(s->active), + (!s->available || s->never_changed) + ? ", [fixed]" + : ((s->requested != s->active) + ? (s->requested ? ", [requested on]" : ", [requested off]") + : "")); + nm_assert(l < buf_size); + return buf; +} + +gboolean +nmp_ethtool_ioctl_set_features( + int ifindex, + const NMEthtoolFeatureStates *features, + const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, + gboolean do_set /* or reset */) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + gs_free struct ethtool_sfeatures *sfeatures_free = NULL; + struct ethtool_sfeatures *sfeatures; + gsize sfeatures_len; + int r; + guint i, j; + struct { + const NMEthtoolFeatureState *f_state; + NMOptionBool requested; + } set_states[N_ETHTOOL_KERNEL_FEATURES]; + guint set_states_n = 0; + gboolean success = TRUE; + + g_return_val_if_fail(ifindex > 0, 0); + g_return_val_if_fail(features, 0); + g_return_val_if_fail(requested, 0); + + nm_assert(features->n_states <= N_ETHTOOL_KERNEL_FEATURES); + + for (i = 0; i < _NM_ETHTOOL_ID_FEATURE_NUM; i++) { + const NMEthtoolFeatureState *const *states_indexed; + + if (requested[i] == NM_OPTION_BOOL_DEFAULT) + continue; + + if (!(states_indexed = features->states_indexed[i])) { + if (do_set) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: set feature %s: skip (not found)", + ifindex, + "set-features", + nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname); + success = FALSE; + } + continue; + } + + for (j = 0; states_indexed[j]; j++) { + const NMEthtoolFeatureState *s = states_indexed[j]; + char sbuf[255]; + + if (set_states_n >= G_N_ELEMENTS(set_states)) + g_return_val_if_reached(FALSE); + + if (s->never_changed) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: %s feature %s (%s): %s, %s (skip feature marked as " + "never changed)", + ifindex, + "set-features", + do_set ? "set" : "reset", + nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname, + s->info->kernel_names[s->idx_kernel_name], + ONOFF(do_set ? requested[i] == NM_OPTION_BOOL_TRUE : s->active), + _ethtool_feature_state_to_string(sbuf, + sizeof(sbuf), + s, + do_set ? " currently:" : " before:")); + continue; + } + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: %s feature %s (%s): %s, %s", + ifindex, + "set-features", + do_set ? "set" : "reset", + nm_ethtool_data[i + _NM_ETHTOOL_ID_FEATURE_FIRST]->optname, + s->info->kernel_names[s->idx_kernel_name], + ONOFF(do_set ? requested[i] == NM_OPTION_BOOL_TRUE : s->active), + _ethtool_feature_state_to_string(sbuf, + sizeof(sbuf), + s, + do_set ? " currently:" : " before:")); + + if (do_set && (!s->available || s->never_changed) + && (s->active != (requested[i] == NM_OPTION_BOOL_TRUE))) { + /* we request to change a flag which kernel reported as fixed. + * While the ethtool operation will silently succeed, mark the request + * as failure. */ + success = FALSE; + } + + set_states[set_states_n].f_state = s; + set_states[set_states_n].requested = requested[i]; + set_states_n++; + } + } + + if (set_states_n == 0) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: no feature requested", + ifindex, + "set-features"); + return TRUE; + } + + sfeatures_len = + sizeof(struct ethtool_sfeatures) + + (NM_DIV_ROUND_UP(features->n_ss_features, 32U) * sizeof(sfeatures->features[0])); + sfeatures = nm_malloc0_maybe_a(300, sfeatures_len, &sfeatures_free); + sfeatures->cmd = ETHTOOL_SFEATURES; + sfeatures->size = NM_DIV_ROUND_UP(features->n_ss_features, 32U); + + for (i = 0; i < set_states_n; i++) { + const NMEthtoolFeatureState *s = set_states[i].f_state; + guint i_block; + guint32 i_flag; + gboolean is_requested; + + i_block = s->idx_ss_features / 32u; + i_flag = (guint32) (1u << (s->idx_ss_features % 32u)); + + sfeatures->features[i_block].valid |= i_flag; + + if (do_set) + is_requested = (set_states[i].requested == NM_OPTION_BOOL_TRUE); + else + is_requested = s->active; + + if (is_requested) + sfeatures->features[i_block].requested |= i_flag; + else + sfeatures->features[i_block].requested &= ~i_flag; + } + + r = _ethtool_call_handle(&shandle, sfeatures, sfeatures_len); + if (r < 0) { + success = FALSE; + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure setting features (%s)", + ifindex, + "set-features", + nm_strerror_native(-r)); + return FALSE; + } + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: %s", + ifindex, + "set-features", + success ? "successfully setting features" + : "at least some of the features were not successfully set"); + return success; +} + +gboolean +nmp_ethtool_ioctl_get_coalesce(int ifindex, NMEthtoolCoalesceState *coalesce) +{ + struct ethtool_coalesce eth_data; + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(coalesce, FALSE); + + eth_data.cmd = ETHTOOL_GCOALESCE; + + if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure getting coalesce settings", + ifindex, + "get-coalesce"); + return FALSE; + } + + *coalesce = (NMEthtoolCoalesceState) { + .s = { + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS)] = + eth_data.rx_coalesce_usecs, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES)] = + eth_data.rx_max_coalesced_frames, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_IRQ)] = + eth_data.rx_coalesce_usecs_irq, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_IRQ)] = + eth_data.rx_max_coalesced_frames_irq, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS)] = + eth_data.tx_coalesce_usecs, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES)] = + eth_data.tx_max_coalesced_frames, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_IRQ)] = + eth_data.tx_coalesce_usecs_irq, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_IRQ)] = + eth_data.tx_max_coalesced_frames_irq, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_STATS_BLOCK_USECS)] = + eth_data.stats_block_coalesce_usecs, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_RX)] = + eth_data.use_adaptive_rx_coalesce, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_TX)] = + eth_data.use_adaptive_tx_coalesce, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_LOW)] = + eth_data.pkt_rate_low, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_LOW)] = + eth_data.rx_coalesce_usecs_low, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_LOW)] = + eth_data.rx_max_coalesced_frames_low, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_LOW)] = + eth_data.tx_coalesce_usecs_low, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_LOW)] = + eth_data.tx_max_coalesced_frames_low, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_HIGH)] = + eth_data.pkt_rate_high, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_HIGH)] = + eth_data.rx_coalesce_usecs_high, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_HIGH)] = + eth_data.rx_max_coalesced_frames_high, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_HIGH)] = + eth_data.tx_coalesce_usecs_high, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_HIGH)] = + eth_data.tx_max_coalesced_frames_high, + [_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_SAMPLE_INTERVAL)] = + eth_data.rate_sample_interval, + }}; + return TRUE; + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: retrieved kernel coalesce settings", + ifindex, + "get-coalesce"); + return TRUE; +} + +gboolean +nmp_ethtool_ioctl_set_coalesce(int ifindex, const NMEthtoolCoalesceState *coalesce) +{ + struct ethtool_coalesce eth_data; + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(coalesce, FALSE); + + eth_data = (struct ethtool_coalesce) { + .cmd = ETHTOOL_SCOALESCE, + .rx_coalesce_usecs = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS)], + .rx_max_coalesced_frames = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES)], + .rx_coalesce_usecs_irq = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_IRQ)], + .rx_max_coalesced_frames_irq = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_IRQ)], + .tx_coalesce_usecs = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS)], + .tx_max_coalesced_frames = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES)], + .tx_coalesce_usecs_irq = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_IRQ)], + .tx_max_coalesced_frames_irq = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_IRQ)], + .stats_block_coalesce_usecs = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_STATS_BLOCK_USECS)], + .use_adaptive_rx_coalesce = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_RX)], + .use_adaptive_tx_coalesce = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_ADAPTIVE_TX)], + .pkt_rate_low = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_LOW)], + .rx_coalesce_usecs_low = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_LOW)], + .rx_max_coalesced_frames_low = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_LOW)], + .tx_coalesce_usecs_low = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_LOW)], + .tx_max_coalesced_frames_low = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_LOW)], + .pkt_rate_high = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_PKT_RATE_HIGH)], + .rx_coalesce_usecs_high = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_USECS_HIGH)], + .rx_max_coalesced_frames_high = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_RX_FRAMES_HIGH)], + .tx_coalesce_usecs_high = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_USECS_HIGH)], + .tx_max_coalesced_frames_high = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_TX_FRAMES_HIGH)], + .rate_sample_interval = + coalesce->s[_NM_ETHTOOL_ID_COALESCE_AS_IDX(NM_ETHTOOL_ID_COALESCE_SAMPLE_INTERVAL)], + }; + + if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure setting coalesce settings", + ifindex, + "set-coalesce"); + return FALSE; + } + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: set kernel coalesce settings", + ifindex, + "set-coalesce"); + return TRUE; +} + +gboolean +nmp_ethtool_ioctl_get_channels(int ifindex, NMEthtoolChannelsState *channels) +{ + struct ethtool_channels eth_data; + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(channels, FALSE); + + eth_data.cmd = ETHTOOL_GCHANNELS; + + if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure getting channels settings", + ifindex, + "get-channels"); + return FALSE; + } + + *channels = (NMEthtoolChannelsState) { + .rx = eth_data.rx_count, + .tx = eth_data.tx_count, + .other = eth_data.other_count, + .combined = eth_data.combined_count, + }; + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: retrieved kernel channels settings", + ifindex, + "get-channels"); + return TRUE; +} + +gboolean +nmp_ethtool_ioctl_set_channels(int ifindex, const NMEthtoolChannelsState *channels) +{ + struct ethtool_channels eth_data; + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(channels, FALSE); + + eth_data = (struct ethtool_channels) { + .cmd = ETHTOOL_SCHANNELS, + .rx_count = channels->rx, + .tx_count = channels->tx, + .other_count = channels->other, + .combined_count = channels->combined, + }; + + if (_ethtool_call_once(ifindex, ð_data, sizeof(eth_data)) < 0) { + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: failure setting channels settings", + ifindex, + "set-channels"); + return FALSE; + } + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %s: set kernel channels settings", + ifindex, + "set-channels"); + return TRUE; +} + +gboolean +nmp_ethtool_ioctl_get_fec_mode(int ifindex, uint32_t *fec_mode) +{ + int r; + struct ethtool_fecparam fec_param = { + .cmd = ETHTOOL_GFECPARAM, + .fec = 0, + }; + + g_return_val_if_fail(ifindex > 0, FALSE); + + if (_ethtool_call_once(ifindex, &fec_param, sizeof(fec_param)) >= 0) { + nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: get FEC options 0x%x", ifindex, fec_param.fec); + *fec_mode = fec_param.fec; + return TRUE; + } else { + r = -NM_ERRNO_NATIVE(errno); + nm_log_dbg(LOGD_PLATFORM, + "ethtool[%d]: ETHTOOL_GFECPARAM failure get fec mode: (%s)", + ifindex, + nm_strerror_native(-r)); + return FALSE; + } +} + +gboolean +nmp_ethtool_ioctl_set_fec_mode(int ifindex, uint32_t fec_mode) +{ + struct ethtool_fecparam fec_param = { + .cmd = ETHTOOL_SFECPARAM, + .fec = fec_mode, + }; + + g_return_val_if_fail(ifindex > 0, FALSE); + + nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: setting FEC options 0x%x", ifindex, fec_mode); + + return _ethtool_call_once(ifindex, &fec_param, sizeof(fec_param)) >= 0; +} + +/*****************************************************************************/ + +gboolean +nmp_ethtool_ioctl_get_driver_info(int ifindex, NMPUtilsEthtoolDriverInfo *data) +{ + struct ethtool_drvinfo *drvinfo; + + G_STATIC_ASSERT_EXPR(sizeof(*data) == sizeof(*drvinfo)); + G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, driver) + == offsetof(struct ethtool_drvinfo, driver)); + G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, version) + == offsetof(struct ethtool_drvinfo, version)); + G_STATIC_ASSERT_EXPR(offsetof(NMPUtilsEthtoolDriverInfo, fw_version) + == offsetof(struct ethtool_drvinfo, fw_version)); + G_STATIC_ASSERT_EXPR(sizeof(data->driver) == sizeof(drvinfo->driver)); + G_STATIC_ASSERT_EXPR(sizeof(data->version) == sizeof(drvinfo->version)); + G_STATIC_ASSERT_EXPR(sizeof(data->fw_version) == sizeof(drvinfo->fw_version)); + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail(data, FALSE); + + drvinfo = (struct ethtool_drvinfo *) data; + *drvinfo = (struct ethtool_drvinfo) { + .cmd = ETHTOOL_GDRVINFO, + }; + return _ethtool_call_once(ifindex, drvinfo, sizeof(*drvinfo)) >= 0; +} + +gboolean +nmp_ethtool_ioctl_get_permanent_address(int ifindex, guint8 *buf, size_t *length) +{ + struct { + struct ethtool_perm_addr e; + guint8 _extra_data[_NM_UTILS_HWADDR_LEN_MAX + 1]; + } edata = { + .e.cmd = ETHTOOL_GPERMADDR, + .e.size = _NM_UTILS_HWADDR_LEN_MAX, + }; + const guint8 *pdata; + + guint i; + + g_return_val_if_fail(ifindex > 0, FALSE); + + if (_ethtool_call_once(ifindex, &edata, sizeof(edata)) < 0) + return FALSE; + + if (edata.e.size > _NM_UTILS_HWADDR_LEN_MAX) + return FALSE; + if (edata.e.size < 1) + return FALSE; + + pdata = (const guint8 *) edata.e.data; + + if (NM_IN_SET(pdata[0], 0, 0xFF)) { + /* Some drivers might return a permanent address of all zeros. + * Reject that (rh#1264024) + * + * Some drivers return a permanent address of all ones. Reject that too */ + for (i = 1; i < edata.e.size; i++) { + if (pdata[0] != pdata[i]) + goto not_all_0or1; + } + return FALSE; + } + +not_all_0or1: + memcpy(buf, pdata, edata.e.size); + *length = edata.e.size; + return TRUE; +} + +gboolean +nmp_ethtool_ioctl_supports_carrier_detect(int ifindex) +{ + struct ethtool_cmd edata = {.cmd = ETHTOOL_GLINK}; + + g_return_val_if_fail(ifindex > 0, FALSE); + + /* We ignore the result. If the ETHTOOL_GLINK call succeeded, then we + * assume the device supports carrier-detect, otherwise we assume it + * doesn't. + */ + return _ethtool_call_once(ifindex, &edata, sizeof(edata)) >= 0; +} + +gboolean +nmp_ethtool_ioctl_supports_vlans(int ifindex) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + gs_free struct ethtool_gfeatures *features_free = NULL; + struct ethtool_gfeatures *features; + gsize features_len; + int idx, block, bit, size; + + g_return_val_if_fail(ifindex > 0, FALSE); + + idx = ethtool_get_stringset_index(&shandle, ETH_SS_FEATURES, "vlan-challenged"); + if (idx < 0) { + nm_log_dbg(LOGD_PLATFORM, + "ethtool[%d]: vlan-challenged ethtool feature does not exist?", + ifindex); + return FALSE; + } + + block = idx / 32; + bit = idx % 32; + size = block + 1; + + features_len = sizeof(*features) + (size * sizeof(struct ethtool_get_features_block)); + features = nm_malloc0_maybe_a(300, features_len, &features_free); + features->cmd = ETHTOOL_GFEATURES; + features->size = size; + + if (_ethtool_call_handle(&shandle, features, features_len) < 0) + return FALSE; + + return !(features->features[block].active & (1 << bit)); +} + +int +nmp_ethtool_ioctl_get_peer_ifindex(int ifindex) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + gsize stats_len; + gs_free struct ethtool_stats *stats_free = NULL; + struct ethtool_stats *stats; + int peer_ifindex_stat; + + g_return_val_if_fail(ifindex > 0, 0); + + peer_ifindex_stat = ethtool_get_stringset_index(&shandle, ETH_SS_STATS, "peer_ifindex"); + if (peer_ifindex_stat < 0) { + nm_log_dbg(LOGD_PLATFORM, "ethtool[%d]: peer_ifindex stat does not exist?", ifindex); + return FALSE; + } + + stats_len = sizeof(*stats) + (peer_ifindex_stat + 1) * sizeof(guint64); + stats = nm_malloc0_maybe_a(300, stats_len, &stats_free); + stats->cmd = ETHTOOL_GSTATS; + stats->n_stats = peer_ifindex_stat + 1; + if (_ethtool_call_handle(&shandle, stats, stats_len) < 0) + return 0; + + return stats->data[peer_ifindex_stat]; +} + +gboolean +nmp_ethtool_ioctl_get_wake_on_lan(int ifindex) +{ + struct ethtool_wolinfo wol = { + .cmd = ETHTOOL_GWOL, + }; + + g_return_val_if_fail(ifindex > 0, FALSE); + + if (_ethtool_call_once(ifindex, &wol, sizeof(wol)) < 0) + return FALSE; + + return wol.wolopts != 0; +} + +gboolean +nmp_ethtool_ioctl_set_wake_on_lan(int ifindex, + _NMSettingWiredWakeOnLan wol, + const char *wol_password) +{ + struct ethtool_wolinfo wol_info = { + .cmd = ETHTOOL_SWOL, + .wolopts = 0, + }; + + g_return_val_if_fail(ifindex > 0, FALSE); + + if (wol == _NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE) + return TRUE; + + nm_log_dbg(LOGD_PLATFORM, + "ethtool[%d]: setting Wake-on-LAN options 0x%x, password '%s'", + ifindex, + (unsigned) wol, + wol_password); + + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_PHY)) + wol_info.wolopts |= WAKE_PHY; + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST)) + wol_info.wolopts |= WAKE_UCAST; + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST)) + wol_info.wolopts |= WAKE_MCAST; + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST)) + wol_info.wolopts |= WAKE_BCAST; + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_ARP)) + wol_info.wolopts |= WAKE_ARP; + if (NM_FLAGS_HAS(wol, _NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC)) + wol_info.wolopts |= WAKE_MAGIC; + + if (wol_password) { + if (!_nm_utils_hwaddr_aton_exact(wol_password, wol_info.sopass, ETH_ALEN)) { + nm_log_dbg(LOGD_PLATFORM, + "ethtool[%d]: couldn't parse Wake-on-LAN password '%s'", + ifindex, + wol_password); + return FALSE; + } + wol_info.wolopts |= WAKE_MAGICSECURE; + } + + return _ethtool_call_once(ifindex, &wol_info, sizeof(wol_info)) >= 0; +} + +/*****************************************************************************/ + +gboolean +nmp_ethtool_ioctl_get_link_settings(int ifindex, + gboolean *out_autoneg, + guint32 *out_speed, + NMPlatformLinkDuplexType *out_duplex) +{ + struct ethtool_cmd edata = { + .cmd = ETHTOOL_GSET, + }; + + g_return_val_if_fail(ifindex > 0, FALSE); + + if (_ethtool_call_once(ifindex, &edata, sizeof(edata)) < 0) + return FALSE; + + NM_SET_OUT(out_autoneg, (edata.autoneg == AUTONEG_ENABLE)); + + if (out_speed) { + guint32 speed; + + speed = ethtool_cmd_speed(&edata); + if (speed == G_MAXUINT16 || speed == G_MAXUINT32) + speed = 0; + + *out_speed = speed; + } + + if (out_duplex) { + switch (edata.duplex) { + case DUPLEX_HALF: + *out_duplex = NM_PLATFORM_LINK_DUPLEX_HALF; + break; + case DUPLEX_FULL: + *out_duplex = NM_PLATFORM_LINK_DUPLEX_FULL; + break; + default: /* DUPLEX_UNKNOWN */ + *out_duplex = NM_PLATFORM_LINK_DUPLEX_UNKNOWN; + break; + } + } + + return TRUE; +} + +#define ADVERTISED_INVALID 0 + +static guint32 +get_baset_mode(guint32 speed, NMPlatformLinkDuplexType duplex) +{ + if (duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN) + return ADVERTISED_INVALID; + + if (duplex == NM_PLATFORM_LINK_DUPLEX_HALF) { + switch (speed) { + case 10: + return ADVERTISED_10baseT_Half; + case 100: + return ADVERTISED_100baseT_Half; + case 1000: + return ADVERTISED_1000baseT_Half; + default: + return ADVERTISED_INVALID; + } + } else { + switch (speed) { + case 10: + return ADVERTISED_10baseT_Full; + case 100: + return ADVERTISED_100baseT_Full; + case 1000: + return ADVERTISED_1000baseT_Full; + case 10000: + return ADVERTISED_10000baseT_Full; + default: + return ADVERTISED_INVALID; + } + } +} + +static gboolean +platform_link_duplex_type_to_native(NMPlatformLinkDuplexType duplex_type, guint8 *out_native) +{ + switch (duplex_type) { + case NM_PLATFORM_LINK_DUPLEX_HALF: + *out_native = DUPLEX_HALF; + return TRUE; + case NM_PLATFORM_LINK_DUPLEX_FULL: + *out_native = DUPLEX_FULL; + return TRUE; + case NM_PLATFORM_LINK_DUPLEX_UNKNOWN: + return FALSE; + default: + g_return_val_if_reached(FALSE); + } +} + +static NMOptionBool +set_link_settings_new(SocketHandle *shandle, + gboolean autoneg, + guint32 speed, + NMPlatformLinkDuplexType duplex) +{ + struct ethtool_link_settings edata0; + gs_free struct ethtool_link_settings *edata = NULL; + gsize edata_size; + guint nwords; + guint i; + + edata0 = (struct ethtool_link_settings) { + .cmd = ETHTOOL_GLINKSETTINGS, + .link_mode_masks_nwords = 0, + }; + + /* perform the handshake to find the size of masks */ + if (_ethtool_call_handle(shandle, &edata0, sizeof(edata0)) < 0 + || edata0.link_mode_masks_nwords >= 0) { + /* new API not supported */ + return NM_OPTION_BOOL_DEFAULT; + } + + nwords = -edata0.link_mode_masks_nwords; + edata_size = sizeof(*edata) + sizeof(guint32) * nwords * 3; + edata = g_malloc0(edata_size); + edata->cmd = ETHTOOL_GLINKSETTINGS; + edata->link_mode_masks_nwords = nwords; + + /* retrieve first current settings */ + if (_ethtool_call_handle(shandle, edata, edata_size) < 0) + return FALSE; + + /* then change the needed ones */ + edata->cmd = ETHTOOL_SLINKSETTINGS; + + { + const guint32 *v_map_supported = &edata->link_mode_masks[0]; + guint32 *v_map_advertising = &edata->link_mode_masks[nwords]; + guint32 *v_map_lp_advertising = &edata->link_mode_masks[2 * nwords]; + + memcpy(v_map_advertising, v_map_supported, sizeof(guint32) * nwords); + (void) v_map_lp_advertising; + + if (speed != 0) { + guint32 mode; + + mode = get_baset_mode(speed, duplex); + + if (mode == ADVERTISED_INVALID) { + if (!autoneg) + goto set_autoneg; + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %uBASE-T %s duplex mode cannot be advertised", + shandle->ifindex, + speed, + nm_platform_link_duplex_type_to_string(duplex)); + return FALSE; + } + + if (!(v_map_supported[0] & mode)) { + if (!autoneg) + goto set_autoneg; + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: device does not support %uBASE-T %s duplex mode", + shandle->ifindex, + speed, + nm_platform_link_duplex_type_to_string(duplex)); + return FALSE; + } + + for (i = 0; i < (guint) G_N_ELEMENTS(_nmp_link_mode_all_advertised_modes); i++) + v_map_advertising[i] &= ~_nmp_link_mode_all_advertised_modes[i]; + v_map_advertising[0] |= mode; + } + } + +set_autoneg: + if (autoneg) + edata->autoneg = AUTONEG_ENABLE; + else { + edata->autoneg = AUTONEG_DISABLE; + + if (speed) + edata->speed = speed; + + platform_link_duplex_type_to_native(duplex, &edata->duplex); + } + + return _ethtool_call_handle(shandle, edata, edata_size) >= 0; +} + +gboolean +nmp_ethtool_ioctl_set_link_settings(int ifindex, + gboolean autoneg, + guint32 speed, + NMPlatformLinkDuplexType duplex) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + struct ethtool_cmd edata = { + .cmd = ETHTOOL_GSET, + }; + NMOptionBool ret; + + g_return_val_if_fail(ifindex > 0, FALSE); + g_return_val_if_fail((speed && duplex != NM_PLATFORM_LINK_DUPLEX_UNKNOWN) + || (!speed && duplex == NM_PLATFORM_LINK_DUPLEX_UNKNOWN), + FALSE); + + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: set link: autoneg=%d, speed=%d, duplex=%s", + ifindex, + autoneg, + speed, + nm_platform_link_duplex_type_to_string(duplex)); + + ret = set_link_settings_new(&shandle, autoneg, speed, duplex); + if (ret != NM_OPTION_BOOL_DEFAULT) + return ret; + + /* new ETHTOOL_GLINKSETTINGS API not supported, fall back to GSET */ + + /* retrieve first current settings */ + if (_ethtool_call_handle(&shandle, &edata, sizeof(edata)) < 0) + return FALSE; + + /* then change the needed ones */ + edata.cmd = ETHTOOL_SSET; + + edata.advertising = edata.supported; + if (speed != 0) { + guint32 mode; + + mode = get_baset_mode(speed, duplex); + + if (mode == ADVERTISED_INVALID) { + if (!autoneg) + goto set_autoneg; + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: %uBASE-T %s duplex mode cannot be advertised", + ifindex, + speed, + nm_platform_link_duplex_type_to_string(duplex)); + return FALSE; + } + if (!(edata.supported & mode)) { + if (!autoneg) + goto set_autoneg; + nm_log_trace(LOGD_PLATFORM, + "ethtool[%d]: device does not support %uBASE-T %s duplex mode", + ifindex, + speed, + nm_platform_link_duplex_type_to_string(duplex)); + return FALSE; + } + edata.advertising &= ~_nmp_link_mode_all_advertised_modes[0]; + edata.advertising |= mode; + } + +set_autoneg: + if (autoneg) + edata.autoneg = AUTONEG_ENABLE; + else { + edata.autoneg = AUTONEG_DISABLE; + + if (speed) + ethtool_cmd_speed_set(&edata, speed); + + platform_link_duplex_type_to_native(duplex, &edata.duplex); + } + + return _ethtool_call_handle(&shandle, &edata, sizeof(edata)) >= 0; +} + +gboolean +nmp_mii_ioctl_supports_carrier_detect(int ifindex) +{ + nm_auto_socket_handle SocketHandle shandle = SOCKET_HANDLE_INIT(ifindex); + int r; + struct ifreq ifr; + struct mii_ioctl_data *mii; + + g_return_val_if_fail(ifindex > 0, FALSE); + + r = _ioctl_call("mii", + "SIOCGMIIPHY", + SIOCGMIIPHY, + shandle.ifindex, + &shandle.fd, + shandle.ifname, + IOCTL_CALL_DATA_TYPE_NONE, + NULL, + 0, + &ifr); + if (r < 0) + return FALSE; + + /* If we can read the BMSR register, we assume that the card supports MII link detection */ + mii = (struct mii_ioctl_data *) &ifr.ifr_ifru; + mii->reg_num = MII_BMSR; + + r = _ioctl_call("mii", + "SIOCGMIIREG", + SIOCGMIIREG, + shandle.ifindex, + &shandle.fd, + shandle.ifname, + IOCTL_CALL_DATA_TYPE_IFRU, + mii, + sizeof(*mii), + &ifr); + if (r < 0) + return FALSE; + + mii = (struct mii_ioctl_data *) &ifr.ifr_ifru; + nm_log_trace(LOGD_PLATFORM, + "mii[%d,%s]: carrier-detect yes: SIOCGMIIREG result 0x%X", + ifindex, + shandle.ifname, + mii->val_out); + return TRUE; +} diff --git a/src/libnm-platform/nmp-ethtool-ioctl.h b/src/libnm-platform/nmp-ethtool-ioctl.h new file mode 100644 index 00000000..cb93e9cf --- /dev/null +++ b/src/libnm-platform/nmp-ethtool-ioctl.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +#ifndef __NMP_ETHTOOL_IOCTL_H__ +#define __NMP_ETHTOOL_IOCTL_H__ + +#include "libnm-platform/nmp-base.h" +#include "libnm-platform/nm-netlink.h" + +gboolean nmp_ethtool_ioctl_supports_carrier_detect(int ifindex); + +gboolean nmp_ethtool_ioctl_supports_vlans(int ifindex); + +int nmp_ethtool_ioctl_get_peer_ifindex(int ifindex); + +gboolean nmp_ethtool_ioctl_get_wake_on_lan(int ifindex); + +gboolean nmp_ethtool_ioctl_set_wake_on_lan(int ifindex, + _NMSettingWiredWakeOnLan wol, + const char *wol_password); + +gboolean nmp_ethtool_ioctl_get_link_settings(int ifindex, + gboolean *out_autoneg, + guint32 *out_speed, + NMPlatformLinkDuplexType *out_duplex); +gboolean nmp_ethtool_ioctl_set_link_settings(int ifindex, + gboolean autoneg, + guint32 speed, + NMPlatformLinkDuplexType duplex); + +gboolean nmp_ethtool_ioctl_get_permanent_address(int ifindex, guint8 *buf, size_t *length); + +gboolean nmp_ethtool_ioctl_get_driver_info(int ifindex, NMPUtilsEthtoolDriverInfo *data); + +NMEthtoolFeatureStates *nmp_ethtool_ioctl_get_features(int ifindex); + +gboolean nmp_ethtool_ioctl_set_features( + int ifindex, + const NMEthtoolFeatureStates *features, + const NMOptionBool *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */, + gboolean do_set /* or reset */); + +gboolean nmp_ethtool_ioctl_get_coalesce(int ifindex, NMEthtoolCoalesceState *coalesce); + +gboolean nmp_ethtool_ioctl_set_coalesce(int ifindex, const NMEthtoolCoalesceState *coalesce); + +gboolean nmp_ethtool_ioctl_get_channels(int ifindex, NMEthtoolChannelsState *channels); + +gboolean nmp_ethtool_ioctl_set_channels(int ifindex, const NMEthtoolChannelsState *channels); + +gboolean nmp_ethtool_ioctl_get_fec_mode(int ifindex, uint32_t *fec_mode); + +gboolean nmp_ethtool_ioctl_set_fec_mode(int ifindex, uint32_t fec_mode); + +gboolean nmp_mii_ioctl_supports_carrier_detect(int ifindex); + +#endif /* __NMP_ETHTOOL_IOCTL_H__ */ diff --git a/src/libnm-platform/nmp-ethtool.c b/src/libnm-platform/nmp-ethtool.c new file mode 100644 index 00000000..ed028f6a --- /dev/null +++ b/src/libnm-platform/nmp-ethtool.c @@ -0,0 +1,559 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#include "libnm-glib-aux/nm-default-glib-i18n-lib.h" + +#include "nmp-ethtool.h" + +#include "libnm-platform/nm-platform.h" +#include "libnm-log-core/nm-logging.h" + +enum { + ETHTOOL_A_HEADER_UNSPEC, + ETHTOOL_A_HEADER_DEV_INDEX, /* u32 */ + ETHTOOL_A_HEADER_DEV_NAME, /* string */ + ETHTOOL_A_HEADER_FLAGS, /* u32 - ETHTOOL_FLAG_* */ + ETHTOOL_A_HEADER_PHY_INDEX, /* u32 */ + + /* add new constants above here */ + __ETHTOOL_A_HEADER_CNT, + ETHTOOL_A_HEADER_MAX = __ETHTOOL_A_HEADER_CNT - 1 +}; + +enum { + ETHTOOL_MSG_USER_NONE = 0, + ETHTOOL_MSG_STRSET_GET = 1, + ETHTOOL_MSG_LINKINFO_GET, + ETHTOOL_MSG_LINKINFO_SET, + ETHTOOL_MSG_LINKMODES_GET, + ETHTOOL_MSG_LINKMODES_SET, + ETHTOOL_MSG_LINKSTATE_GET, + ETHTOOL_MSG_DEBUG_GET, + ETHTOOL_MSG_DEBUG_SET, + ETHTOOL_MSG_WOL_GET, + ETHTOOL_MSG_WOL_SET, + ETHTOOL_MSG_FEATURES_GET, + ETHTOOL_MSG_FEATURES_SET, + ETHTOOL_MSG_PRIVFLAGS_GET, + ETHTOOL_MSG_PRIVFLAGS_SET, + ETHTOOL_MSG_RINGS_GET, + ETHTOOL_MSG_RINGS_SET, + ETHTOOL_MSG_CHANNELS_GET, + ETHTOOL_MSG_CHANNELS_SET, + ETHTOOL_MSG_COALESCE_GET, + ETHTOOL_MSG_COALESCE_SET, + ETHTOOL_MSG_PAUSE_GET, + ETHTOOL_MSG_PAUSE_SET, + ETHTOOL_MSG_EEE_GET, + ETHTOOL_MSG_EEE_SET, + ETHTOOL_MSG_TSINFO_GET, + ETHTOOL_MSG_CABLE_TEST_ACT, + ETHTOOL_MSG_CABLE_TEST_TDR_ACT, + ETHTOOL_MSG_TUNNEL_INFO_GET, + ETHTOOL_MSG_FEC_GET, + ETHTOOL_MSG_FEC_SET, + + /* add new constants above here */ + __ETHTOOL_MSG_USER_CNT, + ETHTOOL_MSG_USER_MAX = __ETHTOOL_MSG_USER_CNT - 1 +}; + +#define ETHTOOL_GENL_VERSION 1 + +#define _NMLOG_DOMAIN LOGD_PLATFORM +#define _NMLOG_PREFIX_NAME "ethtool" +#define _NMLOG(_level, ...) \ + G_STMT_START \ + { \ + int _ifindex = ifindex; \ + \ + nm_log((_level), \ + (_NMLOG_DOMAIN), \ + NULL, \ + NULL, \ + "%s[%d]: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \ + _NMLOG_PREFIX_NAME, \ + _ifindex _NM_UTILS_MACRO_REST(__VA_ARGS__)); \ + } \ + G_STMT_END + +#define CB_RESULT_PENDING 0 +#define CB_RESULT_OK 1 + +static int +ack_cb_handler(const struct nl_msg *msg, void *data) +{ + int *result = data; + *result = CB_RESULT_OK; + return NL_STOP; +} + +static int +finish_cb_handler(const struct nl_msg *msg, void *data) +{ + int *result = data; + *result = CB_RESULT_OK; + return NL_SKIP; +} + +static int +err_cb_handler(const struct sockaddr_nl *nla, const struct nlmsgerr *err, void *data) +{ + void **args = data; + int *result = args[0]; + char **err_msg = args[1]; + const char *extack_msg = NULL; + + *result = err->error; + nlmsg_parse_error(nlmsg_undata(err), &extack_msg); + + if (err_msg) + *err_msg = g_strdup(extack_msg ?: nm_strerror(err->error)); + + return NL_SKIP; +} + +static int +ethtool_send_and_recv(struct nl_sock *sock, + int ifindex, + struct nl_msg *msg, + int (*valid_handler)(const struct nl_msg *, void *), + void *valid_data, + char **err_msg, + const char *log_prefix) +{ + int nle; + int cb_result = CB_RESULT_PENDING; + void *err_arg[] = {&cb_result, err_msg}; + const struct nl_cb cb = { + .err_cb = err_cb_handler, + .err_arg = err_arg, + .finish_cb = finish_cb_handler, + .finish_arg = &cb_result, + .ack_cb = ack_cb_handler, + .ack_arg = &cb_result, + .valid_cb = valid_handler, + .valid_arg = valid_data, + }; + + g_return_val_if_fail(msg, -ENOMEM); + + if (err_msg) + *err_msg = NULL; + + nle = nl_send_auto(sock, msg); + if (nle < 0) + goto out; + + while (cb_result == CB_RESULT_PENDING) { + nle = nl_recvmsgs(sock, &cb); + if (nle < 0 && nle != -EAGAIN) { + break; + } + } + +out: + if (nle < 0 && err_msg && *err_msg == NULL) + *err_msg = strdup(nm_strerror(nle)); + + if (nle >= 0 && cb_result < 0) + nle = cb_result; + + if (nle < 0) { + _LOGT("%s: netlink error: %d (%s)", log_prefix, nle, err_msg && *err_msg ? *err_msg : ""); + } + + return nle; +} + +static struct nl_msg * +ethtool_create_msg(guint16 family_id, + int ifindex, + guint8 cmd, + int header_attr, + const char *log_prefix) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + struct nlattr *nest_header; + + if (family_id == 0) { + _LOGT("%s: ethtool genl family not found", log_prefix); + return NULL; + } + + msg = nlmsg_alloc(nlmsg_total_size(GENL_HDRLEN) + 200); + + if (!genlmsg_put(msg, + NL_AUTO_PORT, + NL_AUTO_SEQ, + family_id, + 0, + NLM_F_REQUEST, + cmd, + ETHTOOL_GENL_VERSION)) + goto nla_put_failure; + + nest_header = nla_nest_start(msg, header_attr); + NLA_PUT_U32(msg, ETHTOOL_A_HEADER_DEV_INDEX, (guint32) ifindex); + NLA_NEST_END(msg, nest_header); + return g_steal_pointer(&msg); + +nla_put_failure: + g_return_val_if_reached(NULL); +} + +/*****************************************************************************/ +/* PAUSE */ +/*****************************************************************************/ + +enum { + ETHTOOL_A_PAUSE_UNSPEC, + ETHTOOL_A_PAUSE_HEADER, + ETHTOOL_A_PAUSE_AUTONEG, + ETHTOOL_A_PAUSE_RX, + ETHTOOL_A_PAUSE_TX, + + __ETHTOOL_A_PAUSE_CNT, + ETHTOOL_A_PAUSE_MAX = (__ETHTOOL_A_PAUSE_CNT - 1) +}; + +static int +ethtool_parse_pause(const struct nl_msg *msg, void *data) +{ + NMEthtoolPauseState *pause = data; + static const struct nla_policy policy[] = { + [ETHTOOL_A_PAUSE_AUTONEG] = {.type = NLA_U8}, + [ETHTOOL_A_PAUSE_RX] = {.type = NLA_U8}, + [ETHTOOL_A_PAUSE_TX] = {.type = NLA_U8}, + }; + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); + struct nlattr *tb[G_N_ELEMENTS(policy)]; + + *pause = (NMEthtoolPauseState) {}; + + if (nla_parse_arr(tb, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), policy) < 0) + return NL_SKIP; + + if (tb[ETHTOOL_A_PAUSE_AUTONEG]) + pause->autoneg = !!nla_get_u8(tb[ETHTOOL_A_PAUSE_AUTONEG]); + if (tb[ETHTOOL_A_PAUSE_RX]) + pause->rx = !!nla_get_u8(tb[ETHTOOL_A_PAUSE_RX]); + if (tb[ETHTOOL_A_PAUSE_TX]) + pause->tx = !!nla_get_u8(tb[ETHTOOL_A_PAUSE_TX]); + + return NL_OK; +} + +gboolean +nmp_ethtool_get_pause(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolPauseState *pause) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(pause, FALSE); + + _LOGT("get-pause: start"); + *pause = (NMEthtoolPauseState) {}; + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_PAUSE_GET, + ETHTOOL_A_PAUSE_HEADER, + "get-pause"); + if (!msg) + return FALSE; + + r = ethtool_send_and_recv(genl_sock, + ifindex, + msg, + ethtool_parse_pause, + pause, + &err_msg, + "get-pause"); + if (r < 0) + return FALSE; + + _LOGT("get-pause: autoneg %d rx %d tx %d", pause->autoneg, pause->rx, pause->tx); + + return TRUE; +} + +gboolean +nmp_ethtool_set_pause(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolPauseState *pause) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(pause, FALSE); + + _LOGT("set-pause: autoneg %d rx %d tx %d", pause->autoneg, pause->rx, pause->tx); + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_PAUSE_SET, + ETHTOOL_A_PAUSE_HEADER, + "set-pause"); + if (!msg) + return FALSE; + + NLA_PUT_U8(msg, ETHTOOL_A_PAUSE_AUTONEG, pause->autoneg); + NLA_PUT_U8(msg, ETHTOOL_A_PAUSE_RX, pause->rx); + NLA_PUT_U8(msg, ETHTOOL_A_PAUSE_TX, pause->tx); + + r = ethtool_send_and_recv(genl_sock, ifindex, msg, NULL, NULL, &err_msg, "set-pause"); + if (r < 0) + return FALSE; + + _LOGT("set-pause: succeeded"); + + return TRUE; +nla_put_failure: + g_return_val_if_reached(FALSE); +} + +/*****************************************************************************/ +/* EEE */ +/*****************************************************************************/ + +enum { + ETHTOOL_A_EEE_UNSPEC, + ETHTOOL_A_EEE_HEADER, /* nest - _A_HEADER_* */ + ETHTOOL_A_EEE_MODES_OURS, /* bitset */ + ETHTOOL_A_EEE_MODES_PEER, /* bitset */ + ETHTOOL_A_EEE_ACTIVE, /* u8 */ + ETHTOOL_A_EEE_ENABLED, /* u8 */ + + /* add new constants above here */ + __ETHTOOL_A_EEE_CNT, + ETHTOOL_A_EEE_MAX = (__ETHTOOL_A_EEE_CNT - 1) +}; + +static int +ethtool_parse_eee(const struct nl_msg *msg, void *data) +{ + NMEthtoolEEEState *eee = data; + static const struct nla_policy policy[] = { + [ETHTOOL_A_EEE_ENABLED] = {.type = NLA_U8}, + }; + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); + struct nlattr *tb[G_N_ELEMENTS(policy)]; + + *eee = (NMEthtoolEEEState) {}; + + if (nla_parse_arr(tb, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), policy) < 0) + return NL_SKIP; + + if (tb[ETHTOOL_A_EEE_ENABLED]) + eee->enabled = !!nla_get_u8(tb[ETHTOOL_A_EEE_ENABLED]); + + return NL_OK; +} + +gboolean +nmp_ethtool_get_eee(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolEEEState *eee) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(eee, FALSE); + + _LOGT("get-eee: start"); + *eee = (NMEthtoolEEEState) {}; + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_EEE_GET, + ETHTOOL_A_EEE_HEADER, + "get-eee"); + if (!msg) + return FALSE; + + r = ethtool_send_and_recv(genl_sock, ifindex, msg, ethtool_parse_eee, eee, &err_msg, "get-eee"); + if (r < 0) + return FALSE; + + _LOGT("get-eee: enabled %d", eee->enabled); + + return TRUE; +} + +gboolean +nmp_ethtool_set_eee(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolEEEState *eee) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(eee, FALSE); + + _LOGT("set-eee: enabled %d", eee->enabled); + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_EEE_SET, + ETHTOOL_A_EEE_HEADER, + "set-eee"); + if (!msg) + return FALSE; + + NLA_PUT_U8(msg, ETHTOOL_A_EEE_ENABLED, eee->enabled); + + r = ethtool_send_and_recv(genl_sock, ifindex, msg, NULL, NULL, &err_msg, "set-eee"); + if (r < 0) + return FALSE; + + _LOGT("set-eee: succeeded"); + + return TRUE; +nla_put_failure: + g_return_val_if_reached(FALSE); +} + +/*****************************************************************************/ +/* RINGS */ +/*****************************************************************************/ + +enum { + ETHTOOL_A_RINGS_UNSPEC, + ETHTOOL_A_RINGS_HEADER, /* nest - _A_HEADER_* */ + ETHTOOL_A_RINGS_RX_MAX, /* u32 */ + ETHTOOL_A_RINGS_RX_MINI_MAX, /* u32 */ + ETHTOOL_A_RINGS_RX_JUMBO_MAX, /* u32 */ + ETHTOOL_A_RINGS_TX_MAX, /* u32 */ + ETHTOOL_A_RINGS_RX, /* u32 */ + ETHTOOL_A_RINGS_RX_MINI, /* u32 */ + ETHTOOL_A_RINGS_RX_JUMBO, /* u32 */ + ETHTOOL_A_RINGS_TX, /* u32 */ + + /* add new constants above here */ + __ETHTOOL_A_RINGS_CNT, + ETHTOOL_A_RINGS_MAX = (__ETHTOOL_A_RINGS_CNT - 1) +}; + +static int +ethtool_parse_ring(const struct nl_msg *msg, void *data) +{ + NMEthtoolRingState *ring = data; + static const struct nla_policy policy[] = { + [ETHTOOL_A_RINGS_RX] = {.type = NLA_U32}, + [ETHTOOL_A_RINGS_RX_MINI] = {.type = NLA_U32}, + [ETHTOOL_A_RINGS_RX_JUMBO] = {.type = NLA_U32}, + [ETHTOOL_A_RINGS_TX] = {.type = NLA_U32}, + }; + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); + struct nlattr *tb[G_N_ELEMENTS(policy)]; + + *ring = (NMEthtoolRingState) {}; + + if (nla_parse_arr(tb, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), policy) < 0) + return NL_SKIP; + + if (tb[ETHTOOL_A_RINGS_RX]) + ring->rx_pending = nla_get_u32(tb[ETHTOOL_A_RINGS_RX]); + if (tb[ETHTOOL_A_RINGS_RX_MINI]) + ring->rx_mini_pending = nla_get_u32(tb[ETHTOOL_A_RINGS_RX_MINI]); + if (tb[ETHTOOL_A_RINGS_RX_JUMBO]) + ring->rx_jumbo_pending = nla_get_u32(tb[ETHTOOL_A_RINGS_RX_JUMBO]); + if (tb[ETHTOOL_A_RINGS_TX]) + ring->tx_pending = nla_get_u32(tb[ETHTOOL_A_RINGS_TX]); + + return NL_OK; +} + +gboolean +nmp_ethtool_get_ring(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolRingState *ring) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(ring, FALSE); + + _LOGT("get-ring: start"); + *ring = (NMEthtoolRingState) {}; + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_RINGS_GET, + ETHTOOL_A_RINGS_HEADER, + "get-ring"); + if (!msg) + return FALSE; + + r = ethtool_send_and_recv(genl_sock, + ifindex, + msg, + ethtool_parse_ring, + ring, + &err_msg, + "get-ring"); + if (r < 0) + return FALSE; + + _LOGT("get-ring: rx %u rx-mini %u rx-jumbo %u tx %u", + ring->rx_pending, + ring->rx_mini_pending, + ring->rx_jumbo_pending, + ring->tx_pending); + + return TRUE; +} + +gboolean +nmp_ethtool_set_ring(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolRingState *ring) +{ + nm_auto_nlmsg struct nl_msg *msg = NULL; + gs_free char *err_msg = NULL; + int r; + + g_return_val_if_fail(ring, FALSE); + + _LOGT("set-ring: rx %u rx-mini %u rx-jumbo %u tx %u", + ring->rx_pending, + ring->rx_mini_pending, + ring->rx_jumbo_pending, + ring->tx_pending); + + msg = ethtool_create_msg(family_id, + ifindex, + ETHTOOL_MSG_RINGS_SET, + ETHTOOL_A_RINGS_HEADER, + "set-ring"); + if (!msg) + return FALSE; + + NLA_PUT_U32(msg, ETHTOOL_A_RINGS_RX, ring->rx_pending); + NLA_PUT_U32(msg, ETHTOOL_A_RINGS_RX_MINI, ring->rx_mini_pending); + NLA_PUT_U32(msg, ETHTOOL_A_RINGS_RX_JUMBO, ring->rx_jumbo_pending); + NLA_PUT_U32(msg, ETHTOOL_A_RINGS_TX, ring->tx_pending); + + r = ethtool_send_and_recv(genl_sock, ifindex, msg, NULL, NULL, &err_msg, "set-ring"); + if (r < 0) + return FALSE; + + _LOGT("set-ring: succeeded"); + + return TRUE; +nla_put_failure: + g_return_val_if_reached(FALSE); +} diff --git a/src/libnm-platform/nmp-ethtool.h b/src/libnm-platform/nmp-ethtool.h new file mode 100644 index 00000000..88bb95b6 --- /dev/null +++ b/src/libnm-platform/nmp-ethtool.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +#ifndef __NMP_ETHTOOL_H__ +#define __NMP_ETHTOOL_H__ + +#include "libnm-platform/nmp-base.h" +#include "libnm-platform/nm-netlink.h" + +gboolean nmp_ethtool_get_pause(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolPauseState *pause); +gboolean nmp_ethtool_set_pause(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolPauseState *pause); + +gboolean nmp_ethtool_get_eee(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolEEEState *eee); +gboolean nmp_ethtool_set_eee(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolEEEState *eee); + +gboolean nmp_ethtool_get_ring(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + NMEthtoolRingState *ring); +gboolean nmp_ethtool_set_ring(struct nl_sock *genl_sock, + guint16 family_id, + int ifindex, + const NMEthtoolRingState *ring); + +#endif /* __NMP_ETHTOOL_H__ */ diff --git a/src/libnm-platform/nmp-object.c b/src/libnm-platform/nmp-object.c index f41cc95a..e11bfb3f 100644 --- a/src/libnm-platform/nmp-object.c +++ b/src/libnm-platform/nmp-object.c @@ -16,6 +16,7 @@ #include "libnm-platform/nm-platform-utils.h" #include "libnm-platform/wifi/nm-wifi-utils.h" #include "libnm-platform/wpan/nm-wpan-utils.h" +#include "libnm-platform/nmp-ethtool-ioctl.h" /*****************************************************************************/ @@ -647,7 +648,7 @@ _link_get_driver(struct udev_device *udevice, const char *kind, int ifindex) if (ifindex > 0) { NMPUtilsEthtoolDriverInfo driver_info; - if (nmp_utils_ethtool_get_driver_info(ifindex, &driver_info)) { + if (nmp_ethtool_ioctl_get_driver_info(ifindex, &driver_info)) { if (driver_info.driver[0]) return g_intern_string(driver_info.driver); } @@ -2006,8 +2007,8 @@ _vt_dedup_obj_clone(const NMDedupMultiObj *obj) .obj_destroy = _vt_dedup_obj_destroy, \ .obj_full_hash_update = \ (void (*)(const NMDedupMultiObj *obj, NMHashState *h)) nmp_object_hash_update, \ - .obj_full_equal = (gboolean(*)(const NMDedupMultiObj *obj_a, \ - const NMDedupMultiObj *obj_b)) nmp_object_equal, \ + .obj_full_equal = (gboolean (*)(const NMDedupMultiObj *obj_a, \ + const NMDedupMultiObj *obj_b)) nmp_object_equal, \ } /*****************************************************************************/ diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index 7f08de5d..840aaade 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -975,7 +975,7 @@ nm_memcpy(void *restrict dest, const void *restrict src, size_t n) * side-effects. */ #define NM_IN_SET_SE(x, ...) _NM_IN_SET(NM_UNIQ, |, typeof(x), x, __VA_ARGS__) -/* the *_TYPED forms allow to explicitly select the type of "x". This is useful +/* the *_TYPED forms allow one to explicitly select the type of "x". This is useful * if "x" doesn't support typeof (bitfields) or you want to gracefully convert * a type using automatic type conversion rules (but not forcing the conversion * with a cast). */ diff --git a/src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-lease.c b/src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-lease.c index 9569af58..ecbc7633 100644 --- a/src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-lease.c +++ b/src/libnm-systemd-core/src/libsystemd-network/sd-dhcp6-lease.c @@ -114,7 +114,7 @@ static void dhcp6_lease_set_lifetime(sd_dhcp6_lease *lease) { } DEFINE_GET_TIME_FUNCTIONS(t1, lifetime_t1); -DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t1); +DEFINE_GET_TIME_FUNCTIONS(t2, lifetime_t2); DEFINE_GET_TIME_FUNCTIONS(valid_lifetime, lifetime_valid); static void dhcp6_lease_set_server_address(sd_dhcp6_lease *lease, const struct in6_addr *server_address) { diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.c b/src/libnmc-setting/nm-meta-setting-base-impl.c index b9dcf34f..52af9ad2 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.c +++ b/src/libnmc-setting/nm-meta-setting-base-impl.c @@ -51,6 +51,7 @@ #include "nm-setting-ovs-port.h" #include "nm-setting-ppp.h" #include "nm-setting-pppoe.h" +#include "nm-setting-prefix-delegation.h" #include "nm-setting-proxy.h" #include "nm-setting-serial.h" #include "nm-setting-tc-config.h" @@ -484,6 +485,13 @@ const NMMetaSettingInfo nm_meta_setting_infos[] = { .setting_name = NM_SETTING_PPP_SETTING_NAME, .get_setting_gtype = nm_setting_ppp_get_type, }, + [NM_META_SETTING_TYPE_PREFIX_DELEGATION] = + { + .meta_type = NM_META_SETTING_TYPE_PREFIX_DELEGATION, + .setting_priority = NM_SETTING_PRIORITY_IP, + .setting_name = NM_SETTING_PREFIX_DELEGATION_SETTING_NAME, + .get_setting_gtype = nm_setting_prefix_delegation_get_type, + }, [NM_META_SETTING_TYPE_PROXY] = { .meta_type = NM_META_SETTING_TYPE_PROXY, @@ -698,6 +706,7 @@ const NMMetaSettingType nm_meta_setting_types_by_priority[] = { NM_META_SETTING_TYPE_HOSTNAME, NM_META_SETTING_TYPE_IP4_CONFIG, NM_META_SETTING_TYPE_IP6_CONFIG, + NM_META_SETTING_TYPE_PREFIX_DELEGATION, NM_META_SETTING_TYPE_PROXY, NM_META_SETTING_TYPE_TC_CONFIG, diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.h b/src/libnmc-setting/nm-meta-setting-base-impl.h index c03285eb..d1535e5e 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.h +++ b/src/libnmc-setting/nm-meta-setting-base-impl.h @@ -143,6 +143,7 @@ typedef enum _nm_packed { NM_META_SETTING_TYPE_OVS_PORT, NM_META_SETTING_TYPE_PPP, NM_META_SETTING_TYPE_PPPOE, + NM_META_SETTING_TYPE_PREFIX_DELEGATION, NM_META_SETTING_TYPE_PROXY, NM_META_SETTING_TYPE_SERIAL, NM_META_SETTING_TYPE_SRIOV, diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index fcb2d041..aa290b9f 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -11,7 +11,6 @@ #include <arpa/inet.h> #include <linux/if_ether.h> #include <linux/if_infiniband.h> -#include <linux/ethtool.h> #include "libnm-core-aux-intern/nm-common-macros.h" #include "libnm-glib-aux/nm-enum-utils.h" @@ -1005,8 +1004,16 @@ _get_fcn_gobject_int(ARGS_GET_FCN) case 16: if (is_uint64) return_str = g_strdup_printf("0x%" G_GINT64_MODIFIER "x", v.u64); - else - return_str = g_strdup_printf("0x%" G_GINT64_MODIFIER "x", (guint64) v.i64); + else { + if (property_info->property_typ_data + && property_info->property_typ_data->subtype.gobject_int + .print_hex_negative_as_base10 + && v.i64 < 0) { + return_str = g_strdup_printf("%" G_GINT64_FORMAT, v.i64); + } else { + return_str = g_strdup_printf("0x%" G_GINT64_MODIFIER "x", (guint64) v.i64); + } + } break; default: return_str = NULL; @@ -1422,6 +1429,11 @@ _set_fcn_gobject_int(ARGS_SET_FCN) nm_meta_property_int_get_range(property_info, &min, &max); + /* See the comment on "print_hex_negative_as_base10" */ + nm_assert(!property_info->property_typ_data + || !property_info->property_typ_data->subtype.gobject_int.print_hex_negative_as_base10 + || (!is_uint64 && min.i64 > -10)); + if (is_uint64) v.u64 = _nm_utils_ascii_str_to_uint64(value, base, min.u64, max.u64, 0); else @@ -6473,6 +6485,9 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { ), ), ), + PROPERTY_INFO (NM_SETTING_IP_CONFIG_FORWARDING, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_FORWARDING, + .property_type = &_pt_gobject_enum, + ), PROPERTY_INFO (NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DHCP_HOSTNAME, .property_type = &_pt_gobject_string, ), @@ -7306,7 +7321,10 @@ static const NMMetaPropertyInfo *const property_infos_OVS_DPDK[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_DPDK_N_TXQ_DESC, .property_type = &_pt_gobject_int, ), - NULL + PROPERTY_INFO_WITH_DESC (NM_SETTING_OVS_DPDK_LSC_INTERRUPT, + .property_type = &_pt_gobject_enum, + ), + NULL }; #undef _CURRENT_NM_META_SETTING_TYPE @@ -7476,6 +7494,19 @@ static const NMMetaPropertyInfo *const property_infos_PPPOE[] = { }; #undef _CURRENT_NM_META_SETTING_TYPE +#define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_PREFIX_DELEGATION +static const NMMetaPropertyInfo *const property_infos_PREFIX_DELEGATION[] = { + PROPERTY_INFO_WITH_DESC (NM_SETTING_PREFIX_DELEGATION_SUBNET_ID, + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .base = 16, + .print_hex_negative_as_base10 = TRUE, + ), + ), + NULL +}; + +#undef _CURRENT_NM_META_SETTING_TYPE #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_PROXY static const NMMetaPropertyInfo *const property_infos_PROXY[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_PROXY_METHOD, @@ -7599,6 +7630,9 @@ static const NMMetaPropertyInfo *const property_infos_SRIOV[] = { PROPERTY_INFO_WITH_DESC (NM_SETTING_SRIOV_ESWITCH_ENCAP_MODE, .property_type = &_pt_gobject_enum, ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_SRIOV_PRESERVE_ON_DOWN, + .property_type = &_pt_gobject_enum, + ), NULL }; @@ -8932,6 +8966,7 @@ _setting_init_fcn_wireless (ARGS_SETTING_INIT_FCN) #define SETTING_PRETTY_NAME_OVS_PORT N_("Open vSwitch port settings") #define SETTING_PRETTY_NAME_PPP N_("PPP settings") #define SETTING_PRETTY_NAME_PPPOE N_("PPPoE") +#define SETTING_PRETTY_NAME_PREFIX_DELEGATION N_("Prefix delegation settings") #define SETTING_PRETTY_NAME_PROXY N_("Proxy") #define SETTING_PRETTY_NAME_SERIAL N_("Serial settings") #define SETTING_PRETTY_NAME_SRIOV N_("SR-IOV settings") @@ -9144,6 +9179,7 @@ const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[] = { NM_META_SETTING_VALID_PART_ITEM (OVS_PATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM (IP4_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM (IP6_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM (PREFIX_DELEGATION, FALSE), NM_META_SETTING_VALID_PART_ITEM (WIRED, FALSE), NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), ), @@ -9169,6 +9205,7 @@ const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[] = { ), ), SETTING_INFO (PPP), + SETTING_INFO (PREFIX_DELEGATION), SETTING_INFO (PROXY, .setting_init_fcn = _setting_init_fcn_proxy, ), @@ -9297,6 +9334,7 @@ static const NMMetaSettingValidPartItem *const valid_settings_noport[] = { NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(IP4_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM(IP6_CONFIG, FALSE), + NM_META_SETTING_VALID_PART_ITEM(PREFIX_DELEGATION, FALSE), NM_META_SETTING_VALID_PART_ITEM(HOSTNAME, FALSE), NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(TC_CONFIG, FALSE), diff --git a/src/libnmc-setting/nm-meta-setting-desc.h b/src/libnmc-setting/nm-meta-setting-desc.h index fa09fbe6..0294b1f7 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.h +++ b/src/libnmc-setting/nm-meta-setting-desc.h @@ -162,7 +162,7 @@ typedef enum { NM_META_ACCESSOR_GET_OUT_FLAGS_NONE = 0, NM_META_ACCESSOR_GET_OUT_FLAGS_STRV = (1LL << 0), - /* the property allows to be hidden, if and only if, it's value is set to the + /* the property allows one to be hidden, if and only if, it's value is set to the * default. This should only be set by new properties, to preserve behavior * of old properties, which were always printed. */ NM_META_ACCESSOR_GET_OUT_FLAGS_HIDE = (1LL << 1), @@ -293,9 +293,21 @@ struct _NMMetaPropertyTypData { int value); } gobject_enum; struct { - NMMetaSignUnsignInt64 min; - NMMetaSignUnsignInt64 max; - guint base; + NMMetaSignUnsignInt64 min; + NMMetaSignUnsignInt64 max; + guint base; + + /* Normally, when a property has "base = 16", it is printed + * as unsigned even if the gtype is signed. For some properties, + * we want to print the hexadecimal representation for positive + * values, and the base10 representation with minus sign for negative + * values. A typical use case is to encode the default value as + * "-1" and use positive values as a hexadecimal number. To avoid + * ambiguity when setting the value via nmcli, the property minimum + * allowed value should not be <= -10. + */ + bool print_hex_negative_as_base10; + const NMMetaUtilsIntValueInfo *value_infos; } gobject_int; struct { diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in index 3bae49b8..56c7c29c 100644 --- a/src/libnmc-setting/settings-docs.h.in +++ b/src/libnmc-setting/settings-docs.h.in @@ -28,7 +28,7 @@ #define DESCRIBE_DOC_NM_SETTING_CONNECTION_READ_ONLY N_("This property is deprecated and has no meaning.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_SECONDARIES N_("List of connection UUIDs that should be activated when the base connection itself is activated. Currently, only VPN connections are supported.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_SLAVE_TYPE N_("Setting name of the device type of this port's controller connection (eg, \"bond\"), or NULL if this connection is not a port. Deprecated 1.46. Use \"port-type\" instead, this is just an alias.") -#define DESCRIBE_DOC_NM_SETTING_CONNECTION_STABLE_ID N_("This represents the identity of the connection used for various purposes. It allows to configure multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity. The '$' character is treated special to perform dynamic substitutions at activation time. Currently, supported are \"${CONNECTION}\", \"${DEVICE}\", \"${MAC}\", \"${NETWORK_SSID}\", \"${BOOT}\", \"${RANDOM}\". These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The \"${CONNECTION}\" uses the profile's connection.uuid, the \"${DEVICE}\" uses the interface name of the device and \"${MAC}\" the permanent MAC address of the device. \"${NETWORK_SSID}\" uses the SSID for Wi-Fi networks and falls back to \"${CONNECTION}\" on other networks. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as \"$$\". For example, set it to \"${CONNECTION}-${BOOT}-${DEVICE}\" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is \"default${CONNECTION}\" go generate an ID unique per connection profile.") +#define DESCRIBE_DOC_NM_SETTING_CONNECTION_STABLE_ID N_("This represents the identity of the connection used for various purposes. It allows configuring multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity. The '$' character is treated special to perform dynamic substitutions at activation time. Currently, supported are \"${CONNECTION}\", \"${DEVICE}\", \"${MAC}\", \"${NETWORK_SSID}\", \"${BOOT}\", \"${RANDOM}\". These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The \"${CONNECTION}\" uses the profile's connection.uuid, the \"${DEVICE}\" uses the interface name of the device and \"${MAC}\" the permanent MAC address of the device. \"${NETWORK_SSID}\" uses the SSID for Wi-Fi networks and falls back to \"${CONNECTION}\" on other networks. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as \"$$\". For example, set it to \"${CONNECTION}-${BOOT}-${DEVICE}\" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is \"default${CONNECTION}\" go generate an ID unique per connection profile.") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_TIMESTAMP N_("The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved).") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_TYPE N_("Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, \"802-3-ethernet\" or \"802-11-wireless\" or \"bluetooth\", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, \"vpn\" or \"bridge\", etc).") #define DESCRIBE_DOC_NM_SETTING_CONNECTION_UUID N_("The connection.uuid is the real identifier of a profile. It cannot change and it must be unique. It is therefore often best to refer to a profile by UUID, for example with `nmcli connection up uuid $UUID`. The UUID cannot be changed, except in offline mode. In that case, the special values \"new\", \"generate\" and \"\" are allowed to generate a new random UUID.") @@ -200,6 +200,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_OPTIONS N_("DNS options for /etc/resolv.conf as described in resolv.conf(5) manual. The currently supported options are \"attempts\", \"debug\", \"edns0\", \"ndots\", \"no-aaaa\", \"no-check-names\", \"no-reload\", \"no-tld-query\", \"rotate\", \"single-request\", \"single-request-reopen\", \"timeout\", \"trust-ad\", \"use-vc\". See the resolv.conf(5) manual. Note that there is a distinction between an unset (default) list and an empty list. In nmcli, to unset the list set the value to \"\". To set an empty list, set it to \" \". Currently, an unset list has the same meaning as an empty list. That might change in the future. The \"trust-ad\" setting is only honored if the profile contributes name servers to resolv.conf, and if all contributing profiles have \"trust-ad\" enabled. When using a caching DNS plugin (dnsmasq or systemd-resolved in NetworkManager.conf) then \"edns0\" and \"trust-ad\" are automatically added. The valid \"ipv4.dns-options\" and \"ipv6.dns-options\" get merged together.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_PRIORITY N_("DNS servers priority. The relative priority for DNS servers specified by this setting. A lower numerical value is better (higher priority). Negative values have the special effect of excluding other configurations with a greater numerical priority value; so in presence of at least one negative priority, only DNS servers from connections with the lowest priority value will be used. To avoid all DNS leaks, set the priority of the profile that should be used to the most negative value of all active connections profiles. Zero selects a globally configured default value. If the latter is missing or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When multiple devices have configurations with the same priority, VPNs will be considered first, then devices with the best (lowest metric) default route and then all other devices. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. Note that commonly the resolver tries name servers in /etc/resolv.conf in the order listed, proceeding with the next server in the list on failure. See for example the \"rotate\" option of the dns-options setting. If there are any negative DNS priorities, then only name servers from the devices with that lowest priority will be considered. When using a DNS resolver that supports Conditional Forwarding or Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection is used to query domains in its search list. The search domains determine which name servers to ask, and the DNS priority is used to prioritize name servers based on the domain. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the best priority (lowest numerical value) wins. If a sub domain is configured on another interface it will be accepted regardless the priority, unless parent domain on the other interface has a negative priority, which causes the sub domain to be shadowed. With Split DNS one can avoid undesired DNS leaks by properly configuring DNS priorities and the search domains, so that only name servers of the desired interface are configured.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_DNS_SEARCH N_("List of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names. When using a DNS plugin that supports Conditional Forwarding or Split DNS, then the search domains specify which name servers to query. This makes the behavior different from running with plain /etc/resolv.conf. For more information see also the dns-priority setting. When set on a profile that also enabled DHCP, the DNS search list received automatically (option 119 for DHCPv4 and option 24 for DHCPv6) gets merged with the manual list. This can be prevented by setting \"ignore-auto-dns\". Note that if no DNS searches are configured, the fallback will be derived from the domain from DHCP (option 15).") +#define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_FORWARDING N_("Whether to configure sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the packet from one interface to another. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, \"auto\" (2) will be used. The \"forwarding\" property is ignored when \"method\" is set to \"shared\", because forwarding is always enabled in this case. The accepted values are: \"default\" (-1): use global default. \"no\" (0): disabled. \"yes\" (1): enabled. \"auto\" (2): enable if any shared connection is active, use kernel default otherwise.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_GATEWAY N_("The gateway associated with this configuration. This is only meaningful if \"addresses\" is also set. Setting the gateway causes NetworkManager to configure a standard default route with the gateway as next hop. This is ignored if \"never-default\" is set. An alternative is to configure the default route explicitly with a manual route and /0 as prefix length. Note that the gateway usually conflicts with routing that NetworkManager configures for WireGuard interfaces, so usually it should not be set in that case. See \"ip4-auto-default-route\".") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_DNS N_("When \"method\" is set to \"auto\" and this property to TRUE, automatically configured name servers and search domains are ignored and only name servers and search domains specified in the \"dns\" and \"dns-search\" properties, if any, are used.") #define DESCRIBE_DOC_NM_SETTING_IP4_CONFIG_IGNORE_AUTO_ROUTES N_("When \"method\" is set to \"auto\" and this property to TRUE, automatically configured routes are ignored and only routes specified in the \"routes\" property, if any, are used.") @@ -235,6 +236,7 @@ #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_OPTIONS N_("DNS options for /etc/resolv.conf as described in resolv.conf(5) manual. The currently supported options are \"attempts\", \"debug\", \"edns0\", \"ndots\", \"no-aaaa\", \"no-check-names\", \"no-reload\", \"no-tld-query\", \"rotate\", \"single-request\", \"single-request-reopen\", \"timeout\", \"trust-ad\", \"use-vc\" and \"inet6\", \"ip6-bytestring\", \"ip6-dotint\", \"no-ip6-dotint\". See the resolv.conf(5) manual. Note that there is a distinction between an unset (default) list and an empty list. In nmcli, to unset the list set the value to \"\". To set an empty list, set it to \" \". Currently, an unset list has the same meaning as an empty list. That might change in the future. The \"trust-ad\" setting is only honored if the profile contributes name servers to resolv.conf, and if all contributing profiles have \"trust-ad\" enabled. When using a caching DNS plugin (dnsmasq or systemd-resolved in NetworkManager.conf) then \"edns0\" and \"trust-ad\" are automatically added. The valid \"ipv4.dns-options\" and \"ipv6.dns-options\" get merged together.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_PRIORITY N_("DNS servers priority. The relative priority for DNS servers specified by this setting. A lower numerical value is better (higher priority). Negative values have the special effect of excluding other configurations with a greater numerical priority value; so in presence of at least one negative priority, only DNS servers from connections with the lowest priority value will be used. To avoid all DNS leaks, set the priority of the profile that should be used to the most negative value of all active connections profiles. Zero selects a globally configured default value. If the latter is missing or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When multiple devices have configurations with the same priority, VPNs will be considered first, then devices with the best (lowest metric) default route and then all other devices. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. Note that commonly the resolver tries name servers in /etc/resolv.conf in the order listed, proceeding with the next server in the list on failure. See for example the \"rotate\" option of the dns-options setting. If there are any negative DNS priorities, then only name servers from the devices with that lowest priority will be considered. When using a DNS resolver that supports Conditional Forwarding or Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection is used to query domains in its search list. The search domains determine which name servers to ask, and the DNS priority is used to prioritize name servers based on the domain. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the best priority (lowest numerical value) wins. If a sub domain is configured on another interface it will be accepted regardless the priority, unless parent domain on the other interface has a negative priority, which causes the sub domain to be shadowed. With Split DNS one can avoid undesired DNS leaks by properly configuring DNS priorities and the search domains, so that only name servers of the desired interface are configured.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_DNS_SEARCH N_("List of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names. When using a DNS plugin that supports Conditional Forwarding or Split DNS, then the search domains specify which name servers to query. This makes the behavior different from running with plain /etc/resolv.conf. For more information see also the dns-priority setting. When set on a profile that also enabled DHCP, the DNS search list received automatically (option 119 for DHCPv4 and option 24 for DHCPv6) gets merged with the manual list. This can be prevented by setting \"ignore-auto-dns\". Note that if no DNS searches are configured, the fallback will be derived from the domain from DHCP (option 15).") +#define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_FORWARDING N_("Whether to configure sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the packet from one interface to another. When set to \"default\" (-1), the value from global configuration is used; if no global default is defined, \"auto\" (2) will be used. The \"forwarding\" property is ignored when \"method\" is set to \"shared\", because forwarding is always enabled in this case. The accepted values are: \"default\" (-1): use global default. \"no\" (0): disabled. \"yes\" (1): enabled. \"auto\" (2): enable if any shared connection is active, use kernel default otherwise.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_GATEWAY N_("The gateway associated with this configuration. This is only meaningful if \"addresses\" is also set. Setting the gateway causes NetworkManager to configure a standard default route with the gateway as next hop. This is ignored if \"never-default\" is set. An alternative is to configure the default route explicitly with a manual route and /0 as prefix length. Note that the gateway usually conflicts with routing that NetworkManager configures for WireGuard interfaces, so usually it should not be set in that case. See \"ip4-auto-default-route\".") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_IGNORE_AUTO_DNS N_("When \"method\" is set to \"auto\" and this property to TRUE, automatically configured name servers and search domains are ignored and only name servers and search domains specified in the \"dns\" and \"dns-search\" properties, if any, are used.") #define DESCRIBE_DOC_NM_SETTING_IP6_CONFIG_IGNORE_AUTO_ROUTES N_("When \"method\" is set to \"auto\" and this property to TRUE, automatically configured routes are ignored and only routes specified in the \"routes\" property, if any, are used.") @@ -301,6 +303,7 @@ #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_RSTP_ENABLE N_("Enable or disable RSTP.") #define DESCRIBE_DOC_NM_SETTING_OVS_BRIDGE_STP_ENABLE N_("Enable or disable STP.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_DEVARGS N_("Open vSwitch DPDK device arguments.") +#define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_LSC_INTERRUPT N_("Configures the Link State Change (LSC) detection mode for the OVS DPDK interface. When set to \"ignore\" (-1), NetworkManager doesn't change the default value configured by Open vSwitch. \"enabled\" (1) enables interrupts. \"disabled\" (0) disables interrupts, thus setting the interface in poll mode.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_N_RXQ N_("Open vSwitch DPDK number of rx queues. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures one queue.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_N_RXQ_DESC N_("The rx queue size (number of rx descriptors) for DPDK ports. Must be zero or a power of 2 between 1 and 4096, and supported by the hardware. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures 2048 descriptors.") #define DESCRIBE_DOC_NM_SETTING_OVS_DPDK_N_TXQ_DESC N_("The tx queue size (number of tx descriptors) for DPDK ports. Must be zero or a power of 2 between 1 and 4096, and supported by the hardware. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures 2048 descriptors.") @@ -350,6 +353,7 @@ #define DESCRIBE_DOC_NM_SETTING_SRIOV_ESWITCH_ENCAP_MODE N_("Select the eswitch encapsulation support. Currently it's only supported for PCI PF devices, and only if the eswitch device is managed from the same PCI address than the PF. If set to \"preserve\" (-1) (default) the eswitch encap-mode won't be modified by NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_SRIOV_ESWITCH_INLINE_MODE N_("Select the eswitch inline-mode of the device. Some HWs need the VF driver to put part of the packet headers on the TX descriptor so the e-switch can do proper matching and steering. Currently it's only supported for PCI PF devices, and only if the eswitch device is managed from the same PCI address than the PF. If set to \"preserve\" (-1) (default) the eswitch inline-mode won't be modified by NetworkManager.") #define DESCRIBE_DOC_NM_SETTING_SRIOV_ESWITCH_MODE N_("Select the eswitch mode of the device. Currently it's only supported for PCI PF devices, and only if the eswitch device is managed from the same PCI address than the PF. If set to \"preserve\" (-1) (default) the eswitch mode won't be modified by NetworkManager.") +#define DESCRIBE_DOC_NM_SETTING_SRIOV_PRESERVE_ON_DOWN N_("This controls whether NetworkManager preserves the SR-IOV parameters set on the device when the connection is deactivated, or whether it resets them to their default value. The SR-IOV parameters are those specified in this setting (the \"sriov\" setting), like the number of VFs to create, the eswitch configuration, etc. If set to \"no\" (0), NetworkManager resets the SR-IOV parameters when the connection is deactivated. When set to \"yes\" (1), NetworkManager preserves those parameters on the device. If the value is \"default\" (-1), NetworkManager looks up a global default value in the configuration; in case no such value is defined, it uses \"no\" (0) as fallback.") #define DESCRIBE_DOC_NM_SETTING_SRIOV_TOTAL_VFS N_("The total number of virtual functions to create. Note that when the sriov setting is present NetworkManager enforces the number of virtual functions on the interface (also when it is zero) during activation and resets it upon deactivation. To prevent any changes to SR-IOV parameters don't add a sriov setting to the connection.") #define DESCRIBE_DOC_NM_SETTING_SRIOV_VFS N_("Array of virtual function descriptors. Each VF descriptor is a dictionary mapping attribute names to GVariant values. The 'index' entry is mandatory for each VF. When represented as string a VF is in the form: \"INDEX [ATTR=VALUE[ ATTR=VALUE]...]\". for example: \"2 mac=00:11:22:33:44:55 spoof-check=true\". Multiple VFs can be specified using a comma as separator. Currently, the following attributes are supported: mac, spoof-check, trust, min-tx-rate, max-tx-rate, vlans. The \"vlans\" attribute is represented as a semicolon-separated list of VLAN descriptors, where each descriptor has the form \"ID[.PRIORITY[.PROTO]]\". PROTO can be either 'q' for 802.1Q (the default) or 'ad' for 802.1ad.") #define DESCRIBE_DOC_NM_SETTING_TC_CONFIG_QDISCS N_("Array of TC queueing disciplines. When the \"tc\" setting is present, qdiscs from this property are applied upon activation. If the property is empty, all qdiscs are removed and the device will only have the default qdisc assigned by kernel according to the \"net.core.default_qdisc\" sysctl. If the \"tc\" setting is not present, NetworkManager doesn't touch the qdiscs present on the interface.") @@ -422,7 +426,7 @@ #define DESCRIBE_DOC_NM_SETTING_WIRED_AUTO_NEGOTIATE N_("When TRUE, enforce auto-negotiation of speed and duplex mode. If \"speed\" and \"duplex\" properties are both specified, only that single mode will be advertised and accepted during the link auto-negotiation process: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. When FALSE, \"speed\" and \"duplex\" properties should be both set or link configuration will be skipped.") #define DESCRIBE_DOC_NM_SETTING_WIRED_CLONED_MAC_ADDRESS N_("If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing. Beside explicitly specifying a MAC address, the special values \"preserve\", \"permanent\", \"random\" and \"stable\" are supported. \"preserve\" means not to touch the MAC address on activation. \"permanent\" means to use the permanent hardware address if the device has one (otherwise this is treated as \"preserve\"). \"random\" creates a random MAC address on each connect. \"stable\" creates a hashed MAC address based on connection.stable-id and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to \"preserve\" (older versions of NetworkManager may use a different default value). On D-Bus, this field is expressed as \"assigned-mac-address\" or the deprecated \"cloned-mac-address\".") #define DESCRIBE_DOC_NM_SETTING_WIRED_DUPLEX N_("When a value is set, either \"half\" or \"full\", configures the device to use the specified duplex mode. If \"auto-negotiate\" is \"yes\" the specified duplex mode will be the only one advertised during link negotiation: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. If the value is unset (the default), the link configuration will be either skipped (if \"auto-negotiate\" is \"no\", the default) or will be auto-negotiated (if \"auto-negotiate\" is \"yes\") and the local device will advertise all the supported duplex modes. Must be set together with the \"speed\" property if specified. Before specifying a duplex mode be sure your device supports it.") -#define DESCRIBE_DOC_NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.") +#define DESCRIBE_DOC_NM_SETTING_WIRED_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows one to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.") #define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS N_("If specified, this connection will only apply to the Ethernet device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).") #define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS_BLACKLIST N_("If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).") #define DESCRIBE_DOC_NM_SETTING_WIRED_MAC_ADDRESS_DENYLIST N_("If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).") @@ -448,7 +452,7 @@ #define DESCRIBE_DOC_NM_SETTING_WIRELESS_CHANNEL N_("Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the \"band\" property to be set.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_CHANNEL_WIDTH N_("Specifies width of the wireless channel in Access Point (AP) mode. When set to \"auto\" (0) (the default), the channel width is automatically determined. At the moment, this means that the safest (smallest) width is chosen. If the value is not \"auto\" (0), then the 'channel' property must also be set. When using the 2.4GHz band, the width can be at most 40MHz. This property can be set to a value different from \"auto\" (0) only when the interface is configured in AP mode.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS N_("If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing. Beside explicitly specifying a MAC address, the special values \"preserve\", \"permanent\", \"random\", \"stable\" and \"stable-ssid\" are supported. \"preserve\" means not to touch the MAC address on activation. \"permanent\" means to use the permanent hardware address of the device. \"random\" creates a random MAC address on each connect. \"stable\" creates a hashed MAC address based on connection.stable-id and a machine dependent key. \"stable-ssid\" creates a hashed MAC address based on the SSID, the same as setting the stable-id to \"${NETWORK_SSID}\". If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to \"preserve\" (older versions of NetworkManager may use a different default value). On D-Bus, this field is expressed as \"assigned-mac-address\" or the deprecated \"cloned-mac-address\".") -#define DESCRIBE_DOC_NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.") +#define DESCRIBE_DOC_NM_SETTING_WIRELESS_GENERATE_MAC_ADDRESS_MASK N_("With \"cloned-mac-address\" setting \"random\" or \"stable\", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows one to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting \"FE:FF:FF:00:00:00\" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the \"random\" or \"stable\" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of \"FE:FF:FF:00:00:00 68:F7:28:00:00:00\" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of \"02:00:00:00:00:00 00:00:00:00:00:00\" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, \"02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00\" will create a fully scrambled MAC address, randomly locally or globally administered.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_HIDDEN N_("If TRUE, indicates that the network is a non-broadcasting network that hides its SSID. This works both in infrastructure and AP mode. In infrastructure mode, various workarounds are used for a more reliable discovery of hidden networks, such as probe-scanning the SSID. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution. In AP mode, the created network does not broadcast its SSID. Note that marking the network as hidden may be a privacy issue for you (in infrastructure mode) or client stations (in AP mode), as the explicit probe-scans are distinctly recognizable on the air.") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_MAC_ADDRESS N_("If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).") #define DESCRIBE_DOC_NM_SETTING_WIRELESS_MAC_ADDRESS_BLACKLIST N_("A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg \"00:11:22:33:44:55\").") @@ -500,4 +504,5 @@ #define DESCRIBE_DOC_NM_SETTING_LOOPBACK_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.") #define DESCRIBE_DOC_NM_SETTING_OVS_EXTERNAL_IDS_DATA N_("A dictionary of key/value pairs with external-ids for OVS.") #define DESCRIBE_DOC_NM_SETTING_OVS_OTHER_CONFIG_DATA N_("A dictionary of key/value pairs with other_config settings for OVS. See also \"other_config\" in the \"ovs-vswitchd.conf.db\" manual for the keys that OVS supports.") +#define DESCRIBE_DOC_NM_SETTING_PREFIX_DELEGATION_SUBNET_ID N_("The subnet ID to use on the interface from the prefix delegation received via an upstream interface. Set to a value between 0 and 0xffffffff (2^32 - 1) to indicate a specific subnet ID; or set to -1 to automatically choose an available subnet ID.") #define DESCRIBE_DOC_NM_SETTING_VETH_PEER N_("This property specifies the peer interface name of the veth. This property is mandatory.") diff --git a/src/nm-cloud-setup/nmcs-provider-oci.c b/src/nm-cloud-setup/nmcs-provider-oci.c index 17cd997e..8dc72ccd 100644 --- a/src/nm-cloud-setup/nmcs-provider-oci.c +++ b/src/nm-cloud-setup/nmcs-provider-oci.c @@ -141,10 +141,10 @@ _get_config_done_cb(GObject *source, GAsyncResult *result, gpointer user_data) } field = json_object_get(vnic, "vnicId"); - vnic_id = field && json_is_string(field) ? json_string_value(field) : ""; + vnic_id = json_is_string(field) ? json_string_value(field) : ""; field = json_object_get(vnic, "macAddr"); - val = field && json_is_string(field) ? json_string_value(field) : NULL; + val = json_is_string(field) ? json_string_value(field) : NULL; mac = val ? nmcs_utils_hwaddr_normalize(val, json_string_length(field)) : NULL; if (!mac) { _VNIC_WARN("missing or invalid 'macAddr', ignoring VNIC"); @@ -153,14 +153,14 @@ _get_config_done_cb(GObject *source, GAsyncResult *result, gpointer user_data) if (is_baremetal) { field = json_object_get(vnic, "nicIndex"); - nic_index = field && json_is_integer(field) ? json_integer_value(field) : -1; + nic_index = json_is_integer(field) ? json_integer_value(field) : -1; if (nic_index < 0 || nic_index >= 1024) { /* 1024 = random limit to prevent abuse*/ _VNIC_WARN("missing or invalid 'nicIndex', ignoring VNIC"); continue; } field = json_object_get(vnic, "vlanTag"); - vlan_tag = field && json_is_integer(field) ? json_integer_value(field) : -1; + vlan_tag = json_is_integer(field) ? json_integer_value(field) : -1; if (vlan_tag < 0) { _VNIC_WARN("missing or invalid 'vlanTag', ignoring VNIC"); continue; @@ -171,7 +171,7 @@ _get_config_done_cb(GObject *source, GAsyncResult *result, gpointer user_data) config_iface_data->iface_idx = i; field = json_object_get(vnic, "privateIp"); - val = field && json_is_string(field) ? json_string_value(field) : NULL; + val = json_is_string(field) ? json_string_value(field) : NULL; if (val && nm_inet_parse_bin(AF_INET, val, NULL, &addr)) { config_iface_data->has_ipv4s = TRUE; config_iface_data->ipv4s_len = 1; @@ -182,7 +182,7 @@ _get_config_done_cb(GObject *source, GAsyncResult *result, gpointer user_data) } field = json_object_get(vnic, "virtualRouterIp"); - val = field && json_is_string(field) ? json_string_value(field) : NULL; + val = json_is_string(field) ? json_string_value(field) : NULL; if (val && nm_inet_parse_bin(AF_INET, val, NULL, &addr)) { config_iface_data->has_gateway = TRUE; config_iface_data->gateway = addr; @@ -191,7 +191,7 @@ _get_config_done_cb(GObject *source, GAsyncResult *result, gpointer user_data) } field = json_object_get(vnic, "subnetCidrBlock"); - val = field && json_is_string(field) ? json_string_value(field) : NULL; + val = json_is_string(field) ? json_string_value(field) : NULL; if (val && nm_inet_parse_with_prefix_bin(AF_INET, val, NULL, &addr, &prefix)) { config_iface_data->has_cidr = TRUE; config_iface_data->cidr_addr = addr; diff --git a/src/nm-dispatcher/nm-dispatcher.c b/src/nm-dispatcher/nm-dispatcher.c index ce252b92..16e35827 100644 --- a/src/nm-dispatcher/nm-dispatcher.c +++ b/src/nm-dispatcher/nm-dispatcher.c @@ -163,7 +163,7 @@ struct Request { const ScriptInfo *const _script = (x_script); \ const Request *const _request = _script ? _script->request : NULL; \ \ - nm_assert(_script &&_request); \ + nm_assert(_script && _request); \ if (enabled_cmd) \ __LOG_print_S(print_cmd, _request, _script, ": "__VA_ARGS__); \ } \ diff --git a/src/nm-initrd-generator/meson.build b/src/nm-initrd-generator/meson.build index 080fe7e4..6b02e066 100644 --- a/src/nm-initrd-generator/meson.build +++ b/src/nm-initrd-generator/meson.build @@ -6,6 +6,7 @@ libnmi_core = static_library( 'nmi-cmdline-reader.c', 'nmi-dt-reader.c', 'nmi-ibft-reader.c', + 'nmi-nbft-reader.c', ), include_directories: [ src_inc, diff --git a/src/nm-initrd-generator/nm-initrd-generator.h b/src/nm-initrd-generator/nm-initrd-generator.h index c2baad4e..a73ce361 100644 --- a/src/nm-initrd-generator/nm-initrd-generator.h +++ b/src/nm-initrd-generator/nm-initrd-generator.h @@ -41,6 +41,8 @@ nmi_ibft_update_connection_from_nic(NMConnection *connection, GHashTable *nic, G NMConnection *nmi_dt_reader_parse(const char *sysfs_dir); +NMConnection **nmi_nbft_reader_parse(const char *sysfs_dir, char **hostname); + GHashTable *nmi_cmdline_reader_parse(const char *etc_connections_dir, const char *sysfs_dir, const char *const *argv, diff --git a/src/nm-initrd-generator/nmi-cmdline-reader.c b/src/nm-initrd-generator/nmi-cmdline-reader.c index 5389748d..ba5380af 100644 --- a/src/nm-initrd-generator/nmi-cmdline-reader.c +++ b/src/nm-initrd-generator/nmi-cmdline-reader.c @@ -1479,8 +1479,10 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir, gs_unref_ptrarray GPtrArray *routes = NULL; gs_unref_ptrarray GPtrArray *znets = NULL; int i; - guint64 dhcp_timeout = 90; - guint64 dhcp_num_tries = 1; + guint64 dhcp_timeout = 90; + guint64 dhcp_num_tries = 1; + gboolean nvmf_nonbft = FALSE; + gboolean have_dracut_nbft = FALSE; reader = reader_new(); @@ -1497,7 +1499,10 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir, /* pass */ } else if (nm_streq(tag, "net.ifnames")) net_ifnames = !nm_streq(argument, "0"); - else if (nm_streq(tag, "rd.peerdns")) + else if (nm_streq(tag, "ifname")) { + if (NM_STR_HAS_PREFIX(argument, "nbft")) + have_dracut_nbft = TRUE; + } else if (nm_streq(tag, "rd.peerdns")) reader->ignore_auto_dns = !_nm_utils_ascii_str_to_bool(argument, TRUE); else if (nm_streq(tag, "rd.net.timeout.dhcp")) { if (nm_streq0(argument, "infinity")) { @@ -1589,7 +1594,18 @@ nmi_cmdline_reader_parse(const char *etc_connections_dir, reader_parse_dns_backend(reader, argument); } else if (nm_streq(tag, "rd.net.dns-resolve-mode")) { reader_parse_dns_resolve_mode(reader, argument); + } else if (nm_streq(tag, "rd.nvmf.nonbft")) + nvmf_nonbft = TRUE; + } + + if (!nvmf_nonbft && !have_dracut_nbft) { + NMConnection **nbft_connections, **c; + + nbft_connections = nmi_nbft_reader_parse(sysfs_dir, &reader->hostname); + for (c = nbft_connections; c && *c; c++) { + reader_add_connection(reader, nm_connection_get_id(*c), *c); } + g_free(nbft_connections); } for (i = 0; i < reader->vlan_parents->len; i++) { diff --git a/src/nm-initrd-generator/nmi-nbft-reader.c b/src/nm-initrd-generator/nmi-nbft-reader.c new file mode 100644 index 00000000..5d12086f --- /dev/null +++ b/src/nm-initrd-generator/nmi-nbft-reader.c @@ -0,0 +1,415 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2024 Red Hat, Inc. + */ + +#include "libnm-core-impl/nm-default-libnm-core.h" + +#include "nm-initrd-generator.h" + +#if WITH_NBFT + +#include <libnvme.h> +#include <dlfcn.h> + +#include "libnm-log-core/nm-logging.h" +#include "libnm-core-intern/nm-core-internal.h" + +/*****************************************************************************/ + +#define _NMLOG(level, domain, ...) \ + nm_log((level), \ + (domain), \ + NULL, \ + NULL, \ + "nbft-reader: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__) _NM_UTILS_MACRO_REST(__VA_ARGS__)) + +/*****************************************************************************/ + +static inline gboolean +is_valid_addr(int family, const char *addr) +{ + return (addr && strlen(addr) > 0 && !nm_streq(addr, "0.0.0.0") && !nm_streq(addr, "::") + && nm_utils_ipaddr_valid(family, addr)); +} + +static int (*_nvme_nbft_read)(struct nbft_info **nbft, const char *filename); +static void (*_nvme_nbft_free)(struct nbft_info *nbft); + +static void * +load_libnvme(void) +{ + void *handle; + + handle = dlopen("libnvme.so.1", RTLD_LAZY); + if (!handle) + return NULL; + +#if HAVE_DLVSYM + _nvme_nbft_read = dlvsym(handle, "nvme_nbft_read", "LIBNVME_1_5"); + _nvme_nbft_free = dlvsym(handle, "nvme_nbft_free", "LIBNVME_1_5"); +#else + /* no dlvsym() in musl */ + _nvme_nbft_read = dlsym(handle, "nvme_nbft_read"); + _nvme_nbft_free = dlsym(handle, "nvme_nbft_free"); +#endif + + if (!_nvme_nbft_read || !_nvme_nbft_free) { + dlclose(handle); + return NULL; + } + return handle; +} + +static char * +format_conn_name(const char *table_name, struct nbft_info_hfi *hfi, gboolean is_vlan) +{ + if (is_vlan) { + nm_assert(hfi->tcp_info.vlan > 0); + return g_strdup_printf("%s connection HFI %d VLAN %d", + table_name, + hfi->index, + hfi->tcp_info.vlan); + } else + return g_strdup_printf("%s connection HFI %d", table_name, hfi->index); +} + +static NMConnection * +find_conn_for_wired_mac(GPtrArray *a, const char *hwaddr) +{ + guint i; + + for (i = 0; i < a->len; i++) { + NMConnection *con = a->pdata[i]; + NMSettingWired *s_wired; + + if (!nm_connection_is_type(con, NM_SETTING_WIRED_SETTING_NAME)) + continue; + s_wired = nm_connection_get_setting_wired(con); + if (!s_wired) + continue; + if (nm_streq(hwaddr, nm_setting_wired_get_mac_address(s_wired))) + return con; + } + return NULL; +} + +static NMConnection * +create_wired_conn(struct nbft_info_hfi *hfi, + const char *conn_name, + const char *hwaddr, + gboolean is_vlan) +{ + NMConnection *connection; + NMSetting *s_connection; + NMSetting *s_wired; + + connection = nm_simple_connection_new(); + + s_connection = nm_setting_connection_new(); + g_object_set(s_connection, + NM_SETTING_CONNECTION_TYPE, + is_vlan ? NM_SETTING_VLAN_SETTING_NAME : NM_SETTING_WIRED_SETTING_NAME, + NM_SETTING_CONNECTION_ID, + conn_name, + NM_SETTING_CONNECTION_AUTOCONNECT_PRIORITY, + NMI_AUTOCONNECT_PRIORITY_FIRMWARE, + NULL); + nm_connection_add_setting(connection, s_connection); + + /* MAC address */ + s_wired = nm_setting_wired_new(); + g_object_set(s_wired, NM_SETTING_WIRED_MAC_ADDRESS, hwaddr, NULL); + nm_connection_add_setting(connection, s_wired); + + return connection; +} + +static void +parse_hfi(GPtrArray *a, struct nbft_info_hfi *hfi, const char *table_name, char **hostname) +{ + gs_unref_object NMConnection *connection = NULL; + NMConnection *parent_connection; + NMSetting *s_vlan; + gs_free char *hwaddr = NULL; + gs_free char *conn_name = NULL; + gs_unref_object NMSetting *s_ip4 = NULL; + gs_unref_object NMSetting *s_ip6 = NULL; + nm_auto_unref_ip_address NMIPAddress *ipaddr = NULL; + guint prefix; + gs_free_error GError *error = NULL; + int family = AF_UNSPEC; + NMIPAddr addr_bin; + + /* Pre-checks */ + if (!nm_inet_parse_bin_full(family, FALSE, hfi->tcp_info.ipaddr, &family, &addr_bin)) { + _LOGW(LOGD_CORE, "NBFT: Malformed IP address: '%s'", hfi->tcp_info.ipaddr); + return; + } + + /* MAC address */ + hwaddr = g_strdup_printf("%02X:%02X:%02X:%02X:%02X:%02X", + hfi->tcp_info.mac_addr[0], + hfi->tcp_info.mac_addr[1], + hfi->tcp_info.mac_addr[2], + hfi->tcp_info.mac_addr[3], + hfi->tcp_info.mac_addr[4], + hfi->tcp_info.mac_addr[5]); + + /* First check if we need VLANs */ + if (hfi->tcp_info.vlan > 0) { + parent_connection = find_conn_for_wired_mac(a, hwaddr); + if (!parent_connection) { + /* Create new parent wired connection */ + conn_name = format_conn_name(table_name, hfi, FALSE); + parent_connection = create_wired_conn(hfi, conn_name, hwaddr, FALSE); + + s_ip4 = nm_setting_ip4_config_new(); + s_ip6 = nm_setting_ip6_config_new(); + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_DISABLED, + NULL); + nm_connection_add_setting(parent_connection, g_steal_pointer(&s_ip4)); + nm_connection_add_setting(parent_connection, g_steal_pointer(&s_ip6)); + + if (!nm_connection_normalize(parent_connection, NULL, NULL, &error)) { + _LOGW(LOGD_CORE, "Generated an invalid connection: %s", error->message); + g_object_unref(parent_connection); + return; + } + g_ptr_array_add(a, parent_connection); + } + + conn_name = format_conn_name(table_name, hfi, TRUE); + connection = create_wired_conn(hfi, conn_name, hwaddr, TRUE); + + s_vlan = nm_setting_vlan_new(); + g_object_set(s_vlan, NM_SETTING_VLAN_ID, hfi->tcp_info.vlan, NULL); + nm_connection_add_setting(connection, s_vlan); + } else { + /* No VLANS */ + conn_name = format_conn_name(table_name, hfi, FALSE); + connection = create_wired_conn(hfi, conn_name, hwaddr, FALSE); + } + + /* IP addresses */ + s_ip4 = nm_setting_ip4_config_new(); + s_ip6 = nm_setting_ip6_config_new(); + + switch (family) { + /* IPv4 */ + case AF_INET: + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_DISABLED, + NULL); + if (is_valid_addr(AF_INET, hfi->tcp_info.dhcp_server_ipaddr)) { + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_AUTO, + NULL); + if (hfi->tcp_info.host_name && strlen(hfi->tcp_info.host_name) > 0) { + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, + hfi->tcp_info.host_name, + NULL); + } + } else { + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_MANUAL, + NULL); + ipaddr = nm_ip_address_new_binary(AF_INET, + &addr_bin, + hfi->tcp_info.subnet_mask_prefix, + &error); + if (!ipaddr) { + _LOGW(LOGD_CORE, + "Cannot parse IP %s/%u: %s", + hfi->tcp_info.ipaddr, + hfi->tcp_info.subnet_mask_prefix, + error->message); + return; + } + nm_setting_ip_config_add_address(NM_SETTING_IP_CONFIG(s_ip4), ipaddr); + if (is_valid_addr(AF_INET, hfi->tcp_info.gateway_ipaddr)) { + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_GATEWAY, + hfi->tcp_info.gateway_ipaddr, + NULL); + } + if (is_valid_addr(AF_INET, hfi->tcp_info.primary_dns_ipaddr)) { + nm_setting_ip_config_add_dns(NM_SETTING_IP_CONFIG(s_ip4), + hfi->tcp_info.primary_dns_ipaddr); + } + if (is_valid_addr(AF_INET, hfi->tcp_info.secondary_dns_ipaddr)) { + nm_setting_ip_config_add_dns(NM_SETTING_IP_CONFIG(s_ip4), + hfi->tcp_info.secondary_dns_ipaddr); + } + } + break; + + /* IPv6 */ + case AF_INET6: + g_object_set(s_ip4, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP4_CONFIG_METHOD_DISABLED, + NULL); + if (is_valid_addr(AF_INET6, hfi->tcp_info.dhcp_server_ipaddr)) { + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_AUTO, + NULL); + if (hfi->tcp_info.host_name && strlen(hfi->tcp_info.host_name) > 0) { + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_DHCP_HOSTNAME, + hfi->tcp_info.host_name, + NULL); + } + } else { + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_METHOD, + NM_SETTING_IP6_CONFIG_METHOD_MANUAL, + NULL); + prefix = hfi->tcp_info.subnet_mask_prefix; + if (prefix == 0) { + /* Buggy firmware implementations may report prefix=0 for v6 addresses, + * let's fall back to /64. + */ + _LOGW(LOGD_CORE, + "NBFT: Invalid IPv6 prefix %d, using /64 as a fallback.", + hfi->tcp_info.subnet_mask_prefix); + prefix = 64; + } + ipaddr = nm_ip_address_new_binary(AF_INET6, &addr_bin, prefix, &error); + if (!ipaddr) { + _LOGW(LOGD_CORE, + "Cannot parse IP %s/%u: %s", + hfi->tcp_info.ipaddr, + prefix, + error->message); + return; + } + nm_setting_ip_config_add_address(NM_SETTING_IP_CONFIG(s_ip6), ipaddr); + if (is_valid_addr(AF_INET6, hfi->tcp_info.gateway_ipaddr)) { + g_object_set(s_ip6, + NM_SETTING_IP_CONFIG_GATEWAY, + hfi->tcp_info.gateway_ipaddr, + NULL); + } + if (is_valid_addr(AF_INET6, hfi->tcp_info.primary_dns_ipaddr)) { + nm_setting_ip_config_add_dns(NM_SETTING_IP_CONFIG(s_ip6), + hfi->tcp_info.primary_dns_ipaddr); + } + if (is_valid_addr(AF_INET6, hfi->tcp_info.secondary_dns_ipaddr)) { + nm_setting_ip_config_add_dns(NM_SETTING_IP_CONFIG(s_ip6), + hfi->tcp_info.secondary_dns_ipaddr); + } + } + break; + default: + g_warn_if_reached(); + } + + nm_connection_add_setting(connection, g_steal_pointer(&s_ip4)); + nm_connection_add_setting(connection, g_steal_pointer(&s_ip6)); + + /* Hostname */ + if (hfi->tcp_info.host_name && strlen(hfi->tcp_info.host_name) > 0) { + g_free(*hostname); + *hostname = g_strdup(hfi->tcp_info.host_name); + } + + /* TODO: translate the following HFI struct members? + * hfi->tcp_info.pci_sbdf + * hfi->tcp_info.ip_origin + * hfi->tcp_info.dhcp_server_ipaddr + * hfi->tcp_info.this_hfi_is_default_route + * hfi->tcp_info.dhcp_override + */ + + if (!nm_connection_normalize(connection, NULL, NULL, &error)) { + _LOGW(LOGD_CORE, "Generated an invalid connection: %s", error->message); + return; + } + + g_ptr_array_add(a, g_steal_pointer(&connection)); +} + +NMConnection ** +nmi_nbft_reader_parse(const char *sysfs_dir, char **hostname) +{ + nm_auto_unref_ptrarray GPtrArray *a = NULL; + gs_free char *path = NULL; + gs_free_error GError *error = NULL; + GDir *dir; + void *libnvme_handle = NULL; + const char *entry_name; + + g_return_val_if_fail(sysfs_dir != NULL, NULL); + path = g_build_filename(sysfs_dir, "firmware", "acpi", "tables", NULL); + + dir = g_dir_open(path, 0, NULL); + if (!dir) + return NULL; + + a = g_ptr_array_new(); + + while ((entry_name = g_dir_read_name(dir))) { + gs_free char *entry_path = NULL; + struct nbft_info *nbft; + struct nbft_info_hfi **hfi; + int ret; + + if (!g_str_has_prefix(entry_name, "NBFT")) + continue; + + /* attempt to load libnvme only on the first table match, saving some I/O */ + if (!libnvme_handle && !(libnvme_handle = load_libnvme())) { + g_dir_close(dir); + return NULL; + } + + entry_path = g_build_filename(path, entry_name, NULL); + ret = _nvme_nbft_read(&nbft, entry_path); + if (ret) { + _LOGW(LOGD_CORE, "Error parsing NBFT table %s: %m", entry_path); + continue; + } + + for (hfi = nbft->hfi_list; hfi && *hfi; hfi++) { + if (!nm_streq((*hfi)->transport, "tcp")) { + _LOGW(LOGD_CORE, + "NBFT table %s, HFI descriptor %d: unsupported transport type '%s'", + entry_path, + (*hfi)->index, + (*hfi)->transport); + continue; + } + parse_hfi(a, *hfi, entry_name, hostname); + } + + _nvme_nbft_free(nbft); + } + + g_dir_close(dir); + if (libnvme_handle) + dlclose(libnvme_handle); + g_ptr_array_add(a, NULL); /* trailing NULL-delimiter */ + return (NMConnection **) g_ptr_array_free(g_steal_pointer(&a), FALSE); +} + +#else /* WITH_NBFT */ + +NMConnection ** +nmi_nbft_reader_parse(const char *sysfs_dir, char **hostname) +{ + return NULL; +} + +#endif diff --git a/src/nmcli/agent.c b/src/nmcli/agent.c index b16a3c51..478f3e68 100644 --- a/src/nmcli/agent.c +++ b/src/nmcli/agent.c @@ -57,7 +57,7 @@ usage_agent_all(void) static char *pre_input_deftext; static int -set_deftext(_NMC_RL_STARTUPHOOK_ARGS) +set_deftext(void) { if (pre_input_deftext && rl_startup_hook) { rl_insert_text(pre_input_deftext); diff --git a/src/nmcli/common.c b/src/nmcli/common.c index 2ced70f3..15a7927b 100644 --- a/src/nmcli/common.c +++ b/src/nmcli/common.c @@ -1138,7 +1138,7 @@ nmc_rl_gen_func_ifnames(const char *text, int state) char *nmc_rl_pre_input_deftext; int -nmc_rl_set_deftext(_NMC_RL_STARTUPHOOK_ARGS) +nmc_rl_set_deftext(void) { if (nmc_rl_pre_input_deftext && rl_startup_hook) { rl_insert_text(nmc_rl_pre_input_deftext); diff --git a/src/nmcli/common.h b/src/nmcli/common.h index 892b2d4e..2ed13054 100644 --- a/src/nmcli/common.h +++ b/src/nmcli/common.h @@ -50,17 +50,9 @@ char *nmc_rl_gen_func_ifnames(const char *text, int state); gboolean nmc_get_in_readline(void); void nmc_set_in_readline(gboolean in_readline); -#if HAVE_EDITLINE_READLINE -/* libedit has different signature for rl_startup_hook function */ -#define _NMC_RL_STARTUPHOOK_ARGS const char *c, int i -#else -/* By default the libreadline shall be used */ -#define _NMC_RL_STARTUPHOOK_ARGS void -#endif - /* for pre-filling a string to readline prompt */ extern char *nmc_rl_pre_input_deftext; -int nmc_rl_set_deftext(_NMC_RL_STARTUPHOOK_ARGS); +int nmc_rl_set_deftext(void); char *nmc_parse_lldp_capabilities(guint value); diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index bccec3a1..d93e16f0 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -1055,27 +1055,28 @@ const NmcMetaGenericInfo "," NM_SETTING_VETH_SETTING_NAME "," NM_SETTING_802_1X_SETTING_NAME \ "," NM_SETTING_WIRELESS_SETTING_NAME "," NM_SETTING_WIRELESS_SECURITY_SETTING_NAME \ "," NM_SETTING_IP4_CONFIG_SETTING_NAME "," NM_SETTING_IP6_CONFIG_SETTING_NAME \ - "," NM_SETTING_SERIAL_SETTING_NAME "," NM_SETTING_WIFI_P2P_SETTING_NAME \ - "," NM_SETTING_PPP_SETTING_NAME "," NM_SETTING_PPPOE_SETTING_NAME \ - "," NM_SETTING_ADSL_SETTING_NAME "," NM_SETTING_GSM_SETTING_NAME \ - "," NM_SETTING_CDMA_SETTING_NAME "," NM_SETTING_BLUETOOTH_SETTING_NAME \ - "," NM_SETTING_OLPC_MESH_SETTING_NAME "," NM_SETTING_VPN_SETTING_NAME \ - "," NM_SETTING_INFINIBAND_SETTING_NAME "," NM_SETTING_BOND_SETTING_NAME \ - "," NM_SETTING_BOND_PORT_SETTING_NAME "," NM_SETTING_VLAN_SETTING_NAME \ - "," NM_SETTING_BRIDGE_SETTING_NAME "," NM_SETTING_BRIDGE_PORT_SETTING_NAME \ - "," NM_SETTING_TEAM_SETTING_NAME "," NM_SETTING_TEAM_PORT_SETTING_NAME \ - "," NM_SETTING_OVS_BRIDGE_SETTING_NAME "," NM_SETTING_OVS_INTERFACE_SETTING_NAME \ - "," NM_SETTING_OVS_PATCH_SETTING_NAME "," NM_SETTING_OVS_PORT_SETTING_NAME \ - "," NM_SETTING_GENERIC_SETTING_NAME "," NM_SETTING_DCB_SETTING_NAME \ - "," NM_SETTING_TUN_SETTING_NAME "," NM_SETTING_IP_TUNNEL_SETTING_NAME \ - "," NM_SETTING_MACSEC_SETTING_NAME "," NM_SETTING_MACVLAN_SETTING_NAME \ - "," NM_SETTING_VXLAN_SETTING_NAME "," NM_SETTING_VRF_SETTING_NAME \ - "," NM_SETTING_WPAN_SETTING_NAME "," NM_SETTING_6LOWPAN_SETTING_NAME \ - "," NM_SETTING_WIREGUARD_SETTING_NAME "," NM_SETTING_LINK_SETTING_NAME \ - "," NM_SETTING_PROXY_SETTING_NAME "," NM_SETTING_TC_CONFIG_SETTING_NAME \ - "," NM_SETTING_SRIOV_SETTING_NAME "," NM_SETTING_ETHTOOL_SETTING_NAME \ - "," NM_SETTING_OVS_DPDK_SETTING_NAME "," NM_SETTING_HOSTNAME_SETTING_NAME \ - "," NM_SETTING_HSR_SETTING_NAME "," NM_SETTING_IPVLAN_SETTING_NAME + "," NM_SETTING_PREFIX_DELEGATION_SETTING_NAME "," NM_SETTING_SERIAL_SETTING_NAME \ + "," NM_SETTING_WIFI_P2P_SETTING_NAME "," NM_SETTING_PPP_SETTING_NAME \ + "," NM_SETTING_PPPOE_SETTING_NAME "," NM_SETTING_ADSL_SETTING_NAME \ + "," NM_SETTING_GSM_SETTING_NAME "," NM_SETTING_CDMA_SETTING_NAME \ + "," NM_SETTING_BLUETOOTH_SETTING_NAME "," NM_SETTING_OLPC_MESH_SETTING_NAME \ + "," NM_SETTING_VPN_SETTING_NAME "," NM_SETTING_INFINIBAND_SETTING_NAME \ + "," NM_SETTING_BOND_SETTING_NAME "," NM_SETTING_BOND_PORT_SETTING_NAME \ + "," NM_SETTING_VLAN_SETTING_NAME "," NM_SETTING_BRIDGE_SETTING_NAME \ + "," NM_SETTING_BRIDGE_PORT_SETTING_NAME "," NM_SETTING_TEAM_SETTING_NAME \ + "," NM_SETTING_TEAM_PORT_SETTING_NAME "," NM_SETTING_OVS_BRIDGE_SETTING_NAME \ + "," NM_SETTING_OVS_INTERFACE_SETTING_NAME "," NM_SETTING_OVS_PATCH_SETTING_NAME \ + "," NM_SETTING_OVS_PORT_SETTING_NAME "," NM_SETTING_GENERIC_SETTING_NAME \ + "," NM_SETTING_DCB_SETTING_NAME "," NM_SETTING_TUN_SETTING_NAME \ + "," NM_SETTING_IP_TUNNEL_SETTING_NAME "," NM_SETTING_MACSEC_SETTING_NAME \ + "," NM_SETTING_MACVLAN_SETTING_NAME "," NM_SETTING_VXLAN_SETTING_NAME \ + "," NM_SETTING_VRF_SETTING_NAME "," NM_SETTING_WPAN_SETTING_NAME \ + "," NM_SETTING_6LOWPAN_SETTING_NAME "," NM_SETTING_WIREGUARD_SETTING_NAME \ + "," NM_SETTING_LINK_SETTING_NAME "," NM_SETTING_PROXY_SETTING_NAME \ + "," NM_SETTING_TC_CONFIG_SETTING_NAME "," NM_SETTING_SRIOV_SETTING_NAME \ + "," NM_SETTING_ETHTOOL_SETTING_NAME "," NM_SETTING_OVS_DPDK_SETTING_NAME \ + "," NM_SETTING_HOSTNAME_SETTING_NAME "," NM_SETTING_HSR_SETTING_NAME \ + "," NM_SETTING_IPVLAN_SETTING_NAME /* NM_SETTING_DUMMY_SETTING_NAME NM_SETTING_WIMAX_SETTING_NAME */ const NmcMetaGenericInfo *const nmc_fields_con_active_details_groups[] = { @@ -3510,9 +3511,9 @@ do_connection_down(const NMCCommand *cmd, NmCli *nmc, int argc, const char *cons active = found_active_cons->pdata[i]; if (!nm_client_deactivate_connection(nmc->client, active, NULL, &error)) { - nmc_print(_("Connection '%s' deactivation failed: %s\n"), - nm_active_connection_get_id(active), - error->message); + nmc_printerr(_("Connection '%s' deactivation failed: %s\n"), + nm_active_connection_get_id(active), + error->message); g_clear_error(&error); if (info) { @@ -3860,6 +3861,11 @@ check_valid_name_toplevel(const char *val, const char **port_type, GError **erro return NM_SETTING_WIRED_SETTING_NAME; } + if (nm_streq(str, "ovs-port")) + NM_SET_OUT(port_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME); + else if (nm_streq(str, "ovs-interface")) + NM_SET_OUT(port_type, NM_SETTING_OVS_PORT_SETTING_NAME); + setting_info = nm_meta_setting_info_editor_find_by_name(str, TRUE); if (setting_info) return setting_info->general->setting_name; @@ -3999,8 +4005,10 @@ normalized_controller_for_port(const GPtrArray *connections, } if (!out_controller) { - nmc_print(_("Warning: controller='%s' doesn't refer to any existing profile.\n"), - controller); + nmc_printerr( + _("Warning: controller '%s' doesn't refer to any existing profile of type '%s'.\n"), + controller, + type); out_controller = controller; if (out_type) *out_type = type; @@ -4615,8 +4623,11 @@ set_connection_type(NmCli *nmc, gboolean allow_reset, GError **error) { - GError *local = NULL; - const char *port_type = NULL; + NMSettingConnection *s_con = nm_connection_get_setting_connection(con); + GError *local = NULL; + const char *port_type = NULL; + + nm_assert(s_con); value = check_valid_name_toplevel(value, &port_type, &local); if (!value) { @@ -4631,7 +4642,7 @@ set_connection_type(NmCli *nmc, return FALSE; } - if (port_type) { + if (!nm_setting_connection_get_port_type(s_con) && port_type) { if (!set_property(nmc->client, con, NM_SETTING_CONNECTION_SETTING_NAME, @@ -5228,19 +5239,140 @@ get_value(const char **value, return TRUE; } +static int +_copy_connection_properties(const char ***dst, + const char *const *src, + gboolean invert_match, + const char *const *options_list_match) +{ + const char *option; + gboolean match; + int count = 0; + + while (*src) { + option = (**src == '+' || **src == '-') ? *src + 1 : *src; + match = _nm_g_strv_contains(options_list_match, option); + match = invert_match ? !match : match; + if (match) { + *((*dst)++) = src[0]; + *((*dst)++) = src[1]; + count += 2; + } + src++; + if (*src) /* Might be the NULL termination, already */ + src++; + } + + return count; +} + +static gboolean +is_ip_setting_for_port_connection(NMConnection *connection, + const char *setting_name, + const char *property_name, + const char *value, + gboolean *out_is_method_disabled) +{ + NMSettingConnection *s_con; + + *out_is_method_disabled = FALSE; + + if (!NM_IN_STRSET(setting_name, + NM_SETTING_IP4_CONFIG_SETTING_NAME, + NM_SETTING_IP6_CONFIG_SETTING_NAME)) + return FALSE; + + s_con = nm_connection_get_setting_connection(connection); + if (!s_con) + return FALSE; + + if (!nm_setting_connection_get_controller(s_con)) + return FALSE; + + if (nm_streq(property_name, NM_SETTING_IP_CONFIG_METHOD)) { + if (nm_streq(setting_name, NM_SETTING_IP4_CONFIG_SETTING_NAME)) { + if (nm_streq(value, NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) + *out_is_method_disabled = TRUE; + } else { + /* IPv6 */ + if (NM_IN_STRSET(value, + NM_SETTING_IP6_CONFIG_METHOD_DISABLED, + NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) + *out_is_method_disabled = TRUE; + } + } + + return TRUE; +} + gboolean -nmc_process_connection_properties(NmCli *nmc, - NMConnection *connection, - int *argc, - const char *const **argv, - gboolean allow_setting_removal, - GError **error) +nmc_process_connection_properties(NmCli *nmc, + NMConnection *connection, + int argc, + const char *const *argv, + gboolean allow_setting_removal, + GError **error) { + gs_free const char **to_free = NULL; + + if (argc == 0) + return TRUE; + /* First check if we have a port-type, as this would mean we will not * have ip properties but possibly others, port-type specific. + * Then check connection.type and connection.controller, as port-type might + * be deduced from them. + * Don't reorder if we are doing CLI argument completion, as it might give + * unexpected results */ + if (!nmc->complete) { + const char **dst; + + dst = to_free = g_new(const char *, argc + 1); + + argc = _copy_connection_properties( + &dst, + argv, + FALSE, + NM_MAKE_STRV(NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_PORT_TYPE, + "port-type", /* alias */ + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_SLAVE_TYPE, + "slave-type" /* alias */)); + argc += _copy_connection_properties(&dst, + argv, + FALSE, + NM_MAKE_STRV(NM_SETTING_CONNECTION_SETTING_NAME + "." NM_SETTING_CONNECTION_TYPE, + "type" /* alias */)); + argc += _copy_connection_properties( + &dst, + argv, + FALSE, + NM_MAKE_STRV(NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_CONTROLLER, + "controller", /* alias */ + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_MASTER, + "master" /* alias */)); + argc += _copy_connection_properties( + &dst, + argv, + TRUE, + NM_MAKE_STRV(NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_PORT_TYPE, + "port-type", + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_SLAVE_TYPE, + "slave-type", + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_TYPE, + "type", + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_CONTROLLER, + "controller", + NM_SETTING_CONNECTION_SETTING_NAME "." NM_SETTING_CONNECTION_MASTER, + "master")); + + *dst = NULL; /* NULL terminated as expected by get_value() */ + argv = to_free; + } + /* Go through arguments and set properties */ - do { + while (argc) { const NMMetaSettingValidPartItem *const *type_settings; const NMMetaSettingValidPartItem *const *port_settings; NMMetaAccessorModifier modifier; @@ -5259,19 +5391,10 @@ nmc_process_connection_properties(NmCli *nmc, ensure_settings(connection, port_settings); ensure_settings(connection, type_settings); - if (*argc <= 0) { - g_set_error_literal(error, - NMCLI_ERROR, - NMC_RESULT_ERROR_USER_INPUT, - _("Error: <setting>.<property> argument is missing.")); - return FALSE; - } - nm_assert(argv); nm_assert(*argv); - nm_assert(**argv); - option_orig = **argv; + option_orig = *argv; switch (option_orig[0]) { case '+': @@ -5293,15 +5416,15 @@ nmc_process_connection_properties(NmCli *nmc, NMSetting *ss; const char *setting_name; - (*argc)--; - (*argv)++; + argc--; + argv++; - if (*argc == 1 && nmc->complete) { + if (argc == 1 && nmc->complete) { complete_existing_setting(nmc, connection, value); - return TRUE; + break; } - if (!*argc) { + if (!argc) { g_set_error_literal(error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT, @@ -5309,9 +5432,9 @@ nmc_process_connection_properties(NmCli *nmc, return FALSE; } - setting_name = **argv; - (*argc)--; - (*argv)++; + setting_name = *argv; + argc--; + argv++; ss = is_setting_valid(connection, type_settings, port_settings, setting_name); if (!ss) { @@ -5341,30 +5464,64 @@ nmc_process_connection_properties(NmCli *nmc, /* This seems like a <setting>.<property> (such as "connection.id" or "bond.mode"), * optionally prefixed with "+| or "-". */ - if (*argc == 1 && nmc->complete) + if (argc == 1 && nmc->complete) complete_property_name(nmc, connection, modifier, option_sett, option_prop); + argc--; + argv++; + if (!get_value(&value, &argc, &argv, option_orig, error)) + return FALSE; + option_sett_expanded = check_valid_name(option_sett, type_settings, port_settings, &local); if (!option_sett_expanded) { - g_set_error(error, - NMCLI_ERROR, - NMC_RESULT_ERROR_USER_INPUT, - _("Error: invalid or not allowed setting '%s': %s."), - option_sett, - local->message); - g_clear_error(&local); - return FALSE; + gboolean raise_error = TRUE; + gboolean is_method_disabled = FALSE; + + /* The setting does not exist or is now allowed for the given + * connection type or for the given port type. In the past nmcli + * accepted IP-config properties for port connections under some + * circumstances. For backward bug compatibility, still allow + * the user to set the IP method to disabled/ignore for ports, + * so that we don't break user scripts. + * */ + if (is_ip_setting_for_port_connection(connection, + option_sett, + option_prop, + value, + &is_method_disabled)) { + if (is_method_disabled) { + /* Allowed */ + option_sett_expanded = option_sett; + raise_error = FALSE; + g_clear_error(&local); + } else { + /* The property is not a disabled/ignore IP method. Raise a + * meaningful error, instead of the generic "setting X is not + * among LIST" */ + g_clear_error(&local); + g_set_error(&local, + NMCLI_ERROR, + NMC_RESULT_ERROR_USER_INPUT, + _("port connections cannot have IP configuration")); + raise_error = TRUE; + } + } + if (raise_error) { + g_set_error(error, + NMCLI_ERROR, + NMC_RESULT_ERROR_USER_INPUT, + _("Error: invalid or not allowed setting '%s': %s."), + option_sett, + local->message); + g_clear_error(&local); + return FALSE; + } } - (*argc)--; - (*argv)++; - if (!get_value(&value, argc, argv, option_orig, error)) - return FALSE; - - if (!*argc && nmc->complete) { + if (!argc && nmc->complete) { complete_property(nmc, option_sett, option_prop, value ?: "", connection); - return TRUE; + break; } if (!set_property(nmc->client, @@ -5446,7 +5603,7 @@ nmc_process_connection_properties(NmCli *nmc, } if (!chosen) { - if (*argc == 1 && nmc->complete) { + if (argc == 1 && nmc->complete) { if (allow_setting_removal && g_str_has_prefix("remove", option)) nmc_print("remove\n"); complete_property_name(nmc, connection, modifier, option, NULL); @@ -5459,21 +5616,20 @@ nmc_process_connection_properties(NmCli *nmc, return FALSE; } - if (*argc == 1 && nmc->complete) + if (argc == 1 && nmc->complete) complete_property_name(nmc, connection, modifier, option, NULL); - (*argc)--; - (*argv)++; - if (!get_value(&value, argc, argv, option_orig, error)) + argc--; + argv++; + if (!get_value(&value, &argc, &argv, option_orig, error)) return FALSE; - if (!*argc && nmc->complete) + if (!argc && nmc->complete) complete_option(nmc, chosen, value ?: "", connection); if (!set_option(nmc, connection, chosen, value, TRUE, error)) return FALSE; - - } while (*argc); + } return TRUE; } @@ -5910,6 +6066,7 @@ nmc_add_connection(NmCli *nmc, NMConnection *connection, gboolean temporary) static void do_connection_add(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const *argv) { + gs_unref_ptrarray GPtrArray *props = NULL; gs_unref_object NMConnection *connection = NULL; NMSettingConnection *s_con; gs_free_error GError *error = NULL; @@ -5928,16 +6085,21 @@ do_connection_add(const NMCCommand *cmd, NmCli *nmc, int argc, const char *const s_con = (NMSettingConnection *) nm_setting_connection_new(); nm_connection_add_setting(connection, NM_SETTING(s_con)); -read_properties: - g_clear_error(&error); - /* Get the arguments from the command line if any */ - if (argc && !nmc_process_connection_properties(nmc, connection, &argc, &argv, FALSE, &error)) { - if (nm_streq0(*argv, "--") && !seen_dash_dash) { + props = g_ptr_array_new_full(sizeof(const char *) * (argc + 1), NULL); + + while (argc) { + if (nm_streq0(*argv, "--")) { /* This is for compatibility with older nmcli that required * options and properties to be separated with "--" */ - seen_dash_dash = TRUE; - next_arg(nmc, &argc, &argv, NULL); - goto read_properties; + if (seen_dash_dash) { + g_string_printf(nmc->return_text, + _("Error: argument '--' can only be passed once")); + nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; + goto finish; + } else { + seen_dash_dash = TRUE; + next_arg(nmc, &argc, &argv, NULL); + } } else if (nm_streq0(*argv, "save")) { /* It would be better if "save" was a separate argument and not * mixed with properties, but there's not much we can do about it now. */ @@ -5950,16 +6112,31 @@ read_properties: nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto finish; } - g_clear_error(&error); if (!nmc_string_to_bool(*argv, &save_bool, &error)) { g_string_printf(nmc->return_text, _("Error: 'save': %s."), error->message); nmc->return_value = NMC_RESULT_ERROR_USER_INPUT; goto finish; } next_arg(nmc, &argc, &argv, NULL); - goto read_properties; + } else { + g_ptr_array_add(props, (gpointer) *argv); + argc--; + argv++; + if (argc > 0) { + g_ptr_array_add(props, (gpointer) *argv); + argc--; + argv++; + } } + } + g_ptr_array_add(props, NULL); /* Must be NULL terminated */ + if (!nmc_process_connection_properties(nmc, + connection, + props->len - 1, + (const char *const *) props->pdata, + FALSE, + &error)) { g_string_assign(nmc->return_text, error->message); nmc->return_value = error->code; goto finish; @@ -6073,7 +6250,7 @@ finish: /* Functions for readline TAB completion in editor */ #if HAVE_EDITLINE_READLINE -#define uuid_display_hook ((void (*)(void)) NULL) +#define uuid_display_hook ((void (*)(char **, int, int)) NULL) #else static void uuid_display_hook(char **array, int len, int max_len) @@ -6944,7 +7121,7 @@ load_history_cmds(const char *uuid) kf = g_key_file_new(); if (!g_key_file_load_from_file(kf, filename, G_KEY_FILE_KEEP_COMMENTS, &err)) { if (g_error_matches(err, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE)) - nmc_print("Warning: %s parse error: %s\n", filename, err->message); + nmc_printerr("Warning: %s parse error: %s\n", filename, err->message); g_key_file_free(kf); g_free(filename); return; @@ -6983,7 +7160,7 @@ save_history_cmds(const char *uuid) if (!g_key_file_load_from_file(kf, filename, G_KEY_FILE_KEEP_COMMENTS, &error)) { if (!g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT) && !g_error_matches(error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND)) { - nmc_print("Warning: %s parse error: %s\n", filename, error->message); + nmc_printerr("Warning: %s parse error: %s\n", filename, error->message); return; } g_clear_error(&error); @@ -7256,7 +7433,7 @@ editor_main_help(const char *command) "is not saved, the user is asked to confirm the action.\n")); break; default: - nmc_print(_("Unknown command: '%s'\n"), command); + nmc_printerr(_("Unknown command: '%s'\n"), command); break; } } @@ -7393,7 +7570,7 @@ editor_sub_usage(const char *command) "is not saved, the user is asked to confirm the action.\n")); break; default: - nmc_print(_("Unknown command: '%s'\n"), command); + nmc_printerr(_("Unknown command: '%s'\n"), command); break; } } @@ -7477,7 +7654,7 @@ progress_activation_editor_cb(gpointer user_data) } else if (ac_state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED || dev_state == NM_DEVICE_STATE_FAILED) { nmc_terminal_erase_line(); - nmc_print(_("Error: Connection activation failed.\n")); + nmc_printerr(_("Error: Connection activation failed.\n")); goto finish; } @@ -7704,9 +7881,9 @@ property_edit_submenu(NmCli *nmc, prop_val_user, &tmp_err); if (!set_result) { - nmc_print(_("Error: failed to set '%s' property: %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to set '%s' property: %s\n"), + prop_name, + tmp_err->message); g_clear_error(&tmp_err); } break; @@ -7723,9 +7900,9 @@ property_edit_submenu(NmCli *nmc, NM_META_ACCESSOR_MODIFIER_SET, prop_val_user, &tmp_err)) { - nmc_print(_("Error: failed to set '%s' property: %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to set '%s' property: %s\n"), + prop_name, + tmp_err->message); g_clear_error(&tmp_err); } break; @@ -7738,7 +7915,7 @@ property_edit_submenu(NmCli *nmc, : NM_META_ACCESSOR_MODIFIER_SET), cmd_property_arg, &tmp_err)) { - nmc_print(_("Error: %s\n"), tmp_err->message); + nmc_printerr(_("Error: %s\n"), tmp_err->message); g_clear_error(&tmp_err); } break; @@ -7757,7 +7934,7 @@ property_edit_submenu(NmCli *nmc, || matches(cmd_property_arg, "all")) editor_show_connection(connection, nmc); else - nmc_print(_("Unknown command argument: '%s'\n"), cmd_property_arg); + nmc_printerr(_("Unknown command argument: '%s'\n"), cmd_property_arg); } else { gs_free char *prop_val = NULL; @@ -7785,7 +7962,7 @@ property_edit_submenu(NmCli *nmc, case NMC_EDITOR_SUB_CMD_UNKNOWN: default: - nmc_print(_("Unknown command: '%s'\n"), cmd_property_user); + nmc_printerr(_("Unknown command: '%s'\n"), cmd_property_user); break; } } @@ -7863,7 +8040,7 @@ ask_check_setting(const NmcConfig *nmc_config, valid_settings_main, valid_settings_port, &err))) { - nmc_print(_("Error: invalid setting name; %s\n"), err->message); + nmc_printerr(_("Error: invalid setting name; %s\n"), err->message); g_clear_error(&err); } return setting_name; @@ -7888,7 +8065,7 @@ ask_check_property(const NmcConfig *nmc_config, prop_name = nmc_string_is_valid(prop_name_user, valid_props, &tmp_err); if (!prop_name) - nmc_print(_("Error: property %s\n"), tmp_err->message); + nmc_printerr(_("Error: property %s\n"), tmp_err->message); return prop_name; } @@ -8098,15 +8275,15 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty NM_META_ACCESSOR_MODIFIER_ADD, prop_val_user, &tmp_err)) { - nmc_print(_("Error: failed to set '%s' property: %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to set '%s' property: %s\n"), + prop_name, + tmp_err->message); g_clear_error(&tmp_err); } } else { - nmc_print(_("Error: no setting selected; valid are [%s]\n"), - valid_settings_str); - nmc_print(_("use 'goto <setting>' first, or 'set <setting>.<property>'\n")); + nmc_printerr(_("Error: no setting selected; valid are [%s]\n"), + valid_settings_str); + nmc_printerr(_("use 'goto <setting>' first, or 'set <setting>.<property>'\n")); } } else { gs_free char *prop_name = NULL; @@ -8126,9 +8303,10 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty valid_settings_port); ss = ss_created; if (!ss) { - nmc_print(_("Error: invalid setting argument '%s'; valid are [%s]\n"), - cmd_arg_s, - valid_settings_str); + nmc_printerr( + _("Error: invalid setting argument '%s'; valid are [%s]\n"), + cmd_arg_s, + valid_settings_str); break; } } @@ -8136,14 +8314,14 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty if (menu_ctx.curr_setting) ss = menu_ctx.curr_setting; else { - nmc_print(_("Error: missing setting for '%s' property\n"), cmd_arg_p); + nmc_printerr(_("Error: missing setting for '%s' property\n"), cmd_arg_p); break; } } prop_name = is_property_valid(ss, cmd_arg_p, &tmp_err); if (!prop_name) { - nmc_print(_("Error: invalid property: %s\n"), tmp_err->message); + nmc_printerr(_("Error: invalid property: %s\n"), tmp_err->message); g_clear_error(&tmp_err); break; } @@ -8173,9 +8351,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty : NM_META_ACCESSOR_MODIFIER_SET, cmd_arg_v, &tmp_err)) { - nmc_print(_("Error: failed to set '%s' property: %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to set '%s' property: %s\n"), + prop_name, + tmp_err->message); g_clear_error(&tmp_err); } @@ -8206,7 +8384,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty setting_info = nm_meta_setting_info_editor_find_by_name(setting_name, FALSE); if (!setting_info) { - nmc_print(_("Error: unknown setting '%s'\n"), setting_name); + nmc_printerr(_("Error: unknown setting '%s'\n"), setting_name); break; } @@ -8278,13 +8456,14 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty NM_META_ACCESSOR_MODIFIER_SET, NULL, &tmp_err)) { - nmc_print(_("Error: failed to remove value of '%s': %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to remove value of '%s': %s\n"), + prop_name, + tmp_err->message); g_clear_error(&tmp_err); } } else - nmc_print(_("Error: no argument given; valid are [%s]\n"), valid_settings_str); + nmc_printerr(_("Error: no argument given; valid are [%s]\n"), + valid_settings_str); } else { NMSetting *ss = NULL; gboolean descr_all; @@ -8306,9 +8485,10 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty nmc_print(_("Setting '%s' is not present in the connection.\n"), user_s); } else { - nmc_print(_("Error: invalid setting argument '%s'; valid are [%s]\n"), - user_s, - valid_settings_str); + nmc_printerr( + _("Error: invalid setting argument '%s'; valid are [%s]\n"), + user_s, + valid_settings_str); } break; } @@ -8340,9 +8520,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty : NM_META_ACCESSOR_MODIFIER_SET, cmd_arg_v ? cmd_arg_v : NULL, &tmp_err)) { - nmc_print(_("Error: failed to remove value of '%s': %s\n"), - prop_name, - tmp_err->message); + nmc_printerr(_("Error: failed to remove value of '%s': %s\n"), + prop_name, + tmp_err->message); } } else { NMSetting *s_tmp; @@ -8366,8 +8546,8 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty nmc_tab_completion.setting = NULL; /* for TAB completion */ } } else { - nmc_print(_("Error: %s properties, nor it is a setting name.\n"), - tmp_err->message); + nmc_printerr(_("Error: %s properties, nor it is a setting name.\n"), + tmp_err->message); } } } @@ -8390,9 +8570,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty /* Show property description */ print_property_description(menu_ctx.curr_setting, prop_name); } else { - nmc_print(_("Error: no setting selected; valid are [%s]\n"), - valid_settings_str); - nmc_print( + nmc_printerr(_("Error: no setting selected; valid are [%s]\n"), + valid_settings_str); + nmc_printerr( _("use 'goto <setting>' first, or 'describe <setting>.<property>'\n")); } } else { @@ -8414,9 +8594,10 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty valid_settings_main, valid_settings_port); if (!ss) { - nmc_print(_("Error: invalid setting argument '%s'; valid are [%s]\n"), - user_s, - valid_settings_str); + nmc_printerr( + _("Error: invalid setting argument '%s'; valid are [%s]\n"), + user_s, + valid_settings_str); break; } ss_free = ss; @@ -8425,9 +8606,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty ss = menu_ctx.curr_setting; if (!ss) { - nmc_print(_("Error: no setting selected; valid are [%s]\n"), - valid_settings_str); - nmc_print( + nmc_printerr(_("Error: no setting selected; valid are [%s]\n"), + valid_settings_str); + nmc_printerr( _("use 'goto <setting>' first, or 'describe <setting>.<property>'\n")); } else if (descr_all) { /* Show description for all properties */ @@ -8451,9 +8632,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty if (s_tmp) print_setting_description(s_tmp); else { - nmc_print(_("Error: invalid property: %s, " - "neither a valid setting name.\n"), - tmp_err->message); + nmc_printerr(_("Error: invalid property: %s, " + "neither a valid setting name.\n"), + tmp_err->message); } } } @@ -8481,13 +8662,13 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty valid_settings_port, NULL); if (!s_name) { - nmc_print(_("Error: unknown setting: '%s'\n"), user_s); + nmc_printerr(_("Error: unknown setting: '%s'\n"), user_s); break; } ss = nm_connection_get_setting_by_name(connection, s_name); if (!ss) { - nmc_print(_("Error: '%s' setting not present in the connection\n"), - s_name); + nmc_printerr(_("Error: '%s' setting not present in the connection\n"), + s_name); break; } } else @@ -8518,9 +8699,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty /* Print the whole setting */ editor_show_setting(s_tmp, nmc); } else - nmc_print(_("Error: invalid property: %s%s\n"), - err->message, - cmd_arg_s ? "" : _(", neither a valid setting name")); + nmc_printerr(_("Error: invalid property: %s%s\n"), + err->message, + cmd_arg_s ? "" : _(", neither a valid setting name")); g_clear_error(&err); } } @@ -8536,7 +8717,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty case NMC_EDITOR_MAIN_CMD_VERIFY: /* Verify current setting or the whole connection */ if (cmd_arg && !nm_streq(cmd_arg, "all") && !nm_streq(cmd_arg, "fix")) { - nmc_print(_("Invalid verify option: %s\n"), cmd_arg); + nmc_printerr(_("Invalid verify option: %s\n"), cmd_arg); break; } @@ -8544,9 +8725,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty gs_free_error GError *tmp_err = NULL; nm_setting_verify(menu_ctx.curr_setting, NULL, &tmp_err); - nmc_print(_("Verify setting '%s': %s\n"), - nm_setting_get_name(menu_ctx.curr_setting), - tmp_err ? tmp_err->message : "OK"); + nmc_printerr(_("Verify setting '%s': %s\n"), + nm_setting_get_name(menu_ctx.curr_setting), + tmp_err ? tmp_err->message : "OK"); } else { gs_free_error GError *tmp_err = NULL; gboolean fixed = TRUE; @@ -8559,9 +8740,15 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty g_clear_error(&tmp_err); fixed = nm_connection_normalize(connection, NULL, &modified, &tmp_err); } - nmc_print(_("Verify connection: %s\n"), tmp_err ? tmp_err->message : "OK"); + + if (tmp_err) { + nmc_printerr(_("Verify connection: %s\n"), tmp_err->message); + } else { + nmc_print(_("Verify connection: %s\n"), "OK"); + } + if (!fixed) - nmc_print(_("The error cannot be fixed automatically.\n")); + nmc_printerr(_("The error cannot be fixed automatically.\n")); } break; @@ -8581,7 +8768,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty else if (matches(cmd_arg, "persistent")) temporary = FALSE; else { - nmc_print(_("Error: invalid argument '%s'\n"), cmd_arg); + nmc_printerr(_("Error: invalid argument '%s'\n"), cmd_arg); break; } } @@ -8638,20 +8825,20 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty g_source_destroy(source); if (nmc_editor_error) { - nmc_print(_("Error: Failed to save '%s' (%s) connection: %s\n"), - nm_connection_get_id(connection), - nm_connection_get_uuid(connection), - nmc_editor_error->message); + nmc_printerr(_("Error: Failed to save '%s' (%s) connection: %s\n"), + nm_connection_get_id(connection), + nm_connection_get_uuid(connection), + nmc_editor_error->message); g_error_free(nmc_editor_error); } else if (timeout) { - nmc_print(_("Error: Timeout saving '%s' (%s) connection\n"), - nm_connection_get_id(connection), - nm_connection_get_uuid(connection)); + nmc_printerr(_("Error: Timeout saving '%s' (%s) connection\n"), + nm_connection_get_id(connection), + nm_connection_get_uuid(connection)); } else { - nmc_print(!rem_con ? _("Connection '%s' (%s) successfully saved.\n") - : _("Connection '%s' (%s) successfully updated.\n"), - nm_connection_get_id(connection), - nm_connection_get_uuid(connection)); + nmc_printerr(!rem_con ? _("Connection '%s' (%s) successfully saved.\n") + : _("Connection '%s' (%s) successfully updated.\n"), + nm_connection_get_id(connection), + nm_connection_get_uuid(connection)); con_tmp = nm_client_get_connection_by_uuid(nmc->client, nm_connection_get_uuid(connection)); @@ -8683,9 +8870,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty nmc_editor_cb_called = FALSE; nmc_editor_error = NULL; } else { - nmc_print(_("Error: connection verification failed: %s\n"), - err1 ? err1->message : _("(unknown error)")); - nmc_print(_("You may try running 'verify fix' to fix errors.\n")); + nmc_printerr(_("Error: connection verification failed: %s\n"), + err1 ? err1->message : _("(unknown error)")); + nmc_printerr(_("You may try running 'verify fix' to fix errors.\n")); } g_clear_error(&err1); @@ -8708,11 +8895,11 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty if (is_connection_dirty(connection, rem_con)) { /* TRANSLATORS: do not translate 'save', leave it as it is */ - nmc_print(_("Error: connection is not saved. Type 'save' first.\n")); + nmc_printerr(_("Error: connection is not saved. Type 'save' first.\n")); break; } if (!nm_connection_verify(NM_CONNECTION(rem_con), &tmp_err)) { - nmc_print(_("Error: connection is not valid: %s\n"), tmp_err->message); + nmc_printerr(_("Error: connection is not valid: %s\n"), tmp_err->message); g_clear_error(&tmp_err); break; } @@ -8728,7 +8915,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty NULL, activate_connection_editor_cb, &tmp_err)) { - nmc_print(_("Error: Cannot activate connection: %s.\n"), tmp_err->message); + nmc_printerr(_("Error: Cannot activate connection: %s.\n"), tmp_err->message); g_clear_error(&tmp_err); break; } @@ -8737,10 +8924,10 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty g_main_context_iteration(NULL, TRUE); if (nmc_editor_error) { - nmc_print(_("Error: Failed to activate '%s' (%s) connection: %s\n"), - nm_connection_get_id(connection), - nm_connection_get_uuid(connection), - nmc_editor_error->message); + nmc_printerr(_("Error: Failed to activate '%s' (%s) connection: %s\n"), + nm_connection_get_id(connection), + nm_connection_get_uuid(connection), + nmc_editor_error->message); g_error_free(nmc_editor_error); } else { nmc_readline(&nmc->nmc_config, @@ -8779,7 +8966,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty GError *tmp_err = NULL; gboolean bb; if (!nmc_string_to_bool(cmd_arg_v ? g_strstrip(cmd_arg_v) : "", &bb, &tmp_err)) { - nmc_print(_("Error: status-line: %s\n"), tmp_err->message); + nmc_printerr(_("Error: status-line: %s\n"), tmp_err->message); g_clear_error(&tmp_err); } else nmc->editor_status_line = bb; @@ -8787,7 +8974,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty GError *tmp_err = NULL; gboolean bb; if (!nmc_string_to_bool(cmd_arg_v ? g_strstrip(cmd_arg_v) : "", &bb, &tmp_err)) { - nmc_print(_("Error: save-confirmation: %s\n"), tmp_err->message); + nmc_printerr(_("Error: save-confirmation: %s\n"), tmp_err->message); g_clear_error(&tmp_err); } else nmc->editor_save_confirmation = bb; @@ -8795,7 +8982,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty GError *tmp_err = NULL; gboolean bb; if (!nmc_string_to_bool(cmd_arg_v ? g_strstrip(cmd_arg_v) : "", &bb, &tmp_err)) { - nmc_print(_("Error: show-secrets: %s\n"), tmp_err->message); + nmc_printerr(_("Error: show-secrets: %s\n"), tmp_err->message); g_clear_error(&tmp_err); } else nmc->nmc_config_mutable.show_secrets = bb; @@ -8811,9 +8998,9 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty nmc->editor_save_confirmation ? "yes" : "no", nmc->nmc_config.show_secrets ? "yes" : "no"); } else - nmc_print(_("Invalid configuration option '%s'; allowed [%s]\n"), - cmd_arg_v ?: "", - "status-line, save-confirmation, show-secrets"); + nmc_printerr(_("Invalid configuration option '%s'; allowed [%s]\n"), + cmd_arg_v ?: "", + "status-line, save-confirmation, show-secrets"); break; @@ -8827,7 +9014,7 @@ editor_menu_main(NmCli *nmc, NMConnection *connection, const char *connection_ty case NMC_EDITOR_MAIN_CMD_UNKNOWN: default: - nmc_print(_("Unknown command: '%s'\n"), cmd_user); + nmc_printerr(_("Unknown command: '%s'\n"), cmd_user); break; } } @@ -9075,10 +9262,11 @@ do_connection_edit(const NMCCommand *cmd, NmCli *nmc, int argc, const char *cons connection_type = nm_setting_connection_get_connection_type(s_con); if (type) - nmc_print(_("Warning: editing existing connection '%s'; 'type' argument is ignored\n"), - nm_connection_get_id(connection)); + nmc_printerr( + _("Warning: editing existing connection '%s'; 'type' argument is ignored\n"), + nm_connection_get_id(connection)); if (con_name) - nmc_print( + nmc_printerr( _("Warning: editing existing connection '%s'; 'con-name' argument is ignored\n"), nm_connection_get_id(connection)); @@ -9106,9 +9294,9 @@ do_connection_edit(const NMCCommand *cmd, NmCli *nmc, int argc, const char *cons gs_free char *type_ask = NULL; if (!type) - nmc_print(_("Valid connection types: %s\n"), tmp_str); + nmc_printerr(_("Valid connection types: %s\n"), tmp_str); else - nmc_print(_("Error: invalid connection type; %s\n"), err1->message); + nmc_printerr(_("Error: invalid connection type; %s\n"), err1->message); g_clear_error(&err1); type_ask = nmc_readline(&nmc->nmc_config, EDITOR_PROMPT_CON_TYPE); @@ -9239,7 +9427,7 @@ do_connection_modify(const NMCCommand *cmd, NmCli *nmc, int argc, const char *co /* Don't insist on having argument if we're running in offline mode. */ if (!nmc->nmc_config.offline || argc > 0) { - if (!nmc_process_connection_properties(nmc, connection, &argc, &argv, TRUE, &error)) { + if (!nmc_process_connection_properties(nmc, connection, argc, argv, TRUE, &error)) { g_string_assign(nmc->return_text, error->message); nmc->return_value = error->code; return; diff --git a/src/nmcli/connections.h b/src/nmcli/connections.h index 48c98170..a343ca25 100644 --- a/src/nmcli/connections.h +++ b/src/nmcli/connections.h @@ -12,12 +12,12 @@ void nmc_monitor_connections(NmCli *nmc); const char *nmc_connection_check_deprecated(NMConnection *c); -gboolean nmc_process_connection_properties(NmCli *nmc, - NMConnection *connection, - int *argc, - const char *const **argv, - gboolean allow_remove_setting, - GError **error); +gboolean nmc_process_connection_properties(NmCli *nmc, + NMConnection *connection, + int argc, + const char *const *args, + gboolean allow_remove_setting, + GError **error); NMMetaColor nmc_active_connection_state_to_color(NMActiveConnection *ac); diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c index b308e440..9a018113 100644 --- a/src/nmcli/devices.c +++ b/src/nmcli/devices.c @@ -2596,7 +2596,7 @@ modify_get_applied_cb(GObject *object, GAsyncResult *result, gpointer user_data) argc = info->argc; argv = (const char *const *) info->argv; - if (!nmc_process_connection_properties(info->nmc, connection, &argc, &argv, TRUE, &error)) { + if (!nmc_process_connection_properties(info->nmc, connection, argc, argv, TRUE, &error)) { g_string_assign(nmc->return_text, error->message); nmc->return_value = error->code; quit(); diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in index 77e6c427..67b14d4c 100644 --- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in +++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in @@ -53,7 +53,7 @@ format="MAC address" special-values="preserve, permanent, random, stable, stable-ssid" /> <property name="generate-mac-address-mask" - nmcli-description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." + nmcli-description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows one to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." format="string" /> <property name="mac-address-blacklist" nmcli-description="A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55")." @@ -362,7 +362,7 @@ format="MAC address" special-values="preserve, permanent, random, stable" /> <property name="generate-mac-address-mask" - nmcli-description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." + nmcli-description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows one to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." format="string" /> <property name="mac-address-blacklist" nmcli-description="If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55)." @@ -623,7 +623,7 @@ nmcli-description="The connection.uuid is the real identifier of a profile. It cannot change and it must be unique. It is therefore often best to refer to a profile by UUID, for example with `nmcli connection up uuid $UUID`. The UUID cannot be changed, except in offline mode. In that case, the special values "new", "generate" and "" are allowed to generate a new random UUID." format="string" /> <property name="stable-id" - nmcli-description="This represents the identity of the connection used for various purposes. It allows to configure multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity. The '$' character is treated special to perform dynamic substitutions at activation time. Currently, supported are "${CONNECTION}", "${DEVICE}", "${MAC}", "${NETWORK_SSID}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The "${CONNECTION}" uses the profile's connection.uuid, the "${DEVICE}" uses the interface name of the device and "${MAC}" the permanent MAC address of the device. "${NETWORK_SSID}" uses the SSID for Wi-Fi networks and falls back to "${CONNECTION}" on other networks. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is "default${CONNECTION}" go generate an ID unique per connection profile." + nmcli-description="This represents the identity of the connection used for various purposes. It allows configuring multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used to derive the DHCP client identifier with ipv4.dhcp-client-id=stable, the DHCPv6 DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid] and the DHCP IAID with ipv4.iaid=stable and ipv6.iaid=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret_key. See NetworkManager(8) manual about the secret-key and the host identity. The '$' character is treated special to perform dynamic substitutions at activation time. Currently, supported are "${CONNECTION}", "${DEVICE}", "${MAC}", "${NETWORK_SSID}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-device, per-SSID, per-boot, or every time. The "${CONNECTION}" uses the profile's connection.uuid, the "${DEVICE}" uses the interface name of the device and "${MAC}" the permanent MAC address of the device. "${NETWORK_SSID}" uses the SSID for Wi-Fi networks and falls back to "${CONNECTION}" on other networks. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is "default${CONNECTION}" go generate an ID unique per connection profile." format="string" /> <property name="type" alias="type" @@ -1402,6 +1402,10 @@ nmcli-description="If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the dhcp-hostname property is NULL and this property is TRUE, the current persistent hostname of the computer is sent. The default value is default (-1). In this case the global value from NetworkManager configuration is looked up. If it's not set, the value from dhcp-send-hostname-deprecated, which defaults to TRUE, is used for backwards compatibility. In the future this will change and, in absence of a global default, it will always fallback to TRUE." format="choice (NMTernary)" values="default (-1), false/no (0), true/yes (1)" /> + <property name="forwarding" + nmcli-description="Whether to configure sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the packet from one interface to another. When set to "default" (-1), the value from global configuration is used; if no global default is defined, "auto" (2) will be used. The "forwarding" property is ignored when "method" is set to "shared", because forwarding is always enabled in this case. The accepted values are: "default" (-1): use global default. "no" (0): disabled. "yes" (1): enabled. "auto" (2): enable if any shared connection is active, use kernel default otherwise." + format="choice (NMSettingIPConfigForwarding)" + values="default (-1), no (0), yes (1), auto (2)" /> <property name="dhcp-hostname" nmcli-description="If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time." format="string" /> @@ -1759,6 +1763,10 @@ nmcli-description="The tx queue size (number of tx descriptors) for DPDK ports. Must be zero or a power of 2 between 1 and 4096, and supported by the hardware. Defaults to zero which means to leave the parameter in OVS unspecified and effectively configures 2048 descriptors." format="integer" values="0 - 4096" /> + <property name="lsc-interrupt" + nmcli-description="Configures the Link State Change (LSC) detection mode for the OVS DPDK interface. When set to "ignore" (-1), NetworkManager doesn't change the default value configured by Open vSwitch. "enabled" (1) enables interrupts. "disabled" (0) disables interrupts, thus setting the interface in poll mode." + format="choice (NMSettingOvsDpdkLscInterrupt)" + values="ignore (-1), disabled (0), enabled (1)" /> </setting> <setting name="ovs-external-ids" > </setting> @@ -1904,6 +1912,12 @@ format="flags (NMSettingSecretFlags)" values="none (0x0), agent-owned (0x1), not-saved (0x2), not-required (0x4)" /> </setting> + <setting name="prefix-delegation" > + <property name="subnet-id" + nmcli-description="The subnet ID to use on the interface from the prefix delegation received via an upstream interface. Set to a value between 0 and 0xffffffff (2^32 - 1) to indicate a specific subnet ID; or set to -1 to automatically choose an available subnet ID." + format="integer" + values="-1 - 4294967295" /> + </setting> <setting name="proxy" > <property name="method" alias="method" @@ -1970,6 +1984,10 @@ nmcli-description="Select the eswitch encapsulation support. Currently it's only supported for PCI PF devices, and only if the eswitch device is managed from the same PCI address than the PF. If set to "preserve" (-1) (default) the eswitch encap-mode won't be modified by NetworkManager." format="choice (NMSriovEswitchEncapMode)" values="preserve (-1), none (0), basic (1)" /> + <property name="preserve-on-down" + nmcli-description="This controls whether NetworkManager preserves the SR-IOV parameters set on the device when the connection is deactivated, or whether it resets them to their default value. The SR-IOV parameters are those specified in this setting (the "sriov" setting), like the number of VFs to create, the eswitch configuration, etc. If set to "no" (0), NetworkManager resets the SR-IOV parameters when the connection is deactivated. When set to "yes" (1), NetworkManager preserves those parameters on the device. If the value is "default" (-1), NetworkManager looks up a global default value in the configuration; in case no such value is defined, it uses "no" (0) as fallback." + format="choice (NMSriovPreserveOnDown)" + values="default (-1), no (0), yes (1)" /> </setting> <setting name="tc" > <property name="qdiscs" diff --git a/src/nmcli/general.c b/src/nmcli/general.c index c6c266a2..2e9aad44 100644 --- a/src/nmcli/general.c +++ b/src/nmcli/general.c @@ -933,7 +933,7 @@ do_general_hostname(const NMCCommand *cmd, NmCli *nmc, int argc, const char *con hostname = *argv; if (next_arg(nmc, &argc, &argv, NULL) == 0) - nmc_print("Warning: ignoring extra garbage after '%s' hostname\n", hostname); + nmc_printerr("Warning: ignoring extra garbage after '%s' hostname\n", hostname); nmc->should_wait++; nm_client_save_hostname_async(nmc->client, hostname, NULL, save_hostname_cb, nmc); diff --git a/src/nmcli/nmcli-completion b/src/nmcli/nmcli-completion index f2de7b67..0c9b5156 100644 --- a/src/nmcli/nmcli-completion +++ b/src/nmcli/nmcli-completion @@ -49,7 +49,10 @@ _nmcli() cur='' fi - output="$(nmcli --complete-args "${words[@]}" 2>/dev/null)" + # If the user set an alias like `nmcli=nmcli --some-arguments`, then --complete-args + # might give unexpected behaviours. Use `command` to ensure that aliases are ignored + # and the nmcli binary is used directly. + output="$(command nmcli --complete-args "${words[@]}" 2>/dev/null)" # Bail out early if we're completing a file name if [ $? = 65 ]; then diff --git a/src/nmcli/settings.c b/src/nmcli/settings.c index 85f4ad83..458b03e5 100644 --- a/src/nmcli/settings.c +++ b/src/nmcli/settings.c @@ -246,10 +246,11 @@ wireless_band_channel_changed_cb(GObject *object, GParamSpec *pspec, gpointer us mode = nm_setting_wireless_get_mode(NM_SETTING_WIRELESS(object)); if (!mode || !*mode || strcmp(mode, NM_SETTING_WIRELESS_MODE_INFRA) == 0) { - nmc_print(_("Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"), - nm_setting_get_name(NM_SETTING(s_wireless)), - g_param_spec_get_name(pspec), - value); + nmc_printerr( + _("Warning: %s.%s set to '%s', but it might be ignored in infrastructure mode\n"), + nm_setting_get_name(NM_SETTING(s_wireless)), + g_param_spec_get_name(pspec), + value); } } @@ -266,9 +267,9 @@ connection_controller_changed_cb(GObject *object, GParamSpec *pspec, gpointer us s_ipv4 = nm_connection_get_setting_by_name(connection, NM_SETTING_IP4_CONFIG_SETTING_NAME); s_ipv6 = nm_connection_get_setting_by_name(connection, NM_SETTING_IP6_CONFIG_SETTING_NAME); if (s_ipv4 || s_ipv6) { - nmc_print(_("Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"), - nm_setting_get_name(NM_SETTING(s_con)), - g_param_spec_get_name(pspec)); + nmc_printerr(_("Warning: setting %s.%s requires removing ipv4 and ipv6 settings\n"), + nm_setting_get_name(NM_SETTING(s_con)), + g_param_spec_get_name(pspec)); tmp_str = nmc_get_user_input(_("Do you want to remove them? [yes] ")); if (!tmp_str || matches(tmp_str, "yes")) { if (s_ipv4) @@ -376,8 +377,8 @@ _set_fcn_precheck_connection_secondaries(NMClient *client, if (nm_utils_is_uuid(*iter)) { con = nmc_find_connection(connections, "uuid", *iter, NULL, FALSE); if (!con) { - nmc_print(_("Warning: %s is not an UUID of any existing connection profile\n"), - *iter); + nmc_printerr(_("Warning: %s is not an UUID of any existing connection profile\n"), + *iter); } else { /* Currently, NM only supports VPN connections as secondaries */ if (!nm_connection_is_type(con, NM_SETTING_VPN_SETTING_NAME)) { @@ -434,13 +435,13 @@ _env_warn_fcn_handle( switch (warn_level) { case NM_META_ENV_WARN_LEVEL_WARN: - nmc_print(_("Warning: %s\n"), m); + nmc_printerr(_("Warning: %s\n"), m); return; case NM_META_ENV_WARN_LEVEL_INFO: nmc_print(_("Info: %s\n"), m); return; } - nmc_print(_("Error: %s\n"), m); + nmc_printerr(_("Error: %s\n"), m); } static NMDevice *const * diff --git a/src/nmtui/meson.build b/src/nmtui/meson.build index eecfaa99..40bb40b9 100644 --- a/src/nmtui/meson.build +++ b/src/nmtui/meson.build @@ -28,6 +28,7 @@ executable( 'nmt-page-ip4.c', 'nmt-page-ip6.c', 'nmt-page-ip-tunnel.c', + 'nmt-page-loopback.c', 'nmt-page-macsec.c', 'nmt-page-ppp.c', 'nmt-page-team.c', diff --git a/src/nmtui/nm-editor-utils.c b/src/nmtui/nm-editor-utils.c index 73fad6d1..7997a8ce 100644 --- a/src/nmtui/nm-editor-utils.c +++ b/src/nmtui/nm-editor-utils.c @@ -156,6 +156,14 @@ nm_editor_utils_get_connection_type_list(void) item->id_format = _("Veth connection %d"); g_ptr_array_add(array, item); + item = g_new0(NMEditorConnectionTypeDataReal, 1); + item->data.name = _("Loopback"); + item->data.setting_type = NM_TYPE_SETTING_LOOPBACK; + item->data.device_type = NM_TYPE_DEVICE_LOOPBACK; + item->data.virtual = TRUE; + item->id_format = _("Loopback connection %d"); + g_ptr_array_add(array, item); + item = g_new0(NMEditorConnectionTypeDataReal, 1); item->data.name = _("Wi-Fi"); item->data.setting_type = NM_TYPE_SETTING_WIRELESS; diff --git a/src/nmtui/nmt-connect-connection-list.c b/src/nmtui/nmt-connect-connection-list.c index 1fd44b29..8e7dc807 100644 --- a/src/nmtui/nmt-connect-connection-list.c +++ b/src/nmtui/nmt-connect-connection-list.c @@ -95,6 +95,7 @@ static const char *device_sort_order[] = {"NMDeviceEthernet", "NMDeviceVeth", "NMDeviceInfiniband", "NMDeviceWifi", + "NMDeviceLoopback", NM_SETTING_VLAN_SETTING_NAME, NM_SETTING_VETH_SETTING_NAME, NM_SETTING_BOND_SETTING_NAME, diff --git a/src/nmtui/nmt-editor.c b/src/nmtui/nmt-editor.c index 6205736a..474d08c2 100644 --- a/src/nmtui/nmt-editor.c +++ b/src/nmtui/nmt-editor.c @@ -35,6 +35,7 @@ #include "nmt-page-ip-tunnel.h" #include "nmt-page-ip4.h" #include "nmt-page-ip6.h" +#include "nmt-page-loopback.h" #include "nmt-page-macsec.h" #include "nmt-page-ppp.h" #include "nmt-page-team.h" @@ -299,13 +300,13 @@ add_sections_for_page(NmtEditor *editor, NmtEditorGrid *grid, NmtEditorPage *pag static void nmt_editor_constructed(GObject *object) { - NmtEditor *editor = NMT_EDITOR(object); - NmtEditorPrivate *priv = NMT_EDITOR_GET_PRIVATE(editor); + NmtEditor *editor = NMT_EDITOR(object); + NmtEditorPrivate *priv = NMT_EDITOR_GET_PRIVATE(editor); + NmtDeviceEntry *deventry = NULL; NMSettingConnection *s_con; NmtNewtWidget *vbox, *widget, *buttons; NmtEditorGrid *grid; const char *deventry_label; - NmtDeviceEntry *deventry; GType hardware_type; const char *port_type; NmtEditorPage *page; @@ -337,22 +338,26 @@ nmt_editor_constructed(GObject *object) else hardware_type = priv->type_data->device_type; - /* For connections involving multiple network devices, clarify which one - * NMSettingConnection:interface-name refers to. - */ - if (nm_connection_is_type(priv->edit_connection, NM_SETTING_PPPOE_SETTING_NAME)) - deventry_label = _("Ethernet device"); - else - deventry_label = _("Device"); - - widget = nmt_device_entry_new(deventry_label, 40, hardware_type); - nmt_editor_grid_append(grid, NULL, widget, NULL); - deventry = NMT_DEVICE_ENTRY(widget); - g_object_bind_property(s_con, - NM_SETTING_CONNECTION_INTERFACE_NAME, - deventry, - "interface-name", - G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + if (nm_connection_is_type(priv->edit_connection, NM_SETTING_LOOPBACK_SETTING_NAME)) { + g_object_set(s_con, NM_SETTING_CONNECTION_INTERFACE_NAME, "lo", NULL); + } else { + /* For connections involving multiple network devices, clarify which one + * NMSettingConnection:interface-name refers to. + */ + if (nm_connection_is_type(priv->edit_connection, NM_SETTING_PPPOE_SETTING_NAME)) + deventry_label = _("Ethernet device"); + else + deventry_label = _("Device"); + + widget = nmt_device_entry_new(deventry_label, 40, hardware_type); + nmt_editor_grid_append(grid, NULL, widget, NULL); + deventry = NMT_DEVICE_ENTRY(widget); + g_object_bind_property(s_con, + NM_SETTING_CONNECTION_INTERFACE_NAME, + deventry, + "interface-name", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + } nmt_editor_grid_append(grid, NULL, nmt_newt_separator_new(), NULL); @@ -376,6 +381,8 @@ nmt_editor_constructed(GObject *object) page = nmt_page_vlan_new(priv->edit_connection, deventry); else if (nm_connection_is_type(priv->edit_connection, NM_SETTING_WIRED_SETTING_NAME)) page = nmt_page_ethernet_new(priv->edit_connection, deventry); + else if (nm_connection_is_type(priv->edit_connection, NM_SETTING_LOOPBACK_SETTING_NAME)) + page = nmt_page_loopback_new(priv->edit_connection); else if (nm_connection_is_type(priv->edit_connection, NM_SETTING_WIRELESS_SETTING_NAME)) page = nmt_page_wifi_new(priv->edit_connection, deventry); else if (nm_connection_is_type(priv->edit_connection, NM_SETTING_IP_TUNNEL_SETTING_NAME)) diff --git a/src/nmtui/nmt-page-loopback.c b/src/nmtui/nmt-page-loopback.c new file mode 100644 index 00000000..e0800168 --- /dev/null +++ b/src/nmtui/nmt-page-loopback.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2025 Red Hat, Inc. + */ +/** + * SECTION:nmt-page-loopback + * @short_description: The editor page for the loopback interface + */ + +#include "libnm-client-aux-extern/nm-default-client.h" + +#include <linux/if_ether.h> + +#include "nmt-page-loopback.h" + +#include "libnm-core-aux-intern/nm-libnm-core-utils.h" +#include "nmt-mtu-entry.h" + +G_DEFINE_TYPE(NmtPageLoopback, nmt_page_loopback, NMT_TYPE_EDITOR_PAGE_DEVICE) + +#define NMT_PAGE_LOOPBACK_GET_PRIVATE(o) \ + _NM_GET_PRIVATE(self, NmtPageLoopback, NMT_IS_PAGE_LOOPBACK) + +static void +nmt_page_loopback_init(NmtPageLoopback *loopback) +{} + +NmtEditorPage * +nmt_page_loopback_new(NMConnection *conn) +{ + return g_object_new(NMT_TYPE_PAGE_LOOPBACK, "connection", conn, NULL); +} + +static void +nmt_page_loopback_constructed(GObject *object) +{ + NmtPageLoopback *loopback = NMT_PAGE_LOOPBACK(object); + NmtEditorSection *section; + NmtEditorGrid *grid; + NMSettingLoopback *s_loopback; + NmtNewtWidget *widget; + NMConnection *conn; + + conn = nmt_editor_page_get_connection(NMT_EDITOR_PAGE(loopback)); + s_loopback = _nm_connection_ensure_setting(conn, NM_TYPE_SETTING_LOOPBACK); + + section = nmt_editor_section_new(_("LOOPBACK"), NULL, FALSE); + grid = nmt_editor_section_get_body(section); + + widget = nmt_mtu_entry_new(); + g_object_bind_property(s_loopback, + NM_SETTING_LOOPBACK_MTU, + widget, + "mtu", + G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + nmt_editor_grid_append(grid, _("MTU"), widget, NULL); + + nmt_editor_page_add_section(NMT_EDITOR_PAGE(loopback), section); + + G_OBJECT_CLASS(nmt_page_loopback_parent_class)->constructed(object); +} + +static void +nmt_page_loopback_class_init(NmtPageLoopbackClass *loopback_class) +{ + GObjectClass *object_class = G_OBJECT_CLASS(loopback_class); + object_class->constructed = nmt_page_loopback_constructed; +} diff --git a/src/nmtui/nmt-page-loopback.h b/src/nmtui/nmt-page-loopback.h new file mode 100644 index 00000000..12c38ef8 --- /dev/null +++ b/src/nmtui/nmt-page-loopback.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2025 Red Hat, Inc. + */ + +#ifndef NMT_PAGE_LOOPBACK_H +#define NMT_PAGE_LOOPBACK_H + +#include "nmt-editor-page-device.h" + +#define NMT_TYPE_PAGE_LOOPBACK (nmt_page_loopback_get_type()) +#define NMT_PAGE_LOOPBACK(obj) \ + (_NM_G_TYPE_CHECK_INSTANCE_CAST((obj), NMT_TYPE_PAGE_LOOPBACK, NmtPageLoopback)) +#define NMT_PAGE_LOOPBACK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NMT_TYPE_PAGE_LOOPBACK, NmtPageLoopbackClass)) +#define NMT_IS_PAGE_LOOPBACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NMT_TYPE_PAGE_LOOPBACK)) +#define NMT_IS_PAGE_LOOPBACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NMT_TYPE_PAGE_LOOPBACK)) +#define NMT_PAGE_LOOPBACK_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NMT_TYPE_PAGE_LOOPBACK, NmtPageLoopbackClass)) + +typedef struct { + NmtEditorPageDevice parent; +} NmtPageLoopback; + +typedef struct { + NmtEditorPageDeviceClass parent; +} NmtPageLoopbackClass; + +GType nmt_page_loopback_get_type(void); + +NmtEditorPage *nmt_page_loopback_new(NMConnection *conn); + +#endif /* NMT_PAGE_LOOPBACK_H */ diff --git a/src/tests/check-potfile-list.py b/src/tests/check-potfile-list.py new file mode 100755 index 00000000..b89743ed --- /dev/null +++ b/src/tests/check-potfile-list.py @@ -0,0 +1,137 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2025 Red Hat, Inc. + +from pathlib import Path +import subprocess +import itertools +import shutil +import sys +import os + +xgettext = shutil.which("xgettext") + +# Paths relative to repo root which should be +# excluded from pot->tree, or tree->pot checks. +ignore_in_potfiles = () +ignore_in_tree = () + + +def err(s): + print(f"ERR: {s}", file=sys.stderr) + + +def read_potfile_list(root, path): + with open(root / path, "r") as f: + for line in f.readlines(): + stripped = line.strip() + if stripped.startswith("#") or len(stripped) == 0: + continue + if stripped in ignore_in_potfiles: + continue + yield (root / stripped).resolve() + + +def get_existing_entries(root): + in_list = read_potfile_list(root, "po/POTFILES.in") + skip_list = read_potfile_list(root, "po/POTFILES.skip") + return set(itertools.chain(in_list, skip_list)) + + +def check_exists_in_tree(root, paths): + is_ok = True + + for path in paths: + if not path.exists(): + err( + f"{path.relative_to(root)} exists in POTFILES.in or POTFILES.skip, but missing in sources" + ) + is_ok = False + + return is_ok + + +def get_gettext_args(root): + arg_name = "XGETTEXT_OPTIONS =" + with open(root / "po" / "Makevars", "r") as f: + for line in f.readlines(): + if line.startswith(arg_name): + return line[len(arg_name) :].strip().split(" ") + + raise Exception("could not get gettext args") + + +def list_c_sources(root): + for path, _, files in os.walk(root / "src"): + for file in files: + relpath_str = str(Path(path).relative_to(root) / file) + extension = file.replace(".in", "").split(".").pop() + if extension in ["c", "h"] and relpath_str not in ignore_in_tree: + full_path = root / path / file + yield full_path.resolve() + + +def gettext_dry_run(root, paths): + args = get_gettext_args(root) + process = subprocess.Popen( + [xgettext, "--files-from=-", "--output=-"] + args, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + text=True, + ) + + for line in paths: + process.stdin.write(f"{line.resolve()}\n") + process.stdin.close() + + seen = set() + for line in process.stdout: + if line.startswith("#: "): + out_path = Path(line.replace("#: ", "").split(":")[0]) + if out_path not in seen: + seen.add(out_path) + yield out_path + + process.stdout.close() + assert process.wait() == 0 + + +def check_exists_in_potfiles(root, pot_paths): + unseen_paths = filter(lambda path: path not in pot_paths, list_c_sources(root)) + + is_ok = True + for path in gettext_dry_run(root, unseen_paths): + err( + f"{path.relative_to(root)} code contains gettext macros, but missing in POTFILES.in or POTFILES.skip" + ) + is_ok = False + + return is_ok + + +def check_potfiles(): + root = (Path(os.path.dirname(__file__)) / "../../").resolve() + file_entries = get_existing_entries(root) + is_ok = True + + # Let's first check that all the files that we + # have in POTFILES.* actually exist. + is_ok &= check_exists_in_tree(root, file_entries) + + # Now the other direction -- check that all sources + # that should be included in POTFILES, are included. + is_ok &= check_exists_in_potfiles(root, file_entries) + + return is_ok + + +if __name__ == "__main__": + if xgettext is None: + raise Exception("xgettext is missing") + + out_msg = "POTFILES consistency check: %s" + if check_potfiles(): + print(out_msg % "ok") + else: + print(out_msg % "failed", file=sys.stderr) + sys.exit(1) diff --git a/src/tests/client/test-client.check-on-disk/test_003.expected b/src/tests/client/test-client.check-on-disk/test_003.expected index 7094583f..40959fed 100644 --- a/src/tests/client/test-client.check-on-disk/test_003.expected +++ b/src/tests/client/test-client.check-on-disk/test_003.expected @@ -182,12 +182,12 @@ id path uuid <<< -size: 6526 +size: 6579 location: src/tests/client/test-client.py:test_003()/14 cmd: $NMCLI con s con-gsm1 lang: C returncode: 0 -stdout: 6393 bytes +stdout: 6446 bytes >>> connection.id: con-gsm1 connection.uuid: UUID-con-gsm1-REPLACED-REPLACED-REPL @@ -244,6 +244,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -329,12 +330,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 6569 +size: 6622 location: src/tests/client/test-client.py:test_003()/15 cmd: $NMCLI con s con-gsm1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6426 bytes +stdout: 6479 bytes >>> connection.id: con-gsm1 connection.uuid: UUID-con-gsm1-REPLACED-REPLACED-REPL @@ -391,6 +392,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -476,42 +478,42 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 581 +size: 584 location: src/tests/client/test-client.py:test_003()/16 cmd: $NMCLI -g all con s con-gsm1 lang: C returncode: 0 -stdout: 442 bytes +stdout: 445 bytes >>> connection:con-gsm1:UUID-con-gsm1-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no proxy:none:no:: <<< -size: 591 +size: 594 location: src/tests/client/test-client.py:test_003()/17 cmd: $NMCLI -g all con s con-gsm1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 442 bytes +stdout: 445 bytes >>> connection:con-gsm1:UUID-con-gsm1-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0:xyz.con-gsm1::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no proxy:none:no:: <<< -size: 6514 +size: 6567 location: src/tests/client/test-client.py:test_003()/18 cmd: $NMCLI con s con-gsm2 lang: C returncode: 0 -stdout: 6381 bytes +stdout: 6434 bytes >>> connection.id: con-gsm2 connection.uuid: UUID-con-gsm2-REPLACED-REPLACED-REPL @@ -568,6 +570,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -653,12 +656,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 6557 +size: 6610 location: src/tests/client/test-client.py:test_003()/19 cmd: $NMCLI con s con-gsm2 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6414 bytes +stdout: 6467 bytes >>> connection.id: con-gsm2 connection.uuid: UUID-con-gsm2-REPLACED-REPLACED-REPL @@ -715,6 +718,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -800,42 +804,42 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 569 +size: 572 location: src/tests/client/test-client.py:test_003()/20 cmd: $NMCLI -g all con s con-gsm2 lang: C returncode: 0 -stdout: 430 bytes +stdout: 433 bytes >>> connection:con-gsm2:UUID-con-gsm2-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0:::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no proxy:none:no:: <<< -size: 579 +size: 582 location: src/tests/client/test-client.py:test_003()/21 cmd: $NMCLI -g all con s con-gsm2 lang: pl_PL.UTF-8 returncode: 0 -stdout: 430 bytes +stdout: 433 bytes >>> connection:con-gsm2:UUID-con-gsm2-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0:::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no proxy:none:no:: <<< -size: 6514 +size: 6567 location: src/tests/client/test-client.py:test_003()/22 cmd: $NMCLI con s con-gsm3 lang: C returncode: 0 -stdout: 6381 bytes +stdout: 6434 bytes >>> connection.id: con-gsm3 connection.uuid: UUID-con-gsm3-REPLACED-REPLACED-REPL @@ -892,6 +896,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -977,12 +982,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 6557 +size: 6610 location: src/tests/client/test-client.py:test_003()/23 cmd: $NMCLI con s con-gsm3 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6414 bytes +stdout: 6467 bytes >>> connection.id: con-gsm3 connection.uuid: UUID-con-gsm3-REPLACED-REPLACED-REPL @@ -1039,6 +1044,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1124,30 +1130,30 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 570 +size: 573 location: src/tests/client/test-client.py:test_003()/24 cmd: $NMCLI -g all con s con-gsm3 lang: C returncode: 0 -stdout: 431 bytes +stdout: 434 bytes >>> connection:con-gsm3:UUID-con-gsm3-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no proxy:none:no:: <<< -size: 580 +size: 583 location: src/tests/client/test-client.py:test_003()/25 cmd: $NMCLI -g all con s con-gsm3 lang: pl_PL.UTF-8 returncode: 0 -stdout: 431 bytes +stdout: 434 bytes >>> connection:con-gsm3:UUID-con-gsm3-REPLACED-REPLACED-REPL::gsm::no:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::: :0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: serial:5:8:even:1:100 gsm:no:::<hidden>:0: ::<hidden>:0:no::::auto:no:::<hidden>:0:yes:no:no:no:no:no @@ -1294,12 +1300,12 @@ UUID NAME UUID-ethernet-REPLACED-REPLACED-REPL ethernet <<< -size: 5866 +size: 5919 location: src/tests/client/test-client.py:test_003()/37 cmd: $NMCLI -f ALL con s ethernet lang: C returncode: 0 -stdout: 5726 bytes +stdout: 5779 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -1371,6 +1377,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1426,12 +1433,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5901 +size: 5954 location: src/tests/client/test-client.py:test_003()/38 cmd: $NMCLI -f ALL con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 5751 bytes +stdout: 5804 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -1503,6 +1510,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1578,12 +1586,12 @@ stdout: 51 bytes GENERAL.STATE: aktywowano <<< -size: 6568 +size: 6621 location: src/tests/client/test-client.py:test_003()/41 cmd: $NMCLI con s ethernet lang: C returncode: 0 -stdout: 6435 bytes +stdout: 6488 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -1655,6 +1663,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1723,12 +1732,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6607 +size: 6660 location: src/tests/client/test-client.py:test_003()/42 cmd: $NMCLI con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 6464 bytes +stdout: 6517 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -1800,6 +1809,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -2354,12 +2364,12 @@ UUID NAME UUID-ethernet-REPLACED-REPLACED-REPL ethernet <<< -size: 5866 +size: 5919 location: src/tests/client/test-client.py:test_003()/62 cmd: $NMCLI -f ALL con s ethernet lang: C returncode: 0 -stdout: 5726 bytes +stdout: 5779 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -2431,6 +2441,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -2486,12 +2497,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5901 +size: 5954 location: src/tests/client/test-client.py:test_003()/63 cmd: $NMCLI -f ALL con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 5751 bytes +stdout: 5804 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -2563,6 +2574,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -2642,12 +2654,12 @@ GENERAL.STATE: aktywowano GENERAL.STATE: aktywowano <<< -size: 7278 +size: 7331 location: src/tests/client/test-client.py:test_003()/66 cmd: $NMCLI con s ethernet lang: C returncode: 0 -stdout: 7145 bytes +stdout: 7198 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -2719,6 +2731,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -2801,12 +2814,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 7321 +size: 7374 location: src/tests/client/test-client.py:test_003()/67 cmd: $NMCLI con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7178 bytes +stdout: 7231 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -2878,6 +2891,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -3468,12 +3482,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 7281 +size: 7334 location: src/tests/client/test-client.py:test_003()/84 cmd: $NMCLI con s ethernet lang: C returncode: 0 -stdout: 7148 bytes +stdout: 7201 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -3545,6 +3559,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -3627,12 +3642,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 7325 +size: 7378 location: src/tests/client/test-client.py:test_003()/85 cmd: $NMCLI con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7182 bytes +stdout: 7235 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -3704,6 +3719,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -3786,12 +3802,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6611 +size: 6664 location: src/tests/client/test-client.py:test_003()/86 cmd: $NMCLI c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6438 bytes +stdout: 6491 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -3863,6 +3879,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -3931,12 +3948,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6651 +size: 6704 location: src/tests/client/test-client.py:test_003()/87 cmd: $NMCLI c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6468 bytes +stdout: 6521 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -4008,6 +4025,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4286,12 +4304,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 7293 +size: 7346 location: src/tests/client/test-client.py:test_003()/94 cmd: $NMCLI --color yes con s ethernet lang: C returncode: 0 -stdout: 7148 bytes +stdout: 7201 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -4363,6 +4381,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4445,12 +4464,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 7337 +size: 7390 location: src/tests/client/test-client.py:test_003()/95 cmd: $NMCLI --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7182 bytes +stdout: 7235 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -4522,6 +4541,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4604,12 +4624,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6623 +size: 6676 location: src/tests/client/test-client.py:test_003()/96 cmd: $NMCLI --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6438 bytes +stdout: 6491 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -4681,6 +4701,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4749,12 +4770,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6663 +size: 6716 location: src/tests/client/test-client.py:test_003()/97 cmd: $NMCLI --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6468 bytes +stdout: 6521 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -4826,6 +4847,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5120,12 +5142,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 8534 +size: 8587 location: src/tests/client/test-client.py:test_003()/104 cmd: $NMCLI --pretty con s ethernet lang: C returncode: 0 -stdout: 8391 bytes +stdout: 8444 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -5202,6 +5224,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5295,12 +5318,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 8599 +size: 8652 location: src/tests/client/test-client.py:test_003()/105 cmd: $NMCLI --pretty con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 8446 bytes +stdout: 8499 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -5377,6 +5400,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5470,12 +5494,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7552 +size: 7605 location: src/tests/client/test-client.py:test_003()/106 cmd: $NMCLI --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 7369 bytes +stdout: 7422 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -5552,6 +5576,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5627,12 +5652,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7605 +size: 7658 location: src/tests/client/test-client.py:test_003()/107 cmd: $NMCLI --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7412 bytes +stdout: 7465 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -5709,6 +5734,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -6034,12 +6060,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 8546 +size: 8599 location: src/tests/client/test-client.py:test_003()/114 cmd: $NMCLI --pretty --color yes con s ethernet lang: C returncode: 0 -stdout: 8391 bytes +stdout: 8444 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -6116,6 +6142,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -6209,12 +6236,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 8611 +size: 8664 location: src/tests/client/test-client.py:test_003()/115 cmd: $NMCLI --pretty --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 8446 bytes +stdout: 8499 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -6291,6 +6318,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -6384,12 +6412,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7564 +size: 7617 location: src/tests/client/test-client.py:test_003()/116 cmd: $NMCLI --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 7369 bytes +stdout: 7422 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -6466,6 +6494,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -6541,12 +6570,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7617 +size: 7670 location: src/tests/client/test-client.py:test_003()/117 cmd: $NMCLI --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7412 bytes +stdout: 7465 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -6623,6 +6652,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -6928,12 +6958,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 3919 +size: 3938 location: src/tests/client/test-client.py:test_003()/124 cmd: $NMCLI --terse con s ethernet lang: C returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7005,6 +7035,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -7087,12 +7118,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3929 +size: 3948 location: src/tests/client/test-client.py:test_003()/125 cmd: $NMCLI --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7164,6 +7195,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -7246,12 +7278,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3569 +size: 3588 location: src/tests/client/test-client.py:test_003()/126 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7323,6 +7355,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -7391,12 +7424,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3579 +size: 3598 location: src/tests/client/test-client.py:test_003()/127 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7468,6 +7501,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -7742,12 +7776,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 3931 +size: 3950 location: src/tests/client/test-client.py:test_003()/134 cmd: $NMCLI --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7819,6 +7853,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -7901,12 +7936,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3941 +size: 3960 location: src/tests/client/test-client.py:test_003()/135 cmd: $NMCLI --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -7978,6 +8013,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -8060,12 +8096,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3581 +size: 3600 location: src/tests/client/test-client.py:test_003()/136 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -8137,6 +8173,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -8205,12 +8242,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3591 +size: 3610 location: src/tests/client/test-client.py:test_003()/137 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -8282,6 +8319,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -8560,12 +8598,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 5027 +size: 5055 location: src/tests/client/test-client.py:test_003()/144 cmd: $NMCLI --mode tabular con s ethernet lang: C returncode: 0 -stdout: 4878 bytes +stdout: 4906 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8573,8 +8611,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -8591,12 +8629,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 5077 +size: 5105 location: src/tests/client/test-client.py:test_003()/145 cmd: $NMCLI --mode tabular con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 4918 bytes +stdout: 4946 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8604,8 +8642,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -8622,12 +8660,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 4565 +size: 4593 location: src/tests/client/test-client.py:test_003()/146 cmd: $NMCLI --mode tabular c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 4376 bytes +stdout: 4404 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8635,8 +8673,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -8649,12 +8687,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4613 +size: 4641 location: src/tests/client/test-client.py:test_003()/147 cmd: $NMCLI --mode tabular c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4414 bytes +stdout: 4442 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8662,8 +8700,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -8812,12 +8850,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 5039 +size: 5067 location: src/tests/client/test-client.py:test_003()/154 cmd: $NMCLI --mode tabular --color yes con s ethernet lang: C returncode: 0 -stdout: 4878 bytes +stdout: 4906 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8825,8 +8863,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -8843,12 +8881,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 5089 +size: 5117 location: src/tests/client/test-client.py:test_003()/155 cmd: $NMCLI --mode tabular --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 4918 bytes +stdout: 4946 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8856,8 +8894,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -8874,12 +8912,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 4577 +size: 4605 location: src/tests/client/test-client.py:test_003()/156 cmd: $NMCLI --mode tabular --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 4376 bytes +stdout: 4404 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8887,8 +8925,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -8901,12 +8939,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 4625 +size: 4653 location: src/tests/client/test-client.py:test_003()/157 cmd: $NMCLI --mode tabular --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4414 bytes +stdout: 4442 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-ethernet -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 @@ -8914,8 +8952,8 @@ connection ethernet UUID-ethernet-REPLACED-REPLACED-REPL -- 802-3-eth name port speed duplex auto-negotiate mac-address cloned-mac-address generate-mac-address-mask mac-address-denylist mtu s390-subchannels s390-nettype s390-options wake-on-lan wake-on-lan-password accept-all-mac-addresses 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -9080,12 +9118,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 8012 +size: 8054 location: src/tests/client/test-client.py:test_003()/164 cmd: $NMCLI --mode tabular --pretty con s ethernet lang: C returncode: 0 -stdout: 7854 bytes +stdout: 7896 bytes >>> ========================================= Connection profile details (ethernet) @@ -9098,9 +9136,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9127,12 +9165,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 8142 +size: 8184 location: src/tests/client/test-client.py:test_003()/165 cmd: $NMCLI --mode tabular --pretty con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7974 bytes +stdout: 8016 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -9145,9 +9183,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9174,12 +9212,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 7094 +size: 7136 location: src/tests/client/test-client.py:test_003()/166 cmd: $NMCLI --mode tabular --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6896 bytes +stdout: 6938 bytes >>> ========================================= Connection profile details (ethernet) @@ -9192,9 +9230,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9213,12 +9251,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 7196 +size: 7238 location: src/tests/client/test-client.py:test_003()/167 cmd: $NMCLI --mode tabular --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6988 bytes +stdout: 7030 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -9231,9 +9269,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9428,12 +9466,12 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL gsm UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet <<< -size: 8024 +size: 8066 location: src/tests/client/test-client.py:test_003()/174 cmd: $NMCLI --mode tabular --pretty --color yes con s ethernet lang: C returncode: 0 -stdout: 7854 bytes +stdout: 7896 bytes >>> ========================================= Connection profile details (ethernet) @@ -9446,9 +9484,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9475,12 +9513,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 8154 +size: 8196 location: src/tests/client/test-client.py:test_003()/175 cmd: $NMCLI --mode tabular --pretty --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7974 bytes +stdout: 8016 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -9493,9 +9531,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9522,12 +9560,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deza <<< -size: 7106 +size: 7148 location: src/tests/client/test-client.py:test_003()/176 cmd: $NMCLI --mode tabular --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6896 bytes +stdout: 6938 bytes >>> ========================================= Connection profile details (ethernet) @@ -9540,9 +9578,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9561,12 +9599,12 @@ GENERAL ethernet UUID-ethernet-REPLACED-REPLACED-REPL eth0 eth0 deac <<< -size: 7208 +size: 7250 location: src/tests/client/test-client.py:test_003()/177 cmd: $NMCLI --mode tabular --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6988 bytes +stdout: 7030 bytes >>> =========================================== Szczegóły profilu połączenia (ethernet) @@ -9579,9 +9617,9 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- -1 (default) -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -9756,16 +9794,16 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 928 +size: 931 location: src/tests/client/test-client.py:test_003()/184 cmd: $NMCLI --mode tabular --terse con s ethernet lang: C returncode: 0 -stdout: 772 bytes +stdout: 775 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -9773,16 +9811,16 @@ GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 938 +size: 941 location: src/tests/client/test-client.py:test_003()/185 cmd: $NMCLI --mode tabular --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 772 bytes +stdout: 775 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -9790,31 +9828,31 @@ GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 776 +size: 779 location: src/tests/client/test-client.py:test_003()/186 cmd: $NMCLI --mode tabular --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 580 bytes +stdout: 583 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 786 +size: 789 location: src/tests/client/test-client.py:test_003()/187 cmd: $NMCLI --mode tabular --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 580 bytes +stdout: 583 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -9918,16 +9956,16 @@ UUID-con-gsm3-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 940 +size: 943 location: src/tests/client/test-client.py:test_003()/194 cmd: $NMCLI --mode tabular --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 772 bytes +stdout: 775 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -9935,16 +9973,16 @@ GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 950 +size: 953 location: src/tests/client/test-client.py:test_003()/195 cmd: $NMCLI --mode tabular --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 772 bytes +stdout: 775 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -9952,31 +9990,31 @@ GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:eth1:activated:no:no: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 788 +size: 791 location: src/tests/client/test-client.py:test_003()/196 cmd: $NMCLI --mode tabular --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 580 bytes +stdout: 583 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: <<< -size: 798 +size: 801 location: src/tests/client/test-client.py:test_003()/197 cmd: $NMCLI --mode tabular --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 580 bytes +stdout: 583 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 802-3-ethernet::0::no:::::auto::::default::-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/6:: @@ -10288,12 +10326,12 @@ UUID: UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE: ethernet <<< -size: 7299 +size: 7352 location: src/tests/client/test-client.py:test_003()/204 cmd: $NMCLI --mode multiline con s ethernet lang: C returncode: 0 -stdout: 7148 bytes +stdout: 7201 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -10365,6 +10403,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -10447,12 +10486,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 7343 +size: 7396 location: src/tests/client/test-client.py:test_003()/205 cmd: $NMCLI --mode multiline con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7182 bytes +stdout: 7235 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -10524,6 +10563,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -10606,12 +10646,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6629 +size: 6682 location: src/tests/client/test-client.py:test_003()/206 cmd: $NMCLI --mode multiline c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6438 bytes +stdout: 6491 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -10683,6 +10723,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -10751,12 +10792,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6669 +size: 6722 location: src/tests/client/test-client.py:test_003()/207 cmd: $NMCLI --mode multiline c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6468 bytes +stdout: 6521 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -10828,6 +10869,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -11310,12 +11352,12 @@ UUID: UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE: ethernet <<< -size: 7311 +size: 7364 location: src/tests/client/test-client.py:test_003()/214 cmd: $NMCLI --mode multiline --color yes con s ethernet lang: C returncode: 0 -stdout: 7148 bytes +stdout: 7201 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -11387,6 +11429,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -11469,12 +11512,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 7355 +size: 7408 location: src/tests/client/test-client.py:test_003()/215 cmd: $NMCLI --mode multiline --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 7182 bytes +stdout: 7235 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -11546,6 +11589,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -11628,12 +11672,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6641 +size: 6694 location: src/tests/client/test-client.py:test_003()/216 cmd: $NMCLI --mode multiline --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 6438 bytes +stdout: 6491 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -11705,6 +11749,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -11773,12 +11818,12 @@ GENERAL.ZONE: -- GENERAL.MASTER-PATH: -- <<< -size: 6681 +size: 6734 location: src/tests/client/test-client.py:test_003()/217 cmd: $NMCLI --mode multiline --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6468 bytes +stdout: 6521 bytes >>> connection.id: ethernet connection.uuid: UUID-ethernet-REPLACED-REPLACED-REPL @@ -11850,6 +11895,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12370,12 +12416,12 @@ TYPE: ethernet ------------------------------------------------------------------------------- <<< -size: 8551 +size: 8604 location: src/tests/client/test-client.py:test_003()/224 cmd: $NMCLI --mode multiline --pretty con s ethernet lang: C returncode: 0 -stdout: 8391 bytes +stdout: 8444 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -12452,6 +12498,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12545,12 +12592,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 8616 +size: 8669 location: src/tests/client/test-client.py:test_003()/225 cmd: $NMCLI --mode multiline --pretty con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 8446 bytes +stdout: 8499 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -12627,6 +12674,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12720,12 +12768,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7569 +size: 7622 location: src/tests/client/test-client.py:test_003()/226 cmd: $NMCLI --mode multiline --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 7369 bytes +stdout: 7422 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -12802,6 +12850,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12877,12 +12926,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7622 +size: 7675 location: src/tests/client/test-client.py:test_003()/227 cmd: $NMCLI --mode multiline --pretty c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7412 bytes +stdout: 7465 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -12959,6 +13008,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -13510,12 +13560,12 @@ TYPE: ethernet ------------------------------------------------------------------------------- <<< -size: 8563 +size: 8616 location: src/tests/client/test-client.py:test_003()/234 cmd: $NMCLI --mode multiline --pretty --color yes con s ethernet lang: C returncode: 0 -stdout: 8391 bytes +stdout: 8444 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -13592,6 +13642,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -13685,12 +13736,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 8628 +size: 8681 location: src/tests/client/test-client.py:test_003()/235 cmd: $NMCLI --mode multiline --pretty --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 8446 bytes +stdout: 8499 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -13767,6 +13818,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -13860,12 +13912,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7581 +size: 7634 location: src/tests/client/test-client.py:test_003()/236 cmd: $NMCLI --mode multiline --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 7369 bytes +stdout: 7422 bytes >>> =============================================================================== Connection profile details (ethernet) @@ -13942,6 +13994,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -14017,12 +14070,12 @@ GENERAL.MASTER-PATH: -- ------------------------------------------------------------------------------- <<< -size: 7634 +size: 7687 location: src/tests/client/test-client.py:test_003()/237 cmd: $NMCLI --mode multiline --pretty --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7412 bytes +stdout: 7465 bytes >>> =============================================================================== Szczegóły profilu połączenia (ethernet) @@ -14099,6 +14152,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -14612,12 +14666,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 3936 +size: 3955 location: src/tests/client/test-client.py:test_003()/244 cmd: $NMCLI --mode multiline --terse con s ethernet lang: C returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14689,6 +14743,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -14771,12 +14826,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3946 +size: 3965 location: src/tests/client/test-client.py:test_003()/245 cmd: $NMCLI --mode multiline --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -14848,6 +14903,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -14930,12 +14986,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3586 +size: 3605 location: src/tests/client/test-client.py:test_003()/246 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15007,6 +15063,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -15075,12 +15132,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3596 +size: 3615 location: src/tests/client/test-client.py:test_003()/247 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15152,6 +15209,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -15634,12 +15692,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 3948 +size: 3967 location: src/tests/client/test-client.py:test_003()/254 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15711,6 +15769,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -15793,12 +15852,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3958 +size: 3977 location: src/tests/client/test-client.py:test_003()/255 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 3777 bytes +stdout: 3796 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -15870,6 +15929,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -15952,12 +16012,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3598 +size: 3617 location: src/tests/client/test-client.py:test_003()/256 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -16029,6 +16089,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16097,12 +16158,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 3608 +size: 3627 location: src/tests/client/test-client.py:test_003()/257 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3387 bytes +stdout: 3406 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -16174,6 +16235,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 diff --git a/src/tests/client/test-client.check-on-disk/test_004.expected b/src/tests/client/test-client.check-on-disk/test_004.expected index c57ea772..09422f10 100644 --- a/src/tests/client/test-client.check-on-disk/test_004.expected +++ b/src/tests/client/test-client.check-on-disk/test_004.expected @@ -58,12 +58,12 @@ location: src/tests/client/test-client.py:test_004()/7 cmd: $NMCLI connection mod con-xx1 ipv4.addresses 192.168.77.5/24 ipv4.routes '2.3.4.5/32 192.168.77.1' ipv6.addresses 1:2:3:4::6/64 ipv6.routes 1:2:3:4:5:6::5/128 lang: C returncode: 0 -size: 6146 +size: 6199 location: src/tests/client/test-client.py:test_004()/8 cmd: $NMCLI con s con-xx1 lang: C returncode: 0 -stdout: 6015 bytes +stdout: 6068 bytes >>> connection.id: con-xx1 connection.uuid: UUID-con-xx1-REPLACED-REPLACED-REPLA @@ -138,6 +138,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -193,12 +194,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 6181 +size: 6234 location: src/tests/client/test-client.py:test_004()/9 cmd: $NMCLI con s con-xx1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6040 bytes +stdout: 6093 bytes >>> connection.id: con-xx1 connection.uuid: UUID-con-xx1-REPLACED-REPLACED-REPLA @@ -273,6 +274,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -364,12 +366,12 @@ con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP vpn -- con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi -- <<< -size: 5522 +size: 5575 location: src/tests/client/test-client.py:test_004()/13 cmd: $NMCLI con s con-vpn-1 lang: C returncode: 0 -stdout: 5388 bytes +stdout: 5441 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -426,6 +428,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -487,12 +490,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5549 +size: 5602 location: src/tests/client/test-client.py:test_004()/14 cmd: $NMCLI con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5405 bytes +stdout: 5458 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -549,6 +552,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -682,12 +686,12 @@ con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi wlan0 con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet -- <<< -size: 6650 +size: 6703 location: src/tests/client/test-client.py:test_004()/21 cmd: $NMCLI con s con-vpn-1 lang: C returncode: 0 -stdout: 6516 bytes +stdout: 6569 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -744,6 +748,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -826,12 +831,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6683 +size: 6736 location: src/tests/client/test-client.py:test_004()/22 cmd: $NMCLI con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6539 bytes +stdout: 6592 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -888,6 +893,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1086,12 +1092,12 @@ con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA wifi 0 never con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 never yes 0 no /org/freedesktop/NetworkManager/Settings/Connection/1 no -- -- -- -- /etc/NetworkManager/system-connections/con-1 <<< -size: 6656 +size: 6709 location: src/tests/client/test-client.py:test_004()/27 cmd: $NMCLI con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1148,6 +1154,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1230,12 +1237,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6693 +size: 6746 location: src/tests/client/test-client.py:test_004()/28 cmd: $NMCLI con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1292,6 +1299,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1374,12 +1382,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6656 +size: 6709 location: src/tests/client/test-client.py:test_004()/29 cmd: $NMCLI con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1436,6 +1444,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1518,12 +1527,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6693 +size: 6746 location: src/tests/client/test-client.py:test_004()/30 cmd: $NMCLI con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1580,6 +1589,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1662,12 +1672,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 5529 +size: 5582 location: src/tests/client/test-client.py:test_004()/31 cmd: $NMCLI -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5388 bytes +stdout: 5441 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1724,6 +1734,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -1785,12 +1796,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5556 +size: 5609 location: src/tests/client/test-client.py:test_004()/32 cmd: $NMCLI -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5405 bytes +stdout: 5458 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -1847,6 +1858,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4518,12 +4530,12 @@ connection.type: 802-11-wireless connection.interface-name: -- <<< -size: 6668 +size: 6721 location: src/tests/client/test-client.py:test_004()/77 cmd: $NMCLI --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -4580,6 +4592,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4662,12 +4675,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6705 +size: 6758 location: src/tests/client/test-client.py:test_004()/78 cmd: $NMCLI --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -4724,6 +4737,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4806,12 +4820,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6668 +size: 6721 location: src/tests/client/test-client.py:test_004()/79 cmd: $NMCLI --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -4868,6 +4882,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -4950,12 +4965,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6705 +size: 6758 location: src/tests/client/test-client.py:test_004()/80 cmd: $NMCLI --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -5012,6 +5027,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5094,12 +5110,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 5541 +size: 5594 location: src/tests/client/test-client.py:test_004()/81 cmd: $NMCLI --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5388 bytes +stdout: 5441 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -5156,6 +5172,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -5217,12 +5234,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5568 +size: 5621 location: src/tests/client/test-client.py:test_004()/82 cmd: $NMCLI --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5405 bytes +stdout: 5458 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -5279,6 +5296,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -7950,12 +7968,12 @@ connection.type: 802-11-wireless connection.interface-name: -- <<< -size: 7677 +size: 7730 location: src/tests/client/test-client.py:test_004()/127 cmd: $NMCLI --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -8016,6 +8034,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -8107,12 +8126,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7727 +size: 7780 location: src/tests/client/test-client.py:test_004()/128 cmd: $NMCLI --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -8173,6 +8192,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -8264,12 +8284,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7677 +size: 7730 location: src/tests/client/test-client.py:test_004()/129 cmd: $NMCLI --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -8330,6 +8350,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -8421,12 +8442,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7727 +size: 7780 location: src/tests/client/test-client.py:test_004()/130 cmd: $NMCLI --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -8487,6 +8508,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -8578,12 +8600,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 6158 +size: 6211 location: src/tests/client/test-client.py:test_004()/131 cmd: $NMCLI --pretty -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 6007 bytes +stdout: 6060 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -8644,6 +8666,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -8709,12 +8732,12 @@ proxy.pac-script: -- ------------------------------------------------------------------------------- <<< -size: 6190 +size: 6243 location: src/tests/client/test-client.py:test_004()/132 cmd: $NMCLI --pretty -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6029 bytes +stdout: 6082 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -8775,6 +8798,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12054,12 +12078,12 @@ connection.interface-name: -- ------------------------------------------------------------------------------- <<< -size: 7689 +size: 7742 location: src/tests/client/test-client.py:test_004()/177 cmd: $NMCLI --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -12120,6 +12144,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12211,12 +12236,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7739 +size: 7792 location: src/tests/client/test-client.py:test_004()/178 cmd: $NMCLI --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -12277,6 +12302,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12368,12 +12394,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7689 +size: 7742 location: src/tests/client/test-client.py:test_004()/179 cmd: $NMCLI --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -12434,6 +12460,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12525,12 +12552,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7739 +size: 7792 location: src/tests/client/test-client.py:test_004()/180 cmd: $NMCLI --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -12591,6 +12618,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12682,12 +12710,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 6170 +size: 6223 location: src/tests/client/test-client.py:test_004()/181 cmd: $NMCLI --pretty --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 6007 bytes +stdout: 6060 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -12748,6 +12776,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -12813,12 +12842,12 @@ proxy.pac-script: -- ------------------------------------------------------------------------------- <<< -size: 6202 +size: 6255 location: src/tests/client/test-client.py:test_004()/182 cmd: $NMCLI --pretty --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6029 bytes +stdout: 6082 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -12879,6 +12908,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -16158,12 +16188,12 @@ connection.interface-name: -- ------------------------------------------------------------------------------- <<< -size: 3409 +size: 3428 location: src/tests/client/test-client.py:test_004()/227 cmd: $NMCLI --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16220,6 +16250,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16302,12 +16333,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3419 +size: 3438 location: src/tests/client/test-client.py:test_004()/228 cmd: $NMCLI --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16364,6 +16395,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16446,12 +16478,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3409 +size: 3428 location: src/tests/client/test-client.py:test_004()/229 cmd: $NMCLI --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16508,6 +16540,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16590,12 +16623,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3419 +size: 3438 location: src/tests/client/test-client.py:test_004()/230 cmd: $NMCLI --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16652,6 +16685,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16734,12 +16768,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2834 +size: 2853 location: src/tests/client/test-client.py:test_004()/231 cmd: $NMCLI --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16796,6 +16830,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -16857,12 +16892,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 2844 +size: 2863 location: src/tests/client/test-client.py:test_004()/232 cmd: $NMCLI --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16919,6 +16954,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -19560,12 +19596,12 @@ connection.type:802-11-wireless connection.interface-name: <<< -size: 3421 +size: 3440 location: src/tests/client/test-client.py:test_004()/277 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -19622,6 +19658,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -19704,12 +19741,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3431 +size: 3450 location: src/tests/client/test-client.py:test_004()/278 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -19766,6 +19803,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -19848,12 +19886,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3421 +size: 3440 location: src/tests/client/test-client.py:test_004()/279 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -19910,6 +19948,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -19992,12 +20031,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3431 +size: 3450 location: src/tests/client/test-client.py:test_004()/280 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -20054,6 +20093,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -20136,12 +20176,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2846 +size: 2865 location: src/tests/client/test-client.py:test_004()/281 cmd: $NMCLI --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -20198,6 +20238,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -20259,12 +20300,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 2856 +size: 2875 location: src/tests/client/test-client.py:test_004()/282 cmd: $NMCLI --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -20321,6 +20362,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -22962,18 +23004,18 @@ connection.type:802-11-wireless connection.interface-name: <<< -size: 4518 +size: 4546 location: src/tests/client/test-client.py:test_004()/327 cmd: $NMCLI --mode tabular con s con-vpn-1 lang: C returncode: 0 -stdout: 4368 bytes +stdout: 4396 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -22991,18 +23033,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4557 +size: 4585 location: src/tests/client/test-client.py:test_004()/328 cmd: $NMCLI --mode tabular con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4397 bytes +stdout: 4425 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -23020,18 +23062,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4518 +size: 4546 location: src/tests/client/test-client.py:test_004()/329 cmd: $NMCLI --mode tabular con s con-vpn-1 lang: C returncode: 0 -stdout: 4368 bytes +stdout: 4396 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -23049,18 +23091,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4557 +size: 4585 location: src/tests/client/test-client.py:test_004()/330 cmd: $NMCLI --mode tabular con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4397 bytes +stdout: 4425 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -23078,18 +23120,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 3766 +size: 3794 location: src/tests/client/test-client.py:test_004()/331 cmd: $NMCLI --mode tabular -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 3609 bytes +stdout: 3637 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -23102,18 +23144,18 @@ proxy none no -- -- <<< -size: 3794 +size: 3822 location: src/tests/client/test-client.py:test_004()/332 cmd: $NMCLI --mode tabular -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3627 bytes +stdout: 3655 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -24616,18 +24658,18 @@ interface-name <<< -size: 4530 +size: 4558 location: src/tests/client/test-client.py:test_004()/377 cmd: $NMCLI --mode tabular --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 4368 bytes +stdout: 4396 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -24645,18 +24687,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4569 +size: 4597 location: src/tests/client/test-client.py:test_004()/378 cmd: $NMCLI --mode tabular --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4397 bytes +stdout: 4425 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -24674,18 +24716,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4530 +size: 4558 location: src/tests/client/test-client.py:test_004()/379 cmd: $NMCLI --mode tabular --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 4368 bytes +stdout: 4396 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -24703,18 +24745,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 4569 +size: 4597 location: src/tests/client/test-client.py:test_004()/380 cmd: $NMCLI --mode tabular --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 4397 bytes +stdout: 4425 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -24732,18 +24774,18 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 3778 +size: 3806 location: src/tests/client/test-client.py:test_004()/381 cmd: $NMCLI --mode tabular --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 3609 bytes +stdout: 3637 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no no yes -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) auto -- -- -- 0 (default) yes -1 (default) -- 0x0 (none) -1 (default) -- @@ -24756,18 +24798,18 @@ proxy none no -- -- <<< -size: 3806 +size: 3834 location: src/tests/client/test-client.py:test_004()/382 cmd: $NMCLI --mode tabular --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3627 bytes +stdout: 3655 bytes >>> name id uuid stable-id type interface-name autoconnect autoconnect-priority autoconnect-retries multi-connect auth-retries timestamp permissions zone controller master slave-type port-type autoconnect-slaves autoconnect-ports down-on-poweroff secondaries gateway-ping-timeout ip-ping-timeout ip-ping-addresses ip-ping-addresses-require-all metered lldp mdns llmnr dns-over-tls mptcp-flags wait-device-timeout wait-activation-delay connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie nie tak -1 (default) -1 (default) 0 (default) 0 (default) default 0 (default) automatyczne -- -- -- 0 (default) tak -1 (default) -- 0x0 (none) -1 (default) -- @@ -26270,12 +26312,12 @@ interface-name <<< -size: 7047 +size: 7089 location: src/tests/client/test-client.py:test_004()/427 cmd: $NMCLI --mode tabular --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 6888 bytes +stdout: 6930 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -26284,9 +26326,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26312,12 +26354,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7133 +size: 7175 location: src/tests/client/test-client.py:test_004()/428 cmd: $NMCLI --mode tabular --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6964 bytes +stdout: 7006 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -26326,9 +26368,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26354,12 +26396,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7047 +size: 7089 location: src/tests/client/test-client.py:test_004()/429 cmd: $NMCLI --mode tabular --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 6888 bytes +stdout: 6930 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -26368,9 +26410,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26396,12 +26438,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7133 +size: 7175 location: src/tests/client/test-client.py:test_004()/430 cmd: $NMCLI --mode tabular --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6964 bytes +stdout: 7006 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -26410,9 +26452,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26438,12 +26480,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 5709 +size: 5751 location: src/tests/client/test-client.py:test_004()/431 cmd: $NMCLI --mode tabular --pretty -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5543 bytes +stdout: 5585 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -26452,9 +26494,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -26470,12 +26512,12 @@ proxy none no -- -- <<< -size: 5756 +size: 5798 location: src/tests/client/test-client.py:test_004()/432 cmd: $NMCLI --mode tabular --pretty -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5580 bytes +stdout: 5622 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -26484,9 +26526,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28578,12 +28620,12 @@ interface-name <<< -size: 7059 +size: 7101 location: src/tests/client/test-client.py:test_004()/477 cmd: $NMCLI --mode tabular --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6888 bytes +stdout: 6930 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -28592,9 +28634,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28620,12 +28662,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7145 +size: 7187 location: src/tests/client/test-client.py:test_004()/478 cmd: $NMCLI --mode tabular --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6964 bytes +stdout: 7006 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -28634,9 +28676,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28662,12 +28704,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7059 +size: 7101 location: src/tests/client/test-client.py:test_004()/479 cmd: $NMCLI --mode tabular --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6888 bytes +stdout: 6930 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -28676,9 +28718,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28704,12 +28746,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 - VPN connected key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 7145 +size: 7187 location: src/tests/client/test-client.py:test_004()/480 cmd: $NMCLI --mode tabular --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6964 bytes +stdout: 7006 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -28718,9 +28760,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28746,12 +28788,12 @@ NAME TYPE USERNAME GATEWAY BANNER VPN-STATE VPN openvpn -- -- *** VPN connection con-vpn-1 *** 5 — Połączono z VPN key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 5721 +size: 5763 location: src/tests/client/test-client.py:test_004()/481 cmd: $NMCLI --mode tabular --pretty --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5543 bytes +stdout: 5585 bytes >>> ========================================== Connection profile details (con-vpn-1) @@ -28760,9 +28802,9 @@ name id uuid stable-id type in -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) unknown default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) no no -- -- -- 0 (default) yes -1 (default) -1 (default) -- -- 0x0 (none) no yes -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -28778,12 +28820,12 @@ proxy none no -- -- <<< -size: 5768 +size: 5810 location: src/tests/client/test-client.py:test_004()/482 cmd: $NMCLI --mode tabular --pretty --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5580 bytes +stdout: 5622 bytes >>> ============================================ Szczegóły profilu połączenia (con-vpn-1) @@ -28792,9 +28834,9 @@ name id uuid stable-id type in --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 -- -- -- -- -- -- -1 (default) -1 (default) -1 (default) -- 0 0 -- -1 (default) nieznane default -1 (default) -1 (default) -1 (default) 0x0 (default) -1 -1 -name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) +name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-iaid dhcp-dscp dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname forwarding dhcp-hostname dhcp-fqdn dhcp-hostname-flags never-default may-fail required-timeout dad-timeout dhcp-vendor-class-identifier dhcp-ipv6-only-preferred link-local dhcp-reject-servers auto-route-ext-gw shared-dhcp-range shared-dhcp-lease-time +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- -1 (default) -1 (default) -1 (default) nie nie -- -- -- 0 (default) tak -1 (default) -1 (default) -- -- 0x0 (none) nie tak -1 (default) -1 (default) -- -1 (default) 0 (default) -- -1 (default) -- 0 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules replace-local-rule dhcp-send-release routed-dns ignore-auto-routes ignore-auto-dns never-default may-fail required-timeout ip6-privacy temp-valid-lifetime temp-preferred-lifetime addr-gen-mode ra-timeout mtu dhcp-pd-hint dhcp-duid dhcp-iaid dhcp-timeout dhcp-send-hostname-deprecated dhcp-send-hostname dhcp-hostname dhcp-hostname-flags auto-route-ext-gw token ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -30886,15 +30928,15 @@ interface-name <<< -size: 883 +size: 886 location: src/tests/client/test-client.py:test_004()/527 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -30902,15 +30944,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 893 +size: 896 location: src/tests/client/test-client.py:test_004()/528 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -30918,15 +30960,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 883 +size: 886 location: src/tests/client/test-client.py:test_004()/529 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -30934,15 +30976,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 893 +size: 896 location: src/tests/client/test-client.py:test_004()/530 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -30950,29 +30992,29 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 590 +size: 593 location: src/tests/client/test-client.py:test_004()/531 cmd: $NMCLI --mode tabular --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 426 bytes +stdout: 429 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: <<< -size: 600 +size: 603 location: src/tests/client/test-client.py:test_004()/532 cmd: $NMCLI --mode tabular --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 426 bytes +stdout: 429 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -31824,15 +31866,15 @@ UUID-con-xx1-REPLACED-REPLACED-REPLA <<< -size: 895 +size: 898 location: src/tests/client/test-client.py:test_004()/577 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -31840,15 +31882,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 905 +size: 908 location: src/tests/client/test-client.py:test_004()/578 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -31856,15 +31898,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 895 +size: 898 location: src/tests/client/test-client.py:test_004()/579 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -31872,15 +31914,15 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 905 +size: 908 location: src/tests/client/test-client.py:test_004()/580 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 726 bytes +stdout: 729 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -31888,29 +31930,29 @@ GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:wlan0:activated:no: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 602 +size: 605 location: src/tests/client/test-client.py:test_004()/581 cmd: $NMCLI --mode tabular --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 426 bytes +stdout: 429 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: <<< -size: 612 +size: 615 location: src/tests/client/test-client.py:test_004()/582 cmd: $NMCLI --mode tabular --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 426 bytes +stdout: 429 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:::::::-1:-1:-1::0:0::-1:unknown:default:-1:-1:-1:0x0:-1:-1 -ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 +ipv4:auto::::0::::-1:0::-1:-1:-1:no:no::::0:yes:-1:-1:::0x0:no:yes:-1:-1::-1:0::-1::0 ipv6:auto::::0::::-1:0::-1:-1:-1:no:no:no:yes:-1:-1:0:0:default:0:auto::::0:yes:-1::0x0:-1: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3:<hidden>:no:0 proxy:none:no:: @@ -32762,12 +32804,12 @@ UUID-con-xx1-REPLACED-REPLACED-REPLA <<< -size: 6674 +size: 6727 location: src/tests/client/test-client.py:test_004()/627 cmd: $NMCLI --mode multiline con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -32824,6 +32866,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -32906,12 +32949,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6711 +size: 6764 location: src/tests/client/test-client.py:test_004()/628 cmd: $NMCLI --mode multiline con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -32968,6 +33011,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -33050,12 +33094,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6674 +size: 6727 location: src/tests/client/test-client.py:test_004()/629 cmd: $NMCLI --mode multiline con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -33112,6 +33156,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -33194,12 +33239,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6711 +size: 6764 location: src/tests/client/test-client.py:test_004()/630 cmd: $NMCLI --mode multiline con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -33256,6 +33301,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -33338,12 +33384,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 5547 +size: 5600 location: src/tests/client/test-client.py:test_004()/631 cmd: $NMCLI --mode multiline -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5388 bytes +stdout: 5441 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -33400,6 +33446,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -33461,12 +33508,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5574 +size: 5627 location: src/tests/client/test-client.py:test_004()/632 cmd: $NMCLI --mode multiline -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5405 bytes +stdout: 5458 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -33523,6 +33570,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -36704,12 +36752,12 @@ connection.type: 802-11-wireless connection.interface-name: -- <<< -size: 6686 +size: 6739 location: src/tests/client/test-client.py:test_004()/677 cmd: $NMCLI --mode multiline --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -36766,6 +36814,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -36848,12 +36897,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6723 +size: 6776 location: src/tests/client/test-client.py:test_004()/678 cmd: $NMCLI --mode multiline --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -36910,6 +36959,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -36992,12 +37042,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6686 +size: 6739 location: src/tests/client/test-client.py:test_004()/679 cmd: $NMCLI --mode multiline --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 6522 bytes +stdout: 6575 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -37054,6 +37104,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -37136,12 +37187,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 6723 +size: 6776 location: src/tests/client/test-client.py:test_004()/680 cmd: $NMCLI --mode multiline --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6549 bytes +stdout: 6602 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -37198,6 +37249,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -37280,12 +37332,12 @@ VPN.CFG[2]: key2 = val2 VPN.CFG[3]: key3 = val3 <<< -size: 5559 +size: 5612 location: src/tests/client/test-client.py:test_004()/681 cmd: $NMCLI --mode multiline --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 5388 bytes +stdout: 5441 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -37342,6 +37394,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -37403,12 +37456,12 @@ proxy.pac-url: -- proxy.pac-script: -- <<< -size: 5586 +size: 5639 location: src/tests/client/test-client.py:test_004()/682 cmd: $NMCLI --mode multiline --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 5405 bytes +stdout: 5458 bytes >>> connection.id: con-vpn-1 connection.uuid: UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -37465,6 +37518,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -40646,12 +40700,12 @@ connection.type: 802-11-wireless connection.interface-name: -- <<< -size: 7694 +size: 7747 location: src/tests/client/test-client.py:test_004()/727 cmd: $NMCLI --mode multiline --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -40712,6 +40766,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -40803,12 +40858,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7744 +size: 7797 location: src/tests/client/test-client.py:test_004()/728 cmd: $NMCLI --mode multiline --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -40869,6 +40924,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -40960,12 +41016,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7694 +size: 7747 location: src/tests/client/test-client.py:test_004()/729 cmd: $NMCLI --mode multiline --pretty con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -41026,6 +41082,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -41117,12 +41174,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7744 +size: 7797 location: src/tests/client/test-client.py:test_004()/730 cmd: $NMCLI --mode multiline --pretty con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -41183,6 +41240,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -41274,12 +41332,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 6175 +size: 6228 location: src/tests/client/test-client.py:test_004()/731 cmd: $NMCLI --mode multiline --pretty -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 6007 bytes +stdout: 6060 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -41340,6 +41398,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -41405,12 +41464,12 @@ proxy.pac-script: -- ------------------------------------------------------------------------------- <<< -size: 6207 +size: 6260 location: src/tests/client/test-client.py:test_004()/732 cmd: $NMCLI --mode multiline --pretty -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6029 bytes +stdout: 6082 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -41471,6 +41530,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -45290,12 +45350,12 @@ connection.interface-name: -- ------------------------------------------------------------------------------- <<< -size: 7706 +size: 7759 location: src/tests/client/test-client.py:test_004()/777 cmd: $NMCLI --mode multiline --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -45356,6 +45416,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -45447,12 +45508,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7756 +size: 7809 location: src/tests/client/test-client.py:test_004()/778 cmd: $NMCLI --mode multiline --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -45513,6 +45574,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -45604,12 +45666,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7706 +size: 7759 location: src/tests/client/test-client.py:test_004()/779 cmd: $NMCLI --mode multiline --pretty --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 7533 bytes +stdout: 7586 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -45670,6 +45732,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -45761,12 +45824,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 7756 +size: 7809 location: src/tests/client/test-client.py:test_004()/780 cmd: $NMCLI --mode multiline --pretty --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 7573 bytes +stdout: 7626 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -45827,6 +45890,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -45918,12 +45982,12 @@ VPN.CFG[3]: key3 = val3 ------------------------------------------------------------------------------- <<< -size: 6187 +size: 6240 location: src/tests/client/test-client.py:test_004()/781 cmd: $NMCLI --mode multiline --pretty --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 6007 bytes +stdout: 6060 bytes >>> =============================================================================== Connection profile details (con-vpn-1) @@ -45984,6 +46048,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: yes ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -46049,12 +46114,12 @@ proxy.pac-script: -- ------------------------------------------------------------------------------- <<< -size: 6219 +size: 6272 location: src/tests/client/test-client.py:test_004()/782 cmd: $NMCLI --mode multiline --pretty --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 6029 bytes +stdout: 6082 bytes >>> =============================================================================== Szczegóły profilu połączenia (con-vpn-1) @@ -46115,6 +46180,7 @@ ipv4.dhcp-dscp: -- ipv4.dhcp-timeout: 0 (default) ipv4.dhcp-send-hostname-deprecated: tak ipv4.dhcp-send-hostname: -1 (default) +ipv4.forwarding: -1 (default) ipv4.dhcp-hostname: -- ipv4.dhcp-fqdn: -- ipv4.dhcp-hostname-flags: 0x0 (none) @@ -49934,12 +50000,12 @@ connection.interface-name: -- ------------------------------------------------------------------------------- <<< -size: 3426 +size: 3445 location: src/tests/client/test-client.py:test_004()/827 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -49996,6 +50062,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -50078,12 +50145,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3436 +size: 3455 location: src/tests/client/test-client.py:test_004()/828 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -50140,6 +50207,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -50222,12 +50290,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3426 +size: 3445 location: src/tests/client/test-client.py:test_004()/829 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -50284,6 +50352,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -50366,12 +50435,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3436 +size: 3455 location: src/tests/client/test-client.py:test_004()/830 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -50428,6 +50497,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -50510,12 +50580,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2851 +size: 2870 location: src/tests/client/test-client.py:test_004()/831 cmd: $NMCLI --mode multiline --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -50572,6 +50642,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -50633,12 +50704,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 2861 +size: 2880 location: src/tests/client/test-client.py:test_004()/832 cmd: $NMCLI --mode multiline --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -50695,6 +50766,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -53876,12 +53948,12 @@ connection.type:802-11-wireless connection.interface-name: <<< -size: 3438 +size: 3457 location: src/tests/client/test-client.py:test_004()/877 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -53938,6 +54010,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -54020,12 +54093,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3448 +size: 3467 location: src/tests/client/test-client.py:test_004()/878 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -54082,6 +54155,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -54164,12 +54238,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3438 +size: 3457 location: src/tests/client/test-client.py:test_004()/879 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -54226,6 +54300,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -54308,12 +54383,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 3448 +size: 3467 location: src/tests/client/test-client.py:test_004()/880 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 3266 bytes +stdout: 3285 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -54370,6 +54445,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -54452,12 +54528,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2863 +size: 2882 location: src/tests/client/test-client.py:test_004()/881 cmd: $NMCLI --mode multiline --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -54514,6 +54590,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -54575,12 +54652,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 2873 +size: 2892 location: src/tests/client/test-client.py:test_004()/882 cmd: $NMCLI --mode multiline --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2684 bytes +stdout: 2703 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -54637,6 +54714,7 @@ ipv4.dhcp-dscp: ipv4.dhcp-timeout:0 ipv4.dhcp-send-hostname-deprecated:yes ipv4.dhcp-send-hostname:-1 +ipv4.forwarding:-1 ipv4.dhcp-hostname: ipv4.dhcp-fqdn: ipv4.dhcp-hostname-flags:0x0 @@ -57903,3 +57981,43 @@ con-xx2 UUID-con-xx2-REPLACED-REPLACED-REPLA ethernet 0 nigdy con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet 0 nigdy tak 0 nie /org/freedesktop/NetworkManager/Settings/Connection/1 nie -- -- -- -- /etc/NetworkManager/system-connections/con-1 <<< +size: 359 +location: src/tests/client/test-client.py:test_004()/934 +cmd: $NMCLI connection add type ethernet ifname foobar con-name con-port1 ipv4.method disabled ipv6.method ignore connection.port-type bridge connection.controller bridge1 +lang: C +returncode: 0 +stdout: 82 bytes +>>> +Connection 'con-port1' (UUID-con-port1-REPLACED-REPLACED-REP) successfully added. + +<<< +size: 353 +location: src/tests/client/test-client.py:test_004()/935 +cmd: $NMCLI connection add type ethernet ifname foobar con-name ethernet-foobar ipv6.method auto connection.port-type bridge connection.controller bridge1 +lang: C +returncode: 2 +stderr: 93 bytes +>>> +Error: invalid or not allowed setting 'ipv6': port connections cannot have IP configuration. + +<<< +size: 373 +location: src/tests/client/test-client.py:test_004()/936 +cmd: $NMCLI connection add type ovs-interface ifname ovs-int con-name con-ovs-int ipv4.method auto ipv6.method link-local connection.port-type ovs-port connection.controller ovs-port1 +lang: C +returncode: 0 +stdout: 84 bytes +>>> +Connection 'con-ovs-int' (UUID-con-ovs-int-REPLACED-REPLACED-R) successfully added. + +<<< +size: 377 +location: src/tests/client/test-client.py:test_004()/937 +cmd: $NMCLI connection add type ethernet ifname enp1s0 con-name con-port2 ipv4.method manual ipv4.addresses 192.0.2.1/24 ipv6.method dhcp connection.port-type vrf connection.controller vrf1 +lang: C +returncode: 0 +stdout: 82 bytes +>>> +Connection 'con-port2' (UUID-con-port2-REPLACED-REPLACED-REP) successfully added. + +<<< diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index 62b72b79..cc76d37b 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -2125,6 +2125,113 @@ class TestNmcli(unittest.TestCase): replace_stdout=replace_uuids, ) + # It is allowed to set IP method disabled/ignore for ports + replace_uuids.append( + self.ctx.srv.ReplaceTextConUuid( + "con-port1", "UUID-con-port1-REPLACED-REPLACED-REP" + ) + ) + self.call_nmcli( + [ + "connection", + "add", + "type", + "ethernet", + "ifname", + "foobar", + "con-name", + "con-port1", + "ipv4.method", + "disabled", + "ipv6.method", + "ignore", + "connection.port-type", + "bridge", + "connection.controller", + "bridge1", + ], + replace_stdout=replace_uuids, + ) + + # It is NOT allowed to set IP method != disabled/ignore for ports + self.call_nmcli( + [ + "connection", + "add", + "type", + "ethernet", + "ifname", + "foobar", + "con-name", + "ethernet-foobar", + "ipv6.method", + "auto", + "connection.port-type", + "bridge", + "connection.controller", + "bridge1", + ], + replace_stdout=replace_uuids, + ) + + # ovs-interface connections support IP configuration + replace_uuids.append( + self.ctx.srv.ReplaceTextConUuid( + "con-ovs-int", "UUID-con-ovs-int-REPLACED-REPLACED-R" + ) + ) + self.call_nmcli( + [ + "connection", + "add", + "type", + "ovs-interface", + "ifname", + "ovs-int", + "con-name", + "con-ovs-int", + "ipv4.method", + "auto", + "ipv6.method", + "link-local", + "connection.port-type", + "ovs-port", + "connection.controller", + "ovs-port1", + ], + replace_stdout=replace_uuids, + ) + + # VRF ports support IP configuration + replace_uuids.append( + self.ctx.srv.ReplaceTextConUuid( + "con-port2", "UUID-con-port2-REPLACED-REPLACED-REP" + ) + ) + self.call_nmcli( + [ + "connection", + "add", + "type", + "ethernet", + "ifname", + "enp1s0", + "con-name", + "con-port2", + "ipv4.method", + "manual", + "ipv4.addresses", + "192.0.2.1/24", + "ipv6.method", + "dhcp", + "connection.port-type", + "vrf", + "connection.controller", + "vrf1", + ], + replace_stdout=replace_uuids, + ) + @nm_test_no_dbus def test_offline(self): # Make sure we're not using D-Bus |