Deleted Added
full compact
if_faith.c (122922) if_faith.c (123922)
1/* $KAME: if_faith.c,v 1.23 2001/12/17 13:55:29 sumikawa Exp $ */
2
3/*
4 * Copyright (c) 1982, 1986, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
1/* $KAME: if_faith.c,v 1.23 2001/12/17 13:55:29 sumikawa Exp $ */
2
3/*
4 * Copyright (c) 1982, 1986, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

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

27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * $FreeBSD: head/sys/net/if_faith.c 122922 2003-11-20 20:07:39Z andre $
35 * $FreeBSD: head/sys/net/if_faith.c 123922 2003-12-28 03:56:00Z sam $
36 */
37/*
38 * derived from
39 * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
40 * Id: if_loop.c,v 1.22 1996/06/19 16:24:10 wollman Exp
41 */
42
43/*

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

208 if (dst->sa_family == AF_UNSPEC) {
209 dst->sa_family = *(mtod(m, int *));
210 m->m_len -= sizeof(int);
211 m->m_pkthdr.len -= sizeof(int);
212 m->m_data += sizeof(int);
213 }
214
215 if (ifp->if_bpf) {
36 */
37/*
38 * derived from
39 * @(#)if_loop.c 8.1 (Berkeley) 6/10/93
40 * Id: if_loop.c,v 1.22 1996/06/19 16:24:10 wollman Exp
41 */
42
43/*

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

208 if (dst->sa_family == AF_UNSPEC) {
209 dst->sa_family = *(mtod(m, int *));
210 m->m_len -= sizeof(int);
211 m->m_pkthdr.len -= sizeof(int);
212 m->m_data += sizeof(int);
213 }
214
215 if (ifp->if_bpf) {
216 /*
217 * We need to prepend the address family as
218 * a four byte field. Cons up a faith header
219 * to pacify bpf. This is safe because bpf
220 * will only read from the mbuf (i.e., it won't
221 * try to free it or keep a pointer a to it).
222 */
223 struct mbuf m0;
224 u_int32_t af = dst->sa_family;
216 u_int32_t af = dst->sa_family;
225
226 m0.m_next = m;
227 m0.m_len = 4;
228 m0.m_data = (char *)⁡
229
230 BPF_MTAP(ifp, &m0);
217 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
231 }
232
233 if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
234 m_freem(m);
235 return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
236 rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
237 }
238 ifp->if_opackets++;

--- 131 unchanged lines hidden ---
218 }
219
220 if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
221 m_freem(m);
222 return (rt->rt_flags & RTF_BLACKHOLE ? 0 :
223 rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
224 }
225 ifp->if_opackets++;

--- 131 unchanged lines hidden ---