Bug 58359 - Интерфейс не добавляется в сетевой мост
Summary: Интерфейс не добавляется в сетевой мост
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: ip-brctl (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-25 12:43 MSK by Vladislav Glinkin
Modified: 2026-03-27 02:12 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladislav Glinkin 2026-03-25 12:43:25 MSK
Версия пакета:
	ip-brctl-0.2-alt1

Согласно man'у:
	The  command  brctl  addif  <brname> <ifname> will make the interface <ifname> a port of the bridge <brname>.

Шаги воспроизведения:
	# brctl addif br0 ens19

Результат:
	device br0 is a bridge device itself; can't enslave a bridge device to a bridge device.

Ошибка в функции cmd_addif():
	1. Проверка на то, что добавляемый интерфейс уже является членом другого моста, выполняется для первого аргумента (моста), а должна для второго (интерфейса).
	2. Проверка на то, что добавляемый интерфейс не является мостом, также выполняется для первого аргумента, хотя должна для второго.

Исправление:
--- a/usr/sbin/ip-brctl
+++ b/usr/sbin/ip-brctl
@@ -338,10 +338,10 @@ cmd_delbr() {
 cmd_addif() {
        err_dev_exists n "${1}" "bridge ${1} does not exist!"
        err_dev_exists n "${2}" "interface ${2} does not exist!"
-       if [ -n "$(parse_iplink master "${1}")" ]; then
+       if [ -n "$(parse_iplink master "${2}")" ]; then
                err "device ${2} is already a member of a bridge; can't enslave it to bridge ${1}."
        fi
-       err_dev_exists y "${1}" "device ${1} is a bridge device itself; can't enslave a bridge device to a bridge device." bridge
+       err_dev_exists y "${2}" "device ${2} is a bridge device itself; can't enslave a bridge device to a bridge device." bridge
 
        exec_iplink "set ${2} master ${1}" "can't add ${2} to bridge ${1}"
 }
Comment 1 Repository Robot 2026-03-27 02:12:59 MSK
ip-brctl-0.3-alt1 -> sisyphus:

Fri Mar 27 2026 Alexey Shabalin <shaba@altlinux> 0.3-alt1
- Fix timer validation error texts.
- Fix delif error argument order.
- Tighten float input validation.
- Fix signed long range check.
- Fix hairpin slave option (ALT#58376).
- Fix boolean conversion in make_bool (ALT#58372).
- Fix setmaxage bridge attribute (ALT#58370).
- Align setgcint docs with implementation (ALT#58360).
- Fix addif validation (ALT#58359).
- Fix exec_iplink argument handling (ALT#58358).