From b92a773cad7c1fc120e6cbca216a6463aa19abd6 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Tue, 13 Oct 2026 03:39:30 +0200 Subject: [PATCH] test/stp: tag the frames the simulator feeds in The frame the simulator builds carries a vlan_tag between the RTL tag and the BPDU, but left its TPID zero. stp_in() now takes the body offset from TRAP_RX_BODY(), which reads those two bytes, so it took the untagged branch and parsed the body four bytes early. Writing 0x8100 makes the frame what its layout says it is. --- test/stp/stp_sim.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/stp/stp_sim.c b/test/stp/stp_sim.c index 84faa12a..db95ec2f 100644 --- a/test/stp/stp_sim.c +++ b/test/stp/stp_sim.c @@ -321,6 +321,7 @@ static void bpdu_in(const struct sim_bpdu *b) struct sim_pkt_in *f = (struct sim_pkt_in *)uip_buf; memset(uip_buf, 0, sizeof(uip_buf)); + f->vlan_tag.svlan = HTONS(0x8100); memcpy(f->stp_addr, "\x01\x80\xc2\x00\x00\x00", 6); memcpy(f->src_addr, b->br_mac, 6); f->rtl_tag.pmask = HTONS(b->port);