diff options
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifbridge.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index 2f24f5a..a4cf861 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -248,31 +248,39 @@ bridge_addresses(int s, const char *prefix) static void bridge_status(int s) { - struct ifbropreq param; + struct ifbropreq ifbp; + struct ifbrparam param; u_int16_t pri; u_int8_t ht, fd, ma, hc, pro; u_int8_t lladdr[ETHER_ADDR_LEN]; u_int16_t bprio; + u_int32_t csize, ctime; - if (do_cmd(s, BRDGPARAM, ¶m, sizeof(param), 0) < 0) + if (do_cmd(s, BRDGGCACHE, ¶m, sizeof(param), 0) < 0) + return; + csize = param.ifbrp_csize; + if (do_cmd(s, BRDGGTO, ¶m, sizeof(param), 0) < 0) + return; + ctime = param.ifbrp_ctime; + if (do_cmd(s, BRDGPARAM, &ifbp, sizeof(ifbp), 0) < 0) return; - pri = param.ifbop_priority; - pro = param.ifbop_protocol; - ht = param.ifbop_hellotime; - fd = param.ifbop_fwddelay; - hc = param.ifbop_holdcount; - ma = param.ifbop_maxage; - - PV2ID(param.ifbop_bridgeid, bprio, lladdr); + pri = ifbp.ifbop_priority; + pro = ifbp.ifbop_protocol; + ht = ifbp.ifbop_hellotime; + fd = ifbp.ifbop_fwddelay; + hc = ifbp.ifbop_holdcount; + ma = ifbp.ifbop_maxage; + + PV2ID(ifbp.ifbop_bridgeid, bprio, lladdr); printf("\tid %s priority %u hellotime %u fwddelay %u\n", ether_ntoa((struct ether_addr *)lladdr), pri, ht, fd); - printf("\tmaxage %u holdcnt %u proto %s\n", - ma, hc, stpproto[pro]); + printf("\tmaxage %u holdcnt %u proto %s maxaddr %u timeout %u\n", + ma, hc, stpproto[pro], csize, ctime); - PV2ID(param.ifbop_designated_root, bprio, lladdr); + PV2ID(ifbp.ifbop_designated_root, bprio, lladdr); printf("\troot id %s priority %d ifcost %u port %u\n", ether_ntoa((struct ether_addr *)lladdr), bprio, - param.ifbop_root_path_cost, param.ifbop_root_port & 0xfff); + ifbp.ifbop_root_path_cost, ifbp.ifbop_root_port & 0xfff); bridge_interfaces(s, "\tmember: "); |