tcp_syncache.c (108703) | tcp_syncache.c (109623) |
---|---|
1/*- 2 * Copyright (c) 2001 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Jonathan Lemon 6 * and NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * | 1/*- 2 * Copyright (c) 2001 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by Jonathan Lemon 6 * and NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/netinet/tcp_syncache.c 108703 2003-01-05 07:56:24Z hsu $ | 34 * $FreeBSD: head/sys/netinet/tcp_syncache.c 109623 2003-01-21 08:56:16Z alfred $ |
35 */ 36 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_mac.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 199 unchanged lines hidden (view full) --- 242 printf("WARNING: syncache hash size is not a power of 2.\n"); 243 tcp_syncache.hashsize = 512; /* safe default */ 244 } 245 tcp_syncache.hashmask = tcp_syncache.hashsize - 1; 246 247 /* Allocate the hash table. */ 248 MALLOC(tcp_syncache.hashbase, struct syncache_head *, 249 tcp_syncache.hashsize * sizeof(struct syncache_head), | 35 */ 36 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39#include "opt_mac.h" 40 41#include <sys/param.h> 42#include <sys/systm.h> --- 199 unchanged lines hidden (view full) --- 242 printf("WARNING: syncache hash size is not a power of 2.\n"); 243 tcp_syncache.hashsize = 512; /* safe default */ 244 } 245 tcp_syncache.hashmask = tcp_syncache.hashsize - 1; 246 247 /* Allocate the hash table. */ 248 MALLOC(tcp_syncache.hashbase, struct syncache_head *, 249 tcp_syncache.hashsize * sizeof(struct syncache_head), |
250 M_SYNCACHE, M_WAITOK); | 250 M_SYNCACHE, 0); |
251 252 /* Initialize the hash buckets. */ 253 for (i = 0; i < tcp_syncache.hashsize; i++) { 254 TAILQ_INIT(&tcp_syncache.hashbase[i].sch_bucket); 255 tcp_syncache.hashbase[i].sch_length = 0; 256 } 257 258 /* Initialize the timer queues. */ --- 835 unchanged lines hidden (view full) --- 1094 1095 /* 1096 * XXX shouldn't this reuse the mbuf if possible ? 1097 * Create the IP+TCP header from scratch. 1098 */ 1099 if (m) 1100 m_freem(m); 1101 | 251 252 /* Initialize the hash buckets. */ 253 for (i = 0; i < tcp_syncache.hashsize; i++) { 254 TAILQ_INIT(&tcp_syncache.hashbase[i].sch_bucket); 255 tcp_syncache.hashbase[i].sch_length = 0; 256 } 257 258 /* Initialize the timer queues. */ --- 835 unchanged lines hidden (view full) --- 1094 1095 /* 1096 * XXX shouldn't this reuse the mbuf if possible ? 1097 * Create the IP+TCP header from scratch. 1098 */ 1099 if (m) 1100 m_freem(m); 1101 |
1102 m = m_gethdr(M_DONTWAIT, MT_HEADER); | 1102 m = m_gethdr(M_NOWAIT, MT_HEADER); |
1103 if (m == NULL) 1104 return (ENOBUFS); 1105 m->m_data += max_linkhdr; 1106 m->m_len = tlen; 1107 m->m_pkthdr.len = tlen; 1108 m->m_pkthdr.rcvif = NULL; 1109#ifdef MAC 1110 mac_create_mbuf_from_socket(sc->sc_tp->t_inpcb->inp_socket, m); --- 270 unchanged lines hidden --- | 1103 if (m == NULL) 1104 return (ENOBUFS); 1105 m->m_data += max_linkhdr; 1106 m->m_len = tlen; 1107 m->m_pkthdr.len = tlen; 1108 m->m_pkthdr.rcvif = NULL; 1109#ifdef MAC 1110 mac_create_mbuf_from_socket(sc->sc_tp->t_inpcb->inp_socket, m); --- 270 unchanged lines hidden --- |