From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chen Gang Subject: [PATCH] net: ipv6: change %8s to %s for rt->dst.dev->name in seq_printf of rt6_info_route Date: Fri, 02 Nov 2012 20:18:47 +0800 Message-ID: <5093BA27.3090109@asianux.com> References: <50938A65.6040507@asianux.com> Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Cc: netdev To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org, yoshfuji@linux-ipv6.org, kaber@trash.net Return-path: Received: from intranet.asianux.com ([58.214.24.6]:1030 "EHLO intranet.asianux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751691Ab2KBMRw (ORCPT ); Fri, 2 Nov 2012 08:17:52 -0400 In-Reply-To: <50938A65.6040507@asianux.com> Sender: netdev-owner@vger.kernel.org List-ID: the length of rt->dst.dev->name is 16 (IFNAMSIZ) in seq_printf, it is not suitable to use %8s for rt->dst.dev->name. so change it to %s, since each line has not been solid any more. additional information: %8s limit the width, not for the original string output length if name length is more than 8, it still can be fully displayed. if name length is less than 8, the ' ' will be filled before name. %.8s truly limit the original string output length (precision) Signed-off-by: Chen Gang --- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c42650c..b60bc52 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2835,7 +2835,7 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg) } else { seq_puts(m, "00000000000000000000000000000000"); } - seq_printf(m, " %08x %08x %08x %08x %8s\n", + seq_printf(m, " %08x %08x %08x %08x %s\n", rt->rt6i_metric, atomic_read(&rt->dst.__refcnt), rt->dst.__use, rt->rt6i_flags, rt->dst.dev ? rt->dst.dev->name : ""); -- 1.7.9.5 -- Chen Gang Asianux Corporation