Hi All, I am implementing a function that send default route to BGP peer, and I am facing an issue about BGP filter, when I use "show route filter" in birdc, the filter result is correct; when I add this filter to config-file and start bird, the bird will occur coredump issue. Does anyone know the reason? Appreciated in advance. 1. bird>show route filter {if format(net) = "0.0.0.0/0" then accept;} //correct result /* show route filter {if net = "0.0.0.0/0" then accept;} // incorrect result */ 2. config-file: filter filter_bgp1{ if format(net) = "0.0.0.0/0" then accept; // "format(net) = ..." , bird coredump ??? /* if net = "0.0.0.0/0" then accept; // " net= ..." , not bird coredump*/ } protocol bgp bgp1 { ...... ipv4 { import all; export filter filter_bgp1; }; ........ } Thanks Arvin
Hi!
1. bird>show route filter {if format(net) = "0.0.0.0/0" then accept;} //correct result
/* show route filter {if net = "0.0.0.0/0" then accept;} // incorrect result */
compare net = 0.0.0.0/0 – the "0.0.0.0/0" is a string literal, the 0.0.0.0/0 is a prefix literal.
2. config-file:
filter filter_bgp1{
if format(net) = "0.0.0.0/0" then accept; // “format(net) = …” , bird coredump ???
/* if net = "0.0.0.0/0" then accept; // “ net= …” , not bird coredump*/
}
Will check this. Thanks for report. M.
2. config-file:
filter filter_bgp1{
if format(net) = "0.0.0.0/0" then accept; // “format(net) = …” , bird coredump ???
/* if net = "0.0.0.0/0" then accept; // “ net= …” , not bird coredump*/
}
Will check this. Thanks for report.
Checked, couldn't reproduce. My test config follows below: --------- 8< ---- BEGIN OF CONFIG --------------------- define x = (format(0.0.0.0/0) = "0.0.0.0/0"); filter y { if format(net) = "0.0.0.0/0" then accept; }; protocol device {} protocol kernel { learn; ipv4; } protocol kernel { learn; ipv6; } ipv4 table ttt; protocol pipe { table ttt; peer table master4; import filter y; export filter y; } --------- 8< ---- END OF CONFIG ----------------------- This does not trigger a coredump when running on v2.0.2. Please try this config on your machine or send in some minimal config that causes a coredump. Thanks! Maria
Thanks, I will try. -----Original Message----- From: Bird-users <bird-users-bounces@network.cz> On Behalf Of Jan Maria Matejka Sent: Wednesday, April 25, 2018 6:31 PM To: bird-users@network.cz Subject: Re: BGP filter
2. config-file:
filter filter_bgp1{
if format(net) = "0.0.0.0/0" then accept; // "format(net) = ." , bird coredump ???
/* if net = "0.0.0.0/0" then accept; // " net= ." , not bird coredump*/
}
Will check this. Thanks for report.
Checked, couldn't reproduce. My test config follows below: --------- 8< ---- BEGIN OF CONFIG --------------------- define x = (format(0.0.0.0/0) = "0.0.0.0/0"); filter y { if format(net) = "0.0.0.0/0" then accept; }; protocol device {} protocol kernel { learn; ipv4; } protocol kernel { learn; ipv6; } ipv4 table ttt; protocol pipe { table ttt; peer table master4; import filter y; export filter y; } --------- 8< ---- END OF CONFIG ----------------------- This does not trigger a coredump when running on v2.0.2. Please try this config on your machine or send in some minimal config that causes a coredump. Thanks! Maria
[...] On 04/25/2018 12:38 PM, Arvin Gan wrote:
Thanks, I will try.
We found out that it may coredump on reconfiguration as instruction comparison happens there and the format() instruction has no comparator. Please look into your log, there should be something like >>Bug: Unknown instruction<<. Thanks Maria
Hi , Yes, I used GDB tools to trace, the coredump occurred on "0x0006ea88 in bug (msg=0x7b7c8 "Unknown instruction %d in same (%c)") at sysdep/unix/log.c:213". Thanks Arvin -----Original Message----- From: Jan Maria Matejka <jan.matejka@nic.cz> Sent: Wednesday, April 25, 2018 9:26 PM To: Arvin Gan <AGan@advaoptical.com>; bird-users@network.cz Subject: Re: BGP filter [...] On 04/25/2018 12:38 PM, Arvin Gan wrote:
Thanks, I will try.
We found out that it may coredump on reconfiguration as instruction comparison happens there and the format() instruction has no comparator. Please look into your log, there should be something like >>Bug: Unknown instruction<<. Thanks Maria
On 04/25/2018 03:26 PM, Jan Maria Matejka wrote:
[...]
On 04/25/2018 12:38 PM, Arvin Gan wrote:
Thanks, I will try.
We found out that it may coredump on reconfiguration as instruction comparison happens there and the format() instruction has no comparator. Please look into your log, there should be something like >>Bug: Unknown instruction<<.
Fixed in 823ad12191e66e243dd088a81c66e4a518563e40. Maria
Hi all, Thanks for your fix. I noticed that we fixed several key bugs recently, do you have plan to merge int-new to master branch and release new archive? My previous reported bug: https://gitlab.labs.nic.cz/labs/bird/commit/f3a8cf050e6181e158dcde2fe885d7bf... Thanks Arvin -----Original Message----- From: Jan Maria Matejka <jan.matejka@nic.cz> Sent: Friday, April 27, 2018 8:41 PM To: Arvin Gan <AGan@advaoptical.com>; bird-users@network.cz Subject: Re: BGP filter On 04/25/2018 03:26 PM, Jan Maria Matejka wrote:
[...]
On 04/25/2018 12:38 PM, Arvin Gan wrote:
Thanks, I will try.
We found out that it may coredump on reconfiguration as instruction comparison happens there and the format() instruction has no comparator. Please look into your log, there should be something like >>Bug: Unknown instruction<<.
Fixed in 823ad12191e66e243dd088a81c66e4a518563e40. Maria
Hi , Thanks for your response. Do you know the reason " show route filter {if format(net) = "0.0.0.0/0" then accept;}" is running correctly in birdc command ,but cause the coredump in config-file? Thanks Arvin -----Original Message----- From: Bird-users <bird-users-bounces@network.cz> On Behalf Of Jan Maria Matejka Sent: Wednesday, April 25, 2018 6:19 PM To: bird-users@network.cz Subject: Re: BGP filter Hi!
1. bird>show route filter {if format(net) = "0.0.0.0/0" then accept;} //correct result
/* show route filter {if net = "0.0.0.0/0" then accept;} // incorrect result */
compare net = 0.0.0.0/0 - the "0.0.0.0/0" is a string literal, the 0.0.0.0/0 is a prefix literal.
2. config-file:
filter filter_bgp1{
if format(net) = "0.0.0.0/0" then accept; // "format(net) = ." , bird coredump ???
/* if net = "0.0.0.0/0" then accept; // " net= ." , not bird coredump*/
}
Will check this. Thanks for report. M.
participants (2)
-
Arvin Gan -
Jan Maria Matejka