New: (tun dev) Impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]/
Quoted 31 lines · On Wed, 23 Jan 2008 13:13:13 -0800 (PST) [email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=9806
Summary: (tun dev) Impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI Product: Drivers Version: 2.5 KernelVersion: 2.6.23 Platform: All OS/Version: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Network AssignedTo: [email protected] ReportedBy: [email protected]Problem Description:
The TUN/TAP driver only permits one-way transitions of
IFF_NO_PIorIFF_ONE_QUEUEduring the lifetime of a tap/tun interface. Note thattun_set_iffcontains541 if (
ifr->ifr_flags&IFF_NO_PI)
542tun->flags|=TUN_NO_PI;
543
544 if (ifr->ifr_flags&IFF_ONE_QUEUE)
545tun->flags|=TUN_ONE_QUEUE;
Quoted 9 lines
This is easily fixed by adding else branches which clear these bits.
Steps to reproduce:
This is easily reproduced by setting an interface persistant using tunctl then attempting to open it as
IFF_TAPorIFF_TUN, without asserting theIFF_NO_PIflag. Theioctl()will succeed and the ifr.flags word is not modified, but the interface remains inIFF_NO_PImode (as it was set by tunctl).
Thanks. Could you please submit the patch via email? Send it to
all recipients of this email.
Quoted 4 lines · Andrew Morton
Quoted 2 lines · On Wed, 23 Jan 2008 13:13:13 -0800 (PST) [email protected] wrote:
Thanks. Could you please submit the patch via email? Send it to
all recipients of this email.
Attached.
--nwf;
tun.c renamed from tun.c.orig +4 -0
@@ -540,9 +540,13 @@if (ifr->ifr_flags &IFF_NO_PI ) tun->flags |=TUN_NO_PI ; +else + tun->flags &= ~TUN_NO_PI ;if (ifr->ifr_flags &IFF_ONE_QUEUE ) tun->flags |=TUN_ONE_QUEUE ; +else + tun->flags &= ~TUN_ONE_QUEUE ; file->private_data = tun; tun->attached =1 ;