ip_fw_table.c (297992) | ip_fw_table.c (298048) |
---|---|
1/*- 2 * Copyright (c) 2004 Ruslan Ermilov and Vsevolod Lobko. 3 * Copyright (c) 2014 Yandex LLC 4 * Copyright (c) 2014 Alexander V. Chernikov 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) 2004 Ruslan Ermilov and Vsevolod Lobko. 3 * Copyright (c) 2014 Yandex LLC 4 * Copyright (c) 2014 Alexander V. Chernikov 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/netpfil/ipfw/ip_fw_table.c 297992 2016-04-14 20:49:27Z ae $"); | 29__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_fw_table.c 298048 2016-04-15 12:24:01Z pfg $"); |
30 31/* 32 * Lookup table support for ipfw. 33 * 34 * This file contains handlers for all generic tables' operations: 35 * add/del/flush entries, list/dump tables etc.. 36 * 37 * Table data modification is protected by both UH and runtime lock --- 2087 unchanged lines hidden (view full) --- 2125 void *arg) 2126{ 2127 ipfw_xtable_info *i; 2128 struct dump_table_args *dta; 2129 2130 dta = (struct dump_table_args *)arg; 2131 2132 i = (ipfw_xtable_info *)ipfw_get_sopt_space(dta->sd, sizeof(*i)); | 30 31/* 32 * Lookup table support for ipfw. 33 * 34 * This file contains handlers for all generic tables' operations: 35 * add/del/flush entries, list/dump tables etc.. 36 * 37 * Table data modification is protected by both UH and runtime lock --- 2087 unchanged lines hidden (view full) --- 2125 void *arg) 2126{ 2127 ipfw_xtable_info *i; 2128 struct dump_table_args *dta; 2129 2130 dta = (struct dump_table_args *)arg; 2131 2132 i = (ipfw_xtable_info *)ipfw_get_sopt_space(dta->sd, sizeof(*i)); |
2133 KASSERT(i != 0, ("previously checked buffer is not enough")); | 2133 KASSERT(i != NULL, ("previously checked buffer is not enough")); |
2134 2135 export_table_info(dta->ch, (struct table_config *)no, i); 2136} 2137 2138/* 2139 * Export all tables as ipfw_xtable_info structures to 2140 * storage provided by @sd. 2141 * --- 599 unchanged lines hidden (view full) --- 2741 olh->size = size; 2742 IPFW_UH_RUNLOCK(ch); 2743 return (ENOMEM); 2744 } 2745 olh->size = size; 2746 2747 for (n = 1; n <= count; n++) { 2748 i = (ipfw_ta_info *)ipfw_get_sopt_space(sd, sizeof(*i)); | 2134 2135 export_table_info(dta->ch, (struct table_config *)no, i); 2136} 2137 2138/* 2139 * Export all tables as ipfw_xtable_info structures to 2140 * storage provided by @sd. 2141 * --- 599 unchanged lines hidden (view full) --- 2741 olh->size = size; 2742 IPFW_UH_RUNLOCK(ch); 2743 return (ENOMEM); 2744 } 2745 olh->size = size; 2746 2747 for (n = 1; n <= count; n++) { 2748 i = (ipfw_ta_info *)ipfw_get_sopt_space(sd, sizeof(*i)); |
2749 KASSERT(i != 0, ("previously checked buffer is not enough")); | 2749 KASSERT(i != NULL, ("previously checked buffer is not enough")); |
2750 ta = tcfg->algo[n]; 2751 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); 2752 i->type = ta->type; 2753 i->refcnt = ta->refcnt; 2754 } 2755 2756 IPFW_UH_RUNLOCK(ch); 2757 --- 665 unchanged lines hidden --- | 2750 ta = tcfg->algo[n]; 2751 strlcpy(i->algoname, ta->name, sizeof(i->algoname)); 2752 i->type = ta->type; 2753 i->refcnt = ta->refcnt; 2754 } 2755 2756 IPFW_UH_RUNLOCK(ch); 2757 --- 665 unchanged lines hidden --- |