Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/frag6.c
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | #endif | ||||
atomic_add_int(&V_frag6_nfragpackets, 1); | atomic_add_int(&V_frag6_nfragpackets, 1); | ||||
/* ip6q_nxt will be filled afterwards, from 1st fragment. */ | /* ip6q_nxt will be filled afterwards, from 1st fragment. */ | ||||
TAILQ_INIT(&q6->ip6q_frags); | TAILQ_INIT(&q6->ip6q_frags); | ||||
q6->ip6q_ident = ip6f->ip6f_ident; | q6->ip6q_ident = ip6f->ip6f_ident; | ||||
q6->ip6q_ttl = IPV6_FRAGTTL; | q6->ip6q_ttl = IPV6_FRAGTTL; | ||||
q6->ip6q_src = ip6->ip6_src; | q6->ip6q_src = ip6->ip6_src; | ||||
q6->ip6q_dst = ip6->ip6_dst; | q6->ip6q_dst = ip6->ip6_dst; | ||||
q6->ip6q_ecn = | q6->ip6q_ecn = IPV6_ECN(ip6); | ||||
(ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; | |||||
q6->ip6q_unfrglen = -1; /* The 1st fragment has not arrived. */ | q6->ip6q_unfrglen = -1; /* The 1st fragment has not arrived. */ | ||||
/* Add the fragemented packet to the bucket. */ | /* Add the fragemented packet to the bucket. */ | ||||
TAILQ_INSERT_HEAD(head, q6, ip6q_tq); | TAILQ_INSERT_HEAD(head, q6, ip6q_tq); | ||||
V_ip6qb[bucket].count++; | V_ip6qb[bucket].count++; | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
/* Do duplicate, condition, and boundry checks. */ | /* Do duplicate, condition, and boundry checks. */ | ||||
/* | /* | ||||
* Handle ECN by comparing this segment with the first one; | * Handle ECN by comparing this segment with the first one; | ||||
* if CE is set, do not lose CE. | * if CE is set, do not lose CE. | ||||
* Drop if CE and not-ECT are mixed for the same packet. | * Drop if CE and not-ECT are mixed for the same packet. | ||||
*/ | */ | ||||
ecn = (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; | ecn = IPV6_ECN(ip6); | ||||
ecn0 = q6->ip6q_ecn; | ecn0 = q6->ip6q_ecn; | ||||
if (ecn == IPTOS_ECN_CE) { | if (ecn == IPTOS_ECN_CE) { | ||||
if (ecn0 == IPTOS_ECN_NOTECT) { | if (ecn0 == IPTOS_ECN_NOTECT) { | ||||
free(ip6af, M_FRAG6); | free(ip6af, M_FRAG6); | ||||
goto dropfrag; | goto dropfrag; | ||||
} | } | ||||
if (ecn0 != IPTOS_ECN_CE) | if (ecn0 != IPTOS_ECN_CE) | ||||
q6->ip6q_ecn = IPTOS_ECN_CE; | q6->ip6q_ecn = IPTOS_ECN_CE; | ||||
▲ Show 20 Lines • Show All 350 Lines • Show Last 20 Lines |