Compare commits

...

No commits in common. "c8" and "c10s" have entirely different histories.
c8 ... c10s

26 changed files with 3755 additions and 1875 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

30
.gitignore vendored
View File

@ -1 +1,29 @@
SOURCES/iproute2-6.2.0.tar.xz /iproute2-4.18.0.tar.xz
/iproute2-4.20.0.tar.xz
/iproute2-5.0.0.tar.xz
/iproute2-5.1.0.tar.xz
/iproute2-5.2.0.tar.xz
/iproute2-5.3.0.tar.xz
/iproute2-5.4.0.tar.xz
/iproute2-5.5.0.tar.xz
/iproute2-5.7.0.tar.xz
/iproute2-5.8.0.tar.xz
/iproute2-5.9.0.tar.xz
/iproute2-5.10.0.tar.xz
/iproute2-5.11.0.tar.xz
/iproute2-5.12.0.tar.xz
/iproute2-5.13.0.tar.xz
/iproute2-5.14.0.tar.xz
/iproute2-5.15.0.tar.xz
/iproute2-5.17.0.tar.xz
/iproute2-5.18.0.tar.xz
/iproute2-6.0.0.tar.xz
/iproute2-6.1.0.tar.xz
/iproute2-6.2.0.tar.xz
/iproute2-6.3.0.tar.xz
/iproute2-6.4.0.tar.xz
/iproute2-6.5.0.tar.xz
/iproute2-6.7.0.tar.xz
/iproute2-6.11.0.tar.xz
/iproute2-6.14.0.tar.xz
/iproute2-6.17.0.tar.xz

View File

@ -1 +0,0 @@
f4e339800fe15b88cfa516cabcc9e883dda245d7 SOURCES/iproute2-6.2.0.tar.xz

View File

@ -0,0 +1,68 @@
From 7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48 Mon Sep 17 00:00:00 2001
Message-ID: <7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48.1769546816.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 27 Jan 2026 19:59:11 +0100
Subject: [PATCH] lib: Move mnlg to lib for shared use
JIRA: https://issues.redhat.com/browse/RHEL-131661
Upstream Status: iproute2.git commit 0d61015ba9910
commit 0d61015ba9910b128db2d7b455056093755e21f9
Author: Petr Oros <poros@redhat.com>
Date: Tue Nov 18 15:10:29 2025 +0100
lib: Move mnlg to lib for shared use
Move mnlg.c to lib/ and mnlg.h to include/ to allow code reuse
across multiple tools.
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
devlink/Makefile | 2 +-
{devlink => include}/mnlg.h | 0
lib/Makefile | 2 +-
{devlink => lib}/mnlg.c | 0
4 files changed, 2 insertions(+), 2 deletions(-)
rename {devlink => include}/mnlg.h (100%)
rename {devlink => lib}/mnlg.c (100%)
diff --git a/devlink/Makefile b/devlink/Makefile
index 1a1eed7e..ec62f0c6 100644
--- a/devlink/Makefile
+++ b/devlink/Makefile
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
include ../config.mk
-DEVLINKOBJ = devlink.o mnlg.o
+DEVLINKOBJ = devlink.o
TARGETS += devlink
LDLIBS += -lm
diff --git a/devlink/mnlg.h b/include/mnlg.h
similarity index 100%
rename from devlink/mnlg.h
rename to include/mnlg.h
diff --git a/lib/Makefile b/lib/Makefile
index 0ba62942..340c37bc 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -20,7 +20,7 @@ endif
NLOBJ=libgenl.o libnetlink.o
ifeq ($(HAVE_MNL),y)
-NLOBJ += mnl_utils.o
+NLOBJ += mnl_utils.o mnlg.o
endif
all: libnetlink.a libutil.a
diff --git a/devlink/mnlg.c b/lib/mnlg.c
similarity index 100%
rename from devlink/mnlg.c
rename to lib/mnlg.c
--
2.52.0

View File

@ -0,0 +1,128 @@
From bc56542924619f49773c44ac21d62124dac7ed76 Mon Sep 17 00:00:00 2001
Message-ID: <bc56542924619f49773c44ac21d62124dac7ed76.1769546816.git.aclaudi@redhat.com>
In-Reply-To: <7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48.1769546816.git.aclaudi@redhat.com>
References: <7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48.1769546816.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 27 Jan 2026 19:59:11 +0100
Subject: [PATCH] lib: Add str_to_bool helper function
JIRA: https://issues.redhat.com/browse/RHEL-131661
Upstream Status: iproute2.git commit 42f2f219c618f
commit 42f2f219c618f0c1bf07e536f5cdcc27cb0d6a4b
Author: Petr Oros <poros@redhat.com>
Date: Tue Nov 18 15:10:30 2025 +0100
lib: Add str_to_bool helper function
Add str_to_bool() helper function to lib/utils.c that uses
parse_one_of() to parse boolean values. Update devlink to
use this common implementation.
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
devlink/devlink.c | 22 +++-------------------
include/utils.h | 1 +
lib/utils.c | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/devlink/devlink.c b/devlink/devlink.c
index 171b8532..89b89d9c 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1038,22 +1038,6 @@ static int ifname_map_rev_lookup(struct dl *dl, const char *bus_name,
return -ENOENT;
}
-static int strtobool(const char *str, bool *p_val)
-{
- bool val;
-
- if (!strcmp(str, "true") || !strcmp(str, "1") ||
- !strcmp(str, "enable"))
- val = true;
- else if (!strcmp(str, "false") || !strcmp(str, "0") ||
- !strcmp(str, "disable"))
- val = false;
- else
- return -EINVAL;
- *p_val = val;
- return 0;
-}
-
static int ident_str_validate(char *str, unsigned int expected)
{
if (!str)
@@ -1356,7 +1340,7 @@ static int dl_argv_bool(struct dl *dl, bool *p_val)
return -EINVAL;
}
- err = strtobool(str, p_val);
+ err = str_to_bool(str, p_val);
if (err) {
pr_err("\"%s\" is not a valid boolean value\n", str);
return err;
@@ -3821,7 +3805,7 @@ static int cmd_dev_param_set(struct dl *dl)
mnl_attr_put_u32(nlh, DEVLINK_ATTR_PARAM_VALUE_DATA, val_u32);
break;
case MNL_TYPE_FLAG:
- err = strtobool(dl->opts.param_value, &val_bool);
+ err = str_to_bool(dl->opts.param_value, &val_bool);
if (err)
goto err_param_value_parse;
if (val_bool == ctx.value.vbool)
@@ -5393,7 +5377,7 @@ static int cmd_port_param_set(struct dl *dl)
mnl_attr_put_u32(nlh, DEVLINK_ATTR_PARAM_VALUE_DATA, val_u32);
break;
case MNL_TYPE_FLAG:
- err = strtobool(dl->opts.param_value, &val_bool);
+ err = str_to_bool(dl->opts.param_value, &val_bool);
if (err)
goto err_param_value_parse;
if (val_bool == ctx.value.vbool)
diff --git a/include/utils.h b/include/utils.h
index 91e6e31f..d8e8d70e 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -350,6 +350,7 @@ int parse_one_of_deprecated(const char *msg, const char *realval,
const char * const *list,
size_t len, int *p_err);
bool parse_on_off(const char *msg, const char *realval, int *p_err);
+int str_to_bool(const char *str, bool *p_val);
int parse_mapping_num_all(__u32 *keyp, const char *key);
int parse_mapping_gen(int *argcp, char ***argvp,
diff --git a/lib/utils.c b/lib/utils.c
index dd242d4d..0719281a 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -1820,6 +1820,23 @@ bool parse_on_off(const char *msg, const char *realval, int *p_err)
ARRAY_SIZE(values_on_off), p_err, strcmp);
}
+int str_to_bool(const char *str, bool *p_val)
+{
+ static const char * const values[] = {
+ "false", "true",
+ "0", "1",
+ "disable", "enable"
+ };
+ int err, index;
+
+ index = parse_one_of(NULL, str, values, ARRAY_SIZE(values), &err);
+ if (err)
+ return err;
+
+ *p_val = index & 1;
+ return 0;
+}
+
int parse_mapping_gen(int *argcp, char ***argvp,
int (*key_cb)(__u32 *keyp, const char *key),
int (*mapping_cb)(__u32 key, char *value, void *data),
--
2.52.0

View File

@ -0,0 +1,314 @@
From 98fe34bfd3e78d1d3fbbe606c441411fad43e8ab Mon Sep 17 00:00:00 2001
Message-ID: <98fe34bfd3e78d1d3fbbe606c441411fad43e8ab.1769546816.git.aclaudi@redhat.com>
In-Reply-To: <7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48.1769546816.git.aclaudi@redhat.com>
References: <7f2e9f746e820e43bafc4ecee18c33a7b6bf5d48.1769546816.git.aclaudi@redhat.com>
From: David Ahern <dsahern@kernel.org>
Date: Fri, 21 Nov 2025 09:11:28 -0700
Subject: [PATCH] uapi: import dpll.h from last sync point
JIRA: https://issues.redhat.com/browse/RHEL-131661
Upstream Status: iproute2.git commit 9771095a3b4de
commit 9771095a3b4de3f965e6ce2c0dd322e94f6420f8
Author: David Ahern <dsahern@kernel.org>
Date: Fri Nov 21 09:11:28 2025 -0700
uapi: import dpll.h from last sync point
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
include/uapi/linux/dpll.h | 280 ++++++++++++++++++++++++++++++++++++++
1 file changed, 280 insertions(+)
create mode 100644 include/uapi/linux/dpll.h
diff --git a/include/uapi/linux/dpll.h b/include/uapi/linux/dpll.h
new file mode 100644
index 00000000..d9064eb9
--- /dev/null
+++ b/include/uapi/linux/dpll.h
@@ -0,0 +1,280 @@
+/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
+/* Do not edit directly, auto-generated from: */
+/* Documentation/netlink/specs/dpll.yaml */
+/* YNL-GEN uapi header */
+
+#ifndef _LINUX_DPLL_H
+#define _LINUX_DPLL_H
+
+#define DPLL_FAMILY_NAME "dpll"
+#define DPLL_FAMILY_VERSION 1
+
+/**
+ * enum dpll_mode - working modes a dpll can support, differentiates if and how
+ * dpll selects one of its inputs to syntonize with it, valid values for
+ * DPLL_A_MODE attribute
+ * @DPLL_MODE_MANUAL: input can be only selected by sending a request to dpll
+ * @DPLL_MODE_AUTOMATIC: highest prio input pin auto selected by dpll
+ */
+enum dpll_mode {
+ DPLL_MODE_MANUAL = 1,
+ DPLL_MODE_AUTOMATIC,
+
+ /* private: */
+ __DPLL_MODE_MAX,
+ DPLL_MODE_MAX = (__DPLL_MODE_MAX - 1)
+};
+
+/**
+ * enum dpll_lock_status - provides information of dpll device lock status,
+ * valid values for DPLL_A_LOCK_STATUS attribute
+ * @DPLL_LOCK_STATUS_UNLOCKED: dpll was not yet locked to any valid input (or
+ * forced by setting DPLL_A_MODE to DPLL_MODE_DETACHED)
+ * @DPLL_LOCK_STATUS_LOCKED: dpll is locked to a valid signal, but no holdover
+ * available
+ * @DPLL_LOCK_STATUS_LOCKED_HO_ACQ: dpll is locked and holdover acquired
+ * @DPLL_LOCK_STATUS_HOLDOVER: dpll is in holdover state - lost a valid lock or
+ * was forced by disconnecting all the pins (latter possible only when dpll
+ * lock-state was already DPLL_LOCK_STATUS_LOCKED_HO_ACQ, if dpll lock-state
+ * was not DPLL_LOCK_STATUS_LOCKED_HO_ACQ, the dpll's lock-state shall remain
+ * DPLL_LOCK_STATUS_UNLOCKED)
+ */
+enum dpll_lock_status {
+ DPLL_LOCK_STATUS_UNLOCKED = 1,
+ DPLL_LOCK_STATUS_LOCKED,
+ DPLL_LOCK_STATUS_LOCKED_HO_ACQ,
+ DPLL_LOCK_STATUS_HOLDOVER,
+
+ /* private: */
+ __DPLL_LOCK_STATUS_MAX,
+ DPLL_LOCK_STATUS_MAX = (__DPLL_LOCK_STATUS_MAX - 1)
+};
+
+/**
+ * enum dpll_lock_status_error - if previous status change was done due to a
+ * failure, this provides information of dpll device lock status error. Valid
+ * values for DPLL_A_LOCK_STATUS_ERROR attribute
+ * @DPLL_LOCK_STATUS_ERROR_NONE: dpll device lock status was changed without
+ * any error
+ * @DPLL_LOCK_STATUS_ERROR_UNDEFINED: dpll device lock status was changed due
+ * to undefined error. Driver fills this value up in case it is not able to
+ * obtain suitable exact error type.
+ * @DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN: dpll device lock status was changed
+ * because of associated media got down. This may happen for example if dpll
+ * device was previously locked on an input pin of type
+ * PIN_TYPE_SYNCE_ETH_PORT.
+ * @DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH: the FFO
+ * (Fractional Frequency Offset) between the RX and TX symbol rate on the
+ * media got too high. This may happen for example if dpll device was
+ * previously locked on an input pin of type PIN_TYPE_SYNCE_ETH_PORT.
+ */
+enum dpll_lock_status_error {
+ DPLL_LOCK_STATUS_ERROR_NONE = 1,
+ DPLL_LOCK_STATUS_ERROR_UNDEFINED,
+ DPLL_LOCK_STATUS_ERROR_MEDIA_DOWN,
+ DPLL_LOCK_STATUS_ERROR_FRACTIONAL_FREQUENCY_OFFSET_TOO_HIGH,
+
+ /* private: */
+ __DPLL_LOCK_STATUS_ERROR_MAX,
+ DPLL_LOCK_STATUS_ERROR_MAX = (__DPLL_LOCK_STATUS_ERROR_MAX - 1)
+};
+
+/*
+ * level of quality of a clock device. This mainly applies when the dpll
+ * lock-status is DPLL_LOCK_STATUS_HOLDOVER. The current list is defined
+ * according to the table 11-7 contained in ITU-T G.8264/Y.1364 document. One
+ * may extend this list freely by other ITU-T defined clock qualities, or
+ * different ones defined by another standardization body (for those, please
+ * use different prefix).
+ */
+enum dpll_clock_quality_level {
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRC = 1,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_A,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_SSU_B,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEC1,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_PRTC,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRTC,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EEEC,
+ DPLL_CLOCK_QUALITY_LEVEL_ITU_OPT1_EPRC,
+
+ /* private: */
+ __DPLL_CLOCK_QUALITY_LEVEL_MAX,
+ DPLL_CLOCK_QUALITY_LEVEL_MAX = (__DPLL_CLOCK_QUALITY_LEVEL_MAX - 1)
+};
+
+#define DPLL_TEMP_DIVIDER 1000
+
+/**
+ * enum dpll_type - type of dpll, valid values for DPLL_A_TYPE attribute
+ * @DPLL_TYPE_PPS: dpll produces Pulse-Per-Second signal
+ * @DPLL_TYPE_EEC: dpll drives the Ethernet Equipment Clock
+ */
+enum dpll_type {
+ DPLL_TYPE_PPS = 1,
+ DPLL_TYPE_EEC,
+
+ /* private: */
+ __DPLL_TYPE_MAX,
+ DPLL_TYPE_MAX = (__DPLL_TYPE_MAX - 1)
+};
+
+/**
+ * enum dpll_pin_type - defines possible types of a pin, valid values for
+ * DPLL_A_PIN_TYPE attribute
+ * @DPLL_PIN_TYPE_MUX: aggregates another layer of selectable pins
+ * @DPLL_PIN_TYPE_EXT: external input
+ * @DPLL_PIN_TYPE_SYNCE_ETH_PORT: ethernet port PHY's recovered clock
+ * @DPLL_PIN_TYPE_INT_OSCILLATOR: device internal oscillator
+ * @DPLL_PIN_TYPE_GNSS: GNSS recovered clock
+ */
+enum dpll_pin_type {
+ DPLL_PIN_TYPE_MUX = 1,
+ DPLL_PIN_TYPE_EXT,
+ DPLL_PIN_TYPE_SYNCE_ETH_PORT,
+ DPLL_PIN_TYPE_INT_OSCILLATOR,
+ DPLL_PIN_TYPE_GNSS,
+
+ /* private: */
+ __DPLL_PIN_TYPE_MAX,
+ DPLL_PIN_TYPE_MAX = (__DPLL_PIN_TYPE_MAX - 1)
+};
+
+/**
+ * enum dpll_pin_direction - defines possible direction of a pin, valid values
+ * for DPLL_A_PIN_DIRECTION attribute
+ * @DPLL_PIN_DIRECTION_INPUT: pin used as a input of a signal
+ * @DPLL_PIN_DIRECTION_OUTPUT: pin used to output the signal
+ */
+enum dpll_pin_direction {
+ DPLL_PIN_DIRECTION_INPUT = 1,
+ DPLL_PIN_DIRECTION_OUTPUT,
+
+ /* private: */
+ __DPLL_PIN_DIRECTION_MAX,
+ DPLL_PIN_DIRECTION_MAX = (__DPLL_PIN_DIRECTION_MAX - 1)
+};
+
+#define DPLL_PIN_FREQUENCY_1_HZ 1
+#define DPLL_PIN_FREQUENCY_10_KHZ 10000
+#define DPLL_PIN_FREQUENCY_77_5_KHZ 77500
+#define DPLL_PIN_FREQUENCY_10_MHZ 10000000
+
+/**
+ * enum dpll_pin_state - defines possible states of a pin, valid values for
+ * DPLL_A_PIN_STATE attribute
+ * @DPLL_PIN_STATE_CONNECTED: pin connected, active input of phase locked loop
+ * @DPLL_PIN_STATE_DISCONNECTED: pin disconnected, not considered as a valid
+ * input
+ * @DPLL_PIN_STATE_SELECTABLE: pin enabled for automatic input selection
+ */
+enum dpll_pin_state {
+ DPLL_PIN_STATE_CONNECTED = 1,
+ DPLL_PIN_STATE_DISCONNECTED,
+ DPLL_PIN_STATE_SELECTABLE,
+
+ /* private: */
+ __DPLL_PIN_STATE_MAX,
+ DPLL_PIN_STATE_MAX = (__DPLL_PIN_STATE_MAX - 1)
+};
+
+/**
+ * enum dpll_pin_capabilities - defines possible capabilities of a pin, valid
+ * flags on DPLL_A_PIN_CAPABILITIES attribute
+ * @DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE: pin direction can be changed
+ * @DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE: pin priority can be changed
+ * @DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE: pin state can be changed
+ */
+enum dpll_pin_capabilities {
+ DPLL_PIN_CAPABILITIES_DIRECTION_CAN_CHANGE = 1,
+ DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE = 2,
+ DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE = 4,
+};
+
+#define DPLL_PHASE_OFFSET_DIVIDER 1000
+
+/**
+ * enum dpll_feature_state - Allow control (enable/disable) and status checking
+ * over features.
+ * @DPLL_FEATURE_STATE_DISABLE: feature shall be disabled
+ * @DPLL_FEATURE_STATE_ENABLE: feature shall be enabled
+ */
+enum dpll_feature_state {
+ DPLL_FEATURE_STATE_DISABLE,
+ DPLL_FEATURE_STATE_ENABLE,
+};
+
+enum dpll_a {
+ DPLL_A_ID = 1,
+ DPLL_A_MODULE_NAME,
+ DPLL_A_PAD,
+ DPLL_A_CLOCK_ID,
+ DPLL_A_MODE,
+ DPLL_A_MODE_SUPPORTED,
+ DPLL_A_LOCK_STATUS,
+ DPLL_A_TEMP,
+ DPLL_A_TYPE,
+ DPLL_A_LOCK_STATUS_ERROR,
+ DPLL_A_CLOCK_QUALITY_LEVEL,
+ DPLL_A_PHASE_OFFSET_MONITOR,
+ DPLL_A_PHASE_OFFSET_AVG_FACTOR,
+
+ __DPLL_A_MAX,
+ DPLL_A_MAX = (__DPLL_A_MAX - 1)
+};
+
+enum dpll_a_pin {
+ DPLL_A_PIN_ID = 1,
+ DPLL_A_PIN_PARENT_ID,
+ DPLL_A_PIN_MODULE_NAME,
+ DPLL_A_PIN_PAD,
+ DPLL_A_PIN_CLOCK_ID,
+ DPLL_A_PIN_BOARD_LABEL,
+ DPLL_A_PIN_PANEL_LABEL,
+ DPLL_A_PIN_PACKAGE_LABEL,
+ DPLL_A_PIN_TYPE,
+ DPLL_A_PIN_DIRECTION,
+ DPLL_A_PIN_FREQUENCY,
+ DPLL_A_PIN_FREQUENCY_SUPPORTED,
+ DPLL_A_PIN_FREQUENCY_MIN,
+ DPLL_A_PIN_FREQUENCY_MAX,
+ DPLL_A_PIN_PRIO,
+ DPLL_A_PIN_STATE,
+ DPLL_A_PIN_CAPABILITIES,
+ DPLL_A_PIN_PARENT_DEVICE,
+ DPLL_A_PIN_PARENT_PIN,
+ DPLL_A_PIN_PHASE_ADJUST_MIN,
+ DPLL_A_PIN_PHASE_ADJUST_MAX,
+ DPLL_A_PIN_PHASE_ADJUST,
+ DPLL_A_PIN_PHASE_OFFSET,
+ DPLL_A_PIN_FRACTIONAL_FREQUENCY_OFFSET,
+ DPLL_A_PIN_ESYNC_FREQUENCY,
+ DPLL_A_PIN_ESYNC_FREQUENCY_SUPPORTED,
+ DPLL_A_PIN_ESYNC_PULSE,
+ DPLL_A_PIN_REFERENCE_SYNC,
+ DPLL_A_PIN_PHASE_ADJUST_GRAN,
+
+ __DPLL_A_PIN_MAX,
+ DPLL_A_PIN_MAX = (__DPLL_A_PIN_MAX - 1)
+};
+
+enum dpll_cmd {
+ DPLL_CMD_DEVICE_ID_GET = 1,
+ DPLL_CMD_DEVICE_GET,
+ DPLL_CMD_DEVICE_SET,
+ DPLL_CMD_DEVICE_CREATE_NTF,
+ DPLL_CMD_DEVICE_DELETE_NTF,
+ DPLL_CMD_DEVICE_CHANGE_NTF,
+ DPLL_CMD_PIN_ID_GET,
+ DPLL_CMD_PIN_GET,
+ DPLL_CMD_PIN_SET,
+ DPLL_CMD_PIN_CREATE_NTF,
+ DPLL_CMD_PIN_DELETE_NTF,
+ DPLL_CMD_PIN_CHANGE_NTF,
+
+ __DPLL_CMD_MAX,
+ DPLL_CMD_MAX = (__DPLL_CMD_MAX - 1)
+};
+
+#define DPLL_MCGRP_MONITOR "monitor"
+
+#endif /* _LINUX_DPLL_H */
--
2.52.0

File diff suppressed because it is too large Load Diff

16
README.etc Normal file
View File

@ -0,0 +1,16 @@
You are looking for your iproute2 config in /etc/iproute2 and it's gone?
Here's an explanation on what's going on:
From v6.5.0, iproute2 supports stateless configuration pattern. This
means that iproute2 now read its config from /etc/iproute2/FOO, and,
if it does not exist, fall back to /usr/share/iproute2/FOO.
You can find iproute2 default configuration in /usr/share/iproute2,
while you can store your user-modified config files in /etc/iproute2.
/usr/share/iproute2 files are not supposed to be manually modified.
If a previous update broke your user config for iproute2, you may
have one or more ".rpmsave" files in /etc/iproute2. You can restore
your config simply dropping the ".rpmsave" suffix from the file name.

View File

@ -1,38 +0,0 @@
From 6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b Mon Sep 17 00:00:00 2001
Message-Id: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1683117490.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Wed, 3 May 2023 11:19:24 +0200
Subject: [PATCH] Update kernel headers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2188134
Upstream Status: iproute2-next.git commit 88786cd1
commit 88786cd1a96a89427bc22061c7736eb2eac31121
Author: David Ahern <dsahern@kernel.org>
Date: Thu Mar 30 09:43:49 2023 -0600
Update kernel headers
Update kernel headers to commit:
da617cd8d906 ("smsc911x: remove superfluous variable init")
Signed-off-by: David Ahern <dsahern@kernel.org>
---
include/uapi/linux/if_link.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 147ad0a3..644d3554 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -628,6 +628,7 @@ enum {
IFLA_MACVLAN_MACADDR_COUNT,
IFLA_MACVLAN_BC_QUEUE_LEN,
IFLA_MACVLAN_BC_QUEUE_LEN_USED,
+ IFLA_MACVLAN_BC_CUTOFF,
__IFLA_MACVLAN_MAX,
};
--
2.40.1

View File

@ -1,149 +0,0 @@
From 1638c2909a2911f981ee437dafde70e5e8d721f8 Mon Sep 17 00:00:00 2001
Message-Id: <1638c2909a2911f981ee437dafde70e5e8d721f8.1683117490.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1683117490.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1683117490.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Wed, 3 May 2023 11:19:24 +0200
Subject: [PATCH] macvlan: Add bclim parameter
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2188134
Upstream Status: iproute2-next.git commit e8a3fb47
commit e8a3fb470b4e96aa35a2731c7cc175b946c0a62d
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Mar 30 11:07:25 2023 +0800
macvlan: Add bclim parameter
This patch adds support for setting the broadcast queueing threshold
on macvlan devices. This controls which multicast packets will be
processed in a workqueue instead of inline.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ip/iplink_macvlan.c | 26 ++++++++++++++++++++++++--
man/man8/ip-link.8.in | 18 ++++++++++++++++++
3 files changed, 43 insertions(+), 2 deletions(-)
Signed-off-by: David Ahern <dsahern@kernel.org>
---
ip/iplink_macvlan.c | 26 ++++++++++++++++++++++++--
man/man8/ip-link.8.in | 18 ++++++++++++++++++
2 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/ip/iplink_macvlan.c b/ip/iplink_macvlan.c
index 0f13637d..6bdc76d1 100644
--- a/ip/iplink_macvlan.c
+++ b/ip/iplink_macvlan.c
@@ -26,13 +26,14 @@
static void print_explain(struct link_util *lu, FILE *f)
{
fprintf(f,
- "Usage: ... %s mode MODE [flag MODE_FLAG] MODE_OPTS [bcqueuelen BC_QUEUE_LEN]\n"
+ "Usage: ... %s mode MODE [flag MODE_FLAG] MODE_OPTS [bcqueuelen BC_QUEUE_LEN] [bclim BCLIM]\n"
"\n"
"MODE: private | vepa | bridge | passthru | source\n"
"MODE_FLAG: null | nopromisc | nodst\n"
"MODE_OPTS: for mode \"source\":\n"
"\tmacaddr { { add | del } <macaddr> | set [ <macaddr> [ <macaddr> ... ] ] | flush }\n"
- "BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: [0-4294967295]\n",
+ "BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: [0-4294967295]\n"
+ "BCLIM: Threshold for broadcast queueing: 32-bit integer\n",
lu->id
);
}
@@ -67,6 +68,12 @@ static int bc_queue_len_arg(const char *arg)
return -1;
}
+static int bclim_arg(const char *arg)
+{
+ fprintf(stderr, "Error: illegal value for \"bclim\": \"%s\"\n", arg);
+ return -1;
+}
+
static int macvlan_parse_opt(struct link_util *lu, int argc, char **argv,
struct nlmsghdr *n)
{
@@ -168,6 +175,15 @@ static int macvlan_parse_opt(struct link_util *lu, int argc, char **argv,
return bc_queue_len_arg(*argv);
}
addattr32(n, 1024, IFLA_MACVLAN_BC_QUEUE_LEN, bc_queue_len);
+ } else if (!strcmp(*argv, "bclim")) {
+ __s32 bclim;
+ NEXT_ARG();
+
+ if (get_s32(&bclim, *argv, 0)) {
+ return bclim_arg(*argv);
+ }
+ addattr_l(n, 1024, IFLA_MACVLAN_BC_CUTOFF,
+ &bclim, sizeof(bclim));
} else if (matches(*argv, "help") == 0) {
explain(lu);
return -1;
@@ -245,6 +261,12 @@ static void macvlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]
print_luint(PRINT_ANY, "usedbcqueuelen", "usedbcqueuelen %lu ", bc_queue_len);
}
+ if (tb[IFLA_MACVLAN_BC_CUTOFF] &&
+ RTA_PAYLOAD(tb[IFLA_MACVLAN_BC_CUTOFF]) >= sizeof(__s32)) {
+ __s32 bclim = rta_getattr_s32(tb[IFLA_MACVLAN_BC_CUTOFF]);
+ print_int(PRINT_ANY, "bclim", "bclim %d ", bclim);
+ }
+
/* in source mode, there are more options to print */
if (mode != MACVLAN_MODE_SOURCE)
diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in
index eeddf493..62aebabd 100644
--- a/man/man8/ip-link.8.in
+++ b/man/man8/ip-link.8.in
@@ -1455,6 +1455,7 @@ the following additional arguments are supported:
.BR mode " { " private " | " vepa " | " bridge " | " passthru
.RB " [ " nopromisc " ] | " source " [ " nodst " ] } "
.RB " [ " bcqueuelen " { " LENGTH " } ] "
+.RB " [ " bclim " " LIMIT " ] "
.in +8
.sp
@@ -1513,6 +1514,13 @@ will be the maximum length that any macvlan interface has requested.
When listing device parameters both the bcqueuelen parameter
as well as the actual used bcqueuelen are listed to better help
the user understand the setting.
+
+.BR bclim " " LIMIT
+- Set the threshold for broadcast queueing.
+.BR LIMIT " must be a 32-bit integer."
+Setting this to -1 disables broadcast queueing altogether. Otherwise
+a multicast address will be queued as broadcast if the number of devices
+using it is greater than the given value.
.in -8
.TP
@@ -2675,6 +2683,9 @@ Update the broadcast/multicast queue length.
[
.BI bcqueuelen " LENGTH "
]
+[
+.BI bclim " LIMIT "
+]
.in +8
.BI bcqueuelen " LENGTH "
@@ -2688,6 +2699,13 @@ will be the maximum length that any macvlan interface has requested.
When listing device parameters both the bcqueuelen parameter
as well as the actual used bcqueuelen are listed to better help
the user understand the setting.
+
+.BI bclim " LIMIT "
+- Set the threshold for broadcast queueing.
+.IR LIMIT " must be a 32-bit integer."
+Setting this to -1 disables broadcast queueing altogether. Otherwise
+a multicast address will be queued as broadcast if the number of devices
+using it is greater than the given value.
.in -8
.TP
--
2.40.1

View File

@ -1,43 +0,0 @@
From 4c2e1768c0d446345796dc058d1e114147a1029a Mon Sep 17 00:00:00 2001
Message-Id: <4c2e1768c0d446345796dc058d1e114147a1029a.1686090191.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1686090191.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1686090191.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Wed, 7 Jun 2023 00:15:59 +0200
Subject: [PATCH] tc: add missing separator
Jira: https://issues.redhat.com/browse/RHEL-487
Upstream Status: iproute2-next.git commit 4e0e56e0
commit 4e0e56e0ef05387f7f5d8ab41fe6ec6a1897b26d
Author: Christian Hesse <mail@eworm.de>
Date: Thu Feb 23 11:15:03 2023 +0100
tc: add missing separator
This is missing a separator, that was accidently removed
when JSON was added.
Fixes: 010a8388aea1 ("tc: Add JSON output to tc-class")
Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
tc/tc_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tc/tc_class.c b/tc/tc_class.c
index c1feb009..096fa2ec 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -356,7 +356,7 @@ int print_class(struct nlmsghdr *n, void *arg)
print_string(PRINT_ANY, "parent", "parent %s ", abuf);
}
if (t->tcm_info)
- print_0xhex(PRINT_ANY, "leaf", "leaf %x", t->tcm_info>>16);
+ print_0xhex(PRINT_ANY, "leaf", "leaf %x: ", t->tcm_info>>16);
q = get_qdisc_kind(RTA_DATA(tb[TCA_KIND]));
if (tb[TCA_OPTIONS]) {
--
2.40.1

View File

@ -1,55 +0,0 @@
From dcff6d4c73cd9c33b4103a4505ecebe6852f63df Mon Sep 17 00:00:00 2001
Message-ID: <dcff6d4c73cd9c33b4103a4505ecebe6852f63df.1695227714.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 5 Sep 2023 12:44:19 +0200
Subject: [PATCH] ss: make is_selinux_enabled stub work like in SELinux
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1780023
Upstream Status: iproute2-next.git commit c8970828
commit c8970828b6509af3ab0f2982da335fb6a6c846af
Author: Andrea Claudi <aclaudi@redhat.com>
Date: Wed Aug 23 19:29:59 2023 +0200
ss: make is_selinux_enabled stub work like in SELinux
From the is_selinux_enabled() manpage:
is_selinux_enabled() returns 1 if SELinux is running or 0 if it is not.
This makes the is_selinux_enabled() stub functions works exactly like
the SELinux function it is supposed to replace.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
misc/ss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index de02fccb..d2dffbf8 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -77,7 +77,7 @@
/* Stubs for SELinux functions */
static int is_selinux_enabled(void)
{
- return -1;
+ return 0;
}
static int getpidcon(pid_t pid, char **context)
@@ -5684,7 +5684,7 @@ int main(int argc, char *argv[])
show_sock_ctx++;
/* fall through */
case 'Z':
- if (is_selinux_enabled() <= 0) {
+ if (!is_selinux_enabled()) {
fprintf(stderr, "ss: SELinux is not enabled.\n");
exit(1);
}
--
2.41.0

View File

@ -1,52 +0,0 @@
From d59fc35f66f5d0d6e7b3209c21f2c891a2ba0768 Mon Sep 17 00:00:00 2001
Message-ID: <d59fc35f66f5d0d6e7b3209c21f2c891a2ba0768.1695227714.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 5 Sep 2023 12:44:19 +0200
Subject: [PATCH] ss: make SELinux stub functions conformant to API definitions
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1780023
Upstream Status: iproute2-next.git commit 61c6882c
commit 61c6882ce21c1247c06cd61783120be0a2e2019c
Author: Andrea Claudi <aclaudi@redhat.com>
Date: Wed Aug 23 19:30:00 2023 +0200
ss: make SELinux stub functions conformant to API definitions
getfilecon() and security_get_initial_context() use the const qualifier
for their first paramater in SELinux APIs.
This commit adds the const qualifier to these functions, making them
conformant to API definitions.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
misc/ss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index d2dffbf8..fe19f489 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -86,13 +86,13 @@ static int getpidcon(pid_t pid, char **context)
return -1;
}
-static int getfilecon(char *path, char **context)
+static int getfilecon(const char *path, char **context)
{
*context = NULL;
return -1;
}
-static int security_get_initial_context(char *name, char **context)
+static int security_get_initial_context(const char *name, char **context)
{
*context = NULL;
return -1;
--
2.41.0

View File

@ -1,156 +0,0 @@
From 0e71f7774a764c0a19037b79b71d7146769082ac Mon Sep 17 00:00:00 2001
Message-ID: <0e71f7774a764c0a19037b79b71d7146769082ac.1695227714.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 5 Sep 2023 12:44:19 +0200
Subject: [PATCH] lib: add SELinux include and stub functions
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1780023
Upstream Status: iproute2-next.git commit e246ebc3
commit e246ebc3b7f1f438310ad6fd1d5976ba6ccf7a69
Author: Andrea Claudi <aclaudi@redhat.com>
Date: Wed Aug 23 19:30:01 2023 +0200
lib: add SELinux include and stub functions
ss provides some selinux stub functions, useful when iproute2 is
compiled without selinux support.
Move them to lib/ so we can use them in other iproute2 tools.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
include/selinux.h | 9 +++++++++
lib/Makefile | 4 ++++
lib/selinux.c | 32 ++++++++++++++++++++++++++++++++
misc/ss.c | 34 +---------------------------------
4 files changed, 46 insertions(+), 33 deletions(-)
create mode 100644 include/selinux.h
create mode 100644 lib/selinux.c
diff --git a/include/selinux.h b/include/selinux.h
new file mode 100644
index 00000000..499aa966
--- /dev/null
+++ b/include/selinux.h
@@ -0,0 +1,9 @@
+#if HAVE_SELINUX
+#include <selinux/selinux.h>
+#else
+int is_selinux_enabled(void);
+void freecon(char *context);
+int getpidcon(pid_t pid, char **context);
+int getfilecon(const char *path, char **context);
+int security_get_initial_context(const char *name, char **context);
+#endif
diff --git a/lib/Makefile b/lib/Makefile
index ddedd37f..aa7bbd2e 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -13,6 +13,10 @@ UTILOBJ += bpf_libbpf.o
endif
endif
+ifneq ($(HAVE_SELINUX),y)
+UTILOBJ += selinux.o
+endif
+
NLOBJ=libgenl.o libnetlink.o
ifeq ($(HAVE_MNL),y)
NLOBJ += mnl_utils.o
diff --git a/lib/selinux.c b/lib/selinux.c
new file mode 100644
index 00000000..4e6805fc
--- /dev/null
+++ b/lib/selinux.c
@@ -0,0 +1,32 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include "selinux.h"
+
+/* Stubs for SELinux functions */
+int is_selinux_enabled(void)
+{
+ return 0;
+}
+
+void freecon(char *context)
+{
+ free(context);
+}
+
+int getpidcon(pid_t pid, char **context)
+{
+ *context = NULL;
+ return -1;
+}
+
+int getfilecon(const char *path, char **context)
+{
+ *context = NULL;
+ return -1;
+}
+
+int security_get_initial_context(const char *name, char **context)
+{
+ *context = NULL;
+ return -1;
+}
diff --git a/misc/ss.c b/misc/ss.c
index fe19f489..6e18bf0c 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -33,6 +33,7 @@
#include "version.h"
#include "rt_names.h"
#include "cg_map.h"
+#include "selinux.h"
#include <linux/tcp.h>
#include <linux/unix_diag.h>
@@ -71,39 +72,6 @@
#define BUF_CHUNKS_MAX 5 /* Maximum number of allocated buffer chunks */
#define LEN_ALIGN(x) (((x) + 1) & ~1)
-#if HAVE_SELINUX
-#include <selinux/selinux.h>
-#else
-/* Stubs for SELinux functions */
-static int is_selinux_enabled(void)
-{
- return 0;
-}
-
-static int getpidcon(pid_t pid, char **context)
-{
- *context = NULL;
- return -1;
-}
-
-static int getfilecon(const char *path, char **context)
-{
- *context = NULL;
- return -1;
-}
-
-static int security_get_initial_context(const char *name, char **context)
-{
- *context = NULL;
- return -1;
-}
-
-static void freecon(char *context)
-{
- free(context);
-}
-#endif
-
int preferred_family = AF_UNSPEC;
static int show_options;
int show_details;
--
2.41.0

View File

@ -1,81 +0,0 @@
From 6bfcc5679d601c393e7d6ca6c78c2d7680c3e4f2 Mon Sep 17 00:00:00 2001
Message-ID: <6bfcc5679d601c393e7d6ca6c78c2d7680c3e4f2.1695227714.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1695227714.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Tue, 5 Sep 2023 12:44:19 +0200
Subject: [PATCH] ip vrf: make ipvrf_exec SELinux-aware
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1780023
Upstream Status: iproute2-next.git commit 0d0eeaa6
commit 0d0eeaa6cb9218e57ce910fc3a8991b80da6393e
Author: Andrea Claudi <aclaudi@redhat.com>
Date: Wed Aug 23 19:30:02 2023 +0200
ip vrf: make ipvrf_exec SELinux-aware
When using ip vrf and SELinux is enabled, make sure to set the exec file
context before calling cmd_exec.
This ensures that the command is executed with the right context,
falling back to the ifconfig_t context when needed.
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
include/selinux.h | 1 +
ip/ipvrf.c | 6 ++++++
lib/selinux.c | 5 +++++
3 files changed, 12 insertions(+)
diff --git a/include/selinux.h b/include/selinux.h
index 499aa966..592c7680 100644
--- a/include/selinux.h
+++ b/include/selinux.h
@@ -6,4 +6,5 @@ void freecon(char *context);
int getpidcon(pid_t pid, char **context);
int getfilecon(const char *path, char **context);
int security_get_initial_context(const char *name, char **context);
+int setexecfilecon(const char *filename, const char *fallback_type);
#endif
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index 0718bea8..b0dd2abe 100644
--- a/ip/ipvrf.c
+++ b/ip/ipvrf.c
@@ -24,6 +24,7 @@
#include "utils.h"
#include "ip_common.h"
#include "bpf_util.h"
+#include "selinux.h"
#define CGRP_PROC_FILE "/cgroup.procs"
@@ -455,6 +456,11 @@ static int ipvrf_exec(int argc, char **argv)
return -1;
}
+ if (is_selinux_enabled() && setexecfilecon(argv[1], "ifconfig_t")) {
+ fprintf(stderr, "setexecfilecon for \"%s\" failed\n", argv[1]);
+ return -1;
+ }
+
return -cmd_exec(argv[1], argv + 1, !!batch_mode, do_switch, argv[0]);
}
diff --git a/lib/selinux.c b/lib/selinux.c
index 4e6805fc..7e5dd16d 100644
--- a/lib/selinux.c
+++ b/lib/selinux.c
@@ -30,3 +30,8 @@ int security_get_initial_context(const char *name, char **context)
*context = NULL;
return -1;
}
+
+int setexecfilecon(const char *filename, const char *fallback_type)
+{
+ return -1;
+}
--
2.41.0

View File

@ -1,158 +0,0 @@
From e4e31412a2cdf90a08a7d5ab1a889f27ee13f7c9 Mon Sep 17 00:00:00 2001
Message-ID: <e4e31412a2cdf90a08a7d5ab1a889f27ee13f7c9.1710441171.git.aclaudi@redhat.com>
In-Reply-To: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1710441171.git.aclaudi@redhat.com>
References: <6a3ecf4fd80f7dcecb72b6c83781f5aed463a75b.1710441171.git.aclaudi@redhat.com>
From: Andrea Claudi <aclaudi@redhat.com>
Date: Thu, 14 Mar 2024 19:26:55 +0100
Subject: [PATCH] ss: Add support for dumping TCP bound-inactive sockets.
JIRA: https://issues.redhat.com/browse/RHEL-21017
Upstream Status: iproute2.git commit ae447da64975ad02e40a93ccbc440a6477af96c0
commit ae447da64975ad02e40a93ccbc440a6477af96c0
Author: Guillaume Nault <gnault@redhat.com>
Date: Tue Dec 19 14:18:13 2023 +0100
ss: Add support for dumping TCP bound-inactive sockets.
Make ss aware of the new "bound-inactive" pseudo-state for TCP (see
Linux commit 91051f003948 ("tcp: Dump bound-only sockets in inet_diag.")).
These are TCP sockets that have been bound, but are neither listening nor
connecting.
With this patch, these sockets can now be dumped with:
* the existing -a (--all) option, to dump all sockets, including
bound-inactive ones,
* the new -B (--bound-inactive) option, to dump them exclusively,
* the new "bound-inactive" state, to be used in a STATE-FILTER.
Note that the SS_BOUND_INACTIVE state is a pseudo-state used for queries
only. The kernel returns them as SS_CLOSE.
The SS_NEW_SYN_RECV pseudo-state is added in this patch only because we
have to set its entry in the sstate_namel array (in scan_state()). Care
is taken not to make it visible by users.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
---
man/man8/ss.8 | 7 +++++++
misc/ss.c | 20 +++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/man/man8/ss.8 b/man/man8/ss.8
index d413e570..2bc42b85 100644
--- a/man/man8/ss.8
+++ b/man/man8/ss.8
@@ -40,6 +40,10 @@ established connections) sockets.
.B \-l, \-\-listening
Display only listening sockets (these are omitted by default).
.TP
+.B \-B, \-\-bound-inactive
+Display only TCP bound but inactive (not listening, connecting, etc.) sockets
+(these are omitted by default).
+.TP
.B \-o, \-\-options
Show timer information. For TCP protocol, the output format is:
.RS
@@ -458,6 +462,9 @@ states except for
- opposite to
.B bucket
+.B bound-inactive
+- bound but otherwise inactive sockets (not listening, connecting, etc.)
+
.SH EXPRESSION
.B EXPRESSION
diff --git a/misc/ss.c b/misc/ss.c
index 6e18bf0c..232178e6 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -210,6 +210,8 @@ enum {
SS_LAST_ACK,
SS_LISTEN,
SS_CLOSING,
+ SS_NEW_SYN_RECV, /* Kernel only value, not for use in user space */
+ SS_BOUND_INACTIVE,
SS_MAX
};
@@ -1377,6 +1379,8 @@ static void sock_state_print(struct sockstat *s)
[SS_LAST_ACK] = "LAST-ACK",
[SS_LISTEN] = "LISTEN",
[SS_CLOSING] = "CLOSING",
+ [SS_NEW_SYN_RECV] = "UNDEF", /* Never returned by kernel */
+ [SS_BOUND_INACTIVE] = "UNDEF", /* Never returned by kernel */
};
switch (s->local.family) {
@@ -5310,6 +5314,7 @@ static void _usage(FILE *dest)
" -r, --resolve resolve host names\n"
" -a, --all display all sockets\n"
" -l, --listening display listening sockets\n"
+" -B, --bound-inactive display TCP bound but inactive sockets\n"
" -o, --options show timer information\n"
" -e, --extended show detailed socket information\n"
" -m, --memory show socket memory usage\n"
@@ -5392,9 +5397,17 @@ static int scan_state(const char *state)
[SS_LAST_ACK] = "last-ack",
[SS_LISTEN] = "listening",
[SS_CLOSING] = "closing",
+ [SS_NEW_SYN_RECV] = "new-syn-recv",
+ [SS_BOUND_INACTIVE] = "bound-inactive",
};
int i;
+ /* NEW_SYN_RECV is a kernel implementation detail. It shouldn't be used
+ * or even be visible by users.
+ */
+ if (strcasecmp(state, "new-syn-recv") == 0)
+ goto wrong_state;
+
if (strcasecmp(state, "close") == 0 ||
strcasecmp(state, "closed") == 0)
return (1<<SS_CLOSE);
@@ -5417,6 +5430,7 @@ static int scan_state(const char *state)
return (1<<i);
}
+wrong_state:
fprintf(stderr, "ss: wrong state name: %s\n", state);
exit(-1);
}
@@ -5458,6 +5472,7 @@ static const struct option long_opts[] = {
{ "vsock", 0, 0, OPT_VSOCK },
{ "all", 0, 0, 'a' },
{ "listening", 0, 0, 'l' },
+ { "bound-inactive", 0, 0, 'B' },
{ "ipv4", 0, 0, '4' },
{ "ipv6", 0, 0, '6' },
{ "packet", 0, 0, '0' },
@@ -5496,7 +5511,7 @@ int main(int argc, char *argv[])
int state_filter = 0;
while ((ch = getopt_long(argc, argv,
- "dhaletuwxnro460spTbEf:mMiA:D:F:vVzZN:KHSO",
+ "dhalBetuwxnro460spTbEf:mMiA:D:F:vVzZN:KHSO",
long_opts, NULL)) != EOF) {
switch (ch) {
case 'n':
@@ -5561,6 +5576,9 @@ int main(int argc, char *argv[])
case 'l':
state_filter = (1 << SS_LISTEN) | (1 << SS_CLOSE);
break;
+ case 'B':
+ state_filter = 1 << SS_BOUND_INACTIVE;
+ break;
case '4':
filter_af_set(&current_filter, AF_INET);
break;
--
2.44.0

File diff suppressed because it is too large Load Diff

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

162
iproute.spec Normal file
View File

@ -0,0 +1,162 @@
Summary: Advanced IP routing and network device configuration tools
Name: iproute
Version: 6.17.0
Release: %autorelease
URL: https://kernel.org/pub/linux/utils/net/%{name}2/
Source0: https://kernel.org/pub/linux/utils/net/%{name}2/%{name}2-%{version}.tar.xz
%if 0%{?rhel}
Source1: rt_dsfield.deprecated
%endif
Source2: README.etc
Patch0: 0001-lib-Move-mnlg-to-lib-for-shared-use.patch
Patch1: 0002-lib-Add-str_to_bool-helper-function.patch
Patch2: 0003-uapi-import-dpll.h-from-last-sync-point.patch
Patch3: 0004-dpll-Add-dpll-command.patch
License: GPL-2.0-or-later AND NIST-PD
BuildRequires: bison
BuildRequires: elfutils-libelf-devel
BuildRequires: flex
BuildRequires: gcc
BuildRequires: iptables-devel >= 1.4.5
BuildRequires: libbpf-devel
BuildRequires: libcap-devel
BuildRequires: libmnl-devel
BuildRequires: libselinux-devel
BuildRequires: make
BuildRequires: pkgconfig
%if ! 0%{?_module_build}
%if 0%{?fedora}
BuildRequires: linux-atm-libs-devel
%endif
%endif
Requires: libbpf
Requires: psmisc
# Compat symlinks for Requires in other packages.
Provides: /sbin/ip
%if "%{_sbindir}" == "%{_bindir}"
# We rely on filesystem to create the symlink for us.
Requires: filesystem(unmerged-sbin-symlinks)
Provides: /usr/sbin/ip
Provides: /usr/sbin/ss
%endif
%description
The iproute package contains networking utilities (ip and rtmon, for example)
which are designed to use the advanced networking capabilities of the Linux
kernel.
%package tc
Summary: Linux Traffic Control utility
License: GPL-2.0-or-later
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: /sbin/tc
%description tc
The Traffic Control utility manages queueing disciplines, their classes and
attached filters and actions. It is the standard tool to configure QoS in
Linux.
%if ! 0%{?_module_build}
%package doc
Summary: Documentation for iproute2 utilities with examples
License: GPL-2.0-or-later
Requires: %{name} = %{version}-%{release}
%description doc
The iproute documentation contains howtos and examples of settings.
%endif
%package devel
Summary: iproute development files
License: GPL-2.0-or-later
Requires: %{name} = %{version}-%{release}
Provides: iproute-static = %{version}-%{release}
%description devel
The libnetlink static library.
%prep
%autosetup -p1 -n %{name}2-%{version}
%build
%configure --color auto
echo -e "\nPREFIX=%{_prefix}\nSBINDIR=%{_sbindir}" >> config.mk
%make_build
%install
%make_install
echo '.so man8/tc-cbq.8' > %{buildroot}%{_mandir}/man8/cbq.8
# libnetlink
install -D -m644 include/libnetlink.h %{buildroot}%{_includedir}/libnetlink.h
install -D -m644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a
# drop these files, iproute-doc package extracts files directly from _builddir
rm -rf '%{buildroot}%{_docdir}'
mkdir -p %{buildroot}%{_sysconfdir}/iproute2
cp %{SOURCE2} %{buildroot}%{_sysconfdir}/iproute2/README
# append deprecated values to rt_dsfield for compatibility reasons
%if 0%{?rhel}
cat %{SOURCE1} >>%{buildroot}%{_datadir}/iproute2/rt_dsfield
cp %{SOURCE2} %{buildroot}%{_datadir}/iproute2/README
# RHEL-94662: restore /etc/iproute2 conf files, if modified
# this is safe because we don't have conf files in /etc/iproute2 anymore, so
# every *.rpmsave file over there is a leftover from a failed conf upgrade
%posttrans
if [ -f /etc/iproute2/*rpmsave ]; then
for conffile in /etc/iproute2/*rpmsave; do
mv $conffile ${conffile%.rpmsave}
done
fi
%endif
%files
%dir %{_sysconfdir}/iproute2
%dir %{_datadir}/iproute2
%license COPYING
%doc README README.devel
%{_mandir}/man7/*
%exclude %{_mandir}/man7/tc-*
%{_mandir}/man8/*
%exclude %{_mandir}/man8/tc*
%exclude %{_mandir}/man8/cbq*
%exclude %{_mandir}/man8/arpd*
%attr(644,root,root) %config %{_datadir}/iproute2/*
%{_sbindir}/*
%attr(644,root,root) %{_sysconfdir}/iproute2/*
%exclude %{_sbindir}/tc
%exclude %{_sbindir}/routel
%{_datadir}/bash-completion/completions/*
%files tc
%license COPYING
%{_mandir}/man7/tc-*
%{_mandir}/man8/tc*
%{_mandir}/man8/cbq*
%dir %{_libdir}/tc/
%{_libdir}/tc/*
%{_sbindir}/tc
%{_datadir}/bash-completion/completions/tc
%if ! 0%{?_module_build}
%files doc
%license COPYING
%doc examples
%endif
%files devel
%license COPYING
%{_mandir}/man3/*
%{_libdir}/libnetlink.a
%{_includedir}/libnetlink.h
%{_includedir}/iproute2/bpf_elf.h
%changelog
%autochangelog

View File

@ -0,0 +1,34 @@
provision:
# nested virtualization supported runner required
hardware:
cpu:
processors: ">= 2"
memory: ">= 6 GB"
virtualization:
is-supported: true
prepare:
- how: install
package:
- git
- podman
- skopeo
- tmt+provision-virtual
- tmt+provision-bootc
- how: shell
script: |
systemctl start libvirtd
systemctl status libvirtd
environment:
TMT_VERBOSE: 1
execute:
how: tmt
discover:
how: fmf
test:
- /testing-farm
finish:
how: shell
script:
# move all tmt plan logs to tmt plan data folder
- mkdir -p $TMT_PLAN_DATA/test-tmt-log
- cp -r /var/tmp/tmt/run-* $TMT_PLAN_DATA/test-tmt-log

18
plans/tier0-im.fmf Normal file
View File

@ -0,0 +1,18 @@
provision:
# use bootc plugin
# plugin configuration doc: https://tmt.readthedocs.io/en/stable/plugins/provision.html#bootc
how: bootc
container-file: /tests/Containerfile
container-file-workdir: .
disk: 20
prepare:
- how: shell
script: |
rpm -q --whatprovides man || rpm-ostree install --apply-live --idempotent --allow-inactive --assumeyes man
summary: Execute iproute Tier0 tests
discover:
how: fmf
filter: 'tier: 0'
url: https://gitlab.cee.redhat.com/kernel-qe/networking/iproute.git
execute:
how: tmt

18
plans/tier0.fmf Normal file
View File

@ -0,0 +1,18 @@
summary: CI plan to run all Tier0 tests
discover:
how: fmf
filter: 'tier: 0'
url: https://gitlab.cee.redhat.com/kernel-qe/networking/iproute.git
prepare:
- how: shell
script: |
grep enabled /etc/yum.repos.d/*
# some beaker library(xx/yy) needs certain repo like beaker-tasks
dnf -y config-manager --enable '*'
# try installing kernel-modules-extra here in case kernel update in "enable tc features in blacklist" and causes finding no module in `modprobe sch_gred`
dnf -y install beakerlib kernel-modules-extra
execute:
how: tmt

4
sources Normal file
View File

@ -0,0 +1,4 @@
SHA512 (iproute2-6.7.0.tar.xz) = 5d8dca139b1b980dac6c841f477b951dd199074cb078b5ea8df23b3532eeb235cca1df9f6628b0f81b7edd62aaf4e95bad15a851843bd61e5715215da97cc546
SHA512 (iproute2-6.11.0.tar.xz) = 06bedd7ae573fe5cf9c72af698987ba03e53dc6fce5f41813bf5bb155b683490e5c75cc835ce5ba4509e491eb6138e96da162204c28ea1b3d80887107997a3b3
SHA512 (iproute2-6.14.0.tar.xz) = e79049bdca0e0381f0a93a40e4d597ce59fb509dabc6e8b04a510ff9953f091c67577d6faa62967bd197bf62ab6e56d928558270a1390621431acb237b77fa46
SHA512 (iproute2-6.17.0.tar.xz) = 3d83d49233c1d984f15d285a46e2ec0eeb820c7cb84cfc84866921f37e8a57d31bc3953be07e8c79ed6079f326a25c3a85f591b0d67f9f689c0c70ccdb0fef77

30
tests/Containerfile Normal file
View File

@ -0,0 +1,30 @@
# Choose nightly base image from https://images.paas.redhat.com/repository/bootc/rhel-bootc?tab=tags
FROM images.paas.redhat.com/bootc/rhel-bootc:latest-10.0
# Add nightly compose repo into container image to install iproute
RUN cat <<EOF >> /etc/yum.repos.d/rhel-10.repo
[rhel10-baseos]
name=rhel10-baseos
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/BaseOS/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[rhel10-appstream]
name=rhel10-appstream
baseurl=http://download-node-02.eng.bos.redhat.com/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/AppStream/\$basearch/os/
enabled=1
gpgcheck=0
repo_gpgcheck=0
[epel10]
name=epel10
baseurl=https://dl.fedoraproject.org/pub/epel/10/Everything/\$basearch/
enabled=1
gpgcheck=0
repo_gpgcheck=0
EOF
# Install packages from nightly compose
RUN dnf -y install iproute && \
dnf clean all

3
tests/testing-farm.fmf Normal file
View File

@ -0,0 +1,3 @@
summary: Deploy testing farm runner to run iproute tmt test
test: cd .. && tmt run -vvvvv plans --name /plans/tier0-im
duration: 20m