ip_input.c (121141) | ip_input.c (121684) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 | 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
34 * $FreeBSD: head/sys/netinet/ip_input.c 121141 2003-10-16 16:25:25Z sam $ | 34 * $FreeBSD: head/sys/netinet/ip_input.c 121684 2003-10-29 15:07:04Z ume $ |
35 */ 36 37#include "opt_bootp.h" 38#include "opt_ipfw.h" 39#include "opt_ipdn.h" 40#include "opt_ipdivert.h" 41#include "opt_ipfilter.h" 42#include "opt_ipstealth.h" --- 989 unchanged lines hidden (view full) --- 1032ip_reass(struct mbuf *m, struct ipqhead *head, struct ipq *fp, 1033 u_int32_t *divinfo, u_int16_t *divert_rule) 1034{ 1035 struct ip *ip = mtod(m, struct ip *); 1036 register struct mbuf *p, *q, *nq; 1037 struct mbuf *t; 1038 int hlen = ip->ip_hl << 2; 1039 int i, next; | 35 */ 36 37#include "opt_bootp.h" 38#include "opt_ipfw.h" 39#include "opt_ipdn.h" 40#include "opt_ipdivert.h" 41#include "opt_ipfilter.h" 42#include "opt_ipstealth.h" --- 989 unchanged lines hidden (view full) --- 1032ip_reass(struct mbuf *m, struct ipqhead *head, struct ipq *fp, 1033 u_int32_t *divinfo, u_int16_t *divert_rule) 1034{ 1035 struct ip *ip = mtod(m, struct ip *); 1036 register struct mbuf *p, *q, *nq; 1037 struct mbuf *t; 1038 int hlen = ip->ip_hl << 2; 1039 int i, next; |
1040 u_int8_t ecn, ecn0; |
|
1040 1041 IPQ_LOCK_ASSERT(); 1042 1043 /* 1044 * Presence of header sizes in mbufs 1045 * would confuse code below. 1046 */ 1047 m->m_data += hlen; --- 33 unchanged lines hidden (view full) --- 1081#ifdef MAC 1082 mac_update_ipq(m, fp); 1083#endif 1084 } 1085 1086#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header)) 1087 1088 /* | 1041 1042 IPQ_LOCK_ASSERT(); 1043 1044 /* 1045 * Presence of header sizes in mbufs 1046 * would confuse code below. 1047 */ 1048 m->m_data += hlen; --- 33 unchanged lines hidden (view full) --- 1082#ifdef MAC 1083 mac_update_ipq(m, fp); 1084#endif 1085 } 1086 1087#define GETIP(m) ((struct ip*)((m)->m_pkthdr.header)) 1088 1089 /* |
1090 * Handle ECN by comparing this segment with the first one; 1091 * if CE is set, do not lose CE. 1092 * drop if CE and not-ECT are mixed for the same packet. 1093 */ 1094 ecn = ip->ip_tos & IPTOS_ECN_MASK; 1095 ecn0 = GETIP(fp->ipq_frags)->ip_tos & IPTOS_ECN_MASK; 1096 if (ecn == IPTOS_ECN_CE) { 1097 if (ecn0 == IPTOS_ECN_NOTECT) 1098 goto dropfrag; 1099 if (ecn0 != IPTOS_ECN_CE) 1100 GETIP(fp->ipq_frags)->ip_tos |= IPTOS_ECN_CE; 1101 } 1102 if (ecn == IPTOS_ECN_NOTECT && ecn0 != IPTOS_ECN_NOTECT) 1103 goto dropfrag; 1104 1105 /* |
|
1089 * Find a segment which begins after this one does. 1090 */ 1091 for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) 1092 if (GETIP(q)->ip_off > ip->ip_off) 1093 break; 1094 1095 /* 1096 * If there is a preceding segment, it may provide some of --- 1180 unchanged lines hidden --- | 1106 * Find a segment which begins after this one does. 1107 */ 1108 for (p = NULL, q = fp->ipq_frags; q; p = q, q = q->m_nextpkt) 1109 if (GETIP(q)->ip_off > ip->ip_off) 1110 break; 1111 1112 /* 1113 * If there is a preceding segment, it may provide some of --- 1180 unchanged lines hidden --- |