On 30/04/19(Tue) 14:45, Hrvoje Popovski wrote:
> Hi all,
> 
> if i have bridge with rstp on interfaces and rstp on switch and i want
> to disable rstp on openbsd interfaces i'm getting fault trap. I can
> reproduce it on 6.4 and on -current.
> i can't reproduce it if i don't have rstp on switch.

Seems that `bs_root_port' isn't reset.  Does the diff below help?

Index: net/bridgestp.c
===================================================================
RCS file: /cvs/src/sys/net/bridgestp.c,v
retrieving revision 1.69
diff -u -p -r1.69 bridgestp.c
--- net/bridgestp.c     28 Apr 2019 22:15:57 -0000      1.69
+++ net/bridgestp.c     30 Apr 2019 21:39:25 -0000
@@ -252,6 +252,7 @@ void        bstp_set_port_proto(struct bstp_por
 void   bstp_set_port_tc(struct bstp_port *, int);
 void   bstp_set_timer_tc(struct bstp_port *);
 void   bstp_set_timer_msgage(struct bstp_port *);
+void   bstp_reset(struct bstp_state *);
 int    bstp_rerooted(struct bstp_state *, struct bstp_port *);
 u_int32_t      bstp_calc_path_cost(struct bstp_port *);
 void   bstp_notify_rtage(struct bstp_port *, int);
@@ -874,11 +875,8 @@ bstp_info_superior(struct bstp_pri_vecto
 }
 
 void
-bstp_assign_roles(struct bstp_state *bs)
+bstp_reset(struct bstp_state *bs)
 {
-       struct bstp_port *bp, *rbp = NULL;
-       struct bstp_pri_vector pv;
-
        /* default to our priority vector */
        bs->bs_root_pv = bs->bs_bridge_pv;
        bs->bs_root_msg_age = 0;
@@ -886,6 +884,15 @@ bstp_assign_roles(struct bstp_state *bs)
        bs->bs_root_fdelay = bs->bs_bridge_fdelay;
        bs->bs_root_htime = bs->bs_bridge_htime;
        bs->bs_root_port = NULL;
+}
+
+void
+bstp_assign_roles(struct bstp_state *bs)
+{
+       struct bstp_port *bp, *rbp = NULL;
+       struct bstp_pri_vector pv;
+
+       bstp_reset(bs);
 
        /* check if any received info supersedes us */
        LIST_FOREACH(bp, &bs->bs_bplist, bp_next) {
@@ -1838,6 +1845,7 @@ bstp_initialization(struct bstp_state *b
 
        if (LIST_EMPTY(&bs->bs_bplist)) {
                bstp_stop(bs);
+               bstp_reset(bs);
                return;
        }
 

Reply via email to