sbezverk / gobmp

go based implementation of BGP's BMP protocol
Apache License 2.0
84 stars 27 forks source link

Peer-Down Messages with Unkown Reason Code(0) #206

Closed denizaydin closed 1 year ago

denizaydin commented 1 year ago

During restarting or stoping goBGP instance, it sends peer-down messages with reason code = 0. When I look at its code, code = 0 is its restarting value for peer down. Obviously goBGP should set a proper value during those phases. Other BGP programs may have this behaviour, bug or what ever you called because its hard match every event to a proper reason code. It seems to me that for peer down messages should be processed and may assign a reason value of invalid reason code or e.t.c if its not already one.

peer-down.go .... if pdw.Reason < 1 || pdw.Reason > 5 { return nil, fmt.Errorf("invalid reason code %d in Peer Down message", pdw.Reason) } ....

if it is ok, I will try to add this option to the code?

sbezverk commented 1 year ago

@denizaydin contributions are welcome ;)

denizaydin commented 1 year ago

Ok then:)