diff options
author | mdodd <mdodd@FreeBSD.org> | 1999-08-18 06:12:00 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 1999-08-18 06:12:00 +0000 |
commit | 1976ef16a8708201289ddbec33fc0efe7ceb061e (patch) | |
tree | ab89143e0a8b4c6b13874c23c8779c2641228422 /sys/dev/lnc/if_lnc.c | |
parent | 212887c836affc05f828e3fddd4dc1b80085f08f (diff) | |
download | FreeBSD-src-1976ef16a8708201289ddbec33fc0efe7ceb061e.zip FreeBSD-src-1976ef16a8708201289ddbec33fc0efe7ceb061e.tar.gz |
SIOCSIFADDR, SIOCGIFADDR, and SIOCSIFMTU are implemented in
sys/net/if_ethersubr.c:ether_ioctl(). Drivers need not implement generic
behavior.
PR: kern/12126
Submitted by: in part by Boris Popov <bp@butya.kz>
Diffstat (limited to 'sys/dev/lnc/if_lnc.c')
-rw-r--r-- | sys/dev/lnc/if_lnc.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c index d035311..2bdfce4 100644 --- a/sys/dev/lnc/if_lnc.c +++ b/sys/dev/lnc/if_lnc.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_lnc.c,v 1.61 1999/07/06 19:22:50 des Exp $ + * $Id: if_lnc.c,v 1.62 1999/08/10 01:03:49 mdodd Exp $ */ /* @@ -83,10 +83,6 @@ #include <net/if.h> #include <net/if_dl.h> #include <net/if_types.h> -#ifdef INET -#include <netinet/in.h> -#include <netinet/if_ether.h> -#endif #if NBPF > 0 #include <net/bpf.h> @@ -1845,28 +1841,17 @@ lnc_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct lnc_softc *sc = ifp->if_softc; - struct ifaddr *ifa = (struct ifaddr *) data; struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; s = splimp(); switch (command) { - case SIOCSIFADDR: - ifp->if_flags |= IFF_UP; - - switch (ifa->ifa_addr->sa_family) { -#ifdef INET - case AF_INET: - lnc_init(sc); - arp_ifinit((struct arpcom *)ifp, ifa); - break; -#endif - default: - lnc_init(sc); - break; - } - break; + case SIOCSIFADDR: + case SIOCGIFADDR: + case SIOCSIFMTU: + error = ether_ioctl(ifp, command, data); + break; case SIOCSIFFLAGS: #ifdef DEBUG @@ -1917,16 +1902,6 @@ lnc_ioctl(struct ifnet * ifp, u_long command, caddr_t data) lnc_init(sc); error = 0; break; - case SIOCSIFMTU: - /* - * Set the interface MTU. - */ - - if (ifr->ifr_mtu > ETHERMTU) { - error = EINVAL; - } else - ifp->if_mtu = ifr->ifr_mtu; - break; default: error = EINVAL; } |