git: 28932dc425e1 - main - tuntap: add SIOCGIFCAP and SIOCSIFCAP ioctls
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 26 Apr 2026 09:59:35 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=28932dc425e19267313d221c26d10d3638e1cc4b
commit 28932dc425e19267313d221c26d10d3638e1cc4b
Author: Timo Völker <timo.voelker@fh-muenster.de>
AuthorDate: 2026-04-26 09:48:36 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-04-26 09:48:36 +0000
tuntap: add SIOCGIFCAP and SIOCSIFCAP ioctls
Add SIOCGIFCAP ioctl-command for tun/tap character device to be used
by bhyve for offloading in the future.
Add SIOCSIFCAP for symmetry.
Reviewed by: markj, pouria, tuexen
MFC after: 1 week
Event: Wiesbaden Hackathon 2026
Differential Revision: https://reviews.freebsd.org/D51289
---
sys/net/if_tuntap.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sys/net/if_tuntap.c b/sys/net/if_tuntap.c
index 3f8a96311725..a1ef2541ffba 100644
--- a/sys/net/if_tuntap.c
+++ b/sys/net/if_tuntap.c
@@ -1802,6 +1802,23 @@ tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag,
case FIOGETOWN:
*(int *)data = fgetown(&tp->tun_sigio);
return (0);
+ case SIOCGIFCAP:
+ ifrp = (struct ifreq *)data;
+ TUN_LOCK(tp);
+ ifrp->ifr_reqcap = ifp->if_capabilities;
+ ifrp->ifr_curcap = ifp->if_capenable;
+ TUN_UNLOCK(tp);
+ break;
+ case SIOCSIFCAP:
+ ifrp = (struct ifreq *)data;
+ if (ifrp->ifr_reqcap & ~ifp->if_capabilities)
+ return (EINVAL);
+ TUN_LOCK(tp);
+ ifp->if_capenable = ifrp->ifr_reqcap;
+ tun_caps_changed(ifp);
+ TUN_UNLOCK(tp);
+ VLAN_CAPABILITIES(ifp);
+ break;
/* This is deprecated, FIOSETOWN should be used instead. */
case TIOCSPGRP: