<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>58359</bug_id>
          
          <creation_ts>2026-03-25 12:43:25 +0300</creation_ts>
          <short_desc>Интерфейс не добавляется в сетевой мост</short_desc>
          <delta_ts>2026-03-27 02:12:59 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>ip-brctl</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Vladislav Glinkin">glinkinvd</reporter>
          <assigned_to name="Alexey Shabalin">shaba</assigned_to>
          <cc>shaba</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>284500</commentid>
    <comment_count>0</comment_count>
    <who name="Vladislav Glinkin">glinkinvd</who>
    <bug_when>2026-03-25 12:43:25 +0300</bug_when>
    <thetext>Версия пакета:
	ip-brctl-0.2-alt1

Согласно man&apos;у:
	The  command  brctl  addif  &lt;brname&gt; &lt;ifname&gt; will make the interface &lt;ifname&gt; a port of the bridge &lt;brname&gt;.

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

Результат:
	device br0 is a bridge device itself; can&apos;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 &quot;${1}&quot; &quot;bridge ${1} does not exist!&quot;
        err_dev_exists n &quot;${2}&quot; &quot;interface ${2} does not exist!&quot;
-       if [ -n &quot;$(parse_iplink master &quot;${1}&quot;)&quot; ]; then
+       if [ -n &quot;$(parse_iplink master &quot;${2}&quot;)&quot; ]; then
                err &quot;device ${2} is already a member of a bridge; can&apos;t enslave it to bridge ${1}.&quot;
        fi
-       err_dev_exists y &quot;${1}&quot; &quot;device ${1} is a bridge device itself; can&apos;t enslave a bridge device to a bridge device.&quot; bridge
+       err_dev_exists y &quot;${2}&quot; &quot;device ${2} is a bridge device itself; can&apos;t enslave a bridge device to a bridge device.&quot; bridge
 
        exec_iplink &quot;set ${2} master ${1}&quot; &quot;can&apos;t add ${2} to bridge ${1}&quot;
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>284648</commentid>
    <comment_count>1</comment_count>
    <who name="Repository Robot">repository-robot</who>
    <bug_when>2026-03-27 02:12:59 +0300</bug_when>
    <thetext>ip-brctl-0.3-alt1 -&gt; sisyphus:

Fri Mar 27 2026 Alexey Shabalin &lt;shaba@altlinux&gt; 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).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>