]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
if_clone: rework cloning KPI
authorAlexander V. Chernikov <melifaro@FreeBSD.org>
Thu, 22 Sep 2022 09:37:37 +0000 (09:37 +0000)
committerAlexander V. Chernikov <melifaro@FreeBSD.org>
Thu, 22 Sep 2022 10:18:31 +0000 (10:18 +0000)
commit09ee0fc023c0c7ef90cb277afbb473abe4d95a9a
treeb5ea53391066a611fb35a1e07bd071e192420568
parent5ae83e0d871bc7cbe4dcc9a33d37eb689e631efe
if_clone: rework cloning KPI

The current cloning KPI does not provide a way of creating interfaces
 with parameres from within kernel. The reason is that those parameters
 are passed as an opaque pointer and it is not possible to specify whether
 this pointer references kernel-space or user-space.
Instead of just adding a flag, generalise the KPI to simplify the
 extension process. Unify current notion of `SIMPLE` and `ADVANCED` users
 by leveraging newly-added IFC_C_AUTOUNIT flag to automatically pick
 unit number, which is a primary feature of the "SIMPLE" KPI.
Use extendable structures everywhere instead of passing function
 pointers or parameters.
Isolate all parts of the oldKPI under `CLONE_COMPAT_13` so it can be safely
 merged back to 13. Old KPI will be removed after the merge.

Differential Revision: https://reviews.freebsd.org/D36632
MFC after: 2 weeks
sys/net/if_clone.c
sys/net/if_clone.h