PERFORCE change 153252 for review
Marko Zec
zec at FreeBSD.org
Wed Nov 19 16:56:13 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=153252
Change 153252 by zec at zec_tca51 on 2008/11/20 00:55:24
First pass at fixing misintegrations by visual inspection.
To be continued at sys/netinet6/in6_rmx.c
Affected files ...
.. //depot/projects/vimage/src/sys/contrib/pf/net/pf_if.c#13 edit
.. //depot/projects/vimage/src/sys/contrib/pf/net/pf_subr.c#12 edit
.. //depot/projects/vimage/src/sys/net/if.c#49 edit
.. //depot/projects/vimage/src/sys/net/if_gif.h#8 edit
.. //depot/projects/vimage/src/sys/net/if_var.h#20 edit
.. //depot/projects/vimage/src/sys/net/raw_cb.h#4 edit
.. //depot/projects/vimage/src/sys/net/route.c#34 edit
.. //depot/projects/vimage/src/sys/net80211/ieee80211.c#24 edit
.. //depot/projects/vimage/src/sys/net80211/ieee80211_freebsd.c#17 edit
.. //depot/projects/vimage/src/sys/netgraph/netgraph.h#16 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_base.c#42 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_ether.c#17 edit
.. //depot/projects/vimage/src/sys/netgraph/ng_iface.c#15 edit
.. //depot/projects/vimage/src/sys/netinet/accf_http.c#5 edit
.. //depot/projects/vimage/src/sys/netinet/icmp_var.h#6 edit
.. //depot/projects/vimage/src/sys/netinet/igmp.c#22 edit
.. //depot/projects/vimage/src/sys/netinet/in.c#21 edit
.. //depot/projects/vimage/src/sys/netinet/in_gif.h#4 edit
.. //depot/projects/vimage/src/sys/netinet/in_pcb.h#21 edit
.. //depot/projects/vimage/src/sys/netinet/in_var.h#13 edit
.. //depot/projects/vimage/src/sys/netinet/ip_divert.c#20 edit
.. //depot/projects/vimage/src/sys/netinet/ip_fw_pfil.c#13 edit
.. //depot/projects/vimage/src/sys/netinet/ip_icmp.c#23 edit
.. //depot/projects/vimage/src/sys/netinet/ip_input.c#40 edit
.. //depot/projects/vimage/src/sys/netinet/ip_ipsec.c#17 edit
.. //depot/projects/vimage/src/sys/netinet/ip_output.c#20 edit
.. //depot/projects/vimage/src/sys/netinet/ip_var.h#12 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#30 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_input.c#45 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_subr.c#60 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_syncache.c#46 edit
.. //depot/projects/vimage/src/sys/netinet/tcp_var.h#27 edit
.. //depot/projects/vimage/src/sys/netinet/udp_var.h#8 edit
.. //depot/projects/vimage/src/sys/netinet6/frag6.c#23 edit
.. //depot/projects/vimage/src/sys/netinet6/icmp6.c#34 edit
.. //depot/projects/vimage/src/sys/netinet6/in6_proto.c#33 edit
Differences ...
==== //depot/projects/vimage/src/sys/contrib/pf/net/pf_if.c#13 (text+ko) ====
@@ -110,7 +110,7 @@
void pfi_detach_group_event(void * __unused, struct ifg_group *);
void pfi_ifaddr_event(void * __unused, struct ifnet *);
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct ifgrouphead ifg_head;
#endif
#endif
==== //depot/projects/vimage/src/sys/contrib/pf/net/pf_subr.c#12 (text+ko) ====
@@ -115,7 +115,7 @@
#define ISN_STATIC_INCREMENT 4096
#define ISN_RANDOM_INCREMENT (4096 - 1)
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
static u_char isn_secret[32];
static int isn_last_reseed;
static u_int32_t isn_offset;
==== //depot/projects/vimage/src/sys/net/if.c#49 (text+ko) ====
@@ -139,13 +139,13 @@
#endif
#ifdef VIMAGE_GLOBALS
+struct ifnethead ifnet; /* depend on static init XXX */
+struct ifgrouphead ifg_head;
int if_index;
static int if_indexlim;
/* Table of ifnet/cdev by index. Locked with ifnet_lock. */
static struct ifindex_entry *ifindex_table;
static struct knlist ifklist;
-struct ifnethead ifnet; /* depend on static init XXX */
-struct ifgrouphead ifg_head;
#endif
int ifqmaxlen = IFQ_MAXLEN;
@@ -397,7 +397,7 @@
TAILQ_INIT(&V_ifnet);
TAILQ_INIT(&V_ifg_head);
knlist_init(&V_ifklist, NULL, NULL, NULL, NULL);
- if_grow(); /* create initial table */
+ if_grow(); /* create initial table */
return 0;
}
==== //depot/projects/vimage/src/sys/net/if_gif.h#8 (text+ko) ====
@@ -114,11 +114,6 @@
* Virtualization support
*/
-#define INIT_VNET_GIF(vnet) \
- INIT_FROM_VNET(vnet, VNET_MOD_GIF, struct vnet_gif, vnet_gif)
-
-#define VNET_GIF(sym) VSYM(vnet_gif, sym)
-
struct vnet_gif {
LIST_HEAD(, gif_softc) _gif_softc_list;
int _max_gif_nesting;
@@ -127,6 +122,11 @@
int _ip6_gif_hlim;
};
+#define INIT_VNET_GIF(vnet) \
+ INIT_FROM_VNET(vnet, VNET_MOD_GIF, struct vnet_gif, vnet_gif)
+
+#define VNET_GIF(sym) VSYM(vnet_gif, sym)
+
#define V_gif_softc_list VNET_GIF(gif_softc_list)
#define V_max_gif_nesting VNET_GIF(max_gif_nesting)
#define V_parallel_tunnels VNET_GIF(parallel_tunnels)
==== //depot/projects/vimage/src/sys/net/if_var.h#20 (text+ko) ====
@@ -662,11 +662,11 @@
struct cdev *ifdev_byindex(u_short idx);
extern int ifqmaxlen;
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct ifnethead ifnet;
extern struct ifnet *loif; /* first loopback interface */
extern int if_index;
-#endif /* !VIMAGE */
+#endif
int if_addgroup(struct ifnet *, const char *);
int if_delgroup(struct ifnet *, const char *);
==== //depot/projects/vimage/src/sys/net/raw_cb.h#4 (text+ko) ====
@@ -56,7 +56,7 @@
#ifdef _KERNEL
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern LIST_HEAD(rawcb_list_head, rawcb) rawcb_list;
#endif
==== //depot/projects/vimage/src/sys/net/route.c#34 (text+ko) ====
@@ -84,6 +84,9 @@
&rt_add_addr_allfibs, 0, "");
TUNABLE_INT("net.add_addr_allfibs", &rt_add_addr_allfibs);
+#ifdef VIMAGE_GLOBALS
+static struct rtstat rtstat;
+
/* by default only the first 'row' of tables will be accessed. */
/*
* XXXMRT When we fix netstat, and do this differnetly,
@@ -91,9 +94,8 @@
* things backwards compaitble we need to allocate this
* statically.
*/
-#ifdef VIMAGE_GLOBALS
struct radix_node_head *rt_tables[RT_MAXFIBS][AF_MAX+1];
-static struct rtstat rtstat;
+
static int rttrash; /* routes not in table but not freed */
#endif
==== //depot/projects/vimage/src/sys/net80211/ieee80211.c#24 (text+ko) ====
@@ -35,6 +35,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+
#include <sys/socket.h>
#include <sys/vimage.h>
==== //depot/projects/vimage/src/sys/net80211/ieee80211_freebsd.c#17 (text+ko) ====
@@ -39,6 +39,7 @@
#include <sys/module.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
+
#include <sys/socket.h>
#include <sys/vimage.h>
==== //depot/projects/vimage/src/sys/netgraph/netgraph.h#16 (text+ko) ====
@@ -1187,7 +1187,7 @@
#define ng_copy_meta(meta) NULL
/* Hash related definitions */
-#define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */
+#define NG_ID_HASH_SIZE 128 /* most systems wont need even this many */
#define NG_NAME_HASH_SIZE 128 /* most systems wont need even this many */
/* Virtualization macros */
==== //depot/projects/vimage/src/sys/netgraph/ng_base.c#42 (text+ko) ====
@@ -168,7 +168,7 @@
/* Hash related definitions */
/* XXX Don't need to initialise them because it's a LIST */
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
static LIST_HEAD(, ng_node) ng_ID_hash[NG_ID_HASH_SIZE];
static LIST_HEAD(, ng_node) ng_name_hash[NG_NAME_HASH_SIZE];
#endif
@@ -358,7 +358,7 @@
#define TRAP_ERROR()
#endif
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
static ng_ID_t nextID;
#endif
==== //depot/projects/vimage/src/sys/netgraph/ng_ether.c#17 (text+ko) ====
@@ -72,10 +72,9 @@
#define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph)
static vnet_attach_fn ng_ether_iattach;
-static vnet_detach_fn ng_ether_idetach;
VNET_MOD_DECLARE_STATELESS(NG_ETHER, ng_ether, ng_ether_iattach,
- ng_ether_idetach, NETGRAPH)
+ NULL, NETGRAPH)
/* Per-node private data */
struct private {
@@ -754,6 +753,18 @@
s = splnet();
switch (event) {
case MOD_LOAD:
+
+ /* Register function hooks */
+ if (ng_ether_attach_p != NULL) {
+ error = EEXIST;
+ break;
+ }
+ ng_ether_attach_p = ng_ether_attach;
+ ng_ether_detach_p = ng_ether_detach;
+ ng_ether_output_p = ng_ether_output;
+ ng_ether_input_p = ng_ether_input;
+ ng_ether_input_orphan_p = ng_ether_input_orphan;
+ ng_ether_link_state_p = ng_ether_link_state;
#ifdef VIMAGE
vnet_mod_register(&vnet_ng_ether_modinfo);
#else
@@ -762,11 +773,26 @@
break;
case MOD_UNLOAD:
+
+ /*
+ * Note that the base code won't try to unload us until
+ * all nodes have been removed, and that can't happen
+ * until all Ethernet interfaces are removed. In any
+ * case, we know there are no nodes left if the action
+ * is MOD_UNLOAD, so there's no need to detach any nodes.
+ */
+
#ifdef VIMAGE
vnet_mod_deregister(&vnet_ng_ether_modinfo);
-#else
- ng_ether_idetach(NULL);
#endif
+
+ /* Unregister function hooks */
+ ng_ether_attach_p = NULL;
+ ng_ether_detach_p = NULL;
+ ng_ether_output_p = NULL;
+ ng_ether_input_p = NULL;
+ ng_ether_input_orphan_p = NULL;
+ ng_ether_link_state_p = NULL;
break;
default:
@@ -782,22 +808,6 @@
INIT_VNET_NET(curvnet);
struct ifnet *ifp;
-#ifdef VIMAGE
- if (IS_DEFAULT_VNET(curvnet)){
-#endif
- /* Register function hooks */
- if (ng_ether_attach_p != NULL)
- return(EEXIST);
- ng_ether_attach_p = ng_ether_attach;
- ng_ether_detach_p = ng_ether_detach;
- ng_ether_output_p = ng_ether_output;
- ng_ether_input_p = ng_ether_input;
- ng_ether_input_orphan_p = ng_ether_input_orphan;
- ng_ether_link_state_p = ng_ether_link_state;
-#ifdef VIMAGE
- }
-#endif
-
/* Create nodes for any already-existing Ethernet interfaces */
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
@@ -809,30 +819,3 @@
return 0;
}
-
-static int ng_ether_idetach(const void *unused)
-{
- /*
- * Note that the base code won't try to unload us until
- * all nodes have been removed, and that can't happen
- * until all Ethernet interfaces are removed. In any
- * case, we know there are no nodes left if the action
- * is MOD_UNLOAD, so there's no need to detach any nodes.
- */
-
-#ifdef VIMAGE
- if (!IS_DEFAULT_VNET(curvnet))
- return(0);
-#endif
-
- /* Unregister function hooks */
- ng_ether_attach_p = NULL;
- ng_ether_detach_p = NULL;
- ng_ether_output_p = NULL;
- ng_ether_input_p = NULL;
- ng_ether_input_orphan_p = NULL;
- ng_ether_link_state_p = NULL;
-
- return 0;
-}
-
==== //depot/projects/vimage/src/sys/netgraph/ng_iface.c#15 (text+ko) ====
@@ -215,7 +215,7 @@
static vnet_attach_fn ng_iface_iattach;
static vnet_detach_fn ng_iface_idetach;
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
static struct unrhdr *ng_iface_unit;
#endif
==== //depot/projects/vimage/src/sys/netinet/accf_http.c#5 (text+ko) ====
@@ -70,7 +70,7 @@
DECLARE_MODULE(accf_http, accf_http_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
static int parse_http_version;
#endif
@@ -436,6 +436,6 @@
V_parse_http_version = 1;
- return 0;
+ return (0);
}
==== //depot/projects/vimage/src/sys/netinet/icmp_var.h#6 (text+ko) ====
@@ -74,7 +74,7 @@
#ifdef _KERNEL
SYSCTL_DECL(_net_inet_icmp);
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct icmpstat icmpstat; /* icmp statistics */
#endif
extern int badport_bandlim(int);
==== //depot/projects/vimage/src/sys/netinet/igmp.c#22 (text+ko) ====
@@ -95,11 +95,9 @@
* when accessed via an in_multi read-only.
*/
#ifdef VIMAGE_GLOBALS
-static struct mtx igmp_mtx;
-#ifndef VIMAGE
static SLIST_HEAD(, router_info) router_info_head;
#endif
-#endif
+static struct mtx igmp_mtx;
static int igmp_timers_are_running;
/*
==== //depot/projects/vimage/src/sys/netinet/in.c#21 (text+ko) ====
@@ -987,7 +987,6 @@
in_purgemaddrs(struct ifnet *ifp)
{
INIT_VNET_INET(ifp->if_vnet);
-
struct in_multi *inm;
struct in_multi *oinm;
==== //depot/projects/vimage/src/sys/netinet/in_gif.h#4 (text+ko) ====
@@ -35,7 +35,7 @@
#define GIF_TTL 30
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern int ip_gif_ttl;
#endif
struct gif_softc;
==== //depot/projects/vimage/src/sys/netinet/in_pcb.h#21 (text+ko) ====
@@ -444,7 +444,7 @@
#define INP_CHECK_SOCKAF(so, af) (INP_SOCKAF(so) == af)
#ifdef _KERNEL
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern int ipport_reservedhigh;
extern int ipport_reservedlow;
extern int ipport_lowfirstauto;
@@ -457,8 +457,8 @@
extern int ipport_randomcps;
extern int ipport_randomtime;
extern int ipport_stoprandom;
+extern int ipport_tcpallocs;
#endif
-extern int ipport_tcpallocs;
extern struct callout ipport_tick_callout;
void in_pcbpurgeif0(struct inpcbinfo *, struct ifnet *);
==== //depot/projects/vimage/src/sys/netinet/in_var.h#13 (text+ko) ====
@@ -86,7 +86,7 @@
*/
LIST_HEAD(in_ifaddrhashhead, in_ifaddr);
TAILQ_HEAD(in_ifaddrhead, in_ifaddr);
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct in_ifaddrhashhead *in_ifaddrhashtbl;
extern struct in_ifaddrhead in_ifaddrhead;
extern u_long in_ifaddrhmask; /* mask for hash table */
@@ -241,8 +241,7 @@
#endif
LIST_HEAD(in_multihead, in_multi);
-
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct in_multihead in_multihead;
#endif
==== //depot/projects/vimage/src/sys/netinet/ip_divert.c#20 (text+ko) ====
@@ -111,7 +111,6 @@
* will cause it to be effectively considered as a standard packet).
*/
-#ifndef VIMAGE
/* Internal variables. */
#ifdef VIMAGE_GLOBALS
static struct inpcbhead divcb;
@@ -714,7 +713,7 @@
static int
div_modevent(module_t mod, int type, void *unused)
{
- INIT_VNET_INET(curvnet);
+ INIT_VNET_INET(curvnet); /* XXX fixme! */
int err = 0;
int n;
==== //depot/projects/vimage/src/sys/netinet/ip_fw_pfil.c#13 (text+ko) ====
@@ -66,11 +66,11 @@
#include <machine/in_cksum.h>
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
int fw_enable = 1;
-# ifdef INET6
+#ifdef INET6
int fw6_enable = 1;
-# endif
+#endif
#endif
int ipfw_chg_hook(SYSCTL_HANDLER_ARGS);
==== //depot/projects/vimage/src/sys/netinet/ip_icmp.c#23 (text+ko) ====
@@ -129,6 +129,7 @@
/*
* ICMP broadcast echo sysctl
*/
+
SYSCTL_V_INT(V_NET, vnet_inet, _net_inet_icmp, OID_AUTO, bmcastecho,
CTLFLAG_RW, icmpbmcastecho, 0, "");
==== //depot/projects/vimage/src/sys/netinet/ip_input.c#40 (text+ko) ====
@@ -277,34 +277,6 @@
NULL, UMA_ALIGN_PTR, 0);
maxnipq_update();
- V_ipsendredirects = 1; /* XXX */
- V_ip_defttl = IPDEFTTL;
-#ifdef IPSTEALTH
- V_ipstealth = 0;
-#endif
-
- V_ipport_lowfirstauto = IPPORT_RESERVED - 1; /* 1023 */
- V_ipport_lowlastauto = IPPORT_RESERVEDSTART; /* 600 */
- V_ipport_firstauto = IPPORT_HIFIRSTAUTO; /* 49152 */
- V_ipport_lastauto = IPPORT_HILASTAUTO; /* 65535 */
- V_ipport_hifirstauto = IPPORT_HIFIRSTAUTO; /* 49152 */
- V_ipport_hilastauto = IPPORT_HILASTAUTO; /* 65535 */
- V_ipport_reservedhigh = IPPORT_RESERVED - 1; /* 1023 */
- V_ipport_reservedlow = 0;
- V_ipport_randomized = 1; /* user controlled via sysctl */
- V_ipport_randomcps = 10; /* user controlled via sysctl */
- V_ipport_randomtime = 45; /* user controlled via sysctl */
- V_ipport_stoprandom = 0; /* toggled by ipport_tick */
-
- V_rsvp_on = 0;
- V_ipforwarding = 0;
- V_ipsendredirects = 1; /* XXX */
- V_ip_defttl = IPDEFTTL;
- V_ip_keepfaith = 0;
- V_ip_sendsourcequench = 0;
- V_ip_do_randomid = 0;
- V_ip_checkinterface = 0;
-
#ifdef VIMAGE
/* Skip initialization of globals for non-default instances. */
if (!IS_DEFAULT_VNET(curvnet))
==== //depot/projects/vimage/src/sys/netinet/ip_ipsec.c#17 (text+ko) ====
@@ -141,9 +141,9 @@
int
ip_ipsec_input(struct mbuf *m)
{
+ struct ip *ip = mtod(m, struct ip *);
#ifdef IPSEC
INIT_VNET_IPSEC(curvnet);
- struct ip *ip = mtod(m, struct ip *);
struct m_tag *mtag;
struct tdb_ident *tdbi;
struct secpolicy *sp;
==== //depot/projects/vimage/src/sys/netinet/ip_output.c#20 (text+ko) ====
@@ -83,7 +83,7 @@
(ntohl(a.s_addr)>>8)&0xFF,\
(ntohl(a.s_addr))&0xFF, y);
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
u_short ip_id;
#endif
==== //depot/projects/vimage/src/sys/netinet/ip_var.h#12 (text+ko) ====
@@ -175,12 +175,12 @@
struct route;
struct sockopt;
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct ipstat ipstat;
extern u_short ip_id; /* ip packet ctr, for ids */
extern int ip_defttl; /* default IP ttl */
extern int ipforwarding; /* ip forwarding */
-extern int ip_do_randomid;
+extern int ip_do_randomid;
#ifdef IPSTEALTH
extern int ipstealth; /* stealth forwarding */
#endif
==== //depot/projects/vimage/src/sys/netinet/tcp_hostcache.c#30 (text+ko) ====
@@ -193,16 +193,16 @@
V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE;
V_tcp_hostcache.bucket_limit = TCP_HOSTCACHE_BUCKETLIMIT;
V_tcp_hostcache.cache_limit =
- V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
+ V_tcp_hostcache.hashsize * V_tcp_hostcache.bucket_limit;
V_tcp_hostcache.expire = TCP_HOSTCACHE_EXPIRE;
V_tcp_hostcache.prune = TCP_HOSTCACHE_PRUNE;
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.hashsize",
- &V_tcp_hostcache.hashsize);
+ &V_tcp_hostcache.hashsize);
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.cachelimit",
- &V_tcp_hostcache.cache_limit);
+ &V_tcp_hostcache.cache_limit);
TUNABLE_INT_FETCH("net.inet.tcp.hostcache.bucketlimit",
- &V_tcp_hostcache.bucket_limit);
+ &V_tcp_hostcache.bucket_limit);
if (!powerof2(V_tcp_hostcache.hashsize)) {
printf("WARNING: hostcache hash size is not a power of 2.\n");
V_tcp_hostcache.hashsize = TCP_HOSTCACHE_HASHSIZE; /* default */
@@ -661,7 +661,7 @@
CURVNET_SET((struct vnet *) arg);
INIT_VNET_INET(curvnet);
struct hc_metrics *hc_entry, *hc_next;
- int all = 0;
+ int all = 0; /* XXX FIXME! was: int all = (intptr_t)arg; */
int i;
if (V_tcp_hostcache.purgeall) {
==== //depot/projects/vimage/src/sys/netinet/tcp_input.c#45 (text+ko) ====
@@ -100,6 +100,7 @@
static const int tcprexmtthresh = 3;
#ifdef VIMAGE_GLOBALS
+struct tcpstat tcpstat;
int blackhole;
int tcp_delack_enabled;
int drop_synfin;
==== //depot/projects/vimage/src/sys/netinet/tcp_subr.c#60 (text+ko) ====
@@ -125,7 +125,6 @@
static int tcp_inflight_min;
static int tcp_inflight_max;
static int tcp_inflight_stab;
-static int nolocaltimewait;
#endif
static int
@@ -336,7 +335,6 @@
V_tcp_autosndbuf_inc = 8*1024;
V_tcp_autosndbuf_max = 256*1024;
- V_nolocaltimewait = 0;
#ifdef VIMAGE
if (IS_DEFAULT_VNET(curvnet)) {
@@ -375,44 +373,6 @@
tcp_rexmit_slop = TCPTV_CPU_VAR;
V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
tcp_finwait2_timeout = TCPTV_FINWAIT2_TIMEOUT;
- V_path_mtu_discovery = 1;
- V_ss_fltsz = 1;
- V_ss_fltsz_local = 4;
- V_tcp_do_newreno = 1;
- V_tcp_do_tso = 1;
- V_tcp_do_autosndbuf = 1;
- V_tcp_autosndbuf_inc = 8*1024;
- V_tcp_autosndbuf_max = 256*1024;
- V_blackhole = 0;
- V_tcp_delack_enabled = 1;
- V_drop_synfin = 0;
- V_tcp_do_rfc3042 = 1;
- V_tcp_do_rfc3390 = 1;
- V_tcp_insecure_rst = 0;
- V_tcp_do_ecn = 0;
- V_tcp_ecn_maxretries = 1;
- V_tcp_do_autorcvbuf = 1;
- V_tcp_autorcvbuf_inc = 16*1024;
- V_tcp_autorcvbuf_max = 256*1024;
- V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
- V_tcp_mssdflt = TCP_MSS;
-#ifdef INET6
- V_tcp_v6mssdflt = TCP6_MSS;
-#endif
- V_tcp_minmss = TCP_MINMSS;
- V_tcp_do_rfc1323 = 1;
- V_icmp_may_rst = 1;
- V_tcp_isn_reseed_interval = 0;
- V_tcp_inflight_enable = 1;
- V_tcp_inflight_min = 6144;
- V_tcp_inflight_max = TCP_MAXWIN << TCP_MAX_WINSHIFT;
- V_tcp_inflight_stab = 20;
- V_nolocaltimewait = 0;
- V_tcp_do_sack = 1;
- V_tcp_sack_maxholes = 128;
- V_tcp_sack_globalmaxholes = 65536;
- V_tcp_sack_globalholes = 0;
- TUNABLE_INT_FETCH("net.inet.tcp.sack.enable", &V_tcp_do_sack);
INP_INFO_LOCK_INIT(&V_tcbinfo, "tcp");
LIST_INIT(&V_tcb);
==== //depot/projects/vimage/src/sys/netinet/tcp_syncache.c#46 (text+ko) ====
@@ -234,7 +234,6 @@
V_tcp_syncache.bucket_limit = TCP_SYNCACHE_BUCKETLIMIT;
V_tcp_syncache.rexmt_limit = SYNCACHE_MAXREXMTS;
V_tcp_syncache.hash_secret = arc4random();
- V_tcp_sc_rst_sock_fail = 1;
TUNABLE_INT_FETCH("net.inet.tcp.syncache.hashsize",
&V_tcp_syncache.hashsize);
==== //depot/projects/vimage/src/sys/netinet/tcp_var.h#27 (text+ko) ====
@@ -519,21 +519,7 @@
extern int ss_fltsz;
extern int ss_fltsz_local;
-extern int tcp_do_sack; /* SACK enabled/disabled */
-extern int tcp_sc_rst_sock_fail; /* RST on sock alloc failure */
-extern int tcp_do_ecn; /* TCP ECN enabled/disabled */
-extern int tcp_ecn_maxretries;
-extern int tcp_sack_maxholes;
-extern int tcp_sack_globalmaxholes;
-extern int tcp_sack_globalholes;
-extern int tcp_do_tso;
-extern int tcp_do_autosndbuf;
-extern int tcp_autosndbuf_max;
-extern int tcp_autosndbuf_inc;
extern int tcp_autorcvbuf;
-extern int tcp_do_autorcvbuf;
-extern int tcp_autorcvbuf_inc;
-extern int tcp_autorcvbuf_max;
extern int blackhole;
extern int drop_synfin;
extern int tcp_do_rfc3042;
@@ -550,6 +536,7 @@
extern int nolocaltimewait;
+extern int tcp_do_sack; /* SACK enabled/disabled */
extern int tcp_sack_maxholes;
extern int tcp_sack_globalmaxholes;
extern int tcp_sack_globalholes;
==== //depot/projects/vimage/src/sys/netinet/udp_var.h#8 (text+ko) ====
@@ -95,7 +95,7 @@
extern struct pr_usrreqs udp_usrreqs;
-#ifndef VIMAGE
+#ifdef VIMAGE_GLOBALS
extern struct inpcbhead udb;
extern struct inpcbinfo udbinfo;
extern struct udpstat udpstat;
==== //depot/projects/vimage/src/sys/netinet6/frag6.c#23 (text+ko) ====
==== //depot/projects/vimage/src/sys/netinet6/icmp6.c#34 (text+ko) ====
@@ -108,13 +108,12 @@
#endif
extern struct domain inet6domain;
-#ifndef VIMAGE
+
+#ifdef VIMAGE_GLOBALS
extern struct inpcbinfo ripcbinfo;
extern struct inpcbhead ripcb;
extern int icmp6errppslim;
extern int icmp6_nodeinfo;
-
-#ifdef VIMAGE_GLOBALS
struct icmp6stat icmp6stat;
static int icmp6errpps_count;
static struct timeval icmp6errppslim_last;
==== //depot/projects/vimage/src/sys/netinet6/in6_proto.c#33 (text+ko) ====
@@ -352,11 +352,30 @@
extern int in6_detachhead(void **, int);
#endif
+struct domain inet6domain = {
+ .dom_family = AF_INET6,
+ .dom_name = "internet6",
+ .dom_protosw = (struct protosw *)inet6sw,
+ .dom_protoswNPROTOSW = (struct protosw *)
+ &inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])],
+#ifdef RADIX_MPATH
+ .dom_rtattach = rn6_mpath_inithead,
+#else
+ .dom_rtattach = in6_inithead,
+#endif
+ .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3,
+ .dom_maxrtkey = sizeof(struct sockaddr_in6),
+ .dom_ifattach = in6_domifattach,
+ .dom_ifdetach = in6_domifdetach
+};
+
+DOMAIN_SET(inet6);
+
/*
* Internet configuration info
*/
#ifdef VIMAGE_GLOBALS
-int ip6_forwarding; /* act as router? */
+int ip6_forwarding;
int ip6_sendredirects;
int ip6_defhlim;
int ip6_defmcasthlim;
@@ -375,41 +394,22 @@
time_t ip6_log_time;
int ip6stealth;
int nd6_onlink_ns_rfc4861;
-int ip6_maxfragpackets; /* initialized in frag6.c:frag6_init() */
-int ip6_maxfrags; /* initialized in frag6.c:frag6_init() */
-int ip6_log_interval;
-int ip6_hdrnestlimit; /* How many header options will we process? */
-int ip6_dad_count; /* DupAddrDetectionTransmits */
-int ip6_auto_flowlabel;
-int ip6_gif_hlim;
-int ip6_use_deprecated; /* allow deprecated addr (RFC2462 5.5.4) */
-int ip6_rr_prune; /* router renumbering prefix */
-int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */
-int ip6_v6only;
-int ip6_keepfaith;
-time_t ip6_log_time;
-int nd6_onlink_ns_rfc4861; /* allow 'on-link' nd6 NS (as in RFC 4861) */
-#ifdef IPSTEALTH
-int ip6stealth;
-#endif
#endif
+#ifdef VIMAGE_GLOBALS
/* icmp6 */
/*
* BSDI4 defines these variables in in_proto.c...
* XXX: what if we don't define INET? Should we define pmtu6_expire
* or so? (jinmei at kame.net 19990310)
*/
-#ifndef VIMAGE
int pmtu_expire;
int pmtu_probe;
-#endif
/* raw IP6 parameters */
/*
* Nominal space allocated to a raw ip socket.
*/
-#ifndef VIMAGE
u_long rip6_sendspace;
u_long rip6_recvspace;
@@ -578,64 +578,3 @@
nd6_onlink_ns_rfc4861, CTLFLAG_RW, nd6_onlink_ns_rfc4861, 0,
"Accept 'on-link' nd6 NS in compliance with RFC 4861.");
-static void
-ip6_dom_init(void)
-{
- INIT_VNET_INET6(curvnet);
-
- V_ip6_forwarding = IPV6FORWARDING;
- V_ip6_sendredirects = IPV6_SENDREDIRECTS;
- V_ip6_defhlim = IPV6_DEFHLIM;
- V_ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
- V_ip6_accept_rtadv = 0;
- V_ip6_log_interval = 5;
- V_ip6_hdrnestlimit = 15;
- V_ip6_dad_count = 1;
- V_ip6_auto_flowlabel = 1;
- V_ip6_use_deprecated = 1;
- V_ip6_rr_prune = 5;
- V_ip6_mcast_pmtu = 0;
- V_ip6_v6only = 1;
- V_ip6_keepfaith = 0;
- V_ip6_log_time = (time_t)0L;
- V_nd6_onlink_ns_rfc4861 = 0;
-#ifdef IPSTEALTH
- V_ip6stealth = 0;
-#endif
- V_pmtu_expire = 60*10;
- V_pmtu_probe = 60*2;
- V_rip6_sendspace = RIPV6SNDQ;
- V_rip6_recvspace = RIPV6RCVQ;
-
- /* ICMPV6 parameters */
- V_icmp6_rediraccept = 1;
- V_icmp6_redirtimeout = 10 * 60; /* 10 minutes */
- V_icmp6errppslim = 100; /* 100pps */
- /* control how to respond to NI queries */
- V_icmp6_nodeinfo = (ICMP6_NODEINFO_FQDNOK|ICMP6_NODEINFO_NODEADDROK);
-
- /* UDP on IP6 parameters */
- V_udp6_sendspace = 9216; /* really max datagram size */
- V_udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
- /* 40 1K datagrams */
-
-}
-
-struct domain inet6domain = {
- .dom_family = AF_INET6,
- .dom_name = "internet6",
- .dom_protosw = (struct protosw *)inet6sw,
- .dom_protoswNPROTOSW = (struct protosw *)
- &inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])],
- .dom_rtattach = in6_inithead,
-#ifdef VIMAGE
- .dom_rtdetach = in6_detachhead,
-#endif
- .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3,
- .dom_maxrtkey = sizeof(struct sockaddr_in6),
- .dom_ifattach = in6_domifattach,
- .dom_ifdetach = in6_domifdetach,
- .dom_init = ip6_dom_init
-};
-
-DOMAIN_SET(inet6);
More information about the p4-projects
mailing list