Deleted Added
full compact
if_tap.c (137101) if_tap.c (139207)
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 137101 2004-10-31 17:39:46Z glebius $
34 * $FreeBSD: head/sys/net/if_tap.c 139207 2004-12-22 17:38:43Z phk $
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
38#include "opt_inet.h"
39
40#include <sys/param.h>
41#include <sys/conf.h>
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
38#include "opt_inet.h"
39
40#include <sys/param.h>
41#include <sys/conf.h>
42#include <sys/filedesc.h>
42#include <sys/fcntl.h>
43#include <sys/filio.h>
44#include <sys/kernel.h>
45#include <sys/malloc.h>
46#include <sys/mbuf.h>
47#include <sys/module.h>
48#include <sys/poll.h>
49#include <sys/proc.h>
43#include <sys/filio.h>
44#include <sys/kernel.h>
45#include <sys/malloc.h>
46#include <sys/mbuf.h>
47#include <sys/module.h>
48#include <sys/poll.h>
49#include <sys/proc.h>
50#include <sys/selinfo.h>
50#include <sys/signalvar.h>
51#include <sys/socket.h>
52#include <sys/sockio.h>
53#include <sys/sysctl.h>
54#include <sys/systm.h>
55#include <sys/ttycom.h>
56#include <sys/uio.h>
51#include <sys/signalvar.h>
52#include <sys/socket.h>
53#include <sys/sockio.h>
54#include <sys/sysctl.h>
55#include <sys/systm.h>
56#include <sys/ttycom.h>
57#include <sys/uio.h>
57#include <sys/vnode.h>
58#include <sys/queue.h>
59
60#include <net/bpf.h>
61#include <net/ethernet.h>
62#include <net/if.h>
63#include <net/if_arp.h>
64#include <net/route.h>
65

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

747
748 /* sleep until we get a packet */
749 do {
750 s = splimp();
751 IF_DEQUEUE(&ifp->if_snd, m);
752 splx(s);
753
754 if (m == NULL) {
58#include <sys/queue.h>
59
60#include <net/bpf.h>
61#include <net/ethernet.h>
62#include <net/if.h>
63#include <net/if_arp.h>
64#include <net/route.h>
65

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

747
748 /* sleep until we get a packet */
749 do {
750 s = splimp();
751 IF_DEQUEUE(&ifp->if_snd, m);
752 splx(s);
753
754 if (m == NULL) {
755 if (flag & IO_NDELAY)
755 if (flag & O_NONBLOCK)
756 return (EWOULDBLOCK);
757
758 mtx_lock(&tp->tap_mtx);
759 tp->tap_flags |= TAP_RWAIT;
760 mtx_unlock(&tp->tap_mtx);
761 error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0);
762 if (error)
763 return (error);

--- 112 unchanged lines hidden ---
756 return (EWOULDBLOCK);
757
758 mtx_lock(&tp->tap_mtx);
759 tp->tap_flags |= TAP_RWAIT;
760 mtx_unlock(&tp->tap_mtx);
761 error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0);
762 if (error)
763 return (error);

--- 112 unchanged lines hidden ---