NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/44131: if_tap.c tap_dev_ioctl() not propagating error

>Number:         44131
>Category:       kern
>Synopsis:       if_tap.c tap_dev_ioctl() not propagating error
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 22 21:10:00 +0000 2010
>Originator:     Matthew Mondor
>Release:        NetBSD 5.1_STABLE and -current
NetBSD behemoth.xisop 5.1 NetBSD 5.1 (GENERIC_MM) #0: Sun Nov 21 00:19:56 EST 
2010  root%behemoth.xisop@localhost:/usr/obj/sys/arch/i386/compile/GENERIC_MM 
Architecture: i386
Machine: i386

When tap(4) ioctl(2)s are invoked, any error reported by internal
functions, such as fsetown(9)/fgetown(9), or even the default ENOTTY
error, don't get propagated at return time.  The error variable is
assigned where necessary, but the final return always returns 0,
meaning success.


Apply the attached diff (against -current).

Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=tap-diff.txt

Index: sys/net/if_tap.c
RCS file: /nfs/ginseng/home/data/cvsup/netbsd/src/sys/net/if_tap.c,v
retrieving revision 1.65
diff -u -p -r1.65 if_tap.c
--- sys/net/if_tap.c    19 May 2010 20:41:59 -0000      1.65
+++ sys/net/if_tap.c    22 Nov 2010 20:56:40 -0000
@@ -1137,7 +1137,7 @@ tap_dev_ioctl(int unit, u_long cmd, void
-       return (0);
+       return error;
 static int


 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline

Home | Main Index | Thread Index | Old Index