All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] bridge: make brctl showstp display port id
Date: Mon, 30 Apr 2012 09:07:47 -0700	[thread overview]
Message-ID: <20120430090747.1d64198b@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <1335775148-5191-1-git-send-email-Joakim.Tjernlund@transmode.se>

On Mon, 30 Apr 2012 10:39:08 +0200
Joakim Tjernlund <Joakim.Tjernlund@transmode.se> wrote:

> My brctl showstp br0 always shows a 0 port id:
> eth2 (1)
>  port id		0			state		       disabled
>  designated root	8000.00069c00b2fb	path cost		 100
> 
> because port id is printed as a hex number in sys fs. Change the
> two hex occurrences(port no and port id) to decimal, just like all
> the other numbers in this area.
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>  net/bridge/br_sysfs_if.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
> index fd5799c..9c4c2eb 100644
> --- a/net/bridge/br_sysfs_if.c
> +++ b/net/bridge/br_sysfs_if.c
> @@ -86,13 +86,13 @@ static BRPORT_ATTR(designated_cost, S_IRUGO, show_designated_cost, NULL);
>  
>  static ssize_t show_port_id(struct net_bridge_port *p, char *buf)
>  {
> -	return sprintf(buf, "0x%x\n", p->port_id);
> +	return sprintf(buf, "%d\n", p->port_id);
>  }
>  static BRPORT_ATTR(port_id, S_IRUGO, show_port_id, NULL);
>  
>  static ssize_t show_port_no(struct net_bridge_port *p, char *buf)
>  {
> -	return sprintf(buf, "0x%x\n", p->port_no);
> +	return sprintf(buf, "%d\n", p->port_no);
>  }
>  
>  static BRPORT_ATTR(port_no, S_IRUGO, show_port_no, NULL);

No. This would be a visible change to applications.
The bridge utilities should be fixed instead.

  reply	other threads:[~2012-04-30 16:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30  8:39 [PATCH] bridge: make brctl showstp display port id Joakim Tjernlund
2012-04-30 16:07 ` Stephen Hemminger [this message]
2012-05-01 14:38   ` Joakim Tjernlund
2012-05-01 16:53     ` Stephen Hemminger
2012-05-01 17:39     ` Stephen Hemminger
2012-05-01 17:47       ` Joakim Tjernlund
2012-05-01 17:57         ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120430090747.1d64198b@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=Joakim.Tjernlund@transmode.se \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.