diff --git a/sbin/ifconfig/ifbridge.c b/sbin/ifconfig/ifbridge.c index a4cf86162751..4fa617557828 100644 --- a/sbin/ifconfig/ifbridge.c +++ b/sbin/ifconfig/ifbridge.c @@ -413,27 +413,27 @@ unsetbridge_autoedge(const char *val, int d, int s, const struct afswtch *afp) } static void -setbridge_p2p(const char *val, int d, int s, const struct afswtch *afp) +setbridge_ptp(const char *val, int d, int s, const struct afswtch *afp) { - do_bridgeflag(s, val, IFBIF_BSTP_P2P, 1); + do_bridgeflag(s, val, IFBIF_BSTP_PTP, 1); } static void -unsetbridge_p2p(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_ptp(const char *val, int d, int s, const struct afswtch *afp) { - do_bridgeflag(s, val, IFBIF_BSTP_P2P, 0); + do_bridgeflag(s, val, IFBIF_BSTP_PTP, 0); } static void -setbridge_autop2p(const char *val, int d, int s, const struct afswtch *afp) +setbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOP2P, 1); + do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 1); } static void -unsetbridge_autop2p(const char *val, int d, int s, const struct afswtch *afp) +unsetbridge_autoptp(const char *val, int d, int s, const struct afswtch *afp) { - do_bridgeflag(s, val, IFBIF_BSTP_AUTOP2P, 0); + do_bridgeflag(s, val, IFBIF_BSTP_AUTOPTP, 0); } static void @@ -681,10 +681,10 @@ static struct cmd bridge_cmds[] = { DEF_CMD_ARG("-edge", unsetbridge_edge), DEF_CMD_ARG("autoedge", setbridge_autoedge), DEF_CMD_ARG("-autoedge", unsetbridge_autoedge), - DEF_CMD_ARG("p2p", setbridge_p2p), - DEF_CMD_ARG("-p2p", unsetbridge_p2p), - DEF_CMD_ARG("autop2p", setbridge_autop2p), - DEF_CMD_ARG("-autop2p", unsetbridge_autop2p), + DEF_CMD_ARG("ptp", setbridge_ptp), + DEF_CMD_ARG("-ptp", unsetbridge_ptp), + DEF_CMD_ARG("autoptp", setbridge_autoptp), + DEF_CMD_ARG("-autoptp", unsetbridge_autoptp), DEF_CMD("flush", 0, setbridge_flush), DEF_CMD("flushall", 0, setbridge_flushall), DEF_CMD_ARG2("static", setbridge_static), diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 39969c48d615..73099657dac1 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1296,24 +1296,24 @@ This is the default for all interfaces added to a bridge. .It Cm -autoedge Ar interface Disable automatic edge status on .Ar interface . -.It Cm p2p Ar interface +.It Cm ptp Ar interface Set the .Ar interface as a point to point link. This is required for straight transitions to forwarding and should be enabled on a direct link to another RSTP capable switch. -.It Cm -p2p Ar interface +.It Cm -ptp Ar interface Disable point to point link status on .Ar interface . This should be disabled for a half duplex link and for an interface connected to a shared network segment, like a hub or a wireless network. -.It Cm autop2p Ar interface +.It Cm autoptp Ar interface Automatically detect the point to point status on .Ar interface by checking the full duplex link status. This is the default for interfaces added to the bridge. -.It Cm -autop2p Ar interface +.It Cm -autoptp Ar interface Disable automatic point to point link detection on .Ar interface . .It Cm maxage Ar seconds diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index dfc59b585eb7..87b95748bef9 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -661,7 +661,7 @@ bstp_received_bpdu(struct bstp_state *bs, struct bstp_port *bp, * only point to point links are allowed fast * transitions to forwarding. */ - if (cu->cu_agree && bp->bp_p2p_link) { + if (cu->cu_agree && bp->bp_ptp_link) { bp->bp_agreed = 1; bp->bp_proposing = 0; } else @@ -1036,7 +1036,7 @@ bstp_update_roles(struct bstp_state *bs, struct bstp_port *bp) bp->bp_proposing = 1; bp->bp_flags |= BSTP_PORT_NEWINFO; bstp_timer_start(&bp->bp_edge_delay_timer, - (bp->bp_p2p_link ? BSTP_DEFAULT_MIGRATE_DELAY : + (bp->bp_ptp_link ? BSTP_DEFAULT_MIGRATE_DELAY : bp->bp_desg_max_age)); DPRINTF("%s -> DESIGNATED_PROPOSE\n", bp->bp_ifp->if_xname); @@ -1663,27 +1663,27 @@ bstp_set_autoedge(struct bstp_port *bp, int set) } int -bstp_set_p2p(struct bstp_port *bp, int set) +bstp_set_ptp(struct bstp_port *bp, int set) { struct bstp_state *bs = bp->bp_bs; BSTP_LOCK(bs); - bp->bp_p2p_link = set; + bp->bp_ptp_link = set; BSTP_UNLOCK(bs); return (0); } int -bstp_set_autop2p(struct bstp_port *bp, int set) +bstp_set_autoptp(struct bstp_port *bp, int set) { struct bstp_state *bs = bp->bp_bs; BSTP_LOCK(bs); if (set) { - bp->bp_flags |= BSTP_PORT_AUTOP2P; + bp->bp_flags |= BSTP_PORT_AUTOPTP; bstp_ifupdstatus(bs, bp); } else - bp->bp_flags &= ~BSTP_PORT_AUTOP2P; + bp->bp_flags &= ~BSTP_PORT_AUTOPTP; BSTP_UNLOCK(bs); return (0); } @@ -1804,8 +1804,8 @@ bstp_ifupdstatus(struct bstp_state *bs, struct bstp_port *bp) if ((error == 0) && (ifp->if_flags & IFF_UP)) { if (ifmr.ifm_status & IFM_ACTIVE) { /* A full-duplex link is assumed to be point to point */ - if (bp->bp_flags & BSTP_PORT_AUTOP2P) { - bp->bp_p2p_link = + if (bp->bp_flags & BSTP_PORT_AUTOPTP) { + bp->bp_ptp_link = ifmr.ifm_active & IFM_FDX ? 1 : 0; } @@ -2163,7 +2163,7 @@ bstp_create(struct bstp_state *bs, struct bstp_port *bp, struct ifnet *ifp) /* Init state */ bp->bp_infois = BSTP_INFO_DISABLED; - bp->bp_flags = BSTP_PORT_AUTOEDGE|BSTP_PORT_AUTOP2P; + bp->bp_flags = BSTP_PORT_AUTOEDGE|BSTP_PORT_AUTOPTP; bstp_set_port_state(bp, BSTP_IFSTATE_DISCARDING); bstp_set_port_proto(bp, bs->bs_protover); bstp_set_port_role(bp, BSTP_ROLE_DISABLED); diff --git a/sys/net/bridgestp.h b/sys/net/bridgestp.h index 025b8f49437a..8bd7319f03d6 100644 --- a/sys/net/bridgestp.h +++ b/sys/net/bridgestp.h @@ -108,7 +108,7 @@ #define BSTP_PORT_DISPUTED 0x0004 #define BSTP_PORT_ADMCOST 0x0008 #define BSTP_PORT_AUTOEDGE 0x0010 -#define BSTP_PORT_AUTOP2P 0x0020 +#define BSTP_PORT_AUTOPTP 0x0020 #define BSTP_PORT_ADMEDGE 0x0040 /* BPDU priority */ @@ -305,7 +305,7 @@ struct bstp_port { uint8_t bp_tc_prop; uint8_t bp_fdbflush; uint8_t bp_priority; - uint8_t bp_p2p_link; + uint8_t bp_ptp_link; uint8_t bp_agree; uint8_t bp_agreed; uint8_t bp_sync; @@ -384,8 +384,8 @@ int bstp_set_port_priority(struct bstp_port *, int); int bstp_set_path_cost(struct bstp_port *, uint32_t); int bstp_set_edge(struct bstp_port *, int); int bstp_set_autoedge(struct bstp_port *, int); -int bstp_set_p2p(struct bstp_port *, int); -int bstp_set_autop2p(struct bstp_port *, int); +int bstp_set_ptp(struct bstp_port *, int); +int bstp_set_autoptp(struct bstp_port *, int); struct mbuf *bstp_input(struct bstp_port *, struct ifnet *, struct mbuf *); #endif /* _KERNEL */ diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 28d4561589c6..359d7ddf17c6 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1020,10 +1020,10 @@ bridge_ioctl_gifflags(struct bridge_softc *sc, void *arg) req->ifbr_ifsflags |= IFBIF_BSTP_EDGE; if (bp->bp_flags & BSTP_PORT_AUTOEDGE) req->ifbr_ifsflags |= IFBIF_BSTP_AUTOEDGE; - if (bp->bp_p2p_link) - req->ifbr_ifsflags |= IFBIF_BSTP_P2P; - if (bp->bp_flags & BSTP_PORT_AUTOP2P) - req->ifbr_ifsflags |= IFBIF_BSTP_AUTOP2P; + if (bp->bp_ptp_link) + req->ifbr_ifsflags |= IFBIF_BSTP_PTP; + if (bp->bp_flags & BSTP_PORT_AUTOPTP) + req->ifbr_ifsflags |= IFBIF_BSTP_AUTOPTP; if (bp->bp_flags & BSTP_PORT_ADMEDGE) req->ifbr_ifsflags |= IFBIF_BSTP_ADMEDGE; if (bp->bp_flags & BSTP_PORT_ADMCOST) @@ -1062,8 +1062,8 @@ bridge_ioctl_sifflags(struct bridge_softc *sc, void *arg) /* Pass on STP flags */ bstp_set_edge(bp, req->ifbr_ifsflags & IFBIF_BSTP_EDGE ? 1 : 0); bstp_set_autoedge(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOEDGE ? 1 : 0); - bstp_set_p2p(bp, req->ifbr_ifsflags & IFBIF_BSTP_P2P ? 1 : 0); - bstp_set_autop2p(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOP2P ? 1 : 0); + bstp_set_ptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_PTP ? 1 : 0); + bstp_set_autoptp(bp, req->ifbr_ifsflags & IFBIF_BSTP_AUTOPTP ? 1 : 0); /* Save the bits relating to the bridge */ bif->bif_flags = req->ifbr_ifsflags & IFBIFMASK; diff --git a/sys/net/if_bridgevar.h b/sys/net/if_bridgevar.h index 2096eaa9ac85..ae33688a00da 100644 --- a/sys/net/if_bridgevar.h +++ b/sys/net/if_bridgevar.h @@ -138,15 +138,15 @@ struct ifbreq { #define IFBIF_STICKY 0x0010 /* if learned addresses stick */ #define IFBIF_BSTP_EDGE 0x0020 /* member stp edge port */ #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_PTP 0x0080 /* member stp point to point */ +#define IFBIF_BSTP_AUTOPTP 0x0100 /* member stp autoptp 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|IFBIF_BSTP_ADMEDGE| \ + "\005STICKY\006EDGE\007AUTOEDGE\010PTP\011AUTOPTP" +#define IFBIFMASK ~(IFBIF_BSTP_EDGE|IFBIF_BSTP_AUTOEDGE|IFBIF_BSTP_PTP| \ + IFBIF_BSTP_AUTOPTP|IFBIF_BSTP_ADMEDGE| \ IFBIF_BSTP_ADMCOST) /* not saved */ /* BRDGFLUSH */