1
0
mirror of https://github.com/bgp/stayrtr.git synced 2024-05-06 15:54:54 +00:00

Add -disable.aspa flag

Just in case!
This commit is contained in:
Ben Cartwright-Cox
2023-02-23 12:19:22 +00:00
parent 0753777f1f
commit 3555d81035

View File

@ -536,6 +536,7 @@ func (s *Server) Start(bind string) error {
}
var DisableBGPSec = flag.Bool("disable.bgpsec", false, "Disable sending out BGPSEC Router Keys")
var DisableASPA = flag.Bool("disable.aspa", false, "Disable sending out ASPA objects")
func (s *Server) acceptClientTCP(tcpconn net.Conn) error {
client := ClientFromConn(tcpconn, s, s)
@ -547,6 +548,9 @@ func (s *Server) acceptClientTCP(tcpconn net.Conn) error {
if *DisableBGPSec {
client.DisableBGPsec()
}
if *DisableASPA {
client.DisableASPA()
}
go client.Start()
return nil
}
@ -733,6 +737,7 @@ type Client struct {
expireInterval uint32
dontSendBGPsecKeys bool
dontSendASPA bool
log Logger
}
@ -757,6 +762,10 @@ func (c *Client) DisableBGPsec() {
c.dontSendBGPsecKeys = true
}
func (c *Client) DisableASPA() {
c.dontSendASPA = true
}
func (c *Client) SetIntervals(refreshInterval uint32, retryInterval uint32, expireInterval uint32) {
c.refreshInterval = refreshInterval
c.retryInterval = retryInterval
@ -1150,7 +1159,7 @@ func (c *Client) SendData(sd SendableData) {
}
c.SendPDU(pdu)
case *ASPARecord:
if c.version < 2 || c.dontSendBGPsecKeys {
if c.version < 2 || c.dontSendASPA {
return
}