Deleted Added
full compact
if_tap.c (160376) if_tap.c (162711)
1/*-
2 * Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * BASED ON:
27 * -------------------------------------------------------------------------
28 *
29 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
30 * Nottingham University 1987.
31 */
32
33/*
1/*-
2 * Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.com>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * BASED ON:
27 * -------------------------------------------------------------------------
28 *
29 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
30 * Nottingham University 1987.
31 */
32
33/*
34 * $FreeBSD: head/sys/net/if_tap.c 160376 2006-07-15 02:13:05Z brooks $
34 * $FreeBSD: head/sys/net/if_tap.c 162711 2006-09-27 19:57:02Z ru $
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
38#include "opt_compat.h"
38#include "opt_inet.h"
39
40#include <sys/param.h>
41#include <sys/conf.h>
42#include <sys/fcntl.h>
43#include <sys/filio.h>
44#include <sys/kernel.h>
45#include <sys/malloc.h>

--- 561 unchanged lines hidden (view full) ---

607static int
608tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
609{
610 struct tap_softc *tp = dev->si_drv1;
611 struct ifnet *ifp = tp->tap_ifp;
612 struct tapinfo *tapp = NULL;
613 int s;
614 int f;
39#include "opt_inet.h"
40
41#include <sys/param.h>
42#include <sys/conf.h>
43#include <sys/fcntl.h>
44#include <sys/filio.h>
45#include <sys/kernel.h>
46#include <sys/malloc.h>

--- 561 unchanged lines hidden (view full) ---

608static int
609tapioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
610{
611 struct tap_softc *tp = dev->si_drv1;
612 struct ifnet *ifp = tp->tap_ifp;
613 struct tapinfo *tapp = NULL;
614 int s;
615 int f;
616#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
617 defined(COMPAT_FREEBSD4)
618 int ival;
619#endif
615
616 switch (cmd) {
617 case TAPSIFINFO:
618 s = splimp();
619 tapp = (struct tapinfo *)data;
620 ifp->if_mtu = tapp->mtu;
621 ifp->if_type = tapp->type;
622 ifp->if_baudrate = tapp->baudrate;

--- 58 unchanged lines hidden (view full) ---

681 return (0);
682
683 /* VMware/VMnet port ioctl's */
684
685 case SIOCGIFFLAGS: /* get ifnet flags */
686 bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags));
687 break;
688
620
621 switch (cmd) {
622 case TAPSIFINFO:
623 s = splimp();
624 tapp = (struct tapinfo *)data;
625 ifp->if_mtu = tapp->mtu;
626 ifp->if_type = tapp->type;
627 ifp->if_baudrate = tapp->baudrate;

--- 58 unchanged lines hidden (view full) ---

686 return (0);
687
688 /* VMware/VMnet port ioctl's */
689
690 case SIOCGIFFLAGS: /* get ifnet flags */
691 bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags));
692 break;
693
694#if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \
695 defined(COMPAT_FREEBSD4)
696 case _IO('V', 0):
697 ival = IOCPARM_IVAL(data);
698 data = (caddr_t)&ival;
699 /* FALLTHROUGH */
700#endif
689 case VMIO_SIOCSIFFLAGS: /* VMware/VMnet SIOCSIFFLAGS */
701 case VMIO_SIOCSIFFLAGS: /* VMware/VMnet SIOCSIFFLAGS */
690 f = *(intptr_t *)data;
702 f = *(int *)data;
691 f &= 0x0fff;
692 f &= ~IFF_CANTCHANGE;
693 f |= IFF_UP;
694
695 s = splimp();
696 ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE);
697 splx(s);
698 break;

--- 274 unchanged lines hidden ---
703 f &= 0x0fff;
704 f &= ~IFF_CANTCHANGE;
705 f |= IFF_UP;
706
707 s = splimp();
708 ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE);
709 splx(s);
710 break;

--- 274 unchanged lines hidden ---