mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
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.
This commit is contained in:
1 parent
068e7467af
commit
b92a773cad
1 file changed
+1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user