mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 03:28:03 +02:00
ifcfg-rh: fix persisting ethtool options
If there were any pause options and any non-pause options, the created setting was invalid. I don't think it's reasonably possible to parse the broken settings. So there is no workaround trying to read the existing broken settings from disk. Luckily, the broken setting was just silently ignored by the parser, so you simply could not persist certain settings. https://bugzilla.redhat.com/show_bug.cgi?id=2134569 Fixes:652ddca04c('ethtool: Introducing PAUSE support') (cherry picked from commit21661c6f71)
This commit is contained in:
parent
3b3ed9f1cc
commit
553e037220
3 changed files with 4 additions and 4 deletions
|
|
@ -1372,6 +1372,8 @@ write_ethtool_setting(NMConnection *connection, shvarFile *ifcfg, GError **error
|
|||
g_string_append(str, nms_ifcfg_rh_utils_get_ethtool_name(ethtool_id));
|
||||
g_string_append_printf(str, " %" G_GUINT32_FORMAT, u32);
|
||||
}
|
||||
|
||||
is_first = TRUE;
|
||||
for (ethtool_id = _NM_ETHTOOL_ID_PAUSE_FIRST; ethtool_id <= _NM_ETHTOOL_ID_PAUSE_LAST;
|
||||
ethtool_id++) {
|
||||
nm_assert(nms_ifcfg_rh_utils_get_ethtool_name(ethtool_id));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
TYPE=Ethernet
|
||||
PROXY_METHOD=none
|
||||
BROWSER_ONLY=no
|
||||
ETHTOOL_OPTS="autoneg on ; -A net0 pause-autoneg off"
|
||||
ETHTOOL_OPTS="autoneg on ; -G net0 rx 512 ; -A net0 pause-autoneg off"
|
||||
BOOTPROTO=dhcp
|
||||
DEFROUTE=yes
|
||||
IPV4_FAILURE_FATAL=no
|
||||
|
|
|
|||
|
|
@ -3544,7 +3544,7 @@ test_roundtrip_ethtool(void)
|
|||
|
||||
s_ethtool = _nm_connection_new_setting(connection, NM_TYPE_SETTING_ETHTOOL);
|
||||
nm_setting_option_set_boolean(s_ethtool, NM_ETHTOOL_OPTNAME_PAUSE_AUTONEG, FALSE);
|
||||
//FIXME: nm_setting_option_set_uint32(s_ethtool, NM_ETHTOOL_OPTNAME_RING_RX, 512);
|
||||
nm_setting_option_set_uint32(s_ethtool, NM_ETHTOOL_OPTNAME_RING_RX, 512);
|
||||
_writer_new_connec_exp(connection,
|
||||
TEST_SCRATCH_DIR,
|
||||
TEST_IFCFG_DIR "/ifcfg-test_roundtrip_ethtool-9.cexpected",
|
||||
|
|
@ -3603,8 +3603,6 @@ test_roundtrip_ethtool(void)
|
|||
ethtool_ids[i] = i;
|
||||
nmtst_rand_perm(NULL, ethtool_ids, NULL, sizeof(ethtool_ids[0]), G_N_ELEMENTS(ethtool_ids));
|
||||
|
||||
l = 1; /* FIXME */
|
||||
|
||||
for (i = 0; i < l; i++) {
|
||||
NMEthtoolID ethtool_id = ethtool_ids[i];
|
||||
const GVariantType *vtype;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue