diff -u /home/syrinx/p4_projects/rstp/sys/net/bridgestp.c sht_rstp/bridgestp.c --- /home/syrinx/p4_projects/rstp/sys/net/bridgestp.c Fri Nov 24 19:35:27 2006 +++ sht_rstp/bridgestp.c Fri Nov 24 21:06:20 2006 @@ -1653,7 +1653,10 @@ struct bstp_state *bs = bp->bp_bs; BSTP_LOCK(bs); - bp->bp_operedge = set; + if ((bp->bp_operedge = set) == 0) + bp->bp_flags &= ~BSTP_PORT_ADMEDGE; + else + bp->bp_flags |= BSTP_PORT_ADMEDGE; BSTP_UNLOCK(bs); return (0); } @@ -1825,8 +1828,12 @@ if (bp->bp_role == BSTP_ROLE_DISABLED) bstp_enable_port(bs, bp); } else { - if (bp->bp_role != BSTP_ROLE_DISABLED) + if (bp->bp_role != BSTP_ROLE_DISABLED) { bstp_disable_port(bs, bp); + if ((bp->bp_flags & BSTP_PORT_ADMEDGE) && + bp->bp_protover == BSTP_PROTO_RSTP) + bp->bp_operedge = 1; + } } return; } diff -u /home/syrinx/p4_projects/rstp/sys/net/bridgestp.h sht_rstp/bridgestp.h --- /home/syrinx/p4_projects/rstp/sys/net/bridgestp.h Fri Nov 24 19:35:27 2006 +++ sht_rstp/bridgestp.h Fri Nov 24 21:06:42 2006 @@ -109,6 +109,7 @@ #define BSTP_PORT_ADMCOST 0x0008 #define BSTP_PORT_AUTOEDGE 0x0010 #define BSTP_PORT_AUTOP2P 0x0020 +#define BSTP_PORT_ADMEDGE 0x0040 /* BPDU priority */ #define BSTP_PDU_SUPERIOR 1 diff -u /home/syrinx/p4_projects/rstp/sys/net/if_bridge.c sht_rstp/if_bridge.c --- /home/syrinx/p4_projects/rstp/sys/net/if_bridge.c Fri Nov 24 19:35:27 2006 +++ sht_rstp/if_bridge.c Tue Nov 28 17:52:02 2006 @@ -1024,6 +1024,10 @@ req->ifbr_ifsflags |= IFBIF_BSTP_P2P; if (bp->bp_flags & BSTP_PORT_AUTOP2P) req->ifbr_ifsflags |= IFBIF_BSTP_AUTOP2P; + if (bp->bp_flags & BSTP_PORT_ADMEDGE) + req->ifbr_ifsflags |= IFBIF_BSTP_ADMEDGE; + if (bp->bp_flags & BSTP_PORT_ADMCOST) + req->ifbr_ifsflags |= IFBIF_BSTP_ADMCOST; return (0); } diff -u /home/syrinx/p4_projects/rstp/sys/net/if_bridgevar.h sht_rstp/if_bridgevar.h --- /home/syrinx/p4_projects/rstp/sys/net/if_bridgevar.h Fri Nov 24 19:35:27 2006 +++ sht_rstp/if_bridgevar.h Fri Nov 24 21:59:57 2006 @@ -140,11 +140,14 @@ #define IFBIF_BSTP_AUTOEDGE 0x0040 /* member stp autoedge enabled */ #define IFBIF_BSTP_P2P 0x0080 /* member stp p2p */ #define IFBIF_BSTP_AUTOP2P 0x0100 /* member stp autop2p enabled */ +#define IFBIF_BSTP_ADMEDGE 0x0200 /* member stp admin edge enabled */ +#define IFBIF_BSTP_ADMCOST 0x0400 /* member stp admin path cost */ #define IFBIFBITS "\020\001LEARNING\002DISCOVER\003STP\004SPAN" \ "\005STICKY\006EDGE\007AUTOEDGE\010P2P\011AUTOP2P" #define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_P2P| \ - IFBIF_BSTP_AUTOP2P) /* not saved */ + IFBIF_BSTP_AUTOP2P|IFBIF_BSTP_ADMEDGE| \ + IFBIF_BSTP_ADMCOST) /* not saved */ /* BRDGFLUSH */ #define IFBF_FLUSHDYN 0x00 /* flush learned addresses only */