Deleted Added
full compact
if_tun.c (163606) if_tun.c (163915)
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 163606 2006-10-22 11:52:19Z rwatson $
16 * $FreeBSD: head/sys/net/if_tun.c 163915 2006-11-02 17:37:22Z andre $
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

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

785 if (uio->uio_resid == 0)
786 return (0);
787
788 if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
789 TUNDEBUG(ifp, "len=%d!\n", uio->uio_resid);
790 return (EIO);
791 }
792
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

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

785 if (uio->uio_resid == 0)
786 return (0);
787
788 if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) {
789 TUNDEBUG(ifp, "len=%d!\n", uio->uio_resid);
790 return (EIO);
791 }
792
793 if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0)) == NULL) {
793 if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) {
794 ifp->if_ierrors++;
795 return (error);
796 }
797
798 m->m_pkthdr.rcvif = ifp;
799#ifdef MAC
800 mac_create_mbuf_from_ifnet(ifp, m);
801#endif

--- 177 unchanged lines hidden ---
794 ifp->if_ierrors++;
795 return (error);
796 }
797
798 m->m_pkthdr.rcvif = ifp;
799#ifdef MAC
800 mac_create_mbuf_from_ifnet(ifp, m);
801#endif

--- 177 unchanged lines hidden ---