if_tun.c (194368) | if_tun.c (194990) |
---|---|
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 194368 2009-06-17 15:01:01Z bz $ | 16 * $FreeBSD: head/sys/net/if_tun.c 194990 2009-06-25 18:46:30Z kib $ |
17 */ 18 19#include "opt_atalk.h" 20#include "opt_inet.h" 21#include "opt_inet6.h" 22#include "opt_ipx.h" 23 24#include <sys/param.h> --- 858 unchanged lines hidden (view full) --- 883 if ((ifp->if_flags & IFF_UP) != IFF_UP) 884 /* ignore silently */ 885 return (0); 886 887 if (uio->uio_resid == 0) 888 return (0); 889 890 if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) { | 17 */ 18 19#include "opt_atalk.h" 20#include "opt_inet.h" 21#include "opt_inet6.h" 22#include "opt_ipx.h" 23 24#include <sys/param.h> --- 858 unchanged lines hidden (view full) --- 883 if ((ifp->if_flags & IFF_UP) != IFF_UP) 884 /* ignore silently */ 885 return (0); 886 887 if (uio->uio_resid == 0) 888 return (0); 889 890 if (uio->uio_resid < 0 || uio->uio_resid > TUNMRU) { |
891 TUNDEBUG(ifp, "len=%d!\n", uio->uio_resid); | 891 TUNDEBUG(ifp, "len=%zd!\n", uio->uio_resid); |
892 return (EIO); 893 } 894 895 if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) { 896 ifp->if_ierrors++; 897 return (error); 898 } 899 --- 183 unchanged lines hidden --- | 892 return (EIO); 893 } 894 895 if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) { 896 ifp->if_ierrors++; 897 return (error); 898 } 899 --- 183 unchanged lines hidden --- |