1/*- 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 |
30 * $FreeBSD: head/sys/netinet/raw_ip.c 157927 2006-04-21 09:25:40Z ps $ |
31 */ 32 33#include "opt_inet6.h" 34#include "opt_ipsec.h" 35#include "opt_mac.h" 36 37#include <sys/param.h> 38#include <sys/jail.h> --- 72 unchanged lines hidden (view full) --- 111 112/* 113 * Raw interface to IP protocol. 114 */ 115 116/* 117 * Initialize raw connection block q. 118 */ |
119static void 120rip_zone_change(void *tag) 121{ 122 123 uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets); 124} 125 |
126void 127rip_init() 128{ 129 INP_INFO_LOCK_INIT(&ripcbinfo, "rip"); 130 LIST_INIT(&ripcb); 131 ripcbinfo.listhead = &ripcb; 132 /* 133 * XXX We don't use the hash list for raw IP, but it's easier 134 * to allocate a one entry hash list than it is to check all 135 * over the place for hashbase == NULL. 136 */ 137 ripcbinfo.hashbase = hashinit(1, M_PCB, &ripcbinfo.hashmask); 138 ripcbinfo.porthashbase = hashinit(1, M_PCB, &ripcbinfo.porthashmask); 139 ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb), 140 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); 141 uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets); |
142 EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, 143 NULL, EVENTHANDLER_PRI_ANY); |
144} 145 146static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; 147 148static int 149raw_append(struct inpcb *last, struct ip *ip, struct mbuf *n) 150{ 151 int policyfail = 0; --- 743 unchanged lines hidden --- |