From 01277d243017648d37d949c9778193123b7703d8 Mon Sep 17 00:00:00 2001 From: msaitoh Date: Tue, 16 Apr 2019 04:26:02 +0000 Subject: [PATCH] The path of SOICSIFMEDA or TAPGIFNAME calls are as follows: doifioctl() pre-convert (if_cvtcmd_43_hook & ifreqo2n) (*ifp->if_ioctl)(ifp, cmd, data); post-convert (ifreqn2o) so it's not required to check OSIOCSIFMEDIA and OTAPGIFNAME in if_tap.c. Those two command is converted to new command in if_cvtcmd_43_hook and always new commands are seen in tap_ioctl(). OK'd by pgoyette. --- sys/net/if_tap.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index c6f023cce5e5..1c20ddb8e8d4 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tap.c,v 1.109 2019/03/25 09:59:59 pgoyette Exp $ */ +/* $NetBSD: if_tap.c,v 1.110 2019/04/16 04:26:02 msaitoh Exp $ */ /* * Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation. @@ -33,12 +33,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.109 2019/03/25 09:59:59 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.110 2019/04/16 04:26:02 msaitoh Exp $"); #if defined(_KERNEL_OPT) #include "opt_modular.h" -#include "opt_compat_netbsd.h" #endif #include @@ -70,8 +69,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.109 2019/03/25 09:59:59 pgoyette Exp $" #include #include -#include - #include "ioconf.h" /* @@ -581,9 +578,6 @@ tap_ioctl(struct ifnet *ifp, u_long cmd, void *data) s = splnet(); switch (cmd) { -#ifdef OSIOCSIFMEDIA - case OSIOCSIFMEDIA: -#endif case SIOCSIFMEDIA: case SIOCGIFMEDIA: error = ifmedia_ioctl(ifp, ifr, &sc->sc_im, cmd); @@ -1164,9 +1158,6 @@ tap_dev_ioctl(int unit, u_long cmd, void *data, struct lwp *l) else sc->sc_flags &= ~TAP_NBIO; return 0; -#ifdef OTAPGIFNAME - case OTAPGIFNAME: -#endif case TAPGIFNAME: { struct ifreq *ifr = (struct ifreq *)data;