Deleted Added
full compact
ip_output.c (150594) ip_output.c (151967)
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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
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

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

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
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 * $FreeBSD: head/sys/netinet/ip_output.c 150594 2005-09-26 20:25:16Z andre $
30 * $FreeBSD: head/sys/netinet/ip_output.c 151967 2005-11-02 13:46:32Z andre $
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipsec.h"
35#include "opt_mac.h"
36#include "opt_mbuf_stress_test.h"
37
38#include <sys/param.h>

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

936 * The fragments are linked off the m_nextpkt of the original
937 * packet, which after processing serves as the first fragment.
938 */
939 for (nfrags = 1; off < ip->ip_len; off += len, nfrags++) {
940 struct ip *mhip; /* ip header on the fragment */
941 struct mbuf *m;
942 int mhlen = sizeof (struct ip);
943
31 */
32
33#include "opt_ipfw.h"
34#include "opt_ipsec.h"
35#include "opt_mac.h"
36#include "opt_mbuf_stress_test.h"
37
38#include <sys/param.h>

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

936 * The fragments are linked off the m_nextpkt of the original
937 * packet, which after processing serves as the first fragment.
938 */
939 for (nfrags = 1; off < ip->ip_len; off += len, nfrags++) {
940 struct ip *mhip; /* ip header on the fragment */
941 struct mbuf *m;
942 int mhlen = sizeof (struct ip);
943
944 MGETHDR(m, M_DONTWAIT, MT_HEADER);
944 MGETHDR(m, M_DONTWAIT, MT_DATA);
945 if (m == NULL) {
946 error = ENOBUFS;
947 ipstat.ips_odropped++;
948 goto done;
949 }
950 m->m_flags |= (m0->m_flags & M_MCAST) | M_FRAG;
951 /*
952 * In the first mbuf, leave room for the link header, then

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

1062 optlen = opt->m_len - sizeof(p->ipopt_dst);
1063 if (optlen + ip->ip_len > IP_MAXPACKET) {
1064 *phlen = 0;
1065 return (m); /* XXX should fail */
1066 }
1067 if (p->ipopt_dst.s_addr)
1068 ip->ip_dst = p->ipopt_dst;
1069 if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
945 if (m == NULL) {
946 error = ENOBUFS;
947 ipstat.ips_odropped++;
948 goto done;
949 }
950 m->m_flags |= (m0->m_flags & M_MCAST) | M_FRAG;
951 /*
952 * In the first mbuf, leave room for the link header, then

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

1062 optlen = opt->m_len - sizeof(p->ipopt_dst);
1063 if (optlen + ip->ip_len > IP_MAXPACKET) {
1064 *phlen = 0;
1065 return (m); /* XXX should fail */
1066 }
1067 if (p->ipopt_dst.s_addr)
1068 ip->ip_dst = p->ipopt_dst;
1069 if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) {
1070 MGETHDR(n, M_DONTWAIT, MT_HEADER);
1070 MGETHDR(n, M_DONTWAIT, MT_DATA);
1071 if (n == NULL) {
1072 *phlen = 0;
1073 return (m);
1074 }
1075 M_MOVE_PKTHDR(n, m);
1076 n->m_pkthdr.rcvif = NULL;
1077#ifdef MAC
1078 mac_copy_mbuf(m, n);

--- 992 unchanged lines hidden ---
1071 if (n == NULL) {
1072 *phlen = 0;
1073 return (m);
1074 }
1075 M_MOVE_PKTHDR(n, m);
1076 n->m_pkthdr.rcvif = NULL;
1077#ifdef MAC
1078 mac_copy_mbuf(m, n);

--- 992 unchanged lines hidden ---