mirror of https://github.com/EdgeVPNio/evio.git
Igonore incoming edges when creating net transform
parent
62130a3e9d
commit
bf2467dc88
|
@ -150,9 +150,9 @@ class GraphBuilder:
|
||||||
adj_list: ConnEdgeAdjacenctList,
|
adj_list: ConnEdgeAdjacenctList,
|
||||||
transition_adj_list: ConnEdgeAdjacenctList,
|
transition_adj_list: ConnEdgeAdjacenctList,
|
||||||
):
|
):
|
||||||
ldlnks = {}
|
|
||||||
if 2 * self._min_successors > len(self._peers):
|
if 2 * self._min_successors > len(self._peers):
|
||||||
return # not enough peers to build LDL
|
return # not enough peers to build LDL
|
||||||
|
ldlnks = {}
|
||||||
if not self._relink:
|
if not self._relink:
|
||||||
ldlnks = transition_adj_list.select_edges(
|
ldlnks = transition_adj_list.select_edges(
|
||||||
edge_type=EDGE_TYPE_OUT.LongDistance
|
edge_type=EDGE_TYPE_OUT.LongDistance
|
||||||
|
@ -260,21 +260,6 @@ class GraphBuilder:
|
||||||
)
|
)
|
||||||
self._build_static(adj_list)
|
self._build_static(adj_list)
|
||||||
if not self._manual_topo:
|
if not self._manual_topo:
|
||||||
# Preserve existing incoming links
|
|
||||||
inlnks = transition_adj_list.select_incoming_edges()
|
|
||||||
for ce in inlnks.values():
|
|
||||||
if (
|
|
||||||
ce.edge_state
|
|
||||||
in (
|
|
||||||
EDGE_STATES.Initialized,
|
|
||||||
EDGE_STATES.PreAuth,
|
|
||||||
EDGE_STATES.Authorized,
|
|
||||||
EDGE_STATES.Created,
|
|
||||||
EDGE_STATES.Connected,
|
|
||||||
)
|
|
||||||
and ce.peer_id not in adj_list
|
|
||||||
):
|
|
||||||
adj_list[ce.peer_id] = ce
|
|
||||||
self._build_successors(adj_list, transition_adj_list)
|
self._build_successors(adj_list, transition_adj_list)
|
||||||
self._build_long_dist_links(adj_list, transition_adj_list)
|
self._build_long_dist_links(adj_list, transition_adj_list)
|
||||||
self._build_ondemand_links(adj_list, transition_adj_list, request_list)
|
self._build_ondemand_links(adj_list, transition_adj_list, request_list)
|
||||||
|
|
|
@ -333,10 +333,6 @@ class ConnEdgeAdjacenctList(MutableMapping):
|
||||||
def update_edge(self, new_conn_edge: ConnectionEdge):
|
def update_edge(self, new_conn_edge: ConnectionEdge):
|
||||||
ce = self._conn_edges.get(new_conn_edge.peer_id)
|
ce = self._conn_edges.get(new_conn_edge.peer_id)
|
||||||
if ce:
|
if ce:
|
||||||
if ce.role != CONNECTION_ROLE.Initiator:
|
|
||||||
raise ValueError(
|
|
||||||
"Existing ConnectionEdge's role is not an initiator, ce=%s", ce
|
|
||||||
)
|
|
||||||
self._decr_edge_type_count(ce.edge_type)
|
self._decr_edge_type_count(ce.edge_type)
|
||||||
ce.edge_type = new_conn_edge.edge_type
|
ce.edge_type = new_conn_edge.edge_type
|
||||||
self._incr_edge_type_count(ce.edge_type)
|
self._incr_edge_type_count(ce.edge_type)
|
||||||
|
@ -457,6 +453,8 @@ class GraphTransformation:
|
||||||
self._edits.append(op)
|
self._edits.append(op)
|
||||||
|
|
||||||
for peer_id in current:
|
for peer_id in current:
|
||||||
|
if current[peer_id].role == CONNECTION_ROLE.Target:
|
||||||
|
continue # take no action on incoming links
|
||||||
if peer_id not in target:
|
if peer_id not in target:
|
||||||
# Op Remove
|
# Op Remove
|
||||||
if current[peer_id].edge_type == EDGE_TYPE_OUT.OnDemand:
|
if current[peer_id].edge_type == EDGE_TYPE_OUT.OnDemand:
|
||||||
|
|
Loading…
Reference in New Issue