ip_fastfwd.c (196881) | ip_fastfwd.c (197952) |
---|---|
1/*- 2 * Copyright (c) 2003 Andre Oppermann, Internet Business Solutions AG 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 --- 60 unchanged lines hidden (view full) --- 69 */ 70 71/* 72 * Many thanks to Matt Thomas of NetBSD for basic structure of ip_flow.c which 73 * is being followed here. 74 */ 75 76#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2003 Andre Oppermann, Internet Business Solutions AG 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 --- 60 unchanged lines hidden (view full) --- 69 */ 70 71/* 72 * Many thanks to Matt Thomas of NetBSD for basic structure of ip_flow.c which 73 * is being followed here. 74 */ 75 76#include <sys/cdefs.h> |
77__FBSDID("$FreeBSD: head/sys/netinet/ip_fastfwd.c 196881 2009-09-06 07:29:22Z pjd $"); | 77__FBSDID("$FreeBSD: head/sys/netinet/ip_fastfwd.c 197952 2009-10-11 05:59:43Z julian $"); |
78 79#include "opt_ipfw.h" 80#include "opt_ipstealth.h" 81 82#include <sys/param.h> 83#include <sys/systm.h> 84#include <sys/kernel.h> 85#include <sys/malloc.h> --- 260 unchanged lines hidden (view full) --- 346 ip->ip_len = ntohs(ip->ip_len); 347 ip->ip_off = ntohs(ip->ip_off); 348 349 odest.s_addr = dest.s_addr = ip->ip_dst.s_addr; 350 351 /* 352 * Run through list of ipfilter hooks for input packets 353 */ | 78 79#include "opt_ipfw.h" 80#include "opt_ipstealth.h" 81 82#include <sys/param.h> 83#include <sys/systm.h> 84#include <sys/kernel.h> 85#include <sys/malloc.h> --- 260 unchanged lines hidden (view full) --- 346 ip->ip_len = ntohs(ip->ip_len); 347 ip->ip_off = ntohs(ip->ip_off); 348 349 odest.s_addr = dest.s_addr = ip->ip_dst.s_addr; 350 351 /* 352 * Run through list of ipfilter hooks for input packets 353 */ |
354 if (!PFIL_HOOKED(&inet_pfil_hook)) | 354 if (!PFIL_HOOKED(&V_inet_pfil_hook)) |
355 goto passin; 356 | 355 goto passin; 356 |
357 if (pfil_run_hooks(&inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || | 357 if (pfil_run_hooks( 358 &V_inet_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL) || |
358 m == NULL) 359 goto drop; 360 361 M_ASSERTVALID(m); 362 M_ASSERTPKTHDR(m); 363 364 ip = mtod(m, struct ip *); /* m may have changed by pfil hook */ 365 dest.s_addr = ip->ip_dst.s_addr; --- 67 unchanged lines hidden (view full) --- 433 434 /* 435 * Step 5: outgoing firewall packet processing 436 */ 437 438 /* 439 * Run through list of hooks for output packets. 440 */ | 359 m == NULL) 360 goto drop; 361 362 M_ASSERTVALID(m); 363 M_ASSERTPKTHDR(m); 364 365 ip = mtod(m, struct ip *); /* m may have changed by pfil hook */ 366 dest.s_addr = ip->ip_dst.s_addr; --- 67 unchanged lines hidden (view full) --- 434 435 /* 436 * Step 5: outgoing firewall packet processing 437 */ 438 439 /* 440 * Run through list of hooks for output packets. 441 */ |
441 if (!PFIL_HOOKED(&inet_pfil_hook)) | 442 if (!PFIL_HOOKED(&V_inet_pfil_hook)) |
442 goto passout; 443 | 443 goto passout; 444 |
444 if (pfil_run_hooks(&inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { | 445 if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { |
445 goto drop; 446 } 447 448 M_ASSERTVALID(m); 449 M_ASSERTPKTHDR(m); 450 451 ip = mtod(m, struct ip *); 452 dest.s_addr = ip->ip_dst.s_addr; --- 164 unchanged lines hidden --- | 446 goto drop; 447 } 448 449 M_ASSERTVALID(m); 450 M_ASSERTPKTHDR(m); 451 452 ip = mtod(m, struct ip *); 453 dest.s_addr = ip->ip_dst.s_addr; --- 164 unchanged lines hidden --- |