Bug 255089

Summary: net/bird2: gw sdl_len too small
Product: Ports & Packages Reporter: greif <greif>
Component: Individual Port(s)Assignee: Olivier Cochard <olivier>
Status: New ---    
Severity: Affects Many People CC: melifaro, stefan+freebsd
Priority: --- Flags: bugzilla: maintainer-feedback? (olivier)
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Workaround for stricter sockaddr_dl checks on FBSD 13 none

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 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 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(-)