From 4a3c894eefe04c74017f2e1db0c474c2c450bdd6 Mon Sep 17 00:00:00 2001 From: bouyer Date: Wed, 19 Mar 2003 10:34:33 +0000 Subject: [PATCH] Fix 2 bugs: - initialise stp when the bridge is turned up, without this stp will keep all interfaces disabled in a sequence like: brconfig bridge0 add if0 add if1 stp if0 stp if1 up - s/BRDGSPRI/BRDGSIFPRIO in brconfig.c:cmd_ifpriority() add a command (ifpathcost) to change the stp path cost of the STP path cost of an interface. Display the interface path cost with the others STP parameters. --- sbin/brconfig/brconfig.8 | 8 +++++++- sbin/brconfig/brconfig.c | 27 +++++++++++++++++++++++++-- sys/net/if_bridge.c | 29 +++++++++++++++++++++++++++-- sys/net/if_bridgevar.h | 8 +++++--- 4 files changed, 64 insertions(+), 8 deletions(-) diff --git a/sbin/brconfig/brconfig.8 b/sbin/brconfig/brconfig.8 index b915a7d60090..0e350f3e4005 100644 --- a/sbin/brconfig/brconfig.8 +++ b/sbin/brconfig/brconfig.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: brconfig.8,v 1.8 2003/03/03 06:50:18 wiz Exp $ +.\" $NetBSD: brconfig.8,v 1.9 2003/03/19 10:34:33 bouyer Exp $ .\" .\" Copyright 2001 Wasabi Systems, Inc. .\" All rights reserved. @@ -197,6 +197,12 @@ to .Ar value . The default is 128. The minimum is 0 and the maximum is 255. +.It Cm ifpathcost Ar interface Ar value +Set the Spanning Tree path cost of ++.Ar interface +to +.Ar value . +The default is 55. The minimum is 0 and the maximum is 65535. .El .Sh EXAMPLES The following then placed in the file diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c index ed2de4f68c69..3dde94b177ff 100644 --- a/sbin/brconfig/brconfig.c +++ b/sbin/brconfig/brconfig.c @@ -1,4 +1,4 @@ -/* $NetBSD: brconfig.c,v 1.4 2003/02/27 19:22:36 perseant Exp $ */ +/* $NetBSD: brconfig.c,v 1.5 2003/03/19 10:34:33 bouyer Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -85,6 +85,7 @@ void cmd_fwddelay(const struct command *, int, const char *, char **); void cmd_maxage(const struct command *, int, const char *, char **); void cmd_priority(const struct command *, int, const char *, char **); void cmd_ifpriority(const struct command *, int, const char *, char **); +void cmd_ifpathcost(const struct command *, int, const char *, char **); void cmd_timeout(const struct command *, int, const char *, char **); void cmd_stp(const struct command *, int, const char *, char **); void cmd_ipf(const struct command *, int, const char *, char **); @@ -116,6 +117,7 @@ const struct command command_table[] = { { "maxage", 1, 0, cmd_maxage }, { "priority", 1, 0, cmd_priority }, { "ifpriority", 2, 0, cmd_ifpriority }, + { "ifpathcost", 2, 0, cmd_ifpathcost }, { "timeout", 1, 0, cmd_timeout }, { "stp", 1, 0, cmd_stp }, { "-stp", 1, CMD_INVERT, cmd_stp }, @@ -261,6 +263,7 @@ usage(void) " hellotime