From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/4] udev: network-hotplug-bridges: Silence a warning when interfaces have gone away Date: Thu, 17 Oct 2024 14:54:15 +0000 Message-ID: <20241017145416.25394-3-michael.tremer@ipfire.org> In-Reply-To: <20241017145416.25394-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2860055753848554600==" List-Id: --===============2860055753848554600== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable It can happen that udev has an event for an interface in the queue that has already gone away - or even just being renamed. Then reading the MAC address fails. Because the shell expands the "$(<...)" statement before running the whole line, the read check is useless. Because the code would get too complicated otherwise, I decided to use cat. Not cool, but this does the job. Signed-off-by: Michael Tremer --- config/udev/network-hotplug-bridges | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/udev/network-hotplug-bridges b/config/udev/network-hotplu= g-bridges index 9fded1fd0..39faeb5a9 100644 --- a/config/udev/network-hotplug-bridges +++ b/config/udev/network-hotplug-bridges @@ -42,7 +42,7 @@ detect_zone() { local slave for slave in $(get_value "${zone}_SLAVES"); do # Compare if the mac address matches or if the name matches - if [ -r "/sys/class/net/${INTERFACE}/address" -a "$(/dev/null)" =3D "${slav= e}" ] || [ "${INTERFACE}" =3D "${slave}" ]; then echo "${zone}" return 0 fi --=20 2.39.5 --===============2860055753848554600==--