@@ -64,18 +64,6 @@ func (s *Server) setup() {
64
64
// Spawn the BGP goroutines.
65
65
s .bgp = bgpServer .NewBgpServer ()
66
66
go s .bgp .Serve ()
67
-
68
- // Insert any path that's already defined.
69
- if len (s .paths ) > 0 {
70
- // Reset the path list.
71
- paths := s .paths
72
- s .paths = map [string ]path {}
73
-
74
- for _ , path := range paths {
75
- err := s .addPrefix (path .prefix , path .nexthop , path .owner )
76
- logger .Warn ("Unable to add prefix to BGP server" , logger.Ctx {"prefix" : path .prefix .String (), "err" : err })
77
- }
78
- }
79
67
}
80
68
81
69
// Start sets up the BGP listener.
@@ -131,6 +119,20 @@ func (s *Server) start(address string, asn uint32, routerID net.IP) error {
131
119
return err
132
120
}
133
121
122
+ // Insert any path that's already defined.
123
+ if len (s .paths ) > 0 {
124
+ // Reset the path list.
125
+ paths := s .paths
126
+ s .paths = map [string ]path {}
127
+
128
+ for _ , path := range paths {
129
+ err := s .addPrefix (path .prefix , path .nexthop , path .owner )
130
+ if err != nil {
131
+ logger .Warn ("Unable to add prefix to BGP server" , logger.Ctx {"prefix" : path .prefix .String (), "err" : err })
132
+ }
133
+ }
134
+ }
135
+
134
136
// Add any existing peers.
135
137
for _ , peer := range s .peers {
136
138
err := s .addPeer (peer .address , peer .asn , peer .password , peer .holdtime )
0 commit comments