alice-lg / birdwatcher

A JSON API for BIRD
BSD 3-Clause "New" or "Revised" License
68 stars 41 forks source link

Regex for interface names #18

Closed stv0g closed 4 years ago

stv0g commented 4 years ago

Currently birdwatcher parses interface names via the \w regex character class.

However Linux seems to be much more flexible in regards to interface names: https://unix.stackexchange.com/questions/451368/allowed-chars-in-linux-network-interface-names

https://github.com/alice-lg/birdwatcher/blob/b7d8845eda2fcfdd4368984c36936e58e523d490/bird/parser.go#L86

stv0g commented 4 years ago

E.g. my interfaces vpn-fra are not parsed properly..

stv0g commented 4 years ago

There is also another issue when parsing the interface and gateway:

bird only prints a gateway or the interface but never both at the same time: https://github.com/CZ-NIC/bird/blob/master/nest/rt-show.c#L89

stv0g commented 4 years ago

Solved by #19