Route export problem with FreeBSD 13.0
Hello guys, After upgrading one of my hosts from FreeBSD 12.2 to FreeBSD 13.0, I started noticing a problem when exporting routes to the KRT. My logs were getting flooded with "kernel: gw sdl_len too small". This message comes from cleanup_xaddrs_gateway() in sys/net/rtsock.c of releng/13.0, so I checked with "route monitor" and noticed that the blackhole routes and one interface route were the ones causing the message. got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 3, errno 22, flags:<UP,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.0.0 link#4 255.0.0.0 got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 4, errno 22, flags:<UP,PROTO1> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.42.10.0 link#5 255.255.255.0 In BIRD they look the same as before the upgrade: bird> show route all 10.0.0.0/8 Table master4: 10.0.0.0/8 blackhole [s_null_4 2021-08-28 15:57:32] ! (200) Type: static univ bird> show route all 10.42.10.0/24 Table master4: 10.42.10.0/24 unicast [direct1 2021-08-28 16:07:59] ! (240) dev vlan10 Type: device univ I then decided to try manually adding a blackhole route using "route add -net 10.0.0.0/8 -blackhole -proto1 -nostatic", to get as close to what BIRD was trying to add and noticed that BIRD had a gateway, but "route add" didn't have one. got message of size 184 on Sat Aug 28 16:05:43 2021 RTM_ADD: Add Route: len 184, pid: 2766, seq 1, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0 I tried commenting out line 324 in sysdep/bsd/krt-sock.c of v2.0.8 to see if that could fix it and bird was able to insert the blackhole route (can be seen below), but then bird started dying a couple seconds after starting up, with no error showing up on the logs. got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 2, errno 22, flags:<UP,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.42.10.0 255.255.255.0 got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 3, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0 At this point, I ran out of ideas on what else to try. This is in a testing environment, so I can easily try things out or provide extra information. Thank you, Luiz
On 28 Aug 2021, at 15:23, Luiz Amaral <email@luiz.eng.br> wrote:
Hello guys, Hi Luiz,
After upgrading one of my hosts from FreeBSD 12.2 to FreeBSD 13.0, I started noticing a problem when exporting routes to the KRT.
Unfortunately, there were a number of issues in 13.0 w.r.t rtsock handling. I’d suggest considering updating to 13-STABLE.
My logs were getting flooded with "kernel: gw sdl_len too small". This message comes from cleanup_xaddrs_gateway() in sys/net/rtsock.c of releng/13.0, so I checked with "route monitor" and noticed that the blackhole routes and one interface route were the ones causing the message.
got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 3, errno 22, flags:<UP,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.0.0 link#4 255.0.0.0
got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 4, errno 22, flags:<UP,PROTO1> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.42.10.0 link#5 255.255.255.0
In BIRD they look the same as before the upgrade:
bird> show route all 10.0.0.0/8 Table master4: 10.0.0.0/8 blackhole [s_null_4 2021-08-28 15:57:32] ! (200) Type: static univ bird> show route all 10.42.10.0/24 Table master4: 10.42.10.0/24 unicast [direct1 2021-08-28 16:07:59] ! (240) dev vlan10 Type: device univ
I then decided to try manually adding a blackhole route using "route add -net 10.0.0.0/8 -blackhole -proto1 -nostatic", to get as close to what BIRD was trying to add and noticed that BIRD had a gateway, but "route add" didn't have one.
got message of size 184 on Sat Aug 28 16:05:43 2021 RTM_ADD: Add Route: len 184, pid: 2766, seq 1, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0
I tried commenting out line 324 in sysdep/bsd/krt-sock.c of v2.0.8 to see if that could fix it and bird was able to insert the blackhole route (can be seen below), but then bird started dying a couple seconds after starting up, with no error showing up on the logs.
got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 2, errno 22, flags:<UP,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.42.10.0 255.255.255.0
got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 3, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0
At this point, I ran out of ideas on what else to try. This is in a testing environment, so I can easily try things out or provide extra information.
Thank you, Luiz
Hello, Please try this patch: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=224258&action=diff https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255089 Thank you. Best regards, David S. ------------------------------------------------ e. david@zeromail.us w. pnyet.web.id p. 087881216110 On Sun, Aug 29, 2021 at 5:07 PM Alexander V. Chernikov <melifaro@ipfw.ru> wrote:
On 28 Aug 2021, at 15:23, Luiz Amaral <email@luiz.eng.br> wrote:
Hello guys, Hi Luiz,
After upgrading one of my hosts from FreeBSD 12.2 to FreeBSD 13.0, I started noticing a problem when exporting routes to the KRT.
Unfortunately, there were a number of issues in 13.0 w.r.t rtsock handling. I’d suggest considering updating to 13-STABLE.
My logs were getting flooded with "kernel: gw sdl_len too small". This message comes from cleanup_xaddrs_gateway() in sys/net/rtsock.c of releng/13.0, so I checked with "route monitor" and noticed that the blackhole routes and one interface route were the ones causing the
message.
got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 3, errno 22, flags:<UP,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.0.0.0 link#4 255.0.0.0
got message of size 192 on Sat Aug 28 15:57:32 2021 RTM_ADD: Add Route: len 192, pid: 2293, seq 4, errno 22,
flags:<UP,PROTO1>
locks: inits: sockaddrs: <DST,GATEWAY,NETMASK> 10.42.10.0 link#5 255.255.255.0
In BIRD they look the same as before the upgrade:
bird> show route all 10.0.0.0/8 Table master4: 10.0.0.0/8 blackhole [s_null_4 2021-08-28 15:57:32] ! (200) Type: static univ bird> show route all 10.42.10.0/24 Table master4: 10.42.10.0/24 unicast [direct1 2021-08-28 16:07:59] ! (240) dev vlan10 Type: device univ
I then decided to try manually adding a blackhole route using "route add -net 10.0.0.0/8 -blackhole -proto1 -nostatic", to get as close to what BIRD was trying to add and noticed that BIRD had a gateway, but "route add" didn't have one.
got message of size 184 on Sat Aug 28 16:05:43 2021 RTM_ADD: Add Route: len 184, pid: 2766, seq 1, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0
I tried commenting out line 324 in sysdep/bsd/krt-sock.c of v2.0.8 to see if that could fix it and bird was able to insert the blackhole route (can be seen below), but then bird started dying a couple seconds after starting up, with no error showing up on the logs.
got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 2, errno 22, flags:<UP,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.42.10.0 255.255.255.0
got message of size 184 on Sat Aug 28 15:27:33 2021 RTM_ADD: Add Route: len 184, pid: 46425, seq 3, errno 0, flags:<UP,GATEWAY,DONE,BLACKHOLE,PROTO1> locks: inits: sockaddrs: <DST,NETMASK> 10.0.0.0 255.0.0.0
At this point, I ran out of ideas on what else to try. This is in a testing environment, so I can easily try things out or provide extra information.
Thank you, Luiz
participants (3)
-
Alexander V. Chernikov -
David S. -
Luiz Amaral