- packet_send(port->if_index, bpdu,
- bpdu_len + sizeof(MAC_HEADER_T) + sizeof(ETH_HEADER_T));
+ struct llc_header h;
+ memcpy(h.dest_addr, bridge_group_address, ETH_ALEN);
+ memcpy(h.src_addr, port->macaddr, ETH_ALEN);
+ /* bpdu_len excludes MAC and LLC headers */
+ h.len8023 = htons(bpdu_len + 3);
+ h.d_sap = h.s_sap = STP_SAP;
+ h.llc_ui = 0x03; /* LLC UI packet */
+
+ struct iovec iov[2] = {
+ { .iov_base = &h, .iov_len = sizeof(h) },
+ { .iov_base = bpdu + sizeof(h), .iov_len = bpdu_len }
+ };
+
+ packet_send(port->if_index, iov, 2, sizeof(h) + bpdu_len);