The pfil(9) layer guarantees us presence of the protocol header,

so remove extra check, that is always false.

P.S. Also, goto there lead to unlocking a not locked rwlock.
This commit is contained in:
Gleb Smirnoff 2012-10-06 07:06:57 +00:00
parent 3dacd67e46
commit ea2951beed
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241244

View File

@ -5620,13 +5620,6 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
if (m->m_flags & M_SKIP_FIREWALL)
return (PF_PASS);
if (m->m_pkthdr.len < (int)sizeof(struct ip)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_SHORT);
log = 1;
goto done;
}
pd.pf_mtag = pf_find_mtag(m);
PF_RULES_RLOCK();
@ -5992,13 +5985,6 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0, struct inpcb *inp)
if (kif->pfik_flags & PFI_IFLAG_SKIP)
return (PF_PASS);
if (m->m_pkthdr.len < (int)sizeof(*h)) {
action = PF_DROP;
REASON_SET(&reason, PFRES_SHORT);
log = 1;
goto done;
}
PF_RULES_RLOCK();
/* We do IP header normalization and packet reassembly here */