Jeremie Courreges-Anglas([email protected]) on 2019.10.19 16:01:45 +0200: > On Sat, Oct 19 2019, "Theo de Raadt" <[email protected]> wrote: > > Jeremie Courreges-Anglas <[email protected]> wrote: > > > >> On Sat, Oct 19 2019, Claudio Jeker <[email protected]> wrote: > >> > bgpd supports up to 255 byte shutdown communications. So the manpage is > >> > not telling the truth. Also I don't think it is helpful to mention the > >> > limit at all. bgpctl will exit with 'shutdown reason too long' if the > >> > text > >> > is too long which is good enough. For best interop people should keep the > >> > shutdown message as simple and short as possible. > >> > >> What about just truncating the shutdown message (possibly with a visible > >> marker like '@')? > >> > >> This way bgpctl would still send the message to the peer, which is nicer > >> in unattended runs. > > [edited] > > > I also think a truncated message is way more useful than a replacement > > which throws away the content of the message! > > I guess I was a bit unclear. I proposed to send a shutdown notification > along with a truncated message, rather than erroring out and not > shutting down the session at all (which is what the current code does > IIUC). > > Anyway, maybe I'm overthinking this and people only use shutdown > <reason> interactively; or they properly check the length of the > Shutdown Communication messages they send. There's also the slight > concern that a truncated message might convey a different meaning.
As you say, this really is only a problem if you use it in a script (otherwise you see the error msg). I think if you rely on 'bgpctl peer down' to work (non interactivly), you should check its status code.
