ip_fw_sockopt.c (201122) | ip_fw_sockopt.c (201527) |
---|---|
1/*- 2 * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa 3 * 4 * Supported by: Valeria Paoli 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2009 Luigi Rizzo, Universita` di Pisa 3 * 4 * Supported by: Valeria Paoli 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/netinet/ipfw/ip_fw_sockopt.c 201122 2009-12-28 10:47:04Z luigi $"); | 29__FBSDID("$FreeBSD: head/sys/netinet/ipfw/ip_fw_sockopt.c 201527 2010-01-04 19:01:22Z luigi $"); |
30 31/* 32 * Sockopt support for ipfw. The routines here implement 33 * the upper half of the ipfw code. 34 */ 35 36#if !defined(KLD_MODULE) 37#include "opt_ipfw.h" --- 22 unchanged lines hidden (view full) --- 60#include <sys/syslog.h> 61#include <net/if.h> 62#include <net/route.h> 63#include <net/vnet.h> 64 65#include <netinet/in.h> 66#include <netinet/ip_fw.h> 67#include <netinet/ipfw/ip_fw_private.h> | 30 31/* 32 * Sockopt support for ipfw. The routines here implement 33 * the upper half of the ipfw code. 34 */ 35 36#if !defined(KLD_MODULE) 37#include "opt_ipfw.h" --- 22 unchanged lines hidden (view full) --- 60#include <sys/syslog.h> 61#include <net/if.h> 62#include <net/route.h> 63#include <net/vnet.h> 64 65#include <netinet/in.h> 66#include <netinet/ip_fw.h> 67#include <netinet/ipfw/ip_fw_private.h> |
68#include <netinet/ip_divert.h> | |
69 70#ifdef MAC 71#include <security/mac/mac_framework.h> 72#endif 73 74MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); 75 76/* --- 222 unchanged lines hidden (view full) --- 299 rule = chain->map[end]; 300 if (rulenum > 0 && rule->rulenum != rulenum) 301 break; 302 if (rule->set != RESVD_SET && 303 (cmd == 0 || rule->set == new_set) ) 304 n++; 305 } 306 } | 68 69#ifdef MAC 70#include <security/mac/mac_framework.h> 71#endif 72 73MALLOC_DEFINE(M_IPFW, "IpFw/IpAcct", "IpFw/IpAcct chain's"); 74 75/* --- 222 unchanged lines hidden (view full) --- 298 rule = chain->map[end]; 299 if (rulenum > 0 && rule->rulenum != rulenum) 300 break; 301 if (rule->set != RESVD_SET && 302 (cmd == 0 || rule->set == new_set) ) 303 n++; 304 } 305 } |
306 if (n == 0 && arg == 0) 307 break; /* special case, flush on empty ruleset */ |
|
307 /* allocate the map, if needed */ 308 if (n > 0) 309 map = get_map(chain, -n, 1 /* locked */); 310 if (n == 0 || map == NULL) { 311 error = EINVAL; 312 break; 313 } 314 /* copy the initial part of the map */ --- 771 unchanged lines hidden --- | 308 /* allocate the map, if needed */ 309 if (n > 0) 310 map = get_map(chain, -n, 1 /* locked */); 311 if (n == 0 || map == NULL) { 312 error = EINVAL; 313 break; 314 } 315 /* copy the initial part of the map */ --- 771 unchanged lines hidden --- |