Bug 277891 - net/bird2: update 2.14 -> 2.15.1
Summary: net/bird2: update 2.14 -> 2.15.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Olivier Cochard
URL: https://bird.network.cz/pipermail/bir...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-22 15:37 UTC by Marek Zarychta
Modified: 2024-04-20 06:37 UTC (History)
2 users (show)

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


Attachments
Update patch (17.12 KB, patch)
2024-03-22 15:42 UTC, Marek Zarychta
no flags Details | Diff
reworked upgrade patch (17.12 KB, patch)
2024-03-22 16:42 UTC, Marek Zarychta
no flags Details | Diff
corrected update patch (17.40 KB, patch)
2024-03-22 22:36 UTC, Marek Zarychta
no flags Details | Diff
corrected rearranged patch (17.42 KB, patch)
2024-03-23 08:14 UTC, Marek Zarychta
no flags Details | Diff
patch with bandaid for setups that transitioned to netlink unintentionally (964 bytes, patch)
2024-04-17 20:37 UTC, Marek Zarychta
zarychtam: maintainer-approval? (olivier)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Zarychta 2024-03-22 15:37:28 UTC
We are ready to update to BIRD 2.15.1 bugfix release and switch to Netlink as all supported FreeBSD versions already have Netlink. 

1. Port was updated to the most recent version.
2. Extra patches for netlink headers created (see bug 277618).
3. The default flavour of the port is now "netlink", "base" flavor is still available as  
   bird2-rtsock.
Comment 1 Marek Zarychta 2024-03-22 15:42:08 UTC
Created attachment 249408 [details]
Update patch
Comment 2 Marek Zarychta 2024-03-22 16:42:31 UTC
Created attachment 249414 [details]
reworked upgrade patch

Let's allow upgrades of the bird2 package. Now it will switch to Netlink flavour gracefully.
Comment 3 Marek Zarychta 2024-03-22 17:09:07 UTC
Maybe we should switch to netlink flavor as default only on FreeBSD 14.0 and higher since FreeBSD 13 has no netlink in kernel, so kldmodule has to loaded. It can break users configs. I will rework the patch later tonight.
Comment 4 Gleb Smirnoff freebsd_committer freebsd_triage 2024-03-22 18:18:20 UTC
On Fri Mar 22 17:09:07  2024 UTC, zarychtam@plan-b.pwste.edu.pl wrote:
> Maybe we should switch to netlink flavor as default only on FreeBSD 14.0 and
> higher since FreeBSD 13 has no netlink in kernel, so kldmodule has to loaded. It
> can break users configs. I will rework the patch later tonight.

If you ask me, I would support this decision.  Given that Alexander melifaro@
has little time to support NetLink, the burden falls on me.  I'd prefer to be
responsible for stable/14 only.  In general I have very conservative approach
to stable branches, especially ex-stable.  I won't add NetLink to stable/13
in the first place, if I was to decide.
Comment 5 Marek Zarychta 2024-03-22 22:35:09 UTC
(In reply to Gleb Smirnoff from comment #4)
>If you ask me, I would support this decision.  Given that Alexander melifaro@
>has little time to support NetLink, the burden falls on me.  I'd prefer to be
>responsible for stable/14 only.  In general I have very conservative approach
>to stable branches, especially ex-stable.  I won't add NetLink to stable/13
>in the first place, if I was to decide.

Thank you for commenting on this, it gives valuable insight. Perhaps we should switch to netlink as the default flavor but only on FreeBSD 14.0 and later since the whole network stack seems to be fully netlink-oriented there and leave FreeBSD 13 as is - with its old rtsock defaults.
Comment 6 Marek Zarychta 2024-03-22 22:36:04 UTC
Created attachment 249418 [details]
corrected update patch
Comment 7 Marek Zarychta 2024-03-23 08:14:50 UTC
Created attachment 249424 [details]
corrected rearranged patch

Rearranged Makefile to improve readability. No functional changes to the previous patch.

Summary: 

- Port was updated to the most recent version.
- Extra patches for fixing netlink headers were prepared (see  PR 277618).
- The default flavor of the port for FreeBSD 14.0 and later is now "netlink".
  The "base" flavor is still available as bird2-rtsock.
  There is no change for FreeBSD versions < 14.0. Here we still use "base"
  (rtsock driven version) as a default flavor.

Changelog: https://bird.network.cz/pipermail/bird-users/2024-March/017468.html
           https://bird.network.cz/pipermail/bird-users/2024-March/017517.html

PR: 277891
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-03-26 10:35:32 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8a57d5eba5e5ff34f3ecd19065373252c42f1300

commit 8a57d5eba5e5ff34f3ecd19065373252c42f1300
Author:     Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
AuthorDate: 2024-03-23 08:05:16 +0000
Commit:     Olivier Cochard <olivier@FreeBSD.org>
CommitDate: 2024-03-26 10:32:40 +0000

    net/bird2: update 2.14 -> 2.15.1

    - Port was updated to the most recent version.
    - Extra patches for fixing netlink headers were prepared (see PR 277618).
    - The default flavor of the port for FreeBSD 14.0 and later is now "netlink".
      The rtsock flavor is still available as bird2-rtsock.
      There is no change for FreeBSD versions < 14.0. Here we still use rtsock
      as a default flavor.

    Changelog: https://bird.network.cz/pipermail/bird-users/2024-March/017468.html
               https://bird.network.cz/pipermail/bird-users/2024-March/017517.html

    PR: 277891

 UPDATING                                           |   7 +
 net/bird2/Makefile                                 |  18 +-
 net/bird2/distinfo                                 |   6 +-
 .../patch-sysdep_bsd-netlink_netlink-route.h (new) | 370 +++++++++++++++++++++
 .../patch-sysdep_bsd-netlink_netlink-sys.h (new)   |  10 +
 5 files changed, 404 insertions(+), 7 deletions(-)
Comment 9 Olivier Cochard freebsd_committer freebsd_triage 2024-03-26 10:37:17 UTC
Thanks for your great patch.

I’ve just changed the flavor "base" to "rtsock" and add an entry in UPDATING because I don’t think we could use MOVED (because only impacting FreeBSD >= 14.0)
Comment 10 Marek Zarychta 2024-03-27 07:53:55 UTC
(In reply to Olivier Cochard from comment #9)
Thank you for testing, refactoring and committing!
Comment 11 Leo Vandewoestijne 2024-04-17 12:46:31 UTC
Before opening a new PR for the same problem...

Wouldn't it maybe be an idea to have something like:

if `uname -U` < 1400000; then
  kldload netlink
fi

...in the rc.script?

I have 6 identical systems with 1 being behaving inconsistant.
Then at the next location of many all over sudden 6 out of 6 failing.
`kldload netlink` solved (or avoided) the problem.
But I wouldn't be surprised I'm not the only suffering this problem.
Comment 12 Marek Zarychta 2024-04-17 15:53:11 UTC
(In reply to Leo Vandewoestijne from comment #11)
For FreeBSD < 14 default flavor is rtsock based and it doesn't require loading netlink.ko module. If someone is installing netlink flavor, then either building kernel with "options NETLINK" or loading netlink.ko is necessary.
Comment 13 Leo Vandewoestijne 2024-04-17 20:30:48 UTC
(In reply to Marek Zarychta from comment #12)

I did a kernel upgrade routine from -p9 to -p11. After booting, I've upgraded bird2. Then suddenly bird doesn't start on boot:

Apr 17 19:04:17 *** bird[40557]: Unable to open rtnetlink socket: Address family not supported by protocol family

OSVERSION says 1302001, but despite I clearly still must load the netlink module.
Indeed bird2-netlink was installed (automagically). But the exact cause of that is unclear to me - I can only guess it then might be my custom kernel.

Now "knowing the problem, is half the solution", so luckaly I found this closed ticket relative quick. And so I'm all fine now.
But with that same credo I just want to report this event, to prevent unpleasant surprises and stress to other bird users.
Comment 14 Marek Zarychta 2024-04-17 20:37:11 UTC
Created attachment 250037 [details]
patch with bandaid for setups that transitioned to netlink unintentionally

We can load the Netlink module behind the scenes. It shouldn't harm those running rtsock-driven flavour of the daemon. It will be silently ignored if the module is unavailable or loaded.

Along with this change, I added a bit of spam to the startup script to give users an idea about route lookup algorithms that can be used. This part of the patch can be deleted if the maintainer has a different opinion on the matter.
Comment 15 Marek Zarychta 2024-04-17 20:48:28 UTC
(In reply to Leo Vandewoestijne from comment #13)
>OSVERSION says 1302001, but despite I clearly still must load the netlink module.
>Indeed bird2-netlink was installed (automagically). But the exact cause of that is
>unclear to me - I can only guess it then might be my custom kernel.

I have heard of similar breakages and helped to troubleshoot one on IRC. In the case of upgrading bird2 by building directly from the ports tree, such a situation could happen on FreeBSD 13. Since the network stack is in transition toward widened netlink(4) deployment, we should probably load this module to avoid troubles like those described in comment #13.
Comment 16 Marek Zarychta 2024-04-20 06:37:03 UTC
The upgrade patch was committed, and that was really what this PR was about. If there is real breakage due to this update,  then probably a new PR should be submitted.