<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ustp, branch master</title>
<subtitle>OpenWrt MSTP/RSTP/STP daemon</subtitle>
<id>https://git.openwrt.org/project/ustp/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/project/ustp/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/'/>
<updated>2026-10-28T10:08:43Z</updated>
<entry>
<title>config: free the config of removed bridges</title>
<updated>2026-10-28T10:08:43Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2026-10-28T10:07:32Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=1be05eb1239fecadad145343f9b7e380bff5f716'/>
<id>urn:sha1:1be05eb1239fecadad145343f9b7e380bff5f716</id>
<content type='text'>
bridge_config_expire() has no caller, so ustp keeps the config of each
bridge name that add_bridge or stp_init ever named. The tree grows with
every bridge that is removed or renamed.

Expire the configs before each add_bridge. Keep a config for an existing
bridge, as a manual change of stp_state starts STP through bridge-stp
without a new stp_init. netifd sends stp_init each time it creates a
bridge, so the config of a bridge that netifd creates again is current.

Fixes: fd93aaef9ba9 ("Initial import")
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>ubus: take the bridge priority from add_bridge</title>
<updated>2026-10-28T10:08:43Z</updated>
<author>
<name>Stijn Cleynhens</name>
</author>
<published>2026-10-25T16:47:49Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=dbf456dfe9adbb5028f93a940e1b9ff111b17794'/>
<id>urn:sha1:dbf456dfe9adbb5028f93a940e1b9ff111b17794</id>
<content type='text'>
add_bridge and the netifd stp_init notification carry the protocol and
the timers, but ustp ignores a priority. Every bridge thus runs at the
default priority of 32768, whatever priority the bridge configuration
sets. netifd commit 20be6d5c7908 ("bridge: pass the bridge priority to
the userspace STP daemon") adds the priority to stp_init.

Accept a priority in add_bridge and apply it to the CIST when the bridge
is set up. As the bridge identifier carries it in steps of 4096, the
lower bits are dropped. Without it the bridge gets the default priority
again, so that removing the option takes effect. Apply the priority
before the CIST configuration, so that a restart of the state machines
for a change of the protocol uses the new bridge identifier.

MSTP_IN_set_msti_bridge_config() rejects a priority above 65535 and the
bridge keeps its current priority, like it keeps the timers for an
invalid timer value. Pass the priority as unsigned int, so that a large
value is not truncated into the valid range.

Also add a default bridge priority constant and use it for the default
in create_tree(), like DEFAULT_HELLO_TIME.

Signed-off-by: Stijn Cleynhens &lt;stijncleynhens@gmail.com&gt;
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>netif_utils: close the port file on a read error</title>
<updated>2026-10-16T09:34:12Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2026-09-26T03:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=d13acc7252ab15f61efa48bcac1bbfef6db17738'/>
<id>urn:sha1:d13acc7252ab15f61efa48bcac1bbfef6db17738</id>
<content type='text'>
get_port_file() returned without closing the descriptor when read()
failed. Go through the common exit, which closes it; res is still -1
there.

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>netif_utils: size sysfs path buffers for the longest interface name</title>
<updated>2026-09-26T03:53:32Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2026-09-26T03:53:32Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=22cb867fd37eb233ca63c55ecf9dfa70b8e502dc'/>
<id>urn:sha1:22cb867fd37eb233ca63c55ecf9dfa70b8e502dc</id>
<content type='text'>
get_port_file() formatted /sys/class/net/&lt;ifname&gt;/brport/&lt;file&gt; into a
buffer of 32 + IFNAMSIZ bytes. A bridge port with a 15 character name,
such as the WDS station interface phy0.0-ap0.sta1, and the file
bpdu_filter need 50 bytes, so the fortified sprintf() aborted ustpd with
SIGTRAP. The port stays in the bridge, so every respawn aborted again
until procd gave up, leaving all bridge ports in the blocking state.

Use PATH_MAX buffers and snprintf() with a truncation check in
get_port_file() and is_bridge().

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>mstp: use default Hello Time in recordTimes</title>
<updated>2026-05-27T11:26:50Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2026-05-27T09:52:16Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=17c36bebada116b98784a6a17412005537bdf8ac'/>
<id>urn:sha1:17c36bebada116b98784a6a17412005537bdf8ac</id>
<content type='text'>
802.1Q-2011 says recordTimes should set Hello Time to the default.
Follow that instead of preserving the local configured Hello Time.

This fixes received information aging when the local bridge uses a shorter
Hello Time than its neighbor. With OpenWrt's hello_time=1 and a Huawei
S6720 sending RSTP BPDUs every 2 seconds, rcvdInfoWhile was set to 3
seconds. With normal scheduling jitter, the superior information could
expire before the next BPDU, causing ustp to briefly elect itself root and
send a self-root BPDU.

On a realtek Edgecore ECS4100-12PH, this caused repeated MSTP
PACKET_ERR_COMPLIAN errors on the Huawei side, together with brief
forwarding -&gt; discarding -&gt; forwarding state changes:

  May 13 2026 16:31:22+03:00 DST cs0 %%01MSTP/3/PACKET_ERR_COMPLIAN(l)[47259]:The port compliance protocol type of the packet received by MSTP from the port XGigabitEthernet0/0/3,(InsId:0,RcvInt:0,SrcMAC:fa8e-a111-a57f,RootId:32768.f88e-a111-a574,ExCost:0,BdgId:32768.f88e-a111-a574,PortId:128.10,RegRootId:0.0000-0000-0000,InCost:0) is invalid.
  May 13 2026 16:31:22+03:00 DST cs0 %%01MSTP/4/SET_PORT_DISCARDING(l)[47260]:In MSTP process 0 instance 0, MSTP set port XGigabitEthernet0/0/3 state as discarding.
  May 13 2026 16:31:22+03:00 DST cs0 %%01MSTP/4/SET_PORT_FORWARDING(l)[47261]:In MSTP process 0 instance 0, MSTP set port XGigabitEthernet0/0/3 state as forwarding.
  May 13 2026 16:31:46+03:00 DST cs0 %%01MSTP/3/PACKET_ERR_COMPLIAN(l)[47262]:The port compliance protocol type of the packet received by MSTP from the port XGigabitEthernet0/0/3,(InsId:0,RcvInt:0,SrcMAC:fa8e-a111-a57f,RootId:32768.f88e-a111-a574,ExCost:0,BdgId:32768.f88e-a111-a574,PortId:128.10,RegRootId:0.0000-0000-0000,InCost:0) is invalid.
  May 13 2026 16:31:46+03:00 DST cs0 %%01MSTP/4/SET_PORT_DISCARDING(l)[47263]:In MSTP process 0 instance 0, MSTP set port XGigabitEthernet0/0/3 state as discarding.
  May 13 2026 16:31:46+03:00 DST cs0 %%01MSTP/4/SET_PORT_FORWARDING(l)[47264]:In MSTP process 0 instance 0, MSTP set port XGigabitEthernet0/0/3 state as forwarding.

There were 2396 errors between 2026-05-01 and 2026-05-19 10:00 with one
OpenWrt realtek switch running STP. After deploying this fix on two
Edgecore ECS4100-12PH switches, both running OpenWrt + ustp and connected
to the same Huawei, there were zero errors for 8 days.

Fixes: fd93aaef9ba9 ("Initial import")
Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
</content>
</entry>
<entry>
<title>mstp: add default Hello Time constant</title>
<updated>2026-05-27T11:21:34Z</updated>
<author>
<name>Stijn Tintel</name>
</author>
<published>2026-05-27T09:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=f5d17dd60a897b581223170c9b25df974696c0ad'/>
<id>urn:sha1:f5d17dd60a897b581223170c9b25df974696c0ad</id>
<content type='text'>
The default Hello Time is used when initializing a bridge. Add a constant
for it instead of hard-coding the value.

This will be reused in the next commit to follow the 802.1Q-2011
recordTimes behavior.

Signed-off-by: Stijn Tintel &lt;stijn@linux-ipv6.be&gt;
</content>
</entry>
<entry>
<title>netif_utils: correctly close fd on read error</title>
<updated>2023-05-29T15:07:54Z</updated>
<author>
<name>Christian Marangi</name>
</author>
<published>2023-05-29T15:07:54Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=a85a5bc83bde5b485319ca12b6e32c4b7f0b120f'/>
<id>urn:sha1:a85a5bc83bde5b485319ca12b6e32c4b7f0b120f</id>
<content type='text'>
Fix Coverity Scan CID 1521069 reporting leaking fd on read error.
Refactor the read error handling and correctly close fd on read error.

Signed-off-by: Christian Marangi &lt;ansuelsmth@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: use pthread cflags/ldflags</title>
<updated>2021-09-21T17:41:11Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-09-21T17:41:09Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=462b3a491347e452c15220861949b1d6371fa59e'/>
<id>urn:sha1:462b3a491347e452c15220861949b1d6371fa59e</id>
<content type='text'>
Fixes build on glibc

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>libnetlink: turn rtnetlink error answers into debug msgs</title>
<updated>2021-08-27T10:36:45Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-08-27T10:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=25555611be916da7fe8cb53f85c741a51ddffa1c'/>
<id>urn:sha1:25555611be916da7fe8cb53f85c741a51ddffa1c</id>
<content type='text'>
They should not be logged by default

Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
<entry>
<title>bridge: check port bpdu filter status and apply it to the config</title>
<updated>2021-08-27T10:19:30Z</updated>
<author>
<name>Felix Fietkau</name>
</author>
<published>2021-08-27T10:19:29Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/project/ustp/commit/?id=c62d85cf7a0db267030e0ac2138e685b5e8f7017'/>
<id>urn:sha1:c62d85cf7a0db267030e0ac2138e685b5e8f7017</id>
<content type='text'>
Signed-off-by: Felix Fietkau &lt;nbd@nbd.name&gt;
</content>
</entry>
</feed>
