PERFORCE change 123649 for review

Ana Kukec anchie at FreeBSD.org
Tue Jul 17 12:27:11 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123649

Change 123649 by anchie at anchie_malimis on 2007/07/17 12:26:45

	Call xform_register() only for default vnet.	

Affected files ...

.. //depot/projects/vimage/src/sys/netipsec/xform_ah.c#6 edit
.. //depot/projects/vimage/src/sys/netipsec/xform_esp.c#5 edit
.. //depot/projects/vimage/src/sys/netipsec/xform_ipcomp.c#4 edit
.. //depot/projects/vimage/src/sys/netipsec/xform_ipip.c#6 edit

Differences ...

==== //depot/projects/vimage/src/sys/netipsec/xform_ah.c#6 (text+ko) ====

@@ -1248,12 +1248,18 @@
 ah_iattach(unused)
     void *unused;
 {
-    INIT_VNET_IPSEC(curvnet);
+	INIT_VNET_IPSEC(curvnet);
 
 	V_ah_enable = 1;          /* control flow of packets with AH */
 	V_ah_cleartos = 1;        /* clear ip_tos when doing AH calc */
 
+#ifdef VIMAGE
+	if (curvnet == &vnet_0) {
+#endif
 	xform_register(&ah_xformsw);
+#ifdef VIMAGE
+	}
+#endif
 
 	return 0;
 }

==== //depot/projects/vimage/src/sys/netipsec/xform_esp.c#5 (text+ko) ====

@@ -1020,7 +1020,7 @@
 esp_iattach(unused)
     void *unused;
 {
-    INIT_VNET_IPSEC(curvnet);
+	INIT_VNET_IPSEC(curvnet);
 
 	V_esp_enable = 1;
 	V_esp_max_ivlen = 0;
@@ -1038,7 +1038,13 @@
 	MAXIV(enc_xform_null);		/* SADB_EALG_NULL */
 	MAXIV(enc_xform_camellia);	/* SADB_X_EALG_CAMELLIACBC */
 
+#ifdef VIMAGE
+	if (curvnet == &vnet_0) {
+#endif
 	xform_register(&esp_xformsw);
+#ifdef VIMAGE
+        }
+#endif
 #undef MAXIV
 
     return 0;

==== //depot/projects/vimage/src/sys/netipsec/xform_ipcomp.c#4 (text+ko) ====

@@ -628,12 +628,17 @@
 ipcomp_iattach(unused)
     void *unused;
 {
-    INIT_VNET_IPSEC(curvnet);
+	INIT_VNET_IPSEC(curvnet);
 
 	V_ipcomp_enable = 0;
 
+#ifdef VIMAGE
+	if (curvnet == &vnet_0) {
+#endif
 	xform_register(&ipcomp_xformsw);
-
+#ifdef VIMAGE
+	}
+#endif
 	return 0;
 }
 

==== //depot/projects/vimage/src/sys/netipsec/xform_ipip.c#6 (text+ko) ====

@@ -708,6 +708,22 @@
 
 	V_ipip_allow = 0;
 
+#ifdef VIMAGE
+	if (curvnet == &vnet_0) {
+#endif
+	xform_register(&ipe4_xformsw);
+	/* attach to encapsulation framework */
+	/* XXX save return cookie for detach on module remove */
+	(void) encap_attach_func(AF_INET, -1,
+	ipe4_encapcheck, &ipe4_protosw, NULL);
+#ifdef INET6
+	(void) encap_attach_func(AF_INET6, -1,
+	ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL);
+#endif
+#ifdef VIMAGE
+	}
+#endif
+
 	return 0;
 }
 
@@ -719,16 +735,6 @@
 #else
 	ipip_iattach(NULL);
 #endif
-
-	xform_register(&ipe4_xformsw);
-	/* attach to encapsulation framework */
-	/* XXX save return cookie for detach on module remove */
-	(void) encap_attach_func(AF_INET, -1,
-		ipe4_encapcheck, &ipe4_protosw, NULL);
-#ifdef INET6
-	(void) encap_attach_func(AF_INET6, -1,
-		ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL);
-#endif
 }
 SYSINIT(ipe4_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipe4_attach, NULL);
 #endif	/* IPSEC */


More information about the p4-projects mailing list