Package: ucarp
Version: 1.5.2-2.2
Severity: wishlist
Tags: patch
This patch adds an environment variable to pass VHID when running the address
up/down commands. This can be useful for scripts to distinguish from
different addresses with its VHID, for example adding the VHID as a virtual
interface name, like 'enp4s0:1'.
-- System Information:
Debian Release: 10.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-6-amd64 (SMP w/32 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE,
TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8
(charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages ucarp depends on:
ii ifupdown 0.8.35
ii libc6 2.28-10
ii libpcap0.8 1.8.1-6
ii net-tools 1.60+git20180626.aebd88e-1
Versions of packages ucarp recommends:
ii iproute2 4.20.0-2
ucarp suggests no packages.
-- no debconf information
diff -ur ucarp-1.5.2.orig/src/spawn.c ucarp-1.5.2/src/spawn.c
--- ucarp-1.5.2.orig/src/spawn.c 2008-01-20 06:25:58.000000000 +0800
+++ ucarp-1.5.2/src/spawn.c 2020-06-23 20:15:19.601720617 +0800
@@ -19,6 +19,9 @@
}
pid = fork();
if (pid == (pid_t) 0) {
+ char vhid_buffer[16];
+ snprintf(vhid_buffer, sizeof vhid_buffer, "UCARP_VHID=%hhu", vhid);
+ putenv(vhid_buffer);
(void) close(dev_desc_fd);
execl(script, script, interface, vaddr_arg, xparam, (char *) NULL);
logfile(LOG_ERR, _("Unable to exec %s %s %s%s%s: %s"),