Remove a tautological compare for offset != 0.

MFC after:	1 week
This commit is contained in:
Cy Schubert 2019-06-26 00:53:46 +00:00
parent 7f39a7e492
commit 2637412cbc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349400

View File

@ -1732,24 +1732,22 @@ ipf_pr_ipv4hdr(fin)
fi->fi_flx |= FI_FRAG; fi->fi_flx |= FI_FRAG;
off &= IP_OFFMASK; off &= IP_OFFMASK;
if (off != 0) { fin->fin_flx |= FI_FRAGBODY;
fin->fin_flx |= FI_FRAGBODY; off <<= 3;
off <<= 3; if ((off + fin->fin_dlen > 65535) ||
if ((off + fin->fin_dlen > 65535) || (fin->fin_dlen == 0) ||
(fin->fin_dlen == 0) || ((morefrag != 0) && ((fin->fin_dlen & 7) != 0))) {
((morefrag != 0) && ((fin->fin_dlen & 7) != 0))) { /*
/* * The length of the packet, starting at its
* The length of the packet, starting at its * offset cannot exceed 65535 (0xffff) as the
* offset cannot exceed 65535 (0xffff) as the * length of an IP packet is only 16 bits.
* length of an IP packet is only 16 bits. *
* * Any fragment that isn't the last fragment
* Any fragment that isn't the last fragment * must have a length greater than 0 and it
* must have a length greater than 0 and it * must be an even multiple of 8.
* must be an even multiple of 8. */
*/ fi->fi_flx |= FI_BAD;
fi->fi_flx |= FI_BAD; DT1(ipf_fi_bad_fragbody_gt_65535, fr_info_t *, fin);
DT1(ipf_fi_bad_fragbody_gt_65535, fr_info_t *, fin);
}
} }
} }
fin->fin_off = off; fin->fin_off = off;