| 1469 | } |
| 1470 | |
| 1471 | int |
| 1472 | bstp_set_htime(struct bstp_state *bs, int t) |
| 1473 | { |
| 1474 | /* convert seconds to ticks */ |
| 1475 | t *= BSTP_TICK_VAL; |
| 1476 | |
| 1477 | /* value can only be changed in leagacy stp mode */ |
| 1478 | if (bs->bs_protover != BSTP_PROTO_STP) |
| 1479 | return (EPERM); |
| 1480 | |
| 1481 | if (t < BSTP_MIN_HELLO_TIME || t > BSTP_MAX_HELLO_TIME) |
| 1482 | return (EINVAL); |
| 1483 | |
| 1484 | BSTP_LOCK(bs); |
| 1485 | bs->bs_bridge_htime = t; |
| 1486 | bstp_reinit(bs); |
| 1487 | BSTP_UNLOCK(bs); |
| 1488 | return (0); |
| 1489 | } |
| 1490 | |
| 1491 | int |
| 1492 | bstp_set_fdelay(struct bstp_state *bs, int t) |
no test coverage detected