After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 674765 - ifnet plugin will classify wired interfaces as wireless interfaces when biosdevname is enabled
ifnet plugin will classify wired interfaces as wireless interfaces when biosd...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2012-04-24 23:28 UTC by Jared_Dominguez
Modified: 2012-05-18 08:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix connection type guessing (mainly for biosdevname) (4.00 KB, patch)
2012-05-10 14:26 UTC, Jiri Klimes
accepted-commit_now Details | Review

Description Jared_Dominguez 2012-04-24 23:28:17 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);
Comment 1 Jiri Klimes 2012-05-10 14:24:48 UTC
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.
Comment 2 Jiri Klimes 2012-05-10 14:26:50 UTC
Created attachment 213811 [details] [review]
Fix connection type guessing (mainly for biosdevname)
Comment 3 Dan Williams 2012-05-17 22:54:59 UTC
Review of attachment 213811 [details] [review]:

Looks good.
Comment 4 Jiri Klimes 2012-05-18 08:25:01 UTC
Pushed as 57bb91f7f0f527732615f94208a25e3a29dba6c4