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 740380 - [PATCH] platform: stop using TUN_* flags
[PATCH] platform: stop using TUN_* flags
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks: nm-1.0
 
 
Reported: 2014-11-19 17:47 UTC by Dan Williams
Modified: 2014-12-01 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Williams 2014-11-19 17:47:03 UTC
Upstream will be removing the incorrect TUN_* flags from if_tun.h so we might as well use the replacements.  Technically TUN_TYPE_MASK and TUN_TUN_DEV/TUN_TAP_DEV were not incorrect as they have the same value as their IFF_* replacements, but they're considered deprecated too.

diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 42444d9..391f175 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -2964,7 +2964,7 @@ tun_get_properties (NMPlatform *platform, int ifindex, NMPlatformTunProperties *
 #ifndef IFF_MULTI_QUEUE
                        const int IFF_MULTI_QUEUE = 0x0100;
 #endif
-                       props->mode = ((flags & TUN_TYPE_MASK) == TUN_TUN_DEV) ? "tun" : "tap";
+                       props->mode = ((flags & (IFF_TUN | IFF_TAP)) == IFF_TUN) ? "tun" : "tap";
                        props->no_pi = !!(flags & IFF_NO_PI);
                        props->vnet_hdr = !!(flags & IFF_VNET_HDR);
                        props->multi_queue = !!(flags & IFF_MULTI_QUEUE);
Comment 1 Dan Williams 2014-11-19 17:47:45 UTC
And by "upstream" I mean the upstream kernel.

https://lkml.org/lkml/2014/11/19/460
Comment 2 Thomas Haller 2014-11-19 17:58:50 UTC
LGTM
Comment 3 Dan Williams 2014-11-20 00:39:42 UTC
5de8a0d3a711d7e9b0fab790964f55f40be99292