diff options
author | mav <mav@FreeBSD.org> | 2008-06-01 12:29:23 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2008-06-01 12:29:23 +0000 |
commit | 2b86a2d4de2912ac6e837f21fe15dd4e734fb001 (patch) | |
tree | 341122d5d3dfca1908f5f680ee5ca72fc7167bf6 | |
parent | f9451aca1bec577f1da039b2b26170eec074401a (diff) | |
download | FreeBSD-src-2b86a2d4de2912ac6e837f21fe15dd4e734fb001.zip FreeBSD-src-2b86a2d4de2912ac6e837f21fe15dd4e734fb001.tar.gz |
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.
-rw-r--r-- | sys/netinet/ip_fw_nat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet/ip_fw_nat.c b/sys/netinet/ip_fw_nat.c index bac0d41..3a4f4a1 100644 --- a/sys/netinet/ip_fw_nat.c +++ b/sys/netinet/ip_fw_nat.c @@ -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: |