Deleted Added
full compact
if_tun.c (148887) if_tun.c (159180)
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 148887 2005-08-09 10:20:02Z rwatson $
16 * $FreeBSD: head/sys/net/if_tun.c 159180 2006-06-02 19:59:33Z csjp $
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

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

504 }
505
506 /* BPF writes need to be handled specially. */
507 if (dst->sa_family == AF_UNSPEC) {
508 bcopy(dst->sa_data, &af, sizeof(af));
509 dst->sa_family = af;
510 }
511
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

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

504 }
505
506 /* BPF writes need to be handled specially. */
507 if (dst->sa_family == AF_UNSPEC) {
508 bcopy(dst->sa_data, &af, sizeof(af));
509 dst->sa_family = af;
510 }
511
512 if (ifp->if_bpf) {
512 if (bpf_peers_present(ifp->if_bpf)) {
513 af = dst->sa_family;
514 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0);
515 }
516
517 /* prepend sockaddr? this may abort if the mbuf allocation fails */
518 if (cached_tun_flags & TUN_LMODE) {
519 /* allocate space for sockaddr */
520 M_PREPEND(m0, dst->sa_len, M_DONTWAIT);

--- 345 unchanged lines hidden ---
513 af = dst->sa_family;
514 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m0);
515 }
516
517 /* prepend sockaddr? this may abort if the mbuf allocation fails */
518 if (cached_tun_flags & TUN_LMODE) {
519 /* allocate space for sockaddr */
520 M_PREPEND(m0, dst->sa_len, M_DONTWAIT);

--- 345 unchanged lines hidden ---