define RANDOM_IP_ID by default (unifdef -DRANDOM_IP_ID).

one use remains in sys/netipsec, which is kept for freebsd source code compat.
This commit is contained in:
itojun 2003-11-26 21:15:47 +00:00
parent b02f563aeb
commit 326cfe57d2
3 changed files with 5 additions and 15 deletions

View File

@ -1,8 +1,8 @@
# $NetBSD: files.netinet,v 1.3 2003/11/17 21:34:27 jonathan Exp $
# $NetBSD: files.netinet,v 1.4 2003/11/26 21:15:47 itojun Exp $
defflag opt_tcp_debug.h TCP_DEBUG
defparam opt_tcp_debug.h TCP_NDEBUG
defflag opt_inet.h INET INET6 INET6_MD_CKSUM RANDOM_IP_ID
defflag opt_inet.h INET INET6 INET6_MD_CKSUM
defparam opt_inet_conf.h SUBNETSARELOCAL HOSTZEROBROADCAST
defflag MROUTING

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_input.c,v 1.186 2003/11/24 20:54:59 scw Exp $ */
/* $NetBSD: ip_input.c,v 1.187 2003/11/26 21:15:47 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -98,7 +98,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.186 2003/11/24 20:54:59 scw Exp $");
__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.187 2003/11/26 21:15:47 itojun Exp $");
#include "opt_inet.h"
#include "opt_gateway.h"
@ -199,9 +199,7 @@ int ip_mtudisc_timeout = IPMTUDISCTIMEOUT;
int ipprintfs = 0;
#endif
#ifdef RANDOM_IP_ID
int ip_do_randomid = 0;
#endif
/*
* XXX - Setting ip_checkinterface mostly implements the receive side of
@ -2075,12 +2073,8 @@ ip_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
newp, newlen, &ipintrq));
case IPCTL_RANDOMID:
#ifdef RANDOM_IP_ID
return (sysctl_int(oldp, oldlenp, newp, newlen,
&ip_do_randomid));
#else
return (sysctl_rdint(oldp, oldlenp, newp, 0));
#endif
default:
return (EOPNOTSUPP);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_var.h,v 1.61 2003/11/25 14:44:13 itojun Exp $ */
/* $NetBSD: ip_var.h,v 1.62 2003/11/26 21:15:47 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -254,18 +254,14 @@ void ipflow_slowtimo __P((void));
extern uint16_t ip_id;
static __inline uint16_t ip_newid __P((void));
#ifdef RANDOM_IP_ID
u_int16_t ip_randomid __P((void));
extern int ip_do_randomid;
#endif
static __inline uint16_t
ip_newid(void)
{
#ifdef RANDOM_IP_ID
if (ip_do_randomid)
return ip_randomid();
#endif /* RANDOM_IP_ID */
return htons(ip_id++);
}