Page MenuHomeFreeBSD

if_gre: Add netlink support with tests
Needs ReviewPublic

Authored by pouria on Jan 1 2026, 6:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 20, 3:18 AM
Unknown Object (File)
Sun, Jan 18, 7:48 AM
Unknown Object (File)
Mon, Jan 12, 4:41 PM
Unknown Object (File)
Mon, Jan 12, 4:28 PM
Unknown Object (File)
Sat, Jan 10, 4:48 PM
Unknown Object (File)
Sat, Jan 10, 4:49 AM
Unknown Object (File)
Thu, Jan 8, 8:06 PM
Unknown Object (File)
Thu, Jan 8, 3:42 PM
Subscribers

Details

Reviewers
glebius
zlei
melifaro
Group Reviewers
network
Summary

Add netlink support to if_gre

Test Plan

I also wrote tests for gre, since it doesn't have it before.

# kyua test -k /usr/tests/sys/netlink/Kyuafile test_rtnl_gre:test_rtnl_gre
test_rtnl_gre:test_rtnl_gre  ->  passed  [0.002s]
Results file id is usr_tests_sys_netlink.20260101-180800-774463
Results saved to /root/.kyua/store/results.usr_tests_sys_netlink.20260101-180800-774463.db
1/1 passed (0 failed)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 69557
Build 66440: arc lint + arc unit

Event Timeline

pouria requested review of this revision.Jan 1 2026, 6:11 PM

There're three tasks in this change,

  1. Migrate to new if_clone KPI
  2. Refactor some ioctls, say GRESKEY
  3. Add netlink support

The first two are simple and easy to review, I expect them can be landed quickly. I'd support you to split the change.

There're three tasks in this change,

  1. Migrate to new if_clone KPI
  2. Refactor some ioctls, say GRESKEY
  3. Add netlink support

The first two are simple and easy to review, I expect them can be landed quickly. I'd support you to split the change.

I understand your perspective, however, migrating directly to the new if_clone_addreq_v2 without netlink support is not possible.
I could migrate to if_clone_addreq without netlink support first, but then transition to v2 to support netlink would ultimately be redundant.
The same reasoning applies to the GRESKEY ioctl.
Refactoring that ioctl is intended to reuse those configuration functions through netlink.
Therefore, without netlink support, refactoring the ioctl interface is pointless.

sys/netlink/route/interface.h
252

Maybe IFLA_TUNNEL_GRE_UDP?

tests/sys/netlink/test_rtnl_gre.c
1

Please add BSD license and you authorship.