Deleted Added
full compact
if_stf.c (121816) if_stf.c (123922)
1/* $FreeBSD: head/sys/net/if_stf.c 121816 2003-10-31 18:32:15Z brooks $ */
1/* $FreeBSD: head/sys/net/if_stf.c 123922 2003-12-28 03:56:00Z sam $ */
2/* $KAME: if_stf.c,v 1.73 2001/12/03 11:08:30 keiichi Exp $ */
3
4/*
5 * Copyright (C) 2000 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

425 if (ifp->if_bpf) {
426 /*
427 * We need to prepend the address family as
428 * a four byte field. Cons up a dummy header
429 * to pacify bpf. This is safe because bpf
430 * will only read from the mbuf (i.e., it won't
431 * try to free it or keep a pointer a to it).
432 */
2/* $KAME: if_stf.c,v 1.73 2001/12/03 11:08:30 keiichi Exp $ */
3
4/*
5 * Copyright (C) 2000 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

425 if (ifp->if_bpf) {
426 /*
427 * We need to prepend the address family as
428 * a four byte field. Cons up a dummy header
429 * to pacify bpf. This is safe because bpf
430 * will only read from the mbuf (i.e., it won't
431 * try to free it or keep a pointer a to it).
432 */
433 struct mbuf m0;
434 u_int32_t af = AF_INET6;
433 u_int32_t af = AF_INET6;
434#ifdef HAVE_OLD_BPF
435 struct mbuf m0;
435
436 m0.m_next = m;
437 m0.m_len = 4;
438 m0.m_data = (char *)⁡
439
436
437 m0.m_next = m;
438 m0.m_len = 4;
439 m0.m_data = (char *)⁡
440
440#ifdef HAVE_OLD_BPF
441 BPF_MTAP(ifp, &m0);
442#else
441 BPF_MTAP(ifp, &m0);
442#else
443 bpf_mtap(ifp->if_bpf, &m0);
443 bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
444#endif
445 }
446#endif /*NBPFILTER > 0*/
447
448 M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
449 if (m && m->m_len < sizeof(struct ip))
450 m = m_pullup(m, sizeof(struct ip));
451 if (m == NULL) {

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

680 if (ifp->if_bpf) {
681 /*
682 * We need to prepend the address family as
683 * a four byte field. Cons up a dummy header
684 * to pacify bpf. This is safe because bpf
685 * will only read from the mbuf (i.e., it won't
686 * try to free it or keep a pointer a to it).
687 */
444#endif
445 }
446#endif /*NBPFILTER > 0*/
447
448 M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
449 if (m && m->m_len < sizeof(struct ip))
450 m = m_pullup(m, sizeof(struct ip));
451 if (m == NULL) {

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

680 if (ifp->if_bpf) {
681 /*
682 * We need to prepend the address family as
683 * a four byte field. Cons up a dummy header
684 * to pacify bpf. This is safe because bpf
685 * will only read from the mbuf (i.e., it won't
686 * try to free it or keep a pointer a to it).
687 */
688 struct mbuf m0;
689 u_int32_t af = AF_INET6;
688 u_int32_t af = AF_INET6;
689#ifdef HAVE_OLD_BPF
690 struct mbuf m0;
690
691 m0.m_next = m;
692 m0.m_len = 4;
693 m0.m_data = (char *)&af;
694
691
692 m0.m_next = m;
693 m0.m_len = 4;
694 m0.m_data = (char *)&af;
695
695#ifdef HAVE_OLD_BPF
696 BPF_MTAP(ifp, &m0);
697#else
696 BPF_MTAP(ifp, &m0);
697#else
698 bpf_mtap(ifp->if_bpf, &m0);
698 bpf_mtap2(ifp->if_bpf, &af, sizeof(ah), m);
699#endif
700 }
701
702 /*
703 * Put the packet to the network layer input queue according to the
704 * specified address family.
705 * See net/if_gif.c for possible issues with packet processing
706 * reorder due to extra queueing.

--- 70 unchanged lines hidden ---
699#endif
700 }
701
702 /*
703 * Put the packet to the network layer input queue according to the
704 * specified address family.
705 * See net/if_gif.c for possible issues with packet processing
706 * reorder due to extra queueing.

--- 70 unchanged lines hidden ---