PERFORCE change 143373 for review
Julian Elischer
julian at FreeBSD.org
Thu Jun 12 17:02:02 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143373
Change 143373 by julian at julian_trafmon1 on 2008/06/12 17:01:32
A bunch of fixes for the exetended NULL branch.
Mostly discovered by comparison with the machine generated branch.
Affected files ...
.. //depot/projects/vimage-commit/src/sys/net/if.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/netgraph.h#2 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_base.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netgraph/ng_eiface.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fw2.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_fw_nat.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netinet/ip_ipsec.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netinet6/ip6_ipsec.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.c#3 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/ipsec.h#3 edit
.. //depot/projects/vimage-commit/src/sys/netipsec/keysock.c#3 edit
Differences ...
==== //depot/projects/vimage-commit/src/sys/net/if.c#3 (text+ko) ====
@@ -522,18 +522,12 @@
IFNET_WLOCK();
TAILQ_INSERT_TAIL(&V_ifnet, ifp, if_link);
-#ifdef VIMAGE
- curvnet->ifccnt++;
-#endif
IFNET_WUNLOCK();
if (domain_init_status >= 2)
if_attachdomain1(ifp);
EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
-#ifdef VIMAGE
- if (IS_DEFAULT_VNET(curvnet))
-#endif
devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL);
/* Announce the interface. */
@@ -685,10 +679,6 @@
found = 1;
break;
}
-#ifdef VIMAGE
- if (found)
- curvnet->ifccnt--;
-#endif
IFNET_WUNLOCK();
if (!found)
return;
==== //depot/projects/vimage-commit/src/sys/netgraph/netgraph.h#2 (text+ko) ====
@@ -1181,4 +1181,20 @@
#define NGI_GET_META(i,m)
#define ng_copy_meta(meta) NULL
+
+#define INIT_VNET_NETGRAPH(vnet) \
+ INIT_FROM_VNET(vnet, VNET_MOD_NETGRAPH, \
+ struct vnet_netgraph, vnet_netgraph)
+
+#define VNET_NETGRAPH(sym) VSYM(vnet_netgraph, sym)
+
+/* Symbol translation macros */
+#define V_ng_ID_hash VNET_NETGRAPH(ng_ID_hash)
+#define V_ng_name_hash VNET_NETGRAPH(ng_name_hash)
+#define V_ng_nodelist VNET_NETGRAPH(ng_nodelist)
+#define V_nextID VNET_NETGRAPH(nextID)
+#define V_ng_iface_unit VNET_NETGRAPH(ng_iface_unit)
+#define V_ng_eiface_unit VNET_NETGRAPH(ng_eiface_unit)
+#define V_ng_wormhole_unit VNET_NETGRAPH(ng_wormhole_unit)
+
#endif /* _NETGRAPH_NETGRAPH_H_ */
==== //depot/projects/vimage-commit/src/sys/netgraph/ng_base.c#3 (text+ko) ====
==== //depot/projects/vimage-commit/src/sys/netgraph/ng_eiface.c#3 (text+ko) ====
@@ -45,7 +45,6 @@
#include <net/if.h>
#include <net/if_types.h>
#include <net/netisr.h>
-#include <net/route.h>
#include <netgraph/ng_message.h>
#include <netgraph/netgraph.h>
==== //depot/projects/vimage-commit/src/sys/netinet/ip_fw2.c#3 (text+ko) ====
@@ -4497,7 +4497,7 @@
}
done:
callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz,
- ipfw_tick, arg);
+ ipfw_tick, NULL);
}
int
==== //depot/projects/vimage-commit/src/sys/netinet/ip_fw_nat.c#3 (text+ko) ====
@@ -605,7 +605,7 @@
NULL, EVENTHANDLER_PRI_ANY);
}
-void
+static void
ipfw_nat_destroy(void)
{
INIT_VNET_IPFW(curvnet);
==== //depot/projects/vimage-commit/src/sys/netinet/ip_ipsec.c#3 (text+ko) ====
==== //depot/projects/vimage-commit/src/sys/netinet6/ip6_ipsec.c#3 (text+ko) ====
@@ -52,6 +52,7 @@
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
+#include <netinet/ip6.h>
#include <netinet/in_pcb.h>
#include <netinet/ip_var.h>
#include <netinet/ip_options.h>
@@ -71,6 +72,7 @@
#endif /*IPSEC*/
#include <netinet6/ip6_ipsec.h>
+#include <netinet6/ip6_var.h>
extern struct protosw inet6sw[];
==== //depot/projects/vimage-commit/src/sys/netipsec/ipsec.c#3 (text+ko) ====
@@ -168,7 +168,7 @@
*/
int ipsec_integrity = 0;
SYSCTL_V_INT(V_NET, vnet_ipsec,_net_inet_ipsec, OID_AUTO, test_integrity,
- CTLFLAG_RW, &ipsec_integrity, 0, "Emulate man-in-the-middle attack");
+ CTLFLAG_RW, ipsec_integrity, 0, "Emulate man-in-the-middle attack");
#endif
#ifdef INET6
==== //depot/projects/vimage-commit/src/sys/netipsec/ipsec.h#3 (text+ko) ====
@@ -37,6 +37,7 @@
#ifndef _NETIPSEC_IPSEC_H_
#define _NETIPSEC_IPSEC_H_
+#ifndef VIMAGE_ONLY
#if defined(_KERNEL) && !defined(_LKM) && !defined(KLD_MODULE)
#include "opt_inet.h"
#include "opt_ipsec.h"
@@ -425,6 +426,7 @@
extern int ipsec_filter(struct mbuf **, int, int);
extern void ipsec_bpf(struct mbuf *, struct secasvar *, int, int);
#endif
+
#endif /* _KERNEL */
#ifndef _KERNEL
@@ -435,4 +437,72 @@
extern const char *ipsec_strerror __P((void));
#endif /* !_KERNEL */
+#endif
+#ifdef _KERNEL
+/*
+ * Symbol translation macros
+ */
+#define INIT_VNET_IPSEC(vnet) \
+ INIT_FROM_VNET(vnet, VNET_MOD_IPSEC, struct vnet_ipsec, vnet_ipsec)
+
+#define VNET_IPSEC(sym) VSYM(vnet_ipsec, sym)
+
+#define V_ipsec_debug VNET_IPSEC(ipsec_debug)
+#define V_ipsec4stat VNET_IPSEC(ipsec4stat)
+#define V_ip4_def_policy VNET_IPSEC(ip4_def_policy)
+#define V_ip4_ah_offsetmask VNET_IPSEC(ip4_ah_offsetmask)
+#define V_ip4_ipsec_dfbit VNET_IPSEC(ip4_ipsec_dfbit)
+#define V_ip4_esp_trans_deflev VNET_IPSEC(ip4_esp_trans_deflev)
+#define V_ip4_esp_net_deflev VNET_IPSEC(ip4_esp_net_deflev)
+#define V_ip4_ah_trans_deflev VNET_IPSEC(ip4_ah_trans_deflev)
+#define V_ip4_ah_net_deflev VNET_IPSEC(ip4_ah_net_deflev)
+#define V_ip4_ipsec_ecn VNET_IPSEC(ip4_ipsec_ecn)
+#define V_ip4_esp_randpad VNET_IPSEC(ip4_esp_randpad)
+#define V_ipsec_replay VNET_IPSEC(ipsec_replay)
+#define V_ipsec_integrity VNET_IPSEC(ipsec_integrity)
+#define V_crypto_support VNET_IPSEC(crypto_support)
+#define V_key_debug_level VNET_IPSEC(key_debug_level)
+#define V_key_spi_trycnt VNET_IPSEC(key_spi_trycnt)
+#define V_key_spi_minval VNET_IPSEC(key_spi_minval)
+#define V_key_spi_maxval VNET_IPSEC(key_spi_maxval)
+#define V_policy_id VNET_IPSEC(policy_id)
+#define V_key_int_random VNET_IPSEC(key_int_random)
+#define V_key_larval_lifetime VNET_IPSEC(key_larval_lifetime)
+#define V_key_blockacq_count VNET_IPSEC(key_blockacq_count)
+#define V_key_blockacq_lifetime VNET_IPSEC(key_blockacq_lifetime)
+#define V_key_preferred_oldsa VNET_IPSEC(key_preferred_oldsa)
+#define V_acq_seq VNET_IPSEC(acq_seq)
+#define V_saorder_state_alive VNET_IPSEC(saorder_state_alive)
+#define V_saorder_state_any VNET_IPSEC(saorder_state_any)
+#define V_esp_enable VNET_IPSEC(esp_enable)
+#define V_espstat VNET_IPSEC(espstat)
+#define V_esp_max_ivlen VNET_IPSEC(esp_max_ivlen)
+#define V_ipsec_esp_keymin VNET_IPSEC(ipsec_esp_keymin)
+#define V_ipsec_esp_auth VNET_IPSEC(ipsec_esp_auth)
+#define V_ipsec_ah_keymin VNET_IPSEC(ipsec_ah_keymin)
+#define V_ipip_allow VNET_IPSEC(ipip_allow)
+#define V_ipipstat VNET_IPSEC(ipipstat)
+#define V_ipsec6stat VNET_IPSEC(ipsec6stat)
+#define V_ip6_esp_trans_deflev VNET_IPSEC(ip6_esp_trans_deflev)
+#define V_ip6_esp_net_deflev VNET_IPSEC(ip6_esp_net_deflev)
+#define V_ip6_ah_trans_deflev VNET_IPSEC(ip6_ah_trans_deflev)
+#define V_ip6_ah_net_deflev VNET_IPSEC(ip6_ah_net_deflev)
+#define V_ip6_ipsec_ecn VNET_IPSEC(ip6_ipsec_ecn)
+#define V_ip6_esp_randpad VNET_IPSEC(ip6_esp_randpad)
+#define V_ah_enable VNET_IPSEC(ah_enable)
+#define V_ah_cleartos VNET_IPSEC(ah_cleartos)
+#define V_ahstat VNET_IPSEC(ahstat)
+#define V_ipcomp_enable VNET_IPSEC(ipcomp_enable)
+#define V_ipcompstat VNET_IPSEC(ipcompstat)
+#define V_pfkeystat VNET_IPSEC(pfkeystat)
+#define V_key_cb VNET_IPSEC(key_cb)
+#define V_key_dst VNET_IPSEC(key_dst)
+#define V_key_src VNET_IPSEC(key_src)
+#define V_sptree VNET_IPSEC(sptree)
+#define V_sahtree VNET_IPSEC(sahtree)
+#define V_regtree VNET_IPSEC(regtree)
+#define V_acqtree VNET_IPSEC(acqtree)
+#define V_spacqtree VNET_IPSEC(spacqtree)
+#endif
+
#endif /* _NETIPSEC_IPSEC_H_ */
==== //depot/projects/vimage-commit/src/sys/netipsec/keysock.c#3 (text+ko) ====
@@ -55,10 +55,15 @@
#include <net/raw_cb.h>
#include <net/route.h>
+#include <net/if.h>
#include <net/pfkeyv2.h>
+#define VIMAGE_ONLY
+#include <netipsec/ipsec.h>
+#undef VIMAGE_ONLY
#include <netipsec/key.h>
#include <netipsec/keysock.h>
+#include <netipsec/keysock.h>
#include <netipsec/key_debug.h>
#include <machine/stdarg.h>
More information about the p4-projects
mailing list