Skip to content

network: interface ioctls for FreeBSD - #8

Merged
ahze merged 1 commit into
mainfrom
feat/freebsd-ioctls
Nov 12, 2026
Merged

ahze merged 1 commit into
mainfrom
feat/freebsd-ioctls

Conversation

@ahze

@ahze ahze commented Nov 12, 2026

Copy link
Copy Markdown
Member

FreeBSD's netlink creates a cloned interface only under its cloner name
(bridge0, epair0a), cannot rename one, cannot move one into a jail and
does not manage bridge members. Those are ioctls, the same ones
ifconfig(8) uses.

Add a network::freebsd module wrapping SIOCIFCREATE2, SIOCIFDESTROY,
SIOCSIFNAME, SIOCSIFVNET and SIOCSDRVSPEC/SIOCGDRVSPEC with BRDGADD and
BRDGGIFS, plus if_indextoname. The ioctl numbers are computed from the
ioccom encoding and unit-tested against the values printed from the
system headers, as is the size of struct ifbreq.

Nothing calls it yet; the netlink and bridge changes that do follow.

Signed-off-by: Michael Johnson buhnux@gmail.com

FreeBSD's netlink creates a cloned interface only under its cloner name
(bridge0, epair0a), cannot rename one, cannot move one into a jail and
does not manage bridge members. Those are ioctls, the same ones
ifconfig(8) uses.

Add a network::freebsd module wrapping SIOCIFCREATE2, SIOCIFDESTROY,
SIOCSIFNAME, SIOCSIFVNET and SIOCSDRVSPEC/SIOCGDRVSPEC with BRDGADD and
BRDGGIFS, plus if_indextoname. The ioctl numbers are computed from the
ioccom encoding and unit-tested against the values printed from the
system headers, as is the size of struct ifbreq.

Nothing calls it yet; the netlink and bridge changes that do follow.

Signed-off-by: Michael Johnson <buhnux@gmail.com>
@ahze
ahze merged commit 635f0d6 into main Nov 12, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant