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

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);