Deleted Added
full compact
ip_reass.c (254518) ip_reass.c (254804)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 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_input.c 8.2 (Berkeley) 1/4/94
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 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_input.c 8.2 (Berkeley) 1/4/94
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/netinet/ip_input.c 254518 2013-08-19 10:34:10Z andre $");
33__FBSDID("$FreeBSD: head/sys/netinet/ip_input.c 254804 2013-08-24 19:51:18Z andre $");
34
35#include "opt_bootp.h"
36#include "opt_ipfw.h"
37#include "opt_ipstealth.h"
38#include "opt_ipsec.h"
39#include "opt_route.h"
40
41#include <sys/param.h>

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

916 m->m_flags &= ~M_IP_FRAG;
917 ip->ip_off = htons(ntohs(ip->ip_off) << 3);
918
919 /*
920 * Attempt reassembly; if it succeeds, proceed.
921 * ip_reass() will return a different mbuf.
922 */
923 IPSTAT_INC(ips_fragments);
34
35#include "opt_bootp.h"
36#include "opt_ipfw.h"
37#include "opt_ipstealth.h"
38#include "opt_ipsec.h"
39#include "opt_route.h"
40
41#include <sys/param.h>

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

916 m->m_flags &= ~M_IP_FRAG;
917 ip->ip_off = htons(ntohs(ip->ip_off) << 3);
918
919 /*
920 * Attempt reassembly; if it succeeds, proceed.
921 * ip_reass() will return a different mbuf.
922 */
923 IPSTAT_INC(ips_fragments);
924 m->m_pkthdr.header = ip;
924 m->m_pkthdr.PH_loc.ptr = ip;
925
926 /* Previous ip_reass() started here. */
927 /*
928 * Presence of header sizes in mbufs
929 * would confuse code below.
930 */
931 m->m_data += hlen;
932 m->m_len -= hlen;

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

959 goto done;
960 } else {
961 fp->ipq_nfrags++;
962#ifdef MAC
963 mac_ipq_update(m, fp);
964#endif
965 }
966
925
926 /* Previous ip_reass() started here. */
927 /*
928 * Presence of header sizes in mbufs
929 * would confuse code below.
930 */
931 m->m_data += hlen;
932 m->m_len -= hlen;

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

959 goto done;
960 } else {
961 fp->ipq_nfrags++;
962#ifdef MAC
963 mac_ipq_update(m, fp);
964#endif
965 }
966
967#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header))
967#define GETIP(m) ((struct ip*)((m)->m_pkthdr.PH_loc.ptr))
968
969 /*
970 * Handle ECN by comparing this segment with the first one;
971 * if CE is set, do not lose CE.
972 * drop if CE and not-ECT are mixed for the same packet.
973 */
974 ecn = ip->ip_tos & IPTOS_ECN_MASK;
975 ecn0 = GETIP(fp->ipq_frags)->ip_tos & IPTOS_ECN_MASK;

--- 788 unchanged lines hidden ---
968
969 /*
970 * Handle ECN by comparing this segment with the first one;
971 * if CE is set, do not lose CE.
972 * drop if CE and not-ECT are mixed for the same packet.
973 */
974 ecn = ip->ip_tos & IPTOS_ECN_MASK;
975 ecn0 = GETIP(fp->ipq_frags)->ip_tos & IPTOS_ECN_MASK;

--- 788 unchanged lines hidden ---