On Tue, 2014-04-22 at 10:05 +0000, John Frankish wrote:
> I compiled networkmanager-0.9.8.9 from source to /usr/local to use dhcpcd 
> (also compiled from source).
> 
> Since networkmanager configured as above looks for /usr/local/etc/hosts, I 
> adjusted the source to look at /etc/hosts (it already knew to look for 
> /etc/resolv.conf).
> 
> Run from the console, neworkmanager looks as though it connects to an ipv4 
> wired network (I've tried two different networks), modifies /etc/resolv.conf 
> accordingly, but it does not actually connect -I cannot ping the router nor 
> google.com.
> 
> Dhcpcd run alone from the console connects without problems.
> 
> This is the same problem I experienced using networkmanager-0.9.8.8 reported 
> in another thread.
> 
> I've attached the networkmanager debug output and the strace output, but 
> neither seem to give a clue as to the problem - I believe that either 
> networkmanager is trying to write something to /usr/local/etc that is in /etc 
> (or vice versa) or there is some kind of linux-pam/polkit permissions error, 
> but I cannot see evidence of either in the debug output.
> 
> From the debug snippet below things look to have worked, but they didn't - 
> any troubleshooting hints would be gratefully received.

The x.x.x.x/0 bits are likely the problem.  Let's investigate why that's
happening especially since NetworkManager says it got the right prefix
from dhcpcd.

Would you mind applying the attached patch to your sources?  Then re-run
the test and reply with the output so we can debug a bit further.

Thanks!
Dan

> Regards
> John
> 
> ----------
> 
> dhcpcd[6086]: eth0: leased 10.180.20.123 for 259200 seconds
> dhcpcd[6086]: eth0: adding route to 10.180.20.0/24
> NetworkManager[6068]: <info> (eth0): DHCPv4 state changed preinit -> bound
> NetworkManager[6068]: <debug> [1397985943.868098] [nm-device.c:1945] 
> dhcp4_state_changed(): (eth0): new DHCPv4 client state 3
> NetworkManager[6068]: <info>   address 10.180.20.123
> NetworkManager[6068]: <info>   prefix 24 (255.255.255.0)
> NetworkManager[6068]: <info>   gateway 10.180.20.1
> NetworkManager[6068]: <info>   nameserver '10.180.1.10'
> NetworkManager[6068]: <info>   domain name 'mena.saxonservices.local'
> NetworkManager[6068]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Configure 
> Commit) scheduled...
> NetworkManager[6068]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) 
> started...
> NetworkManager[6068]: <debug> [1397985943.870957] [nm-system.c:194] 
> sync_addresses(): (eth0): syncing addresses (family 2)
> NetworkManager[6068]: <debug> [1397985943.871084] [nm-system.c:247] 
> sync_addresses(): (eth0): removing address '10.180.20.123/24'
> NetworkManager[6068]: <debug> [1397985943.871263] [nm-system.c:280] 
> sync_addresses(): (eth0): adding address '10.180.20.123/0'
> dhcpcd[6086]: eth0: removing IP address 10.180.20.123/24
> dhcpcd[6086]: eth0: deleting route to 10.180.20.0/24
> NetworkManager[6068]: <debug> [1397985944.871915] [nm-netlink-utils.c:356] 
> dump_route():   route idx 1 family INET (2) addr 127.0.0.1/32
> NetworkManager[6068]: <debug> [1397985944.872102] [nm-netlink-utils.c:356] 
> dump_route():   route idx 1 family INET (2) addr 127.0.0.0/32
> NetworkManager[6068]: <debug> [1397985944.872172] [nm-netlink-utils.c:356] 
> dump_route():   route idx 1 family INET (2) addr 127.0.0.0/8
> NetworkManager[6068]: <debug> [1397985944.872244] [nm-netlink-utils.c:356] 
> dump_route():   route idx 1 family INET (2) addr 127.0.0.1/32
> NetworkManager[6068]: <debug> [1397985944.872319] [nm-netlink-utils.c:356] 
> dump_route():   route idx 1 family INET (2) addr 127.255.255.255/32
> NetworkManager[6068]: <debug> [1397985944.872590] [nm-dns-manager.c:995] 
> nm_dns_manager_begin_updates(): (device_ip4_config_changed): queueing DNS 
> updates (1)
> NetworkManager[6068]: <debug> [1397985944.872675] [nm-dns-manager.c:1013] 
> nm_dns_manager_end_updates(): (nm_dns_manager_end_updates): DNS configuration 
> did not change
> NetworkManager[6068]: <debug> [1397985944.872735] [nm-dns-manager.c:1017] 
> nm_dns_manager_end_updates(): (device_ip4_config_changed): no DNS changes to 
> commit (0)
> NetworkManager[6068]: <info> (eth0): device state change: ip-config -> 
> secondaries (reason 'none') [70 90 0]
> NetworkManager[6068]: <debug> [1397985944.873173] [nm-device.c:5261] 
> nm_device_queue_state(): (eth0): queued state change to activated (id 60)
> NetworkManager[6068]: <debug> [1397985944.873315] [nm-manager.c:4142] 
> policy_activating_device_changed(): ActivatingConnection now (none)
> NetworkManager[6068]: <debug> [1397985944.873423] [nm-device.c:5191] 
> nm_device_state_changed(): (eth0): device entered SECONDARIES state
> NetworkManager[6068]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) 
> complete.
> NetworkManager[6068]: <info> (eth0): DHCPv4 state changed bound -> expire
> NetworkManager[6068]: <debug> [1397985944.875537] [nm-device.c:1945] 
> dhcp4_state_changed(): (eth0): new DHCPv4 client state 17
> NetworkManager[6068]: <debug> [1397985944.875983] [nm-device.c:5219] 
> queued_set_state(): (eth0): running queued state change to activated (id 60)
> NetworkManager[6068]: <info> (eth0): device state change: secondaries -> 
> activated (reason 'none') [90 100 0]
> NetworkManager[6068]: <debug> [1397985944.876484] [nm-manager.c:4050] 
> connectivity_changed(): connectivity checking indicates FULL
> NetworkManager[6068]: <info> NetworkManager state is now CONNECTED_GLOBAL
> NetworkManager[6068]: <debug> [1397985944.876992] [nm-dns-manager.c:995] 
> nm_dns_manager_begin_updates(): (device_state_changed): queueing DNS updates 
> (1)
> NetworkManager[6068]: <debug> [1397985944.877065] [nm-dns-manager.c:995] 
> nm_dns_manager_begin_updates(): (update_routing_and_dns): queueing DNS 
> updates (2)
> NetworkManager[6068]: <info> Policy set 'Wired connection 1' (eth0) as 
> default for IPv4 routing and DNS.
> NetworkManager[6068]: <debug> [1397985944.877721] [nm-manager.c:4109] 
> policy_default_device_changed(): PrimaryConnection now Wired connection 1
> NetworkManager[6068]: <debug> [1397985944.877842] [nm-dns-manager.c:1013] 
> nm_dns_manager_end_updates(): (nm_dns_manager_end_updates): DNS configuration 
> changed
> NetworkManager[6068]: <debug> [1397985944.877893] [nm-dns-manager.c:1017] 
> nm_dns_manager_end_updates(): (update_routing_and_dns): no DNS changes to 
> commit (1)
> NetworkManager[6068]: <debug> [1397985944.877945] [nm-dns-manager.c:1013] 
> nm_dns_manager_end_updates(): (nm_dns_manager_end_updates): DNS configuration 
> changed
> NetworkManager[6068]: <debug> [1397985944.877988] [nm-dns-manager.c:1022] 
> nm_dns_manager_end_updates(): (device_state_changed): committing DNS changes 
> (0)
> NetworkManager[6068]: <debug> [1397985944.878029] [nm-dns-manager.c:591] 
> update_dns(): updating resolv.conf
> NetworkManager[6068]: <info> Activation (eth0) successful, device activated.
> 
> _______________________________________________
> networkmanager-list mailing list
> [email protected]
> https://mail.gnome.org/mailman/listinfo/networkmanager-list

diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 0722981..5a19373 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -35,6 +35,7 @@
 
 #include "nm-ip4-config-glue.h"
 #include "nm-dbus-glib-types.h"
+#include "nm-logging.h"
 
 
 G_DEFINE_TYPE (NMIP4Config, nm_ip4_config, G_TYPE_OBJECT)
@@ -650,6 +651,16 @@ nm_ip4_config_to_rtnl_addr (NMIP4Config *config, guint32 i, guint32 flags)
 		success = (ip4_addr_to_rtnl_broadcast (bcast, addr) >= 0);
 	}
 
+{
+char buf[1024];
+char buf2[INET_ADDRSTRLEN];
+struct in_addr a = { .s_addr = nm_ip4_address_get_address (config_addr) };
+nl_object_dump_buf ((struct nl_object *) addr, buf, sizeof (buf) - 1);
+buf[1023] = 0;
+inet_ntop (AF_INET, &a, buf2, sizeof (buf2));
+nm_log_warn (LOGD_IP4, "%s: created '%s' from '%s/%d' flags 0x%X", __func__, buf, buf2, nm_ip4_address_get_prefix (config_addr), flags);
+}
+
 	if (!success) {
 		rtnl_addr_put (addr);
 		addr = NULL;
diff --git a/src/nm-system.c b/src/nm-system.c
index 3998342..64be89a 100644
--- a/src/nm-system.c
+++ b/src/nm-system.c
@@ -196,6 +196,8 @@ sync_addresses (int ifindex,
 	/* Walk through the cache, comparing the addresses already on
 	 * the interface to the addresses in addrs.
 	 */
+nm_log_warn (LOGD_IP4, "%s: comparing existing addresses", __func__);
+
 	for (match = nl_cache_get_first (addr_cache); match; match = nl_cache_get_next (match)) {
 		gboolean buf_valid = FALSE;
 		match_addr = (struct rtnl_addr *) match;
@@ -211,6 +213,7 @@ sync_addresses (int ifindex,
 			}
 
 			if (addrs[i]) {
+nm_log_warn (LOGD_IP4, "%s: address %d already exists", __func__, i);
 				/* match == addrs[i], so remove it from addrs so we don't
 				 * try to add it to the interface again below.
 				 */
@@ -222,6 +225,13 @@ sync_addresses (int ifindex,
 
 		nladdr = rtnl_addr_get_local (match_addr);
 
+{
+char buf2[1024];
+nl_object_dump_buf ((struct nl_object *) match_addr, buf2, sizeof (buf2) - 1);
+buf2[1023] = 0;
+nm_log_warn (LOGD_IP4, "%s: no match for existing %s", __func__, buf2);
+}
+
 		/* Don't delete IPv6 link-local addresses; they don't belong to NM */
 		if (rtnl_addr_get_family (match_addr) == AF_INET6) {
 			struct in6_addr *tmp;
@@ -276,7 +286,7 @@ sync_addresses (int ifindex,
 		}
 
 		if (buf_valid) {
-			nm_log_dbg (log_domain, "(%s): adding address '%s/%d'",
+			nm_log_warn (log_domain, "(%s): adding address '%s/%d'",
 			            iface, buf, nl_addr_get_prefixlen (nladdr));
 		}
 
@@ -333,6 +343,12 @@ add_ip4_addresses (NMIP4Config *config, int ifindex)
 		}
 
 		addrs[i] = nm_ip4_config_to_rtnl_addr (config, i, flags);
+{
+char buf[1024];
+nl_object_dump_buf ((struct nl_object *) addrs[i], buf, sizeof (buf) - 1);
+buf[1023] = 0;
+nm_log_warn (LOGD_IP4, "   %i: %s", i, buf);
+}
 		if (!addrs[i]) {
 			nm_log_warn (LOGD_DEVICE | LOGD_IP4,
 			             "(%s): couldn't create rtnl address!",
@@ -408,11 +424,14 @@ nm_system_apply_ip4_config (int ifindex,
 	g_return_val_if_fail (ifindex > 0, FALSE);
 	g_return_val_if_fail (config != NULL, FALSE);
 
+nm_log_warn (LOGD_IP4, "%s: applying IPv4 config for ifindex %d", __func__, ifindex);
+
 	if (flags & NM_IP4_COMPARE_FLAG_ADDRESSES) {
 		if (!add_ip4_addresses (config, ifindex))
 			return FALSE;
 		sleep (1);
 	}
+nm_log_warn (LOGD_IP4, "%s: DONE applying IPv4 config", __func__);
 
 	if (flags & NM_IP4_COMPARE_FLAG_ROUTES) {
 		for (i = 0; i < nm_ip4_config_get_num_routes (config); i++) {
_______________________________________________
networkmanager-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to