* [PATCH -next] neigh: remove the extra slash
@ 2020-10-23 10:01 Zhang Qilong
2020-10-23 10:16 ` Vasily Averin
0 siblings, 1 reply; 4+ messages in thread
From: Zhang Qilong @ 2020-10-23 10:01 UTC (permalink / raw)
To: davem, kuba; +Cc: vvs, lirongqing, roopa, netdev
The normal path has only one slash.
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
net/core/neighbour.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 8e39e28b0a8d..503501842a7d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -3623,7 +3623,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
int i;
struct neigh_sysctl_table *t;
const char *dev_name_source;
- char neigh_path[ sizeof("net//neigh/") + IFNAMSIZ + IFNAMSIZ ];
+ char neigh_path[sizeof("net/neigh/") + IFNAMSIZ + IFNAMSIZ];
char *p_name;
t = kmemdup(&neigh_sysctl_template, sizeof(*t), GFP_KERNEL);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH -next] neigh: remove the extra slash
2020-10-23 10:01 [PATCH -next] neigh: remove the extra slash Zhang Qilong
@ 2020-10-23 10:16 ` Vasily Averin
2020-10-25 2:27 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Vasily Averin @ 2020-10-23 10:16 UTC (permalink / raw)
To: Zhang Qilong, davem, kuba; +Cc: lirongqing, roopa, netdev
On 10/23/20 1:01 PM, Zhang Qilong wrote:
> The normal path has only one slash.
it is not normal path
this string is used to calculate number of symbols in "net/%s/neigh/%s" used below
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> ---
> net/core/neighbour.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index 8e39e28b0a8d..503501842a7d 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -3623,7 +3623,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
> int i;
> struct neigh_sysctl_table *t;
> const char *dev_name_source;
> - char neigh_path[ sizeof("net//neigh/") + IFNAMSIZ + IFNAMSIZ ];
> + char neigh_path[sizeof("net/neigh/") + IFNAMSIZ + IFNAMSIZ];
> char *p_name;
>
> t = kmemdup(&neigh_sysctl_template, sizeof(*t), GFP_KERNEL);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next] neigh: remove the extra slash
2020-10-23 10:16 ` Vasily Averin
@ 2020-10-25 2:27 ` Joe Perches
2020-10-26 2:20 ` 答复: " zhangqilong
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2020-10-25 2:27 UTC (permalink / raw)
To: Vasily Averin, Zhang Qilong, davem, kuba; +Cc: lirongqing, roopa, netdev
On Fri, 2020-10-23 at 13:16 +0300, Vasily Averin wrote:
> On 10/23/20 1:01 PM, Zhang Qilong wrote:
> > The normal path has only one slash.
>
> it is not normal path
> this string is used to calculate number of symbols in "net/%s/neigh/%s" used below
Then probably better would be to add +1 rather than
use a rather odd filename.
> > diff --git a/net/core/neighbour.c b/net/core/neighbour.c
[]
> > @@ -3623,7 +3623,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
> > int i;
> > struct neigh_sysctl_table *t;
> > const char *dev_name_source;
> > - char neigh_path[ sizeof("net//neigh/") + IFNAMSIZ + IFNAMSIZ ];
> > + char neigh_path[sizeof("net/neigh/") + IFNAMSIZ + IFNAMSIZ];
> > char *p_name;
> >
> >
> > t = kmemdup(&neigh_sysctl_template, sizeof(*t), GFP_KERNEL);
> >
^ permalink raw reply [flat|nested] 4+ messages in thread
* 答复: [PATCH -next] neigh: remove the extra slash
2020-10-25 2:27 ` Joe Perches
@ 2020-10-26 2:20 ` zhangqilong
0 siblings, 0 replies; 4+ messages in thread
From: zhangqilong @ 2020-10-26 2:20 UTC (permalink / raw)
To: Joe Perches, Vasily Averin, davem, kuba; +Cc: lirongqing, roopa, netdev
> On Fri, 2020-10-23 at 13:16 +0300, Vasily Averin wrote:
> > On 10/23/20 1:01 PM, Zhang Qilong wrote:
> > > The normal path has only one slash.
> >
> > it is not normal path
> > this string is used to calculate number of symbols in
> > "net/%s/neigh/%s" used below
>
> Then probably better would be to add +1 rather than use a rather odd filename.
Hi, Joe
I use the splicing method to rewrite it in patch V2 [0001-neigh-Adjustment-calculation-method-of-neighbour-pat.patch], I think it will be clearer. Looking forward to your reply.
Thanks, best wish to you.
Zhang Qilong
>
> > > diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> []
> > > @@ -3623,7 +3623,7 @@ int neigh_sysctl_register(struct net_device *dev,
> struct neigh_parms *p,
> > > int i;
> > > struct neigh_sysctl_table *t;
> > > const char *dev_name_source;
> > > - char neigh_path[ sizeof("net//neigh/") + IFNAMSIZ + IFNAMSIZ ];
> > > + char neigh_path[sizeof("net/neigh/") + IFNAMSIZ + IFNAMSIZ];
> > > char *p_name;
> > >
> > >
> > > t = kmemdup(&neigh_sysctl_template, sizeof(*t), GFP_KERNEL);
> > >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-10-26 2:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 10:01 [PATCH -next] neigh: remove the extra slash Zhang Qilong
2020-10-23 10:16 ` Vasily Averin
2020-10-25 2:27 ` Joe Perches
2020-10-26 2:20 ` 答复: " zhangqilong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).