Re: [PATCH net-next v2] ppp: add IFLA_PPP_UNIT netlink attribute
From: Guillaume Nault
Date: Wed Mar 18 2026 - 05:55:07 EST
On Wed, Mar 18, 2026 at 09:59:29AM +0800, Qingfang Deng wrote:
> On Sat, 14 Mar 2026 02:14:29 +0100, Martin Olivier wrote:
> > Currently, the PPP rtnetlink API allows creating a new network interface
> > with a custom ifname, but it lacks the ability to specify a custom PPP
> > unit id.
> >
> > Setting a specific unit id is currently only possible with the
> > PPPIOCNEWUNIT ioctl. If a user-space program also requires a custom
> > interface name, it must create the interface first with PPPIOCNEWUNIT
> > and then rename it.
> >
> > Resolve this by introducing the IFLA_PPP_UNIT netlink attribute. This
> > allows user-space programs to atomically request both a custom ifname
> > and a specific PPP unit id during the RTM_NEWLINK creation process,
> > eliminating the post-creation renaming for this use case.
> >
> > Signed-off-by: Martin Olivier <martin.olivier@xxxxxxx>
> > ---
> > Changes in v2:
> > - use nl policy to set IFLA_PPP_UNIT min allowed value instead of a manual check in ppp_nl_validate()
> > - use of nla_get_s32_default() to collect IFLA_PPP_UNIT value
> > Link to v1: https://lore.kernel.org/netdev/PAWP192MB2411A5E7D3BE1B55E155A92F9747A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
>
> The patch itself looks good to me, but I would like to check the
> userspace changes too. Please create a pull request at
> https://github.com/ppp-project/ppp/pulls
>
> +Cc: Paul Mackerras, Guillaume Nault, Pali Rohár
As far as I understand, the original ioctl API allowed setting the unit
id for only one reason: to allow userspace to influence the name of the
ppp device to be created.
The netlink interface on the other hand already allows to set the
device name, without needing to play with the unit id. So what's the
use case for setting the unit id with netlink?
> Regards,
> Qingfang
>