1/*
2 * Copyright (c) 1982, 1989, 1993
3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/net/if_ethersubr.c 107114 2002-11-20 19:07:27Z luigi $
35 */
36
37#include "opt_atalk.h"
38#include "opt_inet.h"
39#include "opt_inet6.h"
40#include "opt_ipx.h"
41#include "opt_bdg.h"
42#include "opt_mac.h"
--- 422 unchanged lines hidden (view full) ---
465 args.eh = &save_eh; /* MAC header for bridged/MAC packets */
466 i = ip_fw_chk_ptr(&args);
467 m = args.m;
468 if (m != NULL) {
469 /*
470 * Restore Ethernet header, as needed, in case the
471 * mbuf chain was replaced by ipfw.
472 */
473 M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT);
474 if (m == NULL) {
475 *m0 = m;
476 return 0;
477 }
478 if (eh != mtod(m, struct ether_header *))
479 bcopy(&save_eh, mtod(m, struct ether_header *),
480 ETHER_HDR_LEN);
481 }
--- 407 unchanged lines hidden (view full) ---
889 * hand the packet to it for last chance processing;
890 * otherwise dispose of it.
891 */
892 if (ng_ether_input_orphan_p != NULL) {
893 /*
894 * Put back the ethernet header so netgraph has a
895 * consistent view of inbound packets.
896 */
897 M_PREPEND(m, sizeof (struct ether_header), M_NOWAIT);
898 (*ng_ether_input_orphan_p)(ifp, m);
899 return;
900 }
901 m_freem(m);
902}
903
904/*
905 * Convert Ethernet address to printable (loggable) representation.
--- 257 unchanged lines hidden ---
2 * Copyright (c) 1982, 1989, 1993
3 * The Regents of the University of California. 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 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/net/if_ethersubr.c 107114 2002-11-20 19:07:27Z luigi $
35 */
36
37#include "opt_atalk.h"
38#include "opt_inet.h"
39#include "opt_inet6.h"
40#include "opt_ipx.h"
41#include "opt_bdg.h"
42#include "opt_mac.h"
--- 422 unchanged lines hidden (view full) ---
465 args.eh = &save_eh; /* MAC header for bridged/MAC packets */
466 i = ip_fw_chk_ptr(&args);
467 m = args.m;
468 if (m != NULL) {
469 /*
470 * Restore Ethernet header, as needed, in case the
471 * mbuf chain was replaced by ipfw.
472 */
473 M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT);
474 if (m == NULL) {
475 *m0 = m;
476 return 0;
477 }
478 if (eh != mtod(m, struct ether_header *))
479 bcopy(&save_eh, mtod(m, struct ether_header *),
480 ETHER_HDR_LEN);
481 }
--- 407 unchanged lines hidden (view full) ---
889 * hand the packet to it for last chance processing;
890 * otherwise dispose of it.
891 */
892 if (ng_ether_input_orphan_p != NULL) {
893 /*
894 * Put back the ethernet header so netgraph has a
895 * consistent view of inbound packets.
896 */
897 M_PREPEND(m, sizeof (struct ether_header), M_NOWAIT);
898 (*ng_ether_input_orphan_p)(ifp, m);
899 return;
900 }
901 m_freem(m);
902}
903
904/*
905 * Convert Ethernet address to printable (loggable) representation.
--- 257 unchanged lines hidden ---