Deleted Added
full compact
if_tap.c (204464) if_tap.c (205024)
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 204464 2010-02-28 16:25:49Z kib $
34 * $FreeBSD: head/sys/net/if_tap.c 205024 2010-03-11 17:56:46Z qingli $
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
38#include "opt_compat.h"
39#include "opt_inet.h"
40
41#include <sys/param.h>
42#include <sys/conf.h>

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

497 ifp = tp->tap_ifp;
498 mtx_unlock(&tp->tap_mtx);
499
500 s = splimp();
501 ifp->if_drv_flags |= IFF_DRV_RUNNING;
502 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
503 if (tapuponopen)
504 ifp->if_flags |= IFF_UP;
35 * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $
36 */
37
38#include "opt_compat.h"
39#include "opt_inet.h"
40
41#include <sys/param.h>
42#include <sys/conf.h>

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

497 ifp = tp->tap_ifp;
498 mtx_unlock(&tp->tap_mtx);
499
500 s = splimp();
501 ifp->if_drv_flags |= IFF_DRV_RUNNING;
502 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
503 if (tapuponopen)
504 ifp->if_flags |= IFF_UP;
505 if_link_state_change(ifp, LINK_STATE_UP);
505 splx(s);
506
507 TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev));
508
509 return (0);
510} /* tapopen */
511
512

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

542 }
543 if_purgeaddrs(ifp);
544 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
545 }
546 splx(s);
547 } else
548 mtx_unlock(&tp->tap_mtx);
549
506 splx(s);
507
508 TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev));
509
510 return (0);
511} /* tapopen */
512
513

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

543 }
544 if_purgeaddrs(ifp);
545 ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
546 }
547 splx(s);
548 } else
549 mtx_unlock(&tp->tap_mtx);
550
551 if_link_state_change(ifp, LINK_STATE_DOWN);
550 funsetown(&tp->tap_sigio);
551 selwakeuppri(&tp->tap_rsel, PZERO+1);
552 KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0);
553
554 mtx_lock(&tp->tap_mtx);
555 tp->tap_flags &= ~TAP_OPEN;
556 tp->tap_pid = 0;
557 mtx_unlock(&tp->tap_mtx);

--- 551 unchanged lines hidden ---
552 funsetown(&tp->tap_sigio);
553 selwakeuppri(&tp->tap_rsel, PZERO+1);
554 KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0);
555
556 mtx_lock(&tp->tap_mtx);
557 tp->tap_flags &= ~TAP_OPEN;
558 tp->tap_pid = 0;
559 mtx_unlock(&tp->tap_mtx);

--- 551 unchanged lines hidden ---