This commit is contained in:
Josh Deprez 2024-03-22 16:18:18 +11:00
parent 19f9d1c891
commit b35cc1387e
No known key found for this signature in database

12
main.go
View file

@ -106,11 +106,17 @@ func main() {
// Formulate a response.
var rp *aurp.OpenRspPacket
if p.Version != 1 {
switch {
case p.Version != 1:
// Respond with Open-Rsp with unknown version error.
rp = tr.NewOpenRspPacket(0, aurp.ErrCodeInvalidVersion, nil)
} else {
// Accept the connection, I guess?
case len(p.Options) > 0:
// Options? OPTIONS? We don't accept no stinkin' _options_
rp = tr.NewOpenRspPacket(0, aurp.ErrCodeOptionNegotiation, nil)
default:
// Accept it I guess.
rp = tr.NewOpenRspPacket(0, 1, nil)
}