summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-04-02 16:31:46 +0200
committerGitHub <noreply@github.com>2026-04-02 16:31:46 +0200
commitc6ec6ade63a48a7e6a2ec5378c863d6d3b5bd000 (patch)
treeb8f7188758322e97b5132768b0fdb8238abc6140 /src/etc
parent2ad37c4a8a963651bbc183d24662f2571c4682c6 (diff)
parentb84bdbf8dd25995aa564081632de6251ecf5ad4e (diff)
downloadvyos-1x-c6ec6ade63a48a7e6a2ec5378c863d6d3b5bd000.tar.gz
vyos-1x-c6ec6ade63a48a7e6a2ec5378c863d6d3b5bd000.zip
Merge pull request #4872 from c-po/vyos-netlinkd
vyos-netlinkd: T8047: replacement of netplugd
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/netplug/linkup.d/vyos-python-helper4
-rwxr-xr-xsrc/etc/netplug/netplug41
-rw-r--r--src/etc/netplug/netplugd.conf4
-rwxr-xr-xsrc/etc/netplug/vyos-netplug-dhcp-client79
4 files changed, 0 insertions, 128 deletions
diff --git a/src/etc/netplug/linkup.d/vyos-python-helper b/src/etc/netplug/linkup.d/vyos-python-helper
deleted file mode 100755
index 9c59c58ad..000000000
--- a/src/etc/netplug/linkup.d/vyos-python-helper
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-PYTHON3=$(which python3)
-# Call the real python script and forward commandline arguments
-$PYTHON3 /etc/netplug/vyos-netplug-dhcp-client "${@:1}"
diff --git a/src/etc/netplug/netplug b/src/etc/netplug/netplug
deleted file mode 100755
index 9f6ab74cc..000000000
--- a/src/etc/netplug/netplug
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-#
-# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-
-dev="$1"
-action="$2"
-
-case "$action" in
-in)
- run-parts --arg $dev --arg in /etc/netplug/linkup.d
- ;;
-out)
- run-parts --arg $dev --arg out /etc/netplug/linkdown.d
- ;;
-
-# probe loads and initialises the driver for the interface and brings the
-# interface into the "up" state, so that it can generate netlink(7) events.
-# This interferes with "admin down" for an interface. Thus, commented out. An
-# "admin up" is treated as a "link up" and thus, "link up" action is executed.
-# To execute "link down" action on "admin down", run appropriate script in
-# /etc/netplug/linkdown.d
-#probe)
-# ;;
-
-*)
- exit 1
- ;;
-esac
diff --git a/src/etc/netplug/netplugd.conf b/src/etc/netplug/netplugd.conf
deleted file mode 100644
index 7da3c67e8..000000000
--- a/src/etc/netplug/netplugd.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-eth*
-br*
-bond*
-wlan*
diff --git a/src/etc/netplug/vyos-netplug-dhcp-client b/src/etc/netplug/vyos-netplug-dhcp-client
deleted file mode 100755
index d538f8b52..000000000
--- a/src/etc/netplug/vyos-netplug-dhcp-client
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright VyOS maintainers and contributors <maintainers@vyos.io>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library. If not, see <http://www.gnu.org/licenses/>.
-
-import sys
-
-from time import sleep
-
-from vyos.config import Config
-from vyos.ifconfig import Section
-from vyos.utils.boot import boot_configuration_complete
-from vyos.utils.process import cmd
-from vyos.utils.process import is_systemd_service_active
-from vyos.utils.commit import commit_in_progress
-from vyos import airbag
-
-airbag.enable()
-
-if len(sys.argv) < 3:
- airbag.noteworthy('Must specify both interface and link status!')
- sys.exit(1)
-
-if not boot_configuration_complete():
- airbag.noteworthy('System bootup not yet finished...')
- sys.exit(1)
-
-interface = sys.argv[1]
-
-while commit_in_progress():
- sleep(0.250)
-
-in_out = sys.argv[2]
-config = Config()
-
-interface_path = ['interfaces'] + Section.get_config_path(interface).split()
-
-systemdV4_service = f'dhclient@{interface}.service'
-systemdV6_service = f'dhcp6c@{interface}.service'
-if in_out == 'out':
- # Interface moved state to down
- if is_systemd_service_active(systemdV4_service):
- cmd(f'systemctl stop {systemdV4_service}')
- if is_systemd_service_active(systemdV6_service):
- cmd(f'systemctl stop {systemdV6_service}')
-elif in_out == 'in':
- v6_restart = False
-
- if config.exists_effective(interface_path + ['address']):
- tmp = config.return_effective_values(interface_path + ['address'])
- # Always (re-)start the DHCP(v6) client service. If the DHCP(v6) client
- # is already running - which could happen if the interface is re-
- # configured in operational down state, it will have a backoff
- # time increasing while not receiving a DHCP(v6) reply.
- #
- # To make the interface instantly available, and as for a DHCP(v6) lease
- # we will re-start the service and thus cancel the backoff time.
- if 'dhcp' in tmp:
- cmd(f'systemctl restart {systemdV4_service}')
- if 'dhcpv6' in tmp:
- v6_restart = True
-
- if config.exists_effective(interface_path + ['dhcpv6-options', 'pd']):
- v6_restart = True
-
- if v6_restart:
- cmd(f'systemctl restart {systemdV6_service}')