From 621a34f8e903362d1c07fe624d0126fb26fff571 Mon Sep 17 00:00:00 2001
From: Oliver Herms <oliver.herms@exaring.de>
Date: Sat, 20 Oct 2018 17:36:08 +0200
Subject: [PATCH] Fix build

---
 examples/bmp/BUILD.bazel                   | 2 +-
 protocols/bgp/server/BUILD.bazel           | 9 +++++++++
 protocols/bgp/server/fsm_address_family.go | 4 +---
 routingtable/adjRIBIn/adj_rib_in.go        | 1 -
 testing/BUILD.bazel                        | 6 +++++-
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/examples/bmp/BUILD.bazel b/examples/bmp/BUILD.bazel
index 63c52ada..66cf5d6e 100644
--- a/examples/bmp/BUILD.bazel
+++ b/examples/bmp/BUILD.bazel
@@ -6,7 +6,7 @@ go_library(
     importpath = "github.com/bio-routing/bio-rd/examples/bmp",
     visibility = ["//visibility:private"],
     deps = [
-        "//protocols/bmp/server:go_default_library",
+        "//protocols/bgp/server:go_default_library",
         "//routingtable/locRIB:go_default_library",
         "//vendor/github.com/sirupsen/logrus:go_default_library",
     ],
diff --git a/protocols/bgp/server/BUILD.bazel b/protocols/bgp/server/BUILD.bazel
index bd45a72d..ea2b4ea6 100644
--- a/protocols/bgp/server/BUILD.bazel
+++ b/protocols/bgp/server/BUILD.bazel
@@ -3,6 +3,8 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
 go_library(
     name = "go_default_library",
     srcs = [
+        "bmp_router.go",
+        "bmp_server.go",
         "fake_conn.go",
         "fsm.go",
         "fsm_active.go",
@@ -29,6 +31,7 @@ go_library(
         "//net:go_default_library",
         "//protocols/bgp/packet:go_default_library",
         "//protocols/bgp/types:go_default_library",
+        "//protocols/bmp/packet:go_default_library",
         "//route:go_default_library",
         "//routingtable:go_default_library",
         "//routingtable/adjRIBIn:go_default_library",
@@ -36,12 +39,15 @@ go_library(
         "//routingtable/filter:go_default_library",
         "//routingtable/locRIB:go_default_library",
         "//vendor/github.com/sirupsen/logrus:go_default_library",
+        "//vendor/github.com/taktv6/tflow2/convert:go_default_library",
     ],
 )
 
 go_test(
     name = "go_default_test",
     srcs = [
+        "bmp_router_test.go",
+        "bmp_server_test.go",
         "fsm_address_family_test.go",
         "fsm_open_sent_test.go",
         "fsm_test.go",
@@ -55,11 +61,14 @@ go_test(
         "//net:go_default_library",
         "//protocols/bgp/packet:go_default_library",
         "//protocols/bgp/types:go_default_library",
+        "//protocols/bmp/packet:go_default_library",
         "//route:go_default_library",
         "//routingtable:go_default_library",
+        "//routingtable/adjRIBIn:go_default_library",
         "//routingtable/filter:go_default_library",
         "//routingtable/locRIB:go_default_library",
         "//testing:go_default_library",
+        "//vendor/github.com/sirupsen/logrus:go_default_library",
         "//vendor/github.com/stretchr/testify/assert:go_default_library",
     ],
 )
diff --git a/protocols/bgp/server/fsm_address_family.go b/protocols/bgp/server/fsm_address_family.go
index af5318e4..01ee06b7 100644
--- a/protocols/bgp/server/fsm_address_family.go
+++ b/protocols/bgp/server/fsm_address_family.go
@@ -1,7 +1,6 @@
 package server
 
 import (
-	"fmt"
 	"time"
 
 	bnet "github.com/bio-routing/bio-rd/net"
@@ -114,8 +113,7 @@ func (f *fsmAddressFamily) updates(u *packet.BGPUpdate) {
 		path := f.newRoutePath()
 		f.processAttributes(u.PathAttributes, path)
 
-		err := f.adjRIBIn.AddPath(r.Prefix, path)
-		fmt.Printf("add path err: %v\n", err)
+		f.adjRIBIn.AddPath(r.Prefix, path)
 	}
 }
 
diff --git a/routingtable/adjRIBIn/adj_rib_in.go b/routingtable/adjRIBIn/adj_rib_in.go
index 279ed35a..631f1d19 100644
--- a/routingtable/adjRIBIn/adj_rib_in.go
+++ b/routingtable/adjRIBIn/adj_rib_in.go
@@ -72,7 +72,6 @@ func (a *AdjRIBIn) AddPath(pfx net.Prefix, p *route.Path) error {
 
 	// RFC4456 Sect. 8: Ignore route with our RouterID as OriginatorID
 	if p.BGPPath.OriginatorID == a.routerID {
-		panic("FKJK")
 		return nil
 	}
 
diff --git a/testing/BUILD.bazel b/testing/BUILD.bazel
index 02411722..ee2d8655 100644
--- a/testing/BUILD.bazel
+++ b/testing/BUILD.bazel
@@ -2,9 +2,13 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
 
 go_library(
     name = "go_default_library",
-    srcs = ["conn_mock.go"],
+    srcs = [
+        "conn_mock.go",
+        "log.go",
+    ],
     importpath = "github.com/bio-routing/bio-rd/testing",
     visibility = ["//visibility:public"],
+    deps = ["//vendor/github.com/sirupsen/logrus:go_default_library"],
 )
 
 go_test(
-- 
GitLab