Deleted Added
full compact
ip_fw_table.c (273274) ip_fw_table.c (274087)
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 273274 2014-10-19 11:15:19Z melifaro $");
29__FBSDID("$FreeBSD: head/sys/netpfil/ipfw/ip_fw_table.c 274087 2014-11-04 10:25:52Z melifaro $");
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

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

1819create_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
1820 struct sockopt_data *sd)
1821{
1822 struct _ipfw_obj_header *oh;
1823 ipfw_xtable_info *i;
1824 char *tname, *aname;
1825 struct tid_info ti;
1826 struct namedobj_instance *ni;
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

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

1819create_table(struct ip_fw_chain *ch, ip_fw3_opheader *op3,
1820 struct sockopt_data *sd)
1821{
1822 struct _ipfw_obj_header *oh;
1823 ipfw_xtable_info *i;
1824 char *tname, *aname;
1825 struct tid_info ti;
1826 struct namedobj_instance *ni;
1827 struct table_config *tc;
1828
1829 if (sd->valsize != sizeof(*oh) + sizeof(ipfw_xtable_info))
1830 return (EINVAL);
1831
1832 oh = (struct _ipfw_obj_header *)sd->kbuf;
1833 i = (ipfw_xtable_info *)(oh + 1);
1834
1835 /*

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

1848 }
1849
1850 objheader_to_ti(oh, &ti);
1851 ti.type = i->type;
1852
1853 ni = CHAIN_TO_NI(ch);
1854
1855 IPFW_UH_RLOCK(ch);
1827
1828 if (sd->valsize != sizeof(*oh) + sizeof(ipfw_xtable_info))
1829 return (EINVAL);
1830
1831 oh = (struct _ipfw_obj_header *)sd->kbuf;
1832 i = (ipfw_xtable_info *)(oh + 1);
1833
1834 /*

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

1847 }
1848
1849 objheader_to_ti(oh, &ti);
1850 ti.type = i->type;
1851
1852 ni = CHAIN_TO_NI(ch);
1853
1854 IPFW_UH_RLOCK(ch);
1856 if ((tc = find_table(ni, &ti)) != NULL) {
1855 if (find_table(ni, &ti) != NULL) {
1857 IPFW_UH_RUNLOCK(ch);
1858 return (EEXIST);
1859 }
1860 IPFW_UH_RUNLOCK(ch);
1861
1862 return (create_table_internal(ch, &ti, aname, i, NULL, 0));
1863}
1864

--- 1810 unchanged lines hidden ---
1856 IPFW_UH_RUNLOCK(ch);
1857 return (EEXIST);
1858 }
1859 IPFW_UH_RUNLOCK(ch);
1860
1861 return (create_table_internal(ch, &ti, aname, i, NULL, 0));
1862}
1863

--- 1810 unchanged lines hidden ---