summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-10-03 11:30:35 +0200
committerThomas Haller <thaller@redhat.com>2017-10-09 22:06:25 +0200
commit9003dae6cdc12fc4860d35b91d5799b1bf8d5638 (patch)
tree7c545600cebfd75f1f1f0d1a0ab829705cc3de51 /src/tests
parent2e146148702615f31209f6ccc07ca02663eddb7b (diff)
downloadNetworkManager-9003dae6cdc12fc4860d35b91d5799b1bf8d5638.tar.gz
core: don't track route MSS in ip-config
The MSS is only set for VPN connections (by merging it in the respective NMIP4Config/NMIP6Config). It is also only used when setting the MSS of the default route. Don't track that property in NMIP4Config/NMIP6Config, instead, set the mss of the route directly in nm_vpn_connection_ip4_config_get() and nm_vpn_connection_ip6_config_get(). There is a potential change in behavior here: NMDevice also consisdered the MSS for the default route, but that would only be set if the MSS gets merged from an vpn-ip-config. Which at most is the case for iterface-less VPN types (libreswan). But even in that case, it doesn't seem right to me to use the VPN's MSS for the device's default-route.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/test-ip4-config.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index 8c6cd8d15c..c2a1c006c5 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -84,7 +84,6 @@ test_subtract (void)
const char *expected_search = "somewhere.com";
guint32 expected_nis = nmtst_inet4_from_string ("1.2.3.13");
guint32 expected_wins = nmtst_inet4_from_string ("2.3.4.5");
- guint32 expected_mss = 1400;
guint32 expected_mtu = 1492;
src = build_test_config ();
@@ -105,7 +104,6 @@ test_subtract (void)
nm_ip4_config_add_nis_server (dst, expected_nis);
nm_ip4_config_add_wins (dst, expected_wins);
- nm_ip4_config_set_mss (dst, expected_mss);
nm_ip4_config_set_mtu (dst, expected_mtu, NM_IP_CONFIG_SOURCE_UNKNOWN);
nm_ip4_config_subtract (dst, src);
@@ -142,7 +140,6 @@ test_subtract (void)
g_assert_cmpuint (nm_ip4_config_get_num_wins (dst), ==, 1);
g_assert_cmpuint (nm_ip4_config_get_wins (dst, 0), ==, expected_wins);
- g_assert_cmpuint (nm_ip4_config_get_mss (dst), ==, expected_mss);
g_assert_cmpuint (nm_ip4_config_get_mtu (dst), ==, expected_mtu);
g_object_unref (src);
@@ -267,12 +264,10 @@ test_add_route_with_source (void)
}
static void
-test_merge_subtract_mss_mtu (void)
+test_merge_subtract_mtu (void)
{
NMIP4Config *cfg1, *cfg2, *cfg3;
- guint32 expected_mss2 = 1400;
guint32 expected_mtu2 = 1492;
- guint32 expected_mss3 = 555;
guint32 expected_mtu3 = 666;
cfg1 = build_test_config ();
@@ -280,24 +275,19 @@ test_merge_subtract_mss_mtu (void)
cfg3 = build_test_config ();
/* add MSS, MTU to configs to test them */
- nm_ip4_config_set_mss (cfg2, expected_mss2);
nm_ip4_config_set_mtu (cfg2, expected_mtu2, NM_IP_CONFIG_SOURCE_UNKNOWN);
- nm_ip4_config_set_mss (cfg3, expected_mss3);
nm_ip4_config_set_mtu (cfg3, expected_mtu3, NM_IP_CONFIG_SOURCE_UNKNOWN);
nm_ip4_config_merge (cfg1, cfg2, NM_IP_CONFIG_MERGE_DEFAULT);
/* ensure MSS and MTU are in cfg1 */
- g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss2);
g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu2);
nm_ip4_config_merge (cfg1, cfg3, NM_IP_CONFIG_MERGE_DEFAULT);
/* ensure again the MSS and MTU in cfg1 got overridden */
- g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss3);
g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu3);
nm_ip4_config_subtract (cfg1, cfg3);
/* ensure MSS and MTU are zero in cfg1 */
- g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, 0);
g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, 0);
g_object_unref (cfg1);
@@ -339,7 +329,7 @@ main (int argc, char **argv)
g_test_add_func ("/ip4-config/compare-with-source", test_compare_with_source);
g_test_add_func ("/ip4-config/add-address-with-source", test_add_address_with_source);
g_test_add_func ("/ip4-config/add-route-with-source", test_add_route_with_source);
- g_test_add_func ("/ip4-config/merge-subtract-mss-mtu", test_merge_subtract_mss_mtu);
+ g_test_add_func ("/ip4-config/merge-subtract-mtu", test_merge_subtract_mtu);
g_test_add_func ("/ip4-config/strip-search-trailing-dot", test_strip_search_trailing_dot);
return g_test_run ();