Skip to content

Commit

Permalink
fix2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Aug 16, 2019
1 parent abe4458 commit d424140
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions go/sciond/internal/fetcher/fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,20 @@ func (f *fetcherHandler) flushSegmentsWithFirstHopInterfaces(ctx context.Context
// in the core we can have down segments or core segments that we
// deleted. We can distinguish them by first IA. (first IA == local
// -> down, otherwise core.)
src := segment.FirstIA()
dst := segment.LastIA()
if !f.topology.ISD_AS.Equal(segment.FirstIA()) {
// for core segments we have to flip src and dst because next
// query is always looking from the local IA.
src, dst = dst, src
}
if _, err := tx.DeleteNQ(ctx, src, dst, nil); err != nil {
return err
src := segment.LastIA()
dst := segment.FirstIA()
if _, err := tx.DeleteNQ(ctx, src, dst, nil); err != nil {
return err
}
} else {
src := addr.IA{I: segment.FirstIA().I}
dst := segment.LastIA()
if _, err := tx.DeleteNQ(ctx, src, dst, nil); err != nil {
return err
}
}
} else {
// in the non-core case deletion can only affect a segment that
Expand Down

0 comments on commit d424140

Please sign in to comment.