1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-23 07:31:31 +00:00

PKT_ALIAS_FOUND_HEADER_FRAGMENT result is not an error, so pass that packet.

This fixes packet fragmentation handeling.

Pass really available buffer size to libalias instead of MCLBYTES constant.
MCLBYTES constant were used with believe that m_megapullup() always moves
date into a fresh cluster that sometimes may become not so.
This commit is contained in:
Alexander Motin 2008-06-01 12:29:23 +00:00
parent aac54f0a70
commit 1913488d10
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179473

View File

@ -318,11 +318,12 @@ ipfw_nat(struct ip_fw_args *args, struct cfg_nat *t, struct mbuf *m)
c = mtod(mcl, char *);
if (args->oif == NULL)
retval = LibAliasIn(t->lib, c,
MCLBYTES);
mcl->m_len + M_TRAILINGSPACE(mcl));
else
retval = LibAliasOut(t->lib, c,
MCLBYTES);
if (retval != PKT_ALIAS_OK) {
mcl->m_len + M_TRAILINGSPACE(mcl));
if (retval != PKT_ALIAS_OK &&
retval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
/* XXX - should i add some logging? */
m_free(mcl);
badnat: