1 /*****************************************************************************
2 Copyright (c) 2006 EMC Corporation.
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc., 59
16 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 The full GNU General Public License is included in this distribution in the
21 Authors: Srinivas Aji <Aji_Srinivas@emc.com>
23 ******************************************************************************/
25 #include "bridge_ctl.h"
26 #include "netif_utils.h"
32 #include <linux/if_bridge.h>
33 #include <arpa/inet.h>
34 #include <sys/types.h>
47 /*------------------------------------------------------------*/
57 struct ifdata
*bridge_next
;
58 struct ifdata
*port_list
;
61 struct stp_instance
*stp
;
62 UID_BRIDGE_ID_T bridge_id
;
64 UID_STP_MODE_T stp_enabled
;
75 struct ifdata
*master
;
76 struct ifdata
*port_next
;
81 int admin_port_path_cost
;
82 ADMIN_P2P_T admin_point2point
;
83 unsigned char admin_edge
;
84 unsigned char admin_non_stp
; /* 1- doesn't participate in STP, 1 - regular */
86 struct epoll_event_handler event
;
90 struct ifdata
*current_br
= NULL
;
92 void instance_begin(struct ifdata
*br
)
95 ERROR("BUG: Trying to set instance over existing instance.");
96 ERROR("%d", *(int *)0); /* ABORT */
99 STP_IN_instance_begin(br
->stp
);
102 void instance_end(void)
104 STP_IN_instance_end(current_br
->stp
);
108 struct ifdata
*find_port(int port_index
)
110 struct ifdata
*ifc
= current_br
->port_list
;
111 while (ifc
&& ifc
->port_index
!= port_index
)
112 ifc
= ifc
->port_next
;
116 /*************************************************************/
117 /* Bridge and port defaults */
119 UID_STP_CFG_T default_bridge_stp_cfg
= {
120 .field_mask
= BR_CFG_ALL
,
121 .bridge_priority
= DEF_BR_PRIO
,
122 .max_age
= DEF_BR_MAXAGE
,
123 .hello_time
= DEF_BR_HELLOT
,
124 .forward_delay
= DEF_BR_FWDELAY
,
125 .force_version
= DEF_FORCE_VERS
, /*NORMAL_RSTP */
128 void update_bridge_stp_config(struct ifdata
*br
, UID_STP_CFG_T
* cfg
)
130 if (cfg
->field_mask
& BR_CFG_PRIO
)
131 br
->bridge_priority
= cfg
->bridge_priority
;
132 if (cfg
->field_mask
& BR_CFG_AGE
)
133 br
->max_age
= cfg
->max_age
;
134 if (cfg
->field_mask
& BR_CFG_HELLO
)
135 br
->hello_time
= cfg
->hello_time
;
136 if (cfg
->field_mask
& BR_CFG_DELAY
)
137 br
->forward_delay
= cfg
->forward_delay
;
138 if (cfg
->field_mask
& BR_CFG_FORCE_VER
)
139 br
->force_version
= cfg
->force_version
;
142 UID_STP_PORT_CFG_T default_port_stp_cfg
= {
143 .field_mask
= PT_CFG_ALL
,
144 .port_priority
= DEF_PORT_PRIO
,
145 .admin_non_stp
= DEF_ADMIN_NON_STP
,
146 .admin_edge
= False
, // DEF_ADMIN_EDGE,
147 .admin_port_path_cost
= ADMIN_PORT_PATH_COST_AUTO
,
148 .admin_point2point
= DEF_P2P
,
151 void update_port_stp_config(struct ifdata
*ifc
, UID_STP_PORT_CFG_T
* cfg
)
153 if (cfg
->field_mask
& PT_CFG_PRIO
)
154 ifc
->port_priority
= cfg
->port_priority
;
155 if (cfg
->field_mask
& PT_CFG_NON_STP
)
156 ifc
->admin_non_stp
= cfg
->admin_non_stp
;
157 if (cfg
->field_mask
& PT_CFG_EDGE
)
158 ifc
->admin_edge
= cfg
->admin_edge
;
159 if (cfg
->field_mask
& PT_CFG_COST
)
160 ifc
->admin_port_path_cost
= cfg
->admin_port_path_cost
;
161 if (cfg
->field_mask
& PT_CFG_P2P
)
162 ifc
->admin_point2point
= cfg
->admin_point2point
;
165 /**************************************************************/
167 int add_port_stp(struct ifdata
*ifc
)
168 { /* Bridge is ifc->master */
169 TST((ifc
->port_index
= get_bridge_portno(ifc
->name
)) >= 0, -1);
171 /* Add port to STP */
172 instance_begin(ifc
->master
);
173 int r
= STP_IN_port_create(0, ifc
->port_index
);
174 if (r
== 0) { /* Update bridge ID */
175 UID_STP_STATE_T state
;
176 STP_IN_stpm_get_state(0, &state
);
177 ifc
->master
->bridge_id
= state
.bridge_id
;
180 if (r
/* check for failure */ ) {
181 ERROR("Couldn't add port for ifindex %d to STP", ifc
->if_index
);
187 void remove_port_stp(struct ifdata
*ifc
)
189 /* Remove port from STP */
190 instance_begin(ifc
->master
);
191 int r
= STP_IN_port_delete(0, ifc
->port_index
);
193 ifc
->port_index
= -1;
195 ERROR("removing port %s failed for bridge %s: %s",
196 ifc
->name
, ifc
->master
->name
,
197 STP_IN_get_error_explanation(r
));
201 int init_rstplib_instance(struct ifdata
*br
)
203 br
->stp
= STP_IN_instance_create();
204 if (br
->stp
== NULL
) {
205 ERROR("Couldn't create STP instance for bridge %s", br
->name
);
212 int r
= STP_IN_stpm_create(0, br
->name
, &ports
);
215 ERROR("stpm create failed for bridge %s: %s",
216 br
->name
, STP_IN_get_error_explanation(r
));
223 void clear_rstplib_instance(struct ifdata
*br
)
226 int r
= STP_IN_delete_all();
229 ERROR("stpm delete failed for bridge %s: %s",
230 br
->name
, STP_IN_get_error_explanation(r
));
233 STP_IN_instance_delete(br
->stp
);
237 int init_bridge_stp(struct ifdata
*br
)
240 ERROR("STP already started");
245 TST(init_rstplib_instance(br
) == 0, -1);
247 struct ifdata
*p
= br
->port_list
;
249 if (add_port_stp(p
) != 0)
254 struct ifdata
*q
= br
->port_list
;
259 /* Clear bridge STP state */
260 clear_rstplib_instance(br
);
267 void clear_bridge_stp(struct ifdata
*br
)
272 struct ifdata
*p
= br
->port_list
;
277 /* Clear bridge STP state */
278 clear_rstplib_instance(br
);
281 struct ifdata
*if_head
= NULL
;
282 struct ifdata
*br_head
= NULL
;
284 struct ifdata
*find_if(int if_index
)
286 struct ifdata
*p
= if_head
;
287 while (p
&& p
->if_index
!= if_index
)
292 #define ADD_TO_LIST(_list, _next, _ifc) \
294 (_ifc)->_next = (_list); \
298 #define REMOVE_FROM_LIST(_list, _next, _ifc, _error_fmt, _args...) \
300 struct ifdata **_prev = &(_list); \
301 while (*_prev && *_prev != (_ifc)) \
302 _prev = &(*_prev)->_next; \
303 if (*_prev != (_ifc)) \
304 ERROR(_error_fmt, ##_args); \
306 *_prev = (_ifc)->_next; \
309 /* Caller ensures that there isn't any ifdata with this index */
310 /* If br is NULL, new interface is a bridge, else it is a port of br */
311 struct ifdata
*create_if(int if_index
, struct ifdata
*br
)
314 TST((p
= malloc(sizeof(*p
))) != NULL
, NULL
);
316 memset(p
, 0, sizeof(*p
));
319 p
->if_index
= if_index
;
320 p
->is_bridge
= (br
== NULL
);
322 /* TODO: purge use of name, due to issue with renameing */
323 if_indextoname(if_index
, p
->name
);
326 INFO("Add bridge %s", p
->name
);
327 /* Init slave list */
334 update_bridge_stp_config(p
, &default_bridge_stp_cfg
);
335 ADD_TO_LIST(br_head
, bridge_next
, p
); /* Add to bridge list */
337 INFO("Add iface %s to bridge %s", p
->name
, br
->name
);
343 update_port_stp_config(p
, &default_port_stp_cfg
);
344 ADD_TO_LIST(br
->port_list
, port_next
, p
); /* Add to bridge port list */
351 /* Add to interface list */
352 ADD_TO_LIST(if_head
, next
, p
);
357 void delete_if(struct ifdata
*ifc
)
359 INFO("Delete iface %s", ifc
->name
);
360 if (ifc
->is_bridge
) { /* Bridge: */
362 clear_bridge_stp(ifc
);
364 while (ifc
->port_list
)
365 delete_if(ifc
->port_list
);
366 /* Remove from bridge list */
367 REMOVE_FROM_LIST(br_head
, bridge_next
, ifc
,
368 "Can't find interface ifindex %d bridge list",
371 if (ifc
->master
->stp_up
)
372 remove_port_stp(ifc
);
373 /* Remove from bridge port list */
374 REMOVE_FROM_LIST(ifc
->master
->port_list
, port_next
, ifc
,
375 "Can't find interface ifindex %d on br %d's port list",
376 ifc
->if_index
, ifc
->master
->if_index
);
379 /* Remove from bridge interface list */
380 REMOVE_FROM_LIST(if_head
, next
, ifc
,
381 "Can't find interface ifindex %d on iflist",
386 void set_br_up(struct ifdata
*br
, int up
)
391 up
? (void)init_bridge_stp(br
) : clear_bridge_stp(br
);
395 void set_if_up(struct ifdata
*ifc
, int up
)
397 INFO("Port %s : %s", ifc
->name
, (up
? "up" : "down"));
400 int notify_flags
= 0;
401 const int NOTIFY_UP
= 1, NOTIFY_SPEED
= 2, NOTIFY_DUPLEX
= 4;
402 if (!up
) { /* Down */
405 notify_flags
|= NOTIFY_UP
;
408 int r
= ethtool_get_speed_duplex(ifc
->name
, &speed
, &duplex
);
409 if (r
< 0) { /* Didn't succeed */
414 duplex
= 0; /* Assume half duplex */
416 if (speed
!= ifc
->speed
) {
418 notify_flags
|= NOTIFY_SPEED
;
420 if (duplex
!= ifc
->duplex
) {
421 ifc
->duplex
= duplex
;
422 notify_flags
|= NOTIFY_DUPLEX
;
426 notify_flags
|= NOTIFY_UP
;
429 if (notify_flags
&& ifc
->master
->stp_up
) {
430 instance_begin(ifc
->master
);
432 if (notify_flags
& NOTIFY_SPEED
)
433 STP_IN_changed_port_speed(ifc
->port_index
, speed
);
434 if (notify_flags
& NOTIFY_DUPLEX
)
435 STP_IN_changed_port_duplex(ifc
->port_index
);
436 if (notify_flags
& NOTIFY_UP
)
437 STP_IN_enable_port(ifc
->port_index
, ifc
->up
);
443 /*------------------------------------------------------------*/
445 int bridge_notify(int br_index
, int if_index
, int newlink
, int up
)
449 LOG("br_index %d, if_index %d, up %d", br_index
, if_index
, up
);
451 struct ifdata
*br
= NULL
;
453 br
= find_if(br_index
);
454 if (br
&& !br
->is_bridge
) {
456 ("Notification shows non bridge interface %d as bridge.",
461 br
= create_if(br_index
, NULL
);
463 ERROR("Couldn't create data for bridge interface %d",
467 /* Bridge must be up if we get such notifications */
472 struct ifdata
*ifc
= find_if(if_index
);
476 if (ifc
->is_bridge
) {
478 ("Notification shows bridge interface %d as slave of %d",
482 if (ifc
->master
!= br
) {
483 INFO("Device %d has come to bridge %d. "
484 "Missed notify for deletion from bridge %d",
485 if_index
, br_index
, ifc
->master
->if_index
);
491 ifc
= create_if(if_index
, br
);
494 ("Couldn't create data for interface %d (master %d)",
498 if (!newlink
&& !is_bridge_slave(br
->name
, ifc
->name
)) {
499 /* brctl delif generates a DELLINK, but so does ifconfig <slave> down.
500 So check and delete if it has been removed.
506 set_if_up(ifc
, up
); /* And speed and duplex */
507 } else { /* No br_index */
509 /* DELLINK not from bridge means interface unregistered. */
510 /* Cleanup removed bridge or removed bridge slave */
514 } else { /* This may be a new link */
516 char ifname
[IFNAMSIZ
];
517 if (if_indextoname(if_index
, ifname
)
518 && is_bridge(ifname
)) {
519 ifc
= create_if(if_index
, NULL
);
522 ("Couldn't create data for bridge interface %d",
528 if (ifc
&& !ifc
->is_bridge
&&
529 !is_bridge_slave(ifc
->master
->name
, ifc
->name
)) {
530 /* Interface might have left bridge and we might have missed deletion */
534 if (ifc
&& ifc
->up
!= up
) {
545 void bridge_bpdu_rcv(int if_index
, const unsigned char *data
, int len
)
547 struct ifdata
*ifc
= find_if(if_index
);
550 LOG("ifindex %d, len %d", if_index
, len
);
554 TST(ifc
->up
&& ifc
->master
->stp_up
,);
556 memset(&bpdu
.eth
, 0, sizeof(bpdu
.eth
));
557 if (len
> sizeof(bpdu
) - sizeof(bpdu
.eth
))
558 len
= sizeof(bpdu
) - sizeof(bpdu
.eth
);
559 memcpy(&bpdu
.hdr
, data
, len
);
561 /* Do some validation */
563 TST(bpdu
.hdr
.protocol
[0] == 0 && bpdu
.hdr
.protocol
[1] == 0,);
564 switch (bpdu
.hdr
.bpdu_type
) {
567 case BPDU_CONFIG_TYPE
:
569 /* 802.1w doesn't ask for this */
570 // TST(ntohs(*(uint16_t*)bpdu.body.message_age)
571 // < ntohs(*(uint16_t*)bpdu.body.max_age), );
572 TST(memcmp(bpdu
.body
.bridge_id
, &ifc
->master
->bridge_id
, 8) != 0
573 || (ntohs(*(uint16_t *) bpdu
.body
.port_id
) & 0xfff) !=
576 case BPDU_TOPO_CHANGE_TYPE
:
582 // dump_hex(data, len);
583 instance_begin(ifc
->master
);
585 STP_IN_rx_bpdu(0, ifc
->port_index
, &bpdu
, len
+ sizeof(bpdu
.eth
));
587 ERROR("STP_IN_rx_bpdu on port %s returned %s", ifc
->name
,
588 STP_IN_get_error_explanation(r
));
592 void bridge_one_second(void)
596 for (br
= br_head
; br
; br
= br
->bridge_next
) {
604 /* To get information about port changes when bridge is down */
605 /* But won't work so well since we will not sense deletions */
606 static int count
= 0;
609 bridge_get_configuration();
613 /* Implementing STP_OUT functions */
615 int flush_port(char *sys_name
)
617 FILE *f
= fopen(sys_name
, "w");
618 TSTM(f
, -1, "Couldn't open flush file %s for write.", sys_name
);
619 int r
= fwrite("1", 1, 1, f
);
626 STP_OUT_flush_lt(IN
int port_index
, IN
int vlan_id
,
627 IN LT_FLASH_TYPE_T type
, IN
char *reason
)
629 LOG("port index %d, flash type %d, reason %s", port_index
, type
,
631 TST(vlan_id
== 0, 0);
634 if (port_index
== 0) { /* i.e. passed port_index was 0 */
635 sprintf(fname
, "/sys/class/net/%s/bridge/flush",
638 } else if (type
== LT_FLASH_ONLY_THE_PORT
) {
639 struct ifdata
*port
= find_port(port_index
);
640 TST(port
!= NULL
, 0);
641 sprintf(fname
, "/sys/class/net/%s/brif/%s/flush",
642 current_br
->name
, port
->name
);
644 } else if (type
== LT_FLASH_ALL_PORTS_EXCLUDE_THIS
) {
646 for (port
= current_br
->port_list
; port
; port
= port
->port_next
) {
647 if (port
->port_index
!= port_index
) {
649 "/sys/class/net/%s/brif/%s/flush",
650 current_br
->name
, port
->name
);
660 void /* for bridge id calculation */ STP_OUT_get_port_mac(IN
int port_index
,
664 LOG("port index %d", port_index
);
665 struct ifdata
*port
= find_port(port_index
);
667 get_hwaddr(port
->name
, mac
);
670 unsigned long STP_OUT_get_port_oper_speed(IN
unsigned int port_index
)
672 LOG("port index %d", port_index
);
673 struct ifdata
*port
= find_port(port_index
);
674 TST(port
!= NULL
, 0);
675 LOG("Speed: %d", port
->speed
);
679 int /* 1- Up, 0- Down */ STP_OUT_get_port_link_status(IN
int port_index
)
681 LOG("port index %d", port_index
);
682 struct ifdata
*port
= find_port(port_index
);
683 TST(port
!= NULL
, 0);
684 LOG("Link status: %d", port
->up
);
688 int /* 1- Full, 0- Half */ STP_OUT_get_duplex(IN
int port_index
)
690 LOG("port index %d", port_index
);
691 struct ifdata
*port
= find_port(port_index
);
692 TST(port
!= NULL
, 0);
693 LOG("Duplex: %d", port
->duplex
);
698 STP_OUT_set_port_state(IN
int port_index
, IN
int vlan_id
,
699 IN RSTP_PORT_STATE state
)
701 LOG("port index %d, state %d", port_index
, state
);
702 struct ifdata
*port
= find_port(port_index
);
703 TST(port
!= NULL
, 0);
704 TST(vlan_id
== 0, 0);
708 case UID_PORT_DISCARDING
:
709 br_state
= BR_STATE_BLOCKING
;
711 case UID_PORT_LEARNING
:
712 br_state
= BR_STATE_LEARNING
;
714 case UID_PORT_FORWARDING
:
715 br_state
= BR_STATE_FORWARDING
;
718 fprintf(stderr
, "set_port_state: Unexpected state %d\n", state
);
722 bridge_set_state(port
->if_index
, br_state
);
726 int STP_OUT_set_hardware_mode(int vlan_id
, UID_STP_MODE_T mode
)
728 LOG("vlan id %d, mode %d", vlan_id
, mode
);
733 STP_OUT_tx_bpdu(IN
int port_index
, IN
int vlan_id
,
734 IN
unsigned char *bpdu
, IN
size_t bpdu_len
)
736 LOG("port index %d, len %zd", port_index
, bpdu_len
);
737 struct ifdata
*port
= find_port(port_index
);
738 TST(port
!= NULL
, 0);
739 TST(vlan_id
== 0, 0);
740 // dump_hex(bpdu + sizeof(MAC_HEADER_T) + sizeof(ETH_HEADER_T),
741 // bpdu_len - (sizeof(MAC_HEADER_T) + sizeof(ETH_HEADER_T)));
742 packet_send(port
->if_index
,
743 bpdu
+ sizeof(MAC_HEADER_T
) + sizeof(ETH_HEADER_T
),
744 bpdu_len
); // The length we get excludes headers!
748 const char *STP_OUT_get_port_name(IN
int port_index
)
750 LOG("port index %d", port_index
);
751 struct ifdata
*port
= find_port(port_index
);
752 TST(port
!= NULL
, 0);
756 int STP_OUT_get_init_stpm_cfg(IN
int vlan_id
, INOUT UID_STP_CFG_T
* cfg
)
759 TST(vlan_id
== 0, 0);
761 cfg
->bridge_priority
= current_br
->bridge_priority
;
762 cfg
->max_age
= current_br
->max_age
;
763 cfg
->hello_time
= current_br
->hello_time
;
764 cfg
->forward_delay
= current_br
->forward_delay
;
765 cfg
->force_version
= current_br
->force_version
;
771 STP_OUT_get_init_port_cfg(IN
int vlan_id
,
772 IN
int port_index
, INOUT UID_STP_PORT_CFG_T
* cfg
)
774 LOG("port index %d", port_index
);
775 struct ifdata
*port
= find_port(port_index
);
776 TST(port
!= NULL
, 0);
777 TST(vlan_id
== 0, 0);
779 cfg
->port_priority
= port
->port_priority
;
780 cfg
->admin_non_stp
= port
->admin_non_stp
;
781 cfg
->admin_edge
= port
->admin_edge
;
782 cfg
->admin_port_path_cost
= port
->admin_port_path_cost
;
783 cfg
->admin_point2point
= port
->admin_point2point
;
788 extern void stp_trace(const char *fmt
, ...)
792 vDprintf(LOG_LEVEL_RSTPLIB
, fmt
, ap
);
796 /* Commands and status */
797 #include "ctl_functions.h"
799 #define CTL_CHECK_BRIDGE \
800 struct ifdata *br = find_if(br_index); \
801 if (br == NULL || !br->is_bridge) return Err_Interface_not_a_bridge; \
802 if (!br->do_stp) return Err_Bridge_RSTP_not_enabled; \
803 if (!br->stp_up) return Err_Bridge_is_down; \
806 #define CTL_CHECK_BRIDGE_PORT \
808 struct ifdata *port = find_if(port_index); \
809 if (port == NULL || port->is_bridge || port->master != br) \
810 return Err_Port_does_not_belong_to_bridge; \
813 int CTL_enable_bridge_rstp(int br_index
, int enable
)
815 INFO("bridge %d, enable %d", br_index
, enable
);
819 struct ifdata
*br
= find_if(br_index
);
821 char ifname
[IFNAMSIZ
];
822 if (if_indextoname(br_index
, ifname
) && is_bridge(ifname
))
823 br
= create_if(br_index
, NULL
);
825 if (br
== NULL
|| !br
->is_bridge
)
826 return Err_Interface_not_a_bridge
;
827 if (br
->do_stp
!= enable
) {
830 r
= enable
? init_bridge_stp(br
)
831 : (clear_bridge_stp(br
), 0);
836 int CTL_get_bridge_state(int br_index
,
837 UID_STP_CFG_T
* cfg
, UID_STP_STATE_T
* state
)
839 LOG("bridge %d", br_index
);
843 r
= STP_IN_stpm_get_state(0, state
);
845 ERROR("Error getting bridge state for %d: %s", br_index
,
846 STP_IN_get_error_explanation(r
));
850 r
= STP_IN_stpm_get_cfg(0, cfg
);
852 ERROR("Error getting bridge config for %d: %s", br_index
,
853 STP_IN_get_error_explanation(r
));
861 int CTL_set_bridge_config(int br_index
, UID_STP_CFG_T
* cfg
)
863 INFO("bridge %d, flags %#lx", br_index
, cfg
->field_mask
);
867 r
= STP_IN_stpm_set_cfg(0, NULL
, cfg
);
869 ERROR("Error setting bridge config for %d: %s", br_index
,
870 STP_IN_get_error_explanation(r
));
875 /* Change init config in ifdata so it will be applied if we
876 disable and enable rstp */
877 update_bridge_stp_config(br
, cfg
);
881 int CTL_get_port_state(int br_index
, int port_index
,
882 UID_STP_PORT_CFG_T
* cfg
, UID_STP_PORT_STATE_T
* state
)
884 LOG("bridge %d port %d", br_index
, port_index
);
885 CTL_CHECK_BRIDGE_PORT
;
888 state
->port_no
= port
->port_index
;
889 r
= STP_IN_port_get_state(0, state
);
891 ERROR("Error getting port state for port %d, bridge %d: %s",
892 port
->port_index
, br_index
,
893 STP_IN_get_error_explanation(r
));
897 r
= STP_IN_port_get_cfg(0, port
->port_index
, cfg
);
899 ERROR("Error getting port config for port %d, bridge %d: %s",
900 port
->port_index
, br_index
,
901 STP_IN_get_error_explanation(r
));
910 int CTL_set_port_config(int br_index
, int port_index
, UID_STP_PORT_CFG_T
* cfg
)
912 INFO("bridge %d, port %d, flags %#lx", br_index
, port_index
,
914 CTL_CHECK_BRIDGE_PORT
;
917 r
= STP_IN_set_port_cfg(0, port
->port_index
, cfg
);
919 ERROR("Error setting port config for port %d, bridge %d: %s",
920 port
->port_index
, br_index
,
921 STP_IN_get_error_explanation(r
));
926 /* Change init config in ifdata so it will be applied if we
927 disable and enable rstp */
928 update_port_stp_config(port
, cfg
);
932 int CTL_set_debug_level(int level
)
934 INFO("level %d", level
);
939 #undef CTL_CHECK_BRIDGE_PORT
940 #undef CTL_CHECK_BRIDGE