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 may become not so.
This commit is contained in:
Alexander Motin 2008-06-01 15:13:32 +00:00
parent 0fecb888b2
commit a9a13b54e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179477

View File

@ -704,14 +704,14 @@ ng_nat_rcvdata(hook_p hook, item_p item )
("ng_nat: ip_len != m_pkthdr.len"));
if (hook == priv->in) {
rval = LibAliasIn(priv->lib, c, MCLBYTES);
rval = LibAliasIn(priv->lib, c, m->m_len + M_TRAILINGSPACE(m));
if (rval != PKT_ALIAS_OK &&
rval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
NG_FREE_ITEM(item);
return (EINVAL);
}
} else if (hook == priv->out) {
rval = LibAliasOut(priv->lib, c, MCLBYTES);
rval = LibAliasOut(priv->lib, c, m->m_len + M_TRAILINGSPACE(m));
if (rval != PKT_ALIAS_OK) {
NG_FREE_ITEM(item);
return (EINVAL);