From 0c91c7a24135620e543c006ab6ab5c4f974dbb10 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 25 Feb 2022 13:56:49 +0900 Subject: [PATCH] network: l2tp: change create type to independent L2TP tunnel does not have underlying interface. Let's change its type to independent. --- man/systemd.network.xml | 3 +-- src/network/netdev/l2tp-tunnel.c | 6 +++--- src/network/networkd-network-gperf.gperf | 2 +- src/network/networkd-network.c | 1 - test/test-network/conf/25-l2tp-dummy.network | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 3f5a22e801..9d4a4b3e1f 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -869,7 +869,6 @@ Table=1234 IPoIB= IPVLAN= IPVTAP= - L2TP= MACsec= MACVLAN= MACVTAP= @@ -878,7 +877,7 @@ Table=1234 VXLAN= Xfrm= - The name of an IPoIB, IPVLAN, IPVTAP, L2TP, MACsec, MACVLAN, MACVTAP, tunnel, VLAN, + The name of an IPoIB, IPVLAN, IPVTAP, MACsec, MACVLAN, MACVTAP, tunnel, VLAN, VXLAN, or Xfrm to be created on the link. See systemd.netdev5. This option may be specified more than once. diff --git a/src/network/netdev/l2tp-tunnel.c b/src/network/netdev/l2tp-tunnel.c index e94ca20407..9724e7760e 100644 --- a/src/network/netdev/l2tp-tunnel.c +++ b/src/network/netdev/l2tp-tunnel.c @@ -432,7 +432,7 @@ static int l2tp_create_tunnel_handler(sd_netlink *rtnl, sd_netlink_message *m, N return 1; } -static int l2tp_create_tunnel(NetDev *netdev, Link *link) { +static int l2tp_create_tunnel(NetDev *netdev) { _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL; union in_addr_union local_address; L2tpTunnel *t; @@ -854,9 +854,9 @@ const NetDevVTable l2tptnl_vtable = { .object_size = sizeof(L2tpTunnel), .init = l2tp_tunnel_init, .sections = NETDEV_COMMON_SECTIONS "L2TP\0L2TPSession\0", - .create_after_configured = l2tp_create_tunnel, + .create = l2tp_create_tunnel, .done = l2tp_tunnel_done, - .create_type = NETDEV_CREATE_AFTER_CONFIGURED, + .create_type = NETDEV_CREATE_INDEPENDENT, .is_ready_to_create = netdev_l2tp_is_ready_to_create, .config_verify = netdev_l2tp_tunnel_verify, }; diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 5d83a25c70..b639714d97 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -93,7 +93,7 @@ Network.VRF, config_parse_ifname, Network.IPoIB, config_parse_stacked_netdev, NETDEV_KIND_IPOIB, offsetof(Network, stacked_netdev_names) Network.IPVLAN, config_parse_stacked_netdev, NETDEV_KIND_IPVLAN, offsetof(Network, stacked_netdev_names) Network.IPVTAP, config_parse_stacked_netdev, NETDEV_KIND_IPVTAP, offsetof(Network, stacked_netdev_names) -Network.L2TP, config_parse_stacked_netdev, NETDEV_KIND_L2TP, offsetof(Network, stacked_netdev_names) +Network.L2TP, config_parse_warn_compat, DISABLED_LEGACY, 0 Network.MACsec, config_parse_stacked_netdev, NETDEV_KIND_MACSEC, offsetof(Network, stacked_netdev_names) Network.MACVLAN, config_parse_stacked_netdev, NETDEV_KIND_MACVLAN, offsetof(Network, stacked_netdev_names) Network.MACVTAP, config_parse_stacked_netdev, NETDEV_KIND_MACVTAP, offsetof(Network, stacked_netdev_names) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index c6dceef1e9..5dae7b4de1 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -871,7 +871,6 @@ int config_parse_stacked_netdev( NETDEV_KIND_IPOIB, NETDEV_KIND_IPVLAN, NETDEV_KIND_IPVTAP, - NETDEV_KIND_L2TP, NETDEV_KIND_MACSEC, NETDEV_KIND_MACVLAN, NETDEV_KIND_MACVTAP, diff --git a/test/test-network/conf/25-l2tp-dummy.network b/test/test-network/conf/25-l2tp-dummy.network index d00a50daf6..507ccd309e 100644 --- a/test/test-network/conf/25-l2tp-dummy.network +++ b/test/test-network/conf/25-l2tp-dummy.network @@ -5,4 +5,3 @@ Name=test1 [Network] Address=192.168.30.100/24 IPv6AcceptRA=false -L2TP=l2tp99