Dear BIRD devs, On https://gitlab.labs.nic.cz/labs/bird/wikis/BGP_filtering I see the following curious snippet: function xx() { ... if bgp_next_hop != from then return false; ... } What in the above example does "from" mean? Is "from" some kind of magic keyword that expands into something? Kind regards, Job
On May 29, 2018 8:42:22 PM GMT+02:00, Job Snijders <job@instituut.net> wrote:
Dear BIRD devs,
On https://gitlab.labs.nic.cz/labs/bird/wikis/BGP_filtering I see the following curious snippet:
function xx() { ... if bgp_next_hop != from then return false; ... }
What in the above example does "from" mean? Is "from" some kind of magic keyword that expands into something?
Yes. It expands to the author of the route (IP of its sender). Therefore this check is to filter out routes with other next hop than the sender herself as this is probably some scam or misconfiguration. Maria
On Tue, May 29, 2018 at 7:56 PM, Maria Jan Matějka <jan.matejka@nic.cz> wrote:
On May 29, 2018 8:42:22 PM GMT+02:00, Job Snijders <job@instituut.net> wrote:
On https://gitlab.labs.nic.cz/labs/bird/wikis/BGP_filtering I see the following curious snippet:
function xx() { ... if bgp_next_hop != from then return false; ... }
What in the above example does "from" mean? Is "from" some kind of magic keyword that expands into something?
Yes. It expands to the author of the route (IP of its sender). Therefore this check is to filter out routes with other next hop than the sender herself as this is probably some scam or misconfiguration.
Thank you for the quick answer! Very useful Kind regards, Job
participants (2)
-
Job Snijders -
Maria Jan Matějka