Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Marco Baffo <marco@mandelbit.com>, netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Antonio Quartulli <antonio@openvpn.net>
Subject: Re: [PATCH iproute2-next] ip: add OVPN device mode support
Date: Wed, 8 Jul 2026 09:33:10 -0600	[thread overview]
Message-ID: <95c5e510-34c3-4ba3-9173-3d3954628948@kernel.org> (raw)
In-Reply-To: <20260703111419.842059-1-marco@mandelbit.com>

On 7/3/26 5:14 AM, Marco Baffo wrote:
> Allow selecting point-to-point or multi-peer mode when creating an
> OVPN device.

iproute2 does not currently support ovpn, so this patch is doing more
than just selecting a mode. It adds support to create ovpn netdevices
via iproute2. Enhance the commit message.

> 
> Signed-off-by: Marco Baffo <marco@mandelbit.com>
> ---
>  ip/Makefile           |  2 +-
>  ip/iplink.c           |  2 +-
>  ip/iplink_ovpn.c      | 87 +++++++++++++++++++++++++++++++++++++++++++
>  man/man8/ip-link.8.in | 24 ++++++++++++
>  4 files changed, 113 insertions(+), 2 deletions(-)
>  create mode 100644 ip/iplink_ovpn.c
> 
> diff --git a/ip/Makefile b/ip/Makefile
> index 3535ba78..978f6841 100644
> --- a/ip/Makefile
> +++ b/ip/Makefile
> @@ -13,7 +13,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
>      ipvrf.o iplink_xstats.o ipseg6.o iplink_netdevsim.o iplink_rmnet.o \
>      ipnexthop.o ipmptcp.o iplink_bareudp.o iplink_wwan.o ipioam6.o \
>      iplink_amt.o iplink_batadv.o iplink_gtp.o iplink_virt_wifi.o \
> -    iplink_netkit.o ipstats.o
> +    iplink_netkit.o ipstats.o iplink_ovpn.o
>  
>  RTMONOBJ=rtmon.o
>  
> diff --git a/ip/iplink.c b/ip/iplink.c
> index 3f0b46c9..c6aee8b6 100644
> --- a/ip/iplink.c
> +++ b/ip/iplink.c
> @@ -42,7 +42,7 @@ void iplink_types_usage(void)
>  		"          ifb | ip6erspan | ip6gre | ip6gretap | ip6tnl |\n"
>  		"          ipip | ipoib | ipvlan | ipvtap |\n"
>  		"          macsec | macvlan | macvtap | netdevsim |\n"
> -		"          netkit | nlmon | pfcp | rmnet | sit | team | team_slave |\n"
> +		"          netkit | nlmon | ovpn | pfcp | rmnet | sit | team | team_slave |\n"
>  		"          vcan | veth | vlan | vrf | vti | vxcan | vxlan | wwan |\n"
>  		"          xfrm | virt_wifi }\n");
>  }
> diff --git a/ip/iplink_ovpn.c b/ip/iplink_ovpn.c
> new file mode 100644
> index 00000000..08e59526
> --- /dev/null
> +++ b/ip/iplink_ovpn.c
> @@ -0,0 +1,87 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * iplink_ovpn.c	OpenVPN DCO device support
> + *
> + * Author: Marco Baffo <marco@mandelbit.com>
> + *
> + */
> +
> +#include <stdio.h>
> +#include <string.h>
> +#include <linux/if_link.h>
> +
> +#include "utils.h"
> +#include "ip_common.h"
> +
> +static void print_explain(FILE *f)
> +{
> +	fprintf(f,
> +		"Usage: ... ovpn [ mode { p2p | mp } ]\n"
> +		"\n"
> +		"MODE := p2p | mp\n"
> +		"(p2p is the default if mode is not specified)\n");
> +}
> +
> +static int ovpn_parse_opt(struct link_util *lu, int argc, char **argv,
> +			  struct nlmsghdr *n)
> +{
> +	while (argc > 0) {
> +		if (matches(*argv, "mode") == 0) {
> +			__u8 mode;
> +
> +			NEXT_ARG();
> +			if (strcmp(*argv, "p2p") == 0)
> +				mode = OVPN_MODE_P2P;
> +			else if (strcmp(*argv, "mp") == 0)
> +				mode = OVPN_MODE_MP;

the options need to be a table used for both setting and displaying value.


  reply	other threads:[~2026-07-08 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03 11:14 [PATCH iproute2-next] ip: add OVPN device mode support Marco Baffo
2026-07-08 15:33 ` David Ahern [this message]
2026-07-08 17:11   ` Antonio Quartulli
2026-07-08 18:14     ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=95c5e510-34c3-4ba3-9173-3d3954628948@kernel.org \
    --to=dsahern@kernel.org \
    --cc=antonio@openvpn.net \
    --cc=marco@mandelbit.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox