Skip to content

Commit

Permalink
drop route uuid var
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrizhu committed Aug 31, 2024
1 parent c97fda0 commit 9941d72
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
type Prefix struct {
prefix string
pathObj *api.Path
lastAdvUuid []byte
lastAdvSite *ConfigSite
}

Expand Down Expand Up @@ -91,7 +90,6 @@ func prefixesInit() (prefixes []*Prefix) {
Nlri: nlri,
Pattrs: attrs,
},
lastAdvUuid: nil,
lastAdvSite: nil,
}
prefixes = append(prefixes, &newPrefix)
Expand All @@ -110,7 +108,7 @@ func (p *Prefix) bgpAnnounce(site *ConfigSite) {
Assigned: 100,
})

a, err := apb.New(&api.IPv4AddressSpecificExtended{
a, _ := apb.New(&api.IPv4AddressSpecificExtended{
IsTransitive: true,
SubType: 0x02,
Address: p.prefix,
Expand Down Expand Up @@ -148,22 +146,19 @@ func (p *Prefix) bgpAnnounce(site *ConfigSite) {
return
}

resp, err := s.AddPath(ctx, &api.AddPathRequest{
if _, err := s.AddPath(ctx, &api.AddPathRequest{
Path: p.pathObj,
VrfId: site.Name,
TableType: api.TableType_VRF,
})
if err != nil {
}); err != nil {
log.Error().Err(err).
Str("site", site.Name).
Str("prefix", p.prefix).
Msg("AddPath")
return
}

p.lastAdvUuid = resp.Uuid
p.lastAdvSite = site

return
}

Expand Down

0 comments on commit 9941d72

Please sign in to comment.