ip6_forward.c (236170) | ip6_forward.c (236332) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 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 --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 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 --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/ip6_forward.c 236170 2012-05-28 09:30:13Z bz $"); | 33__FBSDID("$FreeBSD: head/sys/netinet6/ip6_forward.c 236332 2012-05-30 20:56:07Z tuexen $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipfw.h" 38#include "opt_ipsec.h" 39#include "opt_ipstealth.h" 40 41#include <sys/param.h> --- 540 unchanged lines hidden (view full) --- 582 if (m->m_pkthdr.rcvif == NULL) 583 m->m_pkthdr.rcvif = V_loif; 584 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { 585 m->m_pkthdr.csum_flags |= 586 CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; 587 m->m_pkthdr.csum_data = 0xffff; 588 } 589#ifdef SCTP | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipfw.h" 38#include "opt_ipsec.h" 39#include "opt_ipstealth.h" 40 41#include <sys/param.h> --- 540 unchanged lines hidden (view full) --- 582 if (m->m_pkthdr.rcvif == NULL) 583 m->m_pkthdr.rcvif = V_loif; 584 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { 585 m->m_pkthdr.csum_flags |= 586 CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; 587 m->m_pkthdr.csum_data = 0xffff; 588 } 589#ifdef SCTP |
590 if (m->m_pkthdr.csum_flags & CSUM_SCTP) | 590 if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) |
591 m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; 592#endif 593 error = netisr_queue(NETISR_IPV6, m); 594 goto out; 595 } else 596 goto again; /* Redo the routing table lookup. */ 597 } 598 599#ifdef IPFIREWALL_FORWARD 600 /* See if local, if yes, send it to netisr. */ 601 if (m->m_flags & M_FASTFWD_OURS) { 602 if (m->m_pkthdr.rcvif == NULL) 603 m->m_pkthdr.rcvif = V_loif; 604 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { 605 m->m_pkthdr.csum_flags |= 606 CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; 607 m->m_pkthdr.csum_data = 0xffff; 608 } 609#ifdef SCTP | 591 m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; 592#endif 593 error = netisr_queue(NETISR_IPV6, m); 594 goto out; 595 } else 596 goto again; /* Redo the routing table lookup. */ 597 } 598 599#ifdef IPFIREWALL_FORWARD 600 /* See if local, if yes, send it to netisr. */ 601 if (m->m_flags & M_FASTFWD_OURS) { 602 if (m->m_pkthdr.rcvif == NULL) 603 m->m_pkthdr.rcvif = V_loif; 604 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { 605 m->m_pkthdr.csum_flags |= 606 CSUM_DATA_VALID_IPV6 | CSUM_PSEUDO_HDR; 607 m->m_pkthdr.csum_data = 0xffff; 608 } 609#ifdef SCTP |
610 if (m->m_pkthdr.csum_flags & CSUM_SCTP) 611 m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; 612#endif | 610 if (m->m_pkthdr.csum_flags & CSUM_SCTP_IPV6) 611 m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID; 612#endif |
613 error = netisr_queue(NETISR_IPV6, m); 614 goto out; 615 } 616 /* Or forward to some other address? */ 617 fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); 618 if (fwd_tag) { 619 dst = (struct sockaddr_in6 *)&rin6.ro_dst; 620 bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); --- 66 unchanged lines hidden --- | 613 error = netisr_queue(NETISR_IPV6, m); 614 goto out; 615 } 616 /* Or forward to some other address? */ 617 fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); 618 if (fwd_tag) { 619 dst = (struct sockaddr_in6 *)&rin6.ro_dst; 620 bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); --- 66 unchanged lines hidden --- |