Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net PR/44131: Matthew Mondor: if_tap.c tap_dev_ioctl() n...
details: https://anonhg.NetBSD.org/src/rev/9411a025fae6
branches: trunk
changeset: 758975:9411a025fae6
user: christos <christos%NetBSD.org@localhost>
date: Mon Nov 22 21:31:51 2010 +0000
description:
PR/44131: Matthew Mondor: if_tap.c tap_dev_ioctl() not propagating error,
always returns 0.
diffstat:
sys/net/if_tap.c | 31 +++++++++++++------------------
1 files changed, 13 insertions(+), 18 deletions(-)
diffs (84 lines):
diff -r cd735016d8d9 -r 9411a025fae6 sys/net/if_tap.c
--- a/sys/net/if_tap.c Mon Nov 22 21:20:32 2010 +0000
+++ b/sys/net/if_tap.c Mon Nov 22 21:31:51 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_tap.c,v 1.65 2010/05/19 20:41:59 christos Exp $ */
+/* $NetBSD: if_tap.c,v 1.66 2010/11/22 21:31:51 christos Exp $ */
/*
* Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.65 2010/05/19 20:41:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.66 2010/11/22 21:31:51 christos Exp $");
#if defined(_KERNEL_OPT)
@@ -1079,12 +1079,10 @@
static int
tap_dev_ioctl(int unit, u_long cmd, void *data, struct lwp *l)
{
- struct tap_softc *sc =
- device_lookup_private(&tap_cd, unit);
- int error = 0;
+ struct tap_softc *sc = device_lookup_private(&tap_cd, unit);
if (sc == NULL)
- return (ENXIO);
+ return ENXIO;
switch (cmd) {
case FIONREAD:
@@ -1101,27 +1099,26 @@
else
*(int *)data = m->m_pkthdr.len;
splx(s);
- } break;
+ return 0;
+ }
case TIOCSPGRP:
case FIOSETOWN:
- error = fsetown(&sc->sc_pgid, cmd, data);
- break;
+ return fsetown(&sc->sc_pgid, cmd, data);
case TIOCGPGRP:
case FIOGETOWN:
- error = fgetown(sc->sc_pgid, cmd, data);
- break;
+ return fgetown(sc->sc_pgid, cmd, data);
case FIOASYNC:
if (*(int *)data)
sc->sc_flags |= TAP_ASYNCIO;
else
sc->sc_flags &= ~TAP_ASYNCIO;
- break;
+ return 0;
case FIONBIO:
if (*(int *)data)
sc->sc_flags |= TAP_NBIO;
else
sc->sc_flags &= ~TAP_NBIO;
- break;
+ return 0;
#ifdef OTAPGIFNAME
case OTAPGIFNAME:
#endif
@@ -1131,13 +1128,11 @@
struct ifnet *ifp = &sc->sc_ec.ec_if;
strlcpy(ifr->ifr_name, ifp->if_xname, IFNAMSIZ);
- } break;
+ return 0;
+ }
default:
- error = ENOTTY;
- break;
+ return ENOTTY;
}
-
- return (0);
}
static int
Home |
Main Index |
Thread Index |
Old Index