Deleted Added
full compact
ip_output.c (242161) ip_output.c (242463)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 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

--- 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 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 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

--- 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 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/ip_output.c 242161 2012-10-26 21:06:33Z glebius $");
33__FBSDID("$FreeBSD: head/sys/netinet/ip_output.c 242463 2012-11-02 01:20:55Z ae $");
34
35#include "opt_ipfw.h"
36#include "opt_ipsec.h"
37#include "opt_route.h"
38#include "opt_mbuf_stress_test.h"
39#include "opt_mpath.h"
40#include "opt_sctp.h"
41

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

532 goto done;
533 } else {
534 if (ia != NULL)
535 ifa_free(&ia->ia_ifa);
536 goto again; /* Redo the routing table lookup. */
537 }
538 }
539
34
35#include "opt_ipfw.h"
36#include "opt_ipsec.h"
37#include "opt_route.h"
38#include "opt_mbuf_stress_test.h"
39#include "opt_mpath.h"
40#include "opt_sctp.h"
41

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

532 goto done;
533 } else {
534 if (ia != NULL)
535 ifa_free(&ia->ia_ifa);
536 goto again; /* Redo the routing table lookup. */
537 }
538 }
539
540 if (V_pfilforward == 0)
541 goto passout;
542
543 /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */
544 if (m->m_flags & M_FASTFWD_OURS) {
545 if (m->m_pkthdr.rcvif == NULL)
546 m->m_pkthdr.rcvif = V_loif;
547 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
548 m->m_pkthdr.csum_flags |=
549 CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
550 m->m_pkthdr.csum_data = 0xffff;

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

555#endif
556 m->m_pkthdr.csum_flags |=
557 CSUM_IP_CHECKED | CSUM_IP_VALID;
558
559 error = netisr_queue(NETISR_IP, m);
560 goto done;
561 }
562 /* Or forward to some other address? */
540 /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */
541 if (m->m_flags & M_FASTFWD_OURS) {
542 if (m->m_pkthdr.rcvif == NULL)
543 m->m_pkthdr.rcvif = V_loif;
544 if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
545 m->m_pkthdr.csum_flags |=
546 CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
547 m->m_pkthdr.csum_data = 0xffff;

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

552#endif
553 m->m_pkthdr.csum_flags |=
554 CSUM_IP_CHECKED | CSUM_IP_VALID;
555
556 error = netisr_queue(NETISR_IP, m);
557 goto done;
558 }
559 /* Or forward to some other address? */
563 fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
564 if (fwd_tag) {
560 if ((m->m_flags & M_IP_NEXTHOP) &&
561 (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) {
565 dst = (struct sockaddr_in *)&ro->ro_dst;
566 bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in));
567 m->m_flags |= M_SKIP_FIREWALL;
562 dst = (struct sockaddr_in *)&ro->ro_dst;
563 bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in));
564 m->m_flags |= M_SKIP_FIREWALL;
565 m->m_flags &= ~M_IP_NEXTHOP;
568 m_tag_delete(m, fwd_tag);
569 if (ia != NULL)
570 ifa_free(&ia->ia_ifa);
571 goto again;
572 }
573
574passout:
575 /* 127/8 must not appear on wire - RFC1122. */

--- 749 unchanged lines hidden ---
566 m_tag_delete(m, fwd_tag);
567 if (ia != NULL)
568 ifa_free(&ia->ia_ifa);
569 goto again;
570 }
571
572passout:
573 /* 127/8 must not appear on wire - RFC1122. */

--- 749 unchanged lines hidden ---