Bug 255089 - net/bird2: gw sdl_len too small
Summary: net/bird2: gw sdl_len too small
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Olivier Cochard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-15 11:03 UTC by greif
Modified: 2022-07-22 21:48 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (olivier)


Attachments
Workaround for stricter sockaddr_dl checks on FBSD 13 (1.12 KB, patch)
2021-04-19 16:18 UTC, Stefan Haller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description greif 2021-04-15 11:03:48 UTC
bird2 in version 2.0.8 from ports running on release/13.0.0 spams syslog with 'kernel: gw sdl_len too small' as well as its own log with '<ERR> KRT: Error sending route 1.2.3.4/12 to kernel: Invalid argument' messages, when trying to insert routes into the hosts routing table.

I traced the error to this commit [1]. As far as i can tell the bird side looks good [2] but i'm by no means an expert on that.

[1] lists.freebsd.org/pipermail/dev-commits-src-branches/2021-March/001355.html

[2] gitlab.nic.cz/labs/bird/-/blob/master/sysdep/bsd/krt-sock.c
Comment 1 Olivier Cochard freebsd_committer freebsd_triage 2021-04-15 11:25:44 UTC
Hi,
this was fixed here (on -head):
https://cgit.freebsd.org/src/commit/?id=7f5f3fcc32bfa553faa007579dfcaed84be3b047

But indeed it need to be MFC to 13.0-RELEASE
Comment 2 Stefan Haller 2021-04-19 16:18:14 UTC
Created attachment 224258 [details]
Workaround for stricter sockaddr_dl checks on FBSD 13

(I already wrote this in a private mail to the maintainer. Found this bug report only afterwards.)

I fixed the problem by adapting the BSD routing table code in bird. You might give the attached patch a try.
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-04-19 19:03:53 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=de703e98e6c863874aa6012e3ce1a61eee58c846

commit de703e98e6c863874aa6012e3ce1a61eee58c846
Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
AuthorDate: 2021-04-10 15:25:24 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2021-04-19 18:52:57 +0000

    Fix direct route installation with net/bird.

    Slighly relax the gateway validation rules imposed by the
     2fe5a79425c7, by requiring only first 8 bytes (everyhing
     before sdl_data to be present in the AF_LINK gateway.

    Reported by:    olivier
    PR:             255089

    (cherry picked from commit 7f5f3fcc32bfa553faa007579dfcaed84be3b047)

 sys/net/rtsock.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Comment 4 peter.sopko+freebsd.org 2021-07-20 07:50:14 UTC
anyone has any idea when the fix that has been sitting in 13-STABLE for 3 months already is gonna make it 13-RELEASE ? πŸ˜‡
Comment 5 benoitc 2021-11-08 22:09:20 UTC
agree it would be really useful...
Comment 6 benoitc 2022-02-09 23:25:52 UTC
when can we expect to be merged in latest FreeBSD 13 ? Would be good to not have to patch it ..
Comment 7 Alexander V. Chernikov freebsd_committer freebsd_triage 2022-02-09 23:33:40 UTC
It’s in stable/13 since April last year.
A bit too much changes to merge to 13.0, unfortunately.
Comment 8 Olivier Cochard freebsd_committer freebsd_triage 2022-07-22 19:58:04 UTC
Do you confirm this problem was no more in 13.1Β ?
Comment 9 Stefan Haller 2022-07-22 21:00:43 UTC
Since upgrading to FreeBSD 13.1 the problem does not occur anymore with stock bird2 (from ports/pkg). The bug can be marked as resolved.