Changeset View
Standalone View
sys/netinet6/frag6.c
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
#include <sys/errno.h> | #include <sys/errno.h> | ||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#include <net/route.h> | #include <net/route.h> | ||||
#include <net/netisr.h> | |||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_var.h> | #include <netinet/in_var.h> | ||||
#include <netinet/ip6.h> | #include <netinet/ip6.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet/icmp6.h> | #include <netinet/icmp6.h> | ||||
#include <netinet/in_systm.h> /* for ECN definitions */ | #include <netinet/in_systm.h> /* for ECN definitions */ | ||||
▲ Show 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | #endif | ||||
if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ | if (m->m_flags & M_PKTHDR) { /* Isn't it always true? */ | ||||
int plen = 0; | int plen = 0; | ||||
for (t = m; t; t = t->m_next) | for (t = m; t; t = t->m_next) | ||||
plen += t->m_len; | plen += t->m_len; | ||||
m->m_pkthdr.len = plen; | m->m_pkthdr.len = plen; | ||||
} | } | ||||
IP6Q_UNLOCK(); | |||||
IP6STAT_INC(ip6s_reassembled); | IP6STAT_INC(ip6s_reassembled); | ||||
in6_ifstat_inc(dstifp, ifs6_reass_ok); | in6_ifstat_inc(dstifp, ifs6_reass_ok); | ||||
btw: I'm wondering whether it is a better choice to replace these error handling codes with a… | |||||
m->m_pkthdr.PH_loc.thirtytwo[0] = nxt; | |||||
adrianUnsubmitted Not Done Inline ActionsHi, This bit is fixing a separate bug, right? Are we able to commit just this bit first as a separate fix? adrian: Hi,
This bit is fixing a separate bug, right? Are we able to commit just this bit first as a… | |||||
btwAuthorUnsubmitted Not Done Inline ActionsThat bit is not fixing a separate bug. Previously, after the processing /* * Tell launch routine the next header */ *mp = m; *offp = offset; IP6Q_UNLOCK(); return nxt; And the processing of the next header will be invoked by the following while (nxt != IPPROTO_DONE) { ...... nxt = (*inet6sw[ip6_protox[nxt]].pr_input)(&m, &off, nxt); } But now, the processing of the rest headers (headers after the fragment PS. I'm not pretty sure whether it is the best choice to save the protocol Many thanks! ^_^ btw: That bit is not fixing a separate bug. Previously, after the processing
of fragment header, the… | |||||
m->m_pkthdr.PH_loc.thirtytwo[1] = offset; | |||||
Done Inline ActionsYou should just define it as a struct with two uint32_t members. That way (a) it doesn't change size based on different architectures (eg assuming int is a fixed 32 bit size isn't valid!) and (b) it's less error prone to use a struct with named fields. adrian: You should just define it as a struct with two uint32_t members. That way (a) it doesn't change… | |||||
/* | /* | ||||
* Tell launch routine the next header | * Queue/dispatch for reprocessing. | ||||
*/ | */ | ||||
netisr_dispatch(NETISR_IPV6_DIRECT, m); | |||||
*mp = m; | return IPPROTO_DONE; | ||||
*offp = offset; | |||||
IP6Q_UNLOCK(); | |||||
return nxt; | |||||
dropfrag: | dropfrag: | ||||
IP6Q_UNLOCK(); | IP6Q_UNLOCK(); | ||||
in6_ifstat_inc(dstifp, ifs6_reass_fail); | in6_ifstat_inc(dstifp, ifs6_reass_fail); | ||||
IP6STAT_INC(ip6s_fragdropped); | IP6STAT_INC(ip6s_fragdropped); | ||||
m_freem(m); | m_freem(m); | ||||
return IPPROTO_DONE; | return IPPROTO_DONE; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |
I'm wondering whether it is a better choice to replace these error handling codes with a KASSERT().