GNOME Bugzilla – Bug 674765
ifnet plugin will classify wired interfaces as wireless interfaces when biosdevname is enabled
Last modified: 2012-05-18 08:25:01 UTC
Checking against network-manager-0.9.3.995+git201203152001.04b2a74 in Ubuntu as well as the master in git, I see that NM would treat any NIC names resulting from having biosdevname enabled (of the form em* and p*p*) as wireless interfaces. This is apparent from src/settings/plugins/ifnet/net_parser.c and src/settings/plugins/ifnet/connection_parser.c. (http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/settings/plugins/ifnet/net_parser.c#n156) init_block_by_line in src/settings/plugins/ifnet/net_parser.c: if ((conn = get_connection_config (pos)) == NULL) { if (g_ascii_strncasecmp (pos, "eth", 3) == 0 && strlen (pos) == 4) /* wired connection */ conn = add_new_connection_config ("wired", pos); else if (g_ascii_strncasecmp (pos, "ppp", 3) == 0 && strlen (pos) == 4) /* pppoe connection */ conn = add_new_connection_config ("ppp", pos); else if (ignore_connection_name (pos)) { /* ignored connection */ conn = add_new_connection_config ("ignore", pos); } else /* wireless connection */ conn = add_new_connection_config ("wireless", pos); } (http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/settings/plugins/ifnet/connection_parser.c#n2908) get_wired_name in src/settings/plugins/ifnet/connection_parser.c: gchar *conn_name = g_strdup_printf ("eth%d", i);
Guessing connection type according to interface name is not robust. And what is even more tricky is that 'pos' can also be something different than interface name. According to Gentoo network configuration it can be interface|mac|essid|apmac, which is quite ugly, because these strings can't simply be distinguished from each other. http://www.gentoo.org/doc/en/handbook/2007.0/handbook-x86.xml?full=1#book_part4_chap2__chap3 Nonetheless, we can fix the biosdevname case through checking whether the name is really an interface.
Created attachment 213811 [details] [review] Fix connection type guessing (mainly for biosdevname)
Review of attachment 213811 [details] [review]: Looks good.
Pushed as 57bb91f7f0f527732615f94208a25e3a29dba6c4