diff mbox

[ovs-dev] rstp: Show root bridge info.

Message ID 1497927872-37025-1-git-send-email-nic@opencloud.tech
State Superseded
Headers show

Commit Message

nickcooper-zhangtonghao June 20, 2017, 3:04 a.m. UTC
When we use the 'ovs-appctl rstp/show', the root bridge
of rstp is always 'unknown root port'. We don't expect
that. The reason is that the committer added the check
for var 'p'. In the rstp, if a bridge is root bridge,
there is not root port, and we don't use the root port
'p', 'rstp/show' in the same case. If we check only rstp
root port, the root info will not shown any more.

CC: Ben Pfaff <blp@ovn.org>
Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
---
 lib/rstp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

nickcooper-zhangtonghao July 10, 2017, 4:51 a.m. UTC | #1
Who can help me to review this patch. Thanks.

> On Jun 20, 2017, at 11:04 AM, nickcooper-zhangtonghao <nic@opencloud.tech> wrote:
> 
> When we use the 'ovs-appctl rstp/show', the root bridge
> of rstp is always 'unknown root port'. We don't expect
> that. The reason is that the committer added the check
> for var 'p'. In the rstp, if a bridge is root bridge,
> there is not root port, and we don't use the root port
> 'p', 'rstp/show' in the same case. If we check only rstp
> root port, the root info will not shown any more.
> 
> CC: Ben Pfaff <blp@ovn.org>
> Signed-off-by: nickcooper-zhangtonghao <nic@opencloud.tech>
> ---
> lib/rstp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/rstp.c b/lib/rstp.c
> index 9280b3a..b30f930 100644
> --- a/lib/rstp.c
> +++ b/lib/rstp.c
> @@ -1602,7 +1602,7 @@ rstp_print_details(struct ds *ds, const struct rstp *rstp)
> 
>     bool is_root = rstp_is_root_bridge__(rstp);
>     struct rstp_port *p = rstp_get_root_port__(rstp);
> -    if (!p) {
> +    if (!is_root && !p) {
>         ds_put_cstr(ds, "unknown root port\n");
>         return;
>     }
diff mbox

Patch

diff --git a/lib/rstp.c b/lib/rstp.c
index 9280b3a..b30f930 100644
--- a/lib/rstp.c
+++ b/lib/rstp.c
@@ -1602,7 +1602,7 @@  rstp_print_details(struct ds *ds, const struct rstp *rstp)
 
     bool is_root = rstp_is_root_bridge__(rstp);
     struct rstp_port *p = rstp_get_root_port__(rstp);
-    if (!p) {
+    if (!is_root && !p) {
         ds_put_cstr(ds, "unknown root port\n");
         return;
     }