Blame SOURCES/0008-ospf-multi-instance.patch

133c55
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
133c55
index d8be19db9..6fe94f3a4 100644
133c55
--- a/ospfd/ospfd.c
133c55
+++ b/ospfd/ospfd.c
133c55
@@ -384,12 +384,50 @@ struct ospf *ospf_lookup_by_inst_name(unsigned short instance, const char *name)
133c55
 	return NULL;
133c55
 }
133c55
 
133c55
-struct ospf *ospf_get(unsigned short instance, const char *name, bool *created)
133c55
+static void ospf_init(struct ospf *ospf)
133c55
 {
133c55
-	struct ospf *ospf;
133c55
 	struct vrf *vrf;
133c55
 	struct interface *ifp;
133c55
 
133c55
+	ospf_opaque_type11_lsa_init(ospf);
133c55
+
133c55
+	if (ospf->vrf_id != VRF_UNKNOWN)
133c55
+		ospf->oi_running = 1;
133c55
+
133c55
+	/* Activate 'ip ospf area x' configured interfaces for given
133c55
+	 * vrf. Activate area on vrf x aware interfaces.
133c55
+	 * vrf_enable callback calls router_id_update which
133c55
+	 * internally will call ospf_if_update to trigger
133c55
+	 * network_run_state
133c55
+	 */
133c55
+	vrf = vrf_lookup_by_id(ospf->vrf_id);
133c55
+
133c55
+	FOR_ALL_INTERFACES (vrf, ifp) {
133c55
+		struct ospf_if_params *params;
133c55
+		struct route_node *rn;
133c55
+		uint32_t count = 0;
133c55
+
133c55
+		params = IF_DEF_PARAMS(ifp);
133c55
+		if (OSPF_IF_PARAM_CONFIGURED(params, if_area))
133c55
+			count++;
133c55
+
133c55
+		for (rn = route_top(IF_OIFS_PARAMS(ifp)); rn; rn = route_next(rn))
133c55
+			if ((params = rn->info) && OSPF_IF_PARAM_CONFIGURED(params, if_area))
133c55
+				count++;
133c55
+
133c55
+		if (count > 0) {
133c55
+			ospf_interface_area_set(ospf, ifp);
133c55
+			ospf->if_ospf_cli_count += count;
133c55
+		}
133c55
+	}
133c55
+
133c55
+	ospf_router_id_update(ospf);
133c55
+}
133c55
+
133c55
+struct ospf *ospf_get(unsigned short instance, const char *name, bool *created)
133c55
+{
133c55
+	struct ospf *ospf;
133c55
+
133c55
 	/* vrf name provided call inst and name based api
133c55
 	 * in case of no name pass default ospf instance */
133c55
 	if (name)
133c55
@@ -402,39 +440,7 @@ struct ospf *ospf_get(unsigned short instance, const char *name, bool *created)
133c55
 		ospf = ospf_new(instance, name);
133c55
 		ospf_add(ospf);
133c55
 
133c55
-		ospf_opaque_type11_lsa_init(ospf);
133c55
-
133c55
-		if (ospf->vrf_id != VRF_UNKNOWN)
133c55
-			ospf->oi_running = 1;
133c55
-
133c55
-		/* Activate 'ip ospf area x' configured interfaces for given
133c55
-		 * vrf. Activate area on vrf x aware interfaces.
133c55
-		 * vrf_enable callback calls router_id_update which
133c55
-		 * internally will call ospf_if_update to trigger
133c55
-		 * network_run_state
133c55
-		 */
133c55
-		vrf = vrf_lookup_by_id(ospf->vrf_id);
133c55
-
133c55
-		FOR_ALL_INTERFACES (vrf, ifp) {
133c55
-			struct ospf_if_params *params;
133c55
-			struct route_node *rn;
133c55
-			uint32_t count = 0;
133c55
-
133c55
-			params = IF_DEF_PARAMS(ifp);
133c55
-			if (OSPF_IF_PARAM_CONFIGURED(params, if_area))
133c55
-				count++;
133c55
-
133c55
-			for (rn = route_top(IF_OIFS_PARAMS(ifp)); rn; rn = route_next(rn))
133c55
-				if ((params = rn->info) && OSPF_IF_PARAM_CONFIGURED(params, if_area))
133c55
-					count++;
133c55
-
133c55
-			if (count > 0) {
133c55
-				ospf_interface_area_set(ospf, ifp);
133c55
-				ospf->if_ospf_cli_count += count;
133c55
-			}
133c55
-		}
133c55
-
133c55
-		ospf_router_id_update(ospf);
133c55
+		ospf_init(ospf);
133c55
 	}
133c55
 
133c55
 	return ospf;
133c55
@@ -450,7 +456,7 @@ struct ospf *ospf_get_instance(unsigned short instance, bool *created)
133c55
 		ospf = ospf_new(instance, NULL /* VRF_DEFAULT*/);
133c55
 		ospf_add(ospf);
133c55
 
133c55
-		ospf_opaque_type11_lsa_init(ospf);
133c55
+		ospf_init(ospf);
133c55
 	}
133c55
 
133c55
 	return ospf;
133c55
diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h
133c55
index 192e54281..3087b735a 100644
133c55
--- a/ospfd/ospfd.h
133c55
+++ b/ospfd/ospfd.h
133c55
@@ -604,7 +604,6 @@ extern int ospf_nbr_nbma_poll_interval_set(struct ospf *, struct in_addr,
133c55
 					   unsigned int);
133c55
 extern int ospf_nbr_nbma_poll_interval_unset(struct ospf *, struct in_addr);
133c55
 extern void ospf_prefix_list_update(struct prefix_list *);
133c55
-extern void ospf_init(void);
133c55
 extern void ospf_if_update(struct ospf *, struct interface *);
133c55
 extern void ospf_ls_upd_queue_empty(struct ospf_interface *);
133c55
 extern void ospf_terminate(void);