| 528 | } |
| 529 | |
| 530 | static void |
| 531 | bstp_received_stp(struct bstp_state *bs, struct bstp_port *bp, |
| 532 | struct mbuf **mp, struct bstp_tbpdu *tpdu) |
| 533 | { |
| 534 | struct bstp_cbpdu cpdu; |
| 535 | struct bstp_config_unit *cu = &bp->bp_msg_cu; |
| 536 | struct bstp_tcn_unit tu; |
| 537 | |
| 538 | switch (tpdu->tbu_bpdutype) { |
| 539 | case BSTP_MSGTYPE_TCN: |
| 540 | tu.tu_message_type = tpdu->tbu_bpdutype; |
| 541 | bstp_received_tcn(bs, bp, &tu); |
| 542 | break; |
| 543 | case BSTP_MSGTYPE_CFG: |
| 544 | if ((*mp)->m_len < BSTP_BPDU_STP_LEN && |
| 545 | (*mp = m_pullup(*mp, BSTP_BPDU_STP_LEN)) == NULL) |
| 546 | return; |
| 547 | memcpy(&cpdu, mtod(*mp, caddr_t), BSTP_BPDU_STP_LEN); |
| 548 | |
| 549 | bstp_decode_bpdu(bp, &cpdu, cu); |
| 550 | bstp_received_bpdu(bs, bp, cu); |
| 551 | break; |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | static void |
| 556 | bstp_received_rstp(struct bstp_state *bs, struct bstp_port *bp, |
no test coverage detected