bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
97 stars 15 forks source link

Do not ignore unknown/leftover arguments #18

Closed ties closed 3 years ago

ties commented 3 years ago

As a user I expect stayrtr/rtrmon/rtrdump to exit when there are leftover positional arguments.

Steps to reproduce:

# docker but also applies with the binaries
# note the missing dash before primary.host
$ docker run --rm rpki/rtrmon primary.host https://console.rpki-client.org/vrps.json
time="2021-08-10T14:38:28Z" level=info msg="1: Connecting with tcp to rtr.rpki.cloudflare.com:8282"
time="2021-08-10T14:38:28Z" level=info msg="2: Fetching https://rpki.cloudflare.com/rpki.json"
time="2021-08-10T14:38:29Z" level=info msg="1: Received: PDU Cache Response v1 (session: 45143)"
time="2021-08-10T14:38:29Z" level=info msg="Worker 2 finished: comparison"

The same happens with unknown flags to stayrtr (have not tested rtrdump)

Expected behaviour:

Program exits because there is an unused positional argument. Instead of connecting to a different host and ignoring the argument.

job commented 3 years ago

agreed