1/*- 2 * Copyright (c) 2001 McAfee, Inc. 3 * Copyright (c) 2006 Andre Oppermann, Internet Business Solutions AG 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Jonathan Lemon 7 * and McAfee Research, the Security Research Division of McAfee, Inc. under 8 * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 17 unchanged lines hidden (view full) --- 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/tcp_syncache.c 215701 2010-11-22 19:32:54Z dim $"); |
35 36#include "opt_inet.h" 37#include "opt_inet6.h" 38#include "opt_ipsec.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 49 unchanged lines hidden (view full) --- 92#endif 93#include <netipsec/key.h> 94#endif /*IPSEC*/ 95 96#include <machine/in_cksum.h> 97 98#include <security/mac/mac_framework.h> 99 |
100static VNET_DEFINE(int, tcp_syncookies) = 1; |
101#define V_tcp_syncookies VNET(tcp_syncookies) 102SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_RW, 103 &VNET_NAME(tcp_syncookies), 0, 104 "Use TCP SYN cookies if the syncache overflows"); 105 |
106static VNET_DEFINE(int, tcp_syncookiesonly) = 0; |
107#define V_tcp_syncookiesonly VNET(tcp_syncookiesonly) 108SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, syncookies_only, CTLFLAG_RW, 109 &VNET_NAME(tcp_syncookiesonly), 0, 110 "Use only TCP SYN cookies"); 111 112#ifdef TCP_OFFLOAD_DISABLE 113#define TOEPCB_ISSET(sc) (0) 114#else --- 23 unchanged lines hidden (view full) --- 138 * the odds are that the user has given up attempting to connect by then. 139 */ 140#define SYNCACHE_MAXREXMTS 3 141 142/* Arbitrary values */ 143#define TCP_SYNCACHE_HASHSIZE 512 144#define TCP_SYNCACHE_BUCKETLIMIT 30 145 |
146static VNET_DEFINE(struct tcp_syncache, tcp_syncache); |
147#define V_tcp_syncache VNET(tcp_syncache) 148 149SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, CTLFLAG_RW, 0, "TCP SYN cache"); 150 151SYSCTL_VNET_INT(_net_inet_tcp_syncache, OID_AUTO, bucketlimit, CTLFLAG_RDTUN, 152 &VNET_NAME(tcp_syncache.bucket_limit), 0, 153 "Per-bucket hash limit for syncache"); 154 --- 1656 unchanged lines hidden --- |