Skip to content
Snippets Groups Projects
Commit 46733d6a authored by Daniel Czerwonk's avatar Daniel Czerwonk
Browse files

bio exports ipv6 routes to peers

parent 9476aad1
No related branches found
No related tags found
No related merge requests found
...@@ -45,4 +45,23 @@ func startServer(b server.BGPServer, rib *locRIB.LocRIB) { ...@@ -45,4 +45,23 @@ func startServer(b server.BGPServer, rib *locRIB.LocRIB) {
ExportFilter: filter.NewDrainFilter(), ExportFilter: filter.NewDrainFilter(),
IPv6: true, IPv6: true,
}, rib) }, rib)
b.AddPeer(config.Peer{
AdminEnabled: true,
LocalAS: 65200,
PeerAS: 65400,
PeerAddress: bnet.IPv6FromBlocks(0x2001, 0x678, 0x1e0, 0xcafe, 0, 0, 0, 5),
LocalAddress: bnet.IPv6FromBlocks(0x2001, 0x678, 0x1e0, 0, 0, 0, 0, 0xcafe),
ReconnectInterval: time.Second * 15,
HoldTime: time.Second * 90,
KeepAlive: time.Second * 30,
Passive: true,
RouterID: b.RouterID(),
AddPathSend: routingtable.ClientOptions{
BestOnly: true,
},
ImportFilter: filter.NewDrainFilter(),
ExportFilter: filter.NewAcceptAllFilter(),
IPv6: true,
}, rib)
} }
...@@ -757,7 +757,7 @@ func PathAttributes(p *route.Path, iBGP bool) (*PathAttribute, error) { ...@@ -757,7 +757,7 @@ func PathAttributes(p *route.Path, iBGP bool) (*PathAttribute, error) {
if p.BGPPath.Aggregator != nil { if p.BGPPath.Aggregator != nil {
aggregator := &PathAttribute{ aggregator := &PathAttribute{
TypeCode: AggregatorAttr, TypeCode: AggregatorAttr,
Value: p.BGPPath.Aggregator, Value: *p.BGPPath.Aggregator,
} }
last.Next = aggregator last.Next = aggregator
last = aggregator last = aggregator
......
...@@ -191,22 +191,21 @@ func (u *UpdateSender) bgpUpdateMultiProtocol(pfxs []bnet.Prefix, pa *packet.Pat ...@@ -191,22 +191,21 @@ func (u *UpdateSender) bgpUpdateMultiProtocol(pfxs []bnet.Prefix, pa *packet.Pat
} }
func (u *UpdateSender) copyAttributesWithoutNextHop(pa *packet.PathAttribute) (attrs *packet.PathAttribute, nextHop bnet.IP) { func (u *UpdateSender) copyAttributesWithoutNextHop(pa *packet.PathAttribute) (attrs *packet.PathAttribute, nextHop bnet.IP) {
attrs = pa.Copy()
curCopy := attrs
cur := pa cur := pa
if cur.TypeCode == packet.NextHopAttr { var curCopy, lastCopy *packet.PathAttribute
nextHop = cur.Value.(bnet.IP)
cur = cur.Next
}
for cur != nil { for cur != nil {
if cur.TypeCode == packet.NextHopAttr { if cur.TypeCode == packet.NextHopAttr {
nextHop = cur.Value.(bnet.IP) nextHop = cur.Value.(bnet.IP)
} else { } else {
curCopy.Next = cur.Copy() curCopy = cur.Copy()
curCopy = curCopy.Next
if lastCopy == nil {
attrs = curCopy
} else {
lastCopy.Next = curCopy
}
lastCopy = curCopy
} }
cur = cur.Next cur = cur.Next
...@@ -217,6 +216,11 @@ func (u *UpdateSender) copyAttributesWithoutNextHop(pa *packet.PathAttribute) (a ...@@ -217,6 +216,11 @@ func (u *UpdateSender) copyAttributesWithoutNextHop(pa *packet.PathAttribute) (a
// RemovePath withdraws prefix `pfx` from a peer // RemovePath withdraws prefix `pfx` from a peer
func (u *UpdateSender) RemovePath(pfx bnet.Prefix, p *route.Path) bool { func (u *UpdateSender) RemovePath(pfx bnet.Prefix, p *route.Path) bool {
if u.fsm.options.SupportsMultiProtocol {
// TODO: imeplent withdraw
return false
}
err := withDrawPrefixesAddPath(u.fsm.con, u.fsm.options, pfx, p) err := withDrawPrefixesAddPath(u.fsm.con, u.fsm.options, pfx, p)
if err != nil { if err != nil {
log.Errorf("Unable to withdraw prefix: %v", err) log.Errorf("Unable to withdraw prefix: %v", err)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment