Deleted Added
full compact
ip_fw_nat.c (185937) ip_fw_nat.c (188294)
1/*-
2 * Copyright (c) 2008 Paolo Pisati
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Paolo Pisati
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/netinet/ip_fw_nat.c 185937 2008-12-11 16:26:38Z bz $");
28__FBSDID("$FreeBSD: head/sys/netinet/ip_fw_nat.c 188294 2009-02-07 18:49:42Z piso $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/condvar.h>
33#include <sys/eventhandler.h>
34#include <sys/malloc.h>
35#include <sys/mbuf.h>
36#include <sys/kernel.h>

--- 284 unchanged lines hidden (view full) ---

321
322 c = mtod(mcl, char *);
323 if (args->oif == NULL)
324 retval = LibAliasIn(t->lib, c,
325 mcl->m_len + M_TRAILINGSPACE(mcl));
326 else
327 retval = LibAliasOut(t->lib, c,
328 mcl->m_len + M_TRAILINGSPACE(mcl));
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/condvar.h>
33#include <sys/eventhandler.h>
34#include <sys/malloc.h>
35#include <sys/mbuf.h>
36#include <sys/kernel.h>

--- 284 unchanged lines hidden (view full) ---

321
322 c = mtod(mcl, char *);
323 if (args->oif == NULL)
324 retval = LibAliasIn(t->lib, c,
325 mcl->m_len + M_TRAILINGSPACE(mcl));
326 else
327 retval = LibAliasOut(t->lib, c,
328 mcl->m_len + M_TRAILINGSPACE(mcl));
329 if (retval == PKT_ALIAS_RESPOND) {
330 m->m_flags |= M_SKIP_FIREWALL;
331 retval = PKT_ALIAS_OK;
332 }
329 if (retval != PKT_ALIAS_OK &&
330 retval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
331 /* XXX - should i add some logging? */
332 m_free(mcl);
333 badnat:
334 args->m = NULL;
335 return (IP_FW_DENY);
336 }

--- 328 unchanged lines hidden ---
333 if (retval != PKT_ALIAS_OK &&
334 retval != PKT_ALIAS_FOUND_HEADER_FRAGMENT) {
335 /* XXX - should i add some logging? */
336 m_free(mcl);
337 badnat:
338 args->m = NULL;
339 return (IP_FW_DENY);
340 }

--- 328 unchanged lines hidden ---