about summary refs log tree commit diff
path: root/src/settings/plugins/ifcfg-rh/writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/plugins/ifcfg-rh/writer.c')
-rw-r--r--src/settings/plugins/ifcfg-rh/writer.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c
index e258081f..8ecbf2bd 100644
--- a/src/settings/plugins/ifcfg-rh/writer.c
+++ b/src/settings/plugins/ifcfg-rh/writer.c
@@ -1329,7 +1329,7 @@ write_bridge_setting (NMConnection *connection, shvarFile *ifcfg, GError **error
 
 	svSetValue (ifcfg, "DEVICE", iface, FALSE);
 	svSetValue (ifcfg, "BRIDGING_OPTS", NULL, FALSE);
-	svSetValue (ifcfg, "STP", NULL, FALSE);
+	svSetValue (ifcfg, "STP", "no", FALSE);
 	svSetValue (ifcfg, "DELAY", NULL, FALSE);
 
 	/* Bridge options */
@@ -1941,11 +1941,14 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
 	}
 
 	if (!strcmp (value, NM_SETTING_IP6_CONFIG_METHOD_MANUAL)) {
+		char ipv6_defaultgw[INET6_ADDRSTRLEN];
+
 		/* Write out IP addresses */
 		num = nm_setting_ip6_config_get_num_addresses (s_ip6);
 
 		ip_str1 = g_string_new (NULL);
 		ip_str2 = g_string_new (NULL);
+		ipv6_defaultgw[0] = 0;
 		for (i = 0; i < num; i++) {
 			if (i == 0)
 				ip_ptr = ip_str1;
@@ -1967,13 +1970,14 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
 			/* We only support gateway for the first IP address for now */
 			if (i == 0) {
 				ip = nm_ip6_address_get_gateway (addr);
-				inet_ntop (AF_INET6, (const void *) ip, buf, sizeof (buf));
-				svSetValue (ifcfg, "IPV6_DEFAULTGW", buf, FALSE);
+				if (!IN6_IS_ADDR_UNSPECIFIED (ip))
+					inet_ntop (AF_INET6, ip, ipv6_defaultgw, sizeof (ipv6_defaultgw));
 			}
 		}
 
 		svSetValue (ifcfg, "IPV6ADDR", ip_str1->str, FALSE);
 		svSetValue (ifcfg, "IPV6ADDR_SECONDARIES", ip_str2->str, FALSE);
+		svSetValue (ifcfg, "IPV6_DEFAULTGW", ipv6_defaultgw, FALSE);
 		g_string_free (ip_str1, TRUE);
 		g_string_free (ip_str2, TRUE);
 	} else {