Deleted Added
full compact
if_tun.c (139823) if_tun.c (144389)
1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */
2
3/*-
4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
5 * Nottingham University 1987.
6 *
7 * This source may be freely distributed, however I would be interested
8 * in any changes that are made.
9 *
10 * This driver takes packets off the IP i/f and hands them up to a
11 * user process to have its wicked way with. This driver has it's
12 * roots in a similar driver written by Phil Cockcroft (formerly) at
13 * UCL. This driver is based much more on read/write/poll mode of
14 * operation though.
15 *
1/* $NetBSD: if_tun.c,v 1.14 1994/06/29 06:36:25 cgd Exp $ */
2
3/*-
4 * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk>
5 * Nottingham University 1987.
6 *
7 * This source may be freely distributed, however I would be interested
8 * in any changes that are made.
9 *
10 * This driver takes packets off the IP i/f and hands them up to a
11 * user process to have its wicked way with. This driver has it's
12 * roots in a similar driver written by Phil Cockcroft (formerly) at
13 * UCL. This driver is based much more on read/write/poll mode of
14 * operation though.
15 *
16 * $FreeBSD: head/sys/net/if_tun.c 139823 2005-01-07 01:45:51Z imp $
16 * $FreeBSD: head/sys/net/if_tun.c 144389 2005-03-31 12:19:44Z phk $
17 */
18
19#include "opt_atalk.h"
20#include "opt_inet.h"
21#include "opt_inet6.h"
22#include "opt_ipx.h"
23#include "opt_mac.h"
24

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

150 return; /* Unit number too high */
151
152 /* find any existing device, or allocate new unit number */
153 i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0);
154 if (i) {
155 /* No preexisting struct cdev *, create one */
156 *dev = make_dev(&tun_cdevsw, unit2minor(u),
157 UID_UUCP, GID_DIALER, 0600, "tun%d", u);
17 */
18
19#include "opt_atalk.h"
20#include "opt_inet.h"
21#include "opt_inet6.h"
22#include "opt_ipx.h"
23#include "opt_mac.h"
24

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

150 return; /* Unit number too high */
151
152 /* find any existing device, or allocate new unit number */
153 i = clone_create(&tunclones, &tun_cdevsw, &u, dev, 0);
154 if (i) {
155 /* No preexisting struct cdev *, create one */
156 *dev = make_dev(&tun_cdevsw, unit2minor(u),
157 UID_UUCP, GID_DIALER, 0600, "tun%d", u);
158 if (*dev != NULL)
158 if (*dev != NULL) {
159 dev_ref(*dev);
159 (*dev)->si_flags |= SI_CHEAPCLONE;
160 (*dev)->si_flags |= SI_CHEAPCLONE;
161 }
160 }
161}
162
163static void
164tun_destroy(struct tun_softc *tp)
165{
166 struct cdev *dev;
167

--- 689 unchanged lines hidden ---
162 }
163}
164
165static void
166tun_destroy(struct tun_softc *tp)
167{
168 struct cdev *dev;
169

--- 689 unchanged lines hidden ---