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 254889 2013-08-25 21:54:41Z markj $"); |
34 35#include "opt_ipfw.h" 36#include "opt_ipsec.h" |
37#include "opt_kdtrace.h" |
38#include "opt_mbuf_stress_test.h" 39#include "opt_mpath.h" |
40#include "opt_route.h" |
41#include "opt_sctp.h" 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/kernel.h> 46#include <sys/malloc.h> 47#include <sys/mbuf.h> 48#include <sys/priv.h> 49#include <sys/proc.h> 50#include <sys/protosw.h> |
51#include <sys/sdt.h> |
52#include <sys/socket.h> 53#include <sys/socketvar.h> 54#include <sys/sysctl.h> 55#include <sys/ucred.h> 56 57#include <net/if.h> 58#include <net/if_llatbl.h> 59#include <net/netisr.h> 60#include <net/pfil.h> 61#include <net/route.h> 62#include <net/flowtable.h> 63#ifdef RADIX_MPATH 64#include <net/radix_mpath.h> 65#endif 66#include <net/vnet.h> 67 68#include <netinet/in.h> |
69#include <netinet/in_kdtrace.h> |
70#include <netinet/in_systm.h> 71#include <netinet/ip.h> 72#include <netinet/in_pcb.h> 73#include <netinet/in_var.h> 74#include <netinet/ip_var.h> 75#include <netinet/ip_options.h> 76#ifdef SCTP 77#include <netinet/sctp.h> --- 542 unchanged lines hidden (view full) --- 620 if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) 621 m = m_fragment(m, M_NOWAIT, mbuf_frag_size); 622#endif 623 /* 624 * Reset layer specific mbuf flags 625 * to avoid confusing lower layers. 626 */ 627 m_clrprotoflags(m); |
628 IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); |
629 error = (*ifp->if_output)(ifp, m, 630 (const struct sockaddr *)gw, ro); 631 goto done; 632 } 633 634 /* Balk when DF bit is set or the interface didn't support TSO. */ 635 if ((ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { 636 error = EMSGSIZE; --- 18 unchanged lines hidden (view full) --- 655 ia->ia_ifa.if_obytes += m->m_pkthdr.len; 656 } 657 /* 658 * Reset layer specific mbuf flags 659 * to avoid confusing upper layers. 660 */ 661 m_clrprotoflags(m); 662 |
663 IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); |
664 error = (*ifp->if_output)(ifp, m, 665 (const struct sockaddr *)gw, ro); 666 } else 667 m_freem(m); 668 } 669 670 if (error == 0) 671 IPSTAT_INC(ips_fragmented); --- 640 unchanged lines hidden --- |