From: Chen Gang <gang.chen@asianux.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [Suggestion] net-ipv6: format %8s change to %16s in rt6_info_route function of route.c
Date: Thu, 01 Nov 2012 14:45:38 +0800 [thread overview]
Message-ID: <50921A92.8000809@asianux.com> (raw)
Hello:
1) For Public Kernel:
A) in rt6_info_route function of net/ipv6/route.c
B) the length of rt->rt6i_dev->name is 16 (IFNAMSIZ)
C) using %16s is better than %8s (it will be more "beautiful")
(also suggest to delete RT6_INFO_LEN, it is useless for ever)
2) For Red Hat RHEL5:
A) in rt6_info_route function of net/ipv6/route.c
B) the length of rt->rt6i_dev->name is 16 (IFNAMSIZ)
C) for RT6_INFO_LEN is still useful, so it is an correctness issue.
the relative patch for RHEL5 is below:
-------------------------------------------------------------------------
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 08ab51f..3c90b4c 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2285,7 +2285,7 @@ void inet6_rt_notify(int event, struct rt6_info
*rt, struct nlmsghdr *nlh,
#ifdef CONFIG_PROC_FS
-#define RT6_INFO_LEN (32 + 4 + 32 + 4 + 32 + 40 + 5 + 1)
+#define RT6_INFO_LEN (32 + 4 + 32 + 4 + 32 + 48 + 5 + 1)
struct rt6_proc_arg
{
@@ -2343,7 +2343,7 @@ static int rt6_info_route(struct rt6_info *rt,
void *p_arg)
arg->len += 32;
}
arg->len += sprintf(arg->buffer + arg->len,
- " %08x %08x %08x %08x %8s\n",
+ " %08x %08x %08x %08x %16s\n",
rt->rt6i_metric,
atomic_read(&rt->u.dst.__refcnt),
rt->u.dst.__use, rt->rt6i_flags,
rt->rt6i_dev ? rt->rt6i_dev->name : "");
----------------------------------------------------------------------------
--
Chen Gang
Asianux Corporation
next reply other threads:[~2012-11-01 6:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 6:45 Chen Gang [this message]
2012-11-01 9:01 ` [Suggestion] net-ipv6: format %8s change to %16s in rt6_info_route function of route.c Eric Dumazet
2012-11-01 10:23 ` Chen Gang
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=50921A92.8000809@asianux.com \
--to=gang.chen@asianux.com \
--cc=linux-kernel@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.