From d424140e4c8a0e510b16e3ef7742ec7caec403b2 Mon Sep 17 00:00:00 2001 From: Lukas Vogel Date: Fri, 16 Aug 2019 11:12:44 +0200 Subject: [PATCH] fix2 --- go/sciond/internal/fetcher/fetcher.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/go/sciond/internal/fetcher/fetcher.go b/go/sciond/internal/fetcher/fetcher.go index fc22b06349..fa35695888 100644 --- a/go/sciond/internal/fetcher/fetcher.go +++ b/go/sciond/internal/fetcher/fetcher.go @@ -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