netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][IP] Make use of the inline function dst_metric_locked()
@ 2008-04-30  1:18 Satoru SATOH
  2008-04-30  1:24 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Satoru SATOH @ 2008-04-30  1:18 UTC (permalink / raw)
  To: netdev

I found some parts inline function dst_metric_locked should be used but
not.
The following patch fixes these.

Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>

include/net/ip.h | 2 +-
net/ipv4/route.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/ip.h b/include/net/ip.h
index 6d7bcd5..3b40bc2 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -210,7 +210,7 @@ int ip_dont_fragment(struct sock *sk, struct
dst_entry *dst)
{
return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
(inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
- !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
+ !(dst_metric_locked(dst, RTAX_MTU))));
}

extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst,
int more);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ce25a13..2fd69b5 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1607,7 +1607,7 @@ static void rt_set_nexthop(struct rtable *rt,
struct fib_result *res, u32 itag)
sizeof(rt->u.dst.metrics));
if (fi->fib_mtu == 0) {
rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
- if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
+ if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
rt->rt_gateway != rt->rt_dst &&
rt->u.dst.dev->mtu > 576)
rt->u.dst.metrics[RTAX_MTU-1] = 576;




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][IP] Make use of the inline function dst_metric_locked()
  2008-04-30  1:18 [PATCH][IP] Make use of the inline function dst_metric_locked() Satoru SATOH
@ 2008-04-30  1:24 ` David Miller
  2008-04-30  2:53   ` Satoru SATOH
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2008-04-30  1:24 UTC (permalink / raw)
  To: satoru.satoh; +Cc: netdev

From: Satoru SATOH <satoru.satoh@gmail.com>
Date: Wed, 30 Apr 2008 10:18:45 +0900

> I found some parts inline function dst_metric_locked should be used but
> not.
> The following patch fixes these.
> 
> Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>

Your patch has been massively corrupted by your email client.

Please correct this before submitting future patches, thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][IP] Make use of the inline function dst_metric_locked()
  2008-04-30  1:24 ` David Miller
@ 2008-04-30  2:53   ` Satoru SATOH
  2008-04-30  4:10     ` Wang Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Satoru SATOH @ 2008-04-30  2:53 UTC (permalink / raw)
  To: netdev

# Resend it. I think it fixed.

I found some parts inline function dst_metric_locked should be used but
not. The following patch fixes these.

Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>

  include/net/ip.h |    2 +-
  net/ipv4/route.c |    2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/ip.h b/include/net/ip.h
index 6d7bcd5..3b40bc2 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -210,7 +210,7 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
  {
  	return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
  		(inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
-		 !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
+		 !(dst_metric_locked(dst, RTAX_MTU))));
  }

  extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index ce25a13..2fd69b5 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1607,7 +1607,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
  		       sizeof(rt->u.dst.metrics));
  		if (fi->fib_mtu == 0) {
  			rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
-			if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
+			if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
  			    rt->rt_gateway != rt->rt_dst &&
  			    rt->u.dst.dev->mtu > 576)
  				rt->u.dst.metrics[RTAX_MTU-1] = 576;


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][IP] Make use of the inline function dst_metric_locked()
  2008-04-30  2:53   ` Satoru SATOH
@ 2008-04-30  4:10     ` Wang Chen
  2008-05-05  3:44       ` Satoru SATOH
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Chen @ 2008-04-30  4:10 UTC (permalink / raw)
  To: Satoru SATOH; +Cc: netdev

Satoru SATOH said the following on 2008-4-30 10:53:
> # Resend it. I think it fixed.
> 
> I found some parts inline function dst_metric_locked should be used but
> not. The following patch fixes these.
> 
> Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
> 
>  include/net/ip.h |    2 +-
>  net/ipv4/route.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/ip.h b/include/net/ip.h
> index 6d7bcd5..3b40bc2 100644
> --- a/include/net/ip.h
> +++ b/include/net/ip.h
> @@ -210,7 +210,7 @@ int ip_dont_fragment(struct sock *sk, struct
> dst_entry *dst)
>  {
>      return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||

Still not fixed.
Your mail client converted tab to blank space.

BTW, you need to send this patch to David and cc to netdev list.

>          (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
> -         !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
> +         !(dst_metric_locked(dst, RTAX_MTU))));
>  }
> 
>  extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst,
> int more);
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index ce25a13..2fd69b5 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1607,7 +1607,7 @@ static void rt_set_nexthop(struct rtable *rt,
> struct fib_result *res, u32 itag)
>                 sizeof(rt->u.dst.metrics));
>          if (fi->fib_mtu == 0) {
>              rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
> -            if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
> +            if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
>                  rt->rt_gateway != rt->rt_dst &&
>                  rt->u.dst.dev->mtu > 576)
>                  rt->u.dst.metrics[RTAX_MTU-1] = 576;
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH][IP] Make use of the inline function dst_metric_locked()
  2008-04-30  4:10     ` Wang Chen
@ 2008-05-05  3:44       ` Satoru SATOH
  2008-05-05  5:13         ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Satoru SATOH @ 2008-05-05  3:44 UTC (permalink / raw)
  To: Wang Chen; +Cc: netdev, David Miller

[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

Thanks for your info.

I don't know the way to fix that problem, so I send it also as an
attachment to be safe.

- satoru

2008/4/30 Wang Chen <wangchen@cn.fujitsu.com>:
> Satoru SATOH said the following on 2008-4-30 10:53:
>
> > # Resend it. I think it fixed.
>  >
>  > I found some parts inline function dst_metric_locked should be used but
>  > not. The following patch fixes these.
>  >
>  > Signed-off-by: Satoru SATOH <satoru.satoh@gmail.com>
>  >
>  >  include/net/ip.h |    2 +-
>  >  net/ipv4/route.c |    2 +-
>  >  2 files changed, 2 insertions(+), 2 deletions(-)
>  >
>  > diff --git a/include/net/ip.h b/include/net/ip.h
>  > index 6d7bcd5..3b40bc2 100644
>  > --- a/include/net/ip.h
>  > +++ b/include/net/ip.h
>  > @@ -210,7 +210,7 @@ int ip_dont_fragment(struct sock *sk, struct
>  > dst_entry *dst)
>  >  {
>  >      return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
>
>  Still not fixed.
>  Your mail client converted tab to blank space.
>
>  BTW, you need to send this patch to David and cc to netdev list.
>
>
>
>  >          (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
>  > -         !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
>  > +         !(dst_metric_locked(dst, RTAX_MTU))));
>  >  }
>  >
>  >  extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst,
>  > int more);
>  > diff --git a/net/ipv4/route.c b/net/ipv4/route.c
>  > index ce25a13..2fd69b5 100644
>  > --- a/net/ipv4/route.c
>  > +++ b/net/ipv4/route.c
>  > @@ -1607,7 +1607,7 @@ static void rt_set_nexthop(struct rtable *rt,
>  > struct fib_result *res, u32 itag)
>  >                 sizeof(rt->u.dst.metrics));
>  >          if (fi->fib_mtu == 0) {
>  >              rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
>  > -            if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
>  > +            if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
>  >                  rt->rt_gateway != rt->rt_dst &&
>  >                  rt->u.dst.dev->mtu > 576)
>  >                  rt->u.dst.metrics[RTAX_MTU-1] = 576;

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: linux-net-2.6-use-dst_metric_locked.patch --]
[-- Type: text/x-patch; name=linux-net-2.6-use-dst_metric_locked.patch, Size: 1176 bytes --]

 include/net/ip.h |    2 +-
 net/ipv4/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/ip.h b/include/net/ip.h
index 6d7bcd5..3b40bc2 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -210,7 +210,7 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
 {
 	return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
 		(inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
-		 !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
+		 !(dst_metric_locked(dst, RTAX_MTU))));
 }
 
 extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5e3685c..9084055 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1613,7 +1613,7 @@ static void rt_set_nexthop(struct rtable *rt, struct fib_result *res, u32 itag)
 		       sizeof(rt->u.dst.metrics));
 		if (fi->fib_mtu == 0) {
 			rt->u.dst.metrics[RTAX_MTU-1] = rt->u.dst.dev->mtu;
-			if (rt->u.dst.metrics[RTAX_LOCK-1] & (1 << RTAX_MTU) &&
+			if (dst_metric_locked(&rt->u.dst, RTAX_MTU) &&
 			    rt->rt_gateway != rt->rt_dst &&
 			    rt->u.dst.dev->mtu > 576)
 				rt->u.dst.metrics[RTAX_MTU-1] = 576;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH][IP] Make use of the inline function dst_metric_locked()
  2008-05-05  3:44       ` Satoru SATOH
@ 2008-05-05  5:13         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2008-05-05  5:13 UTC (permalink / raw)
  To: satoru.satoh; +Cc: wangchen, netdev

From: "Satoru SATOH" <satoru.satoh@gmail.com>
Date: Mon, 5 May 2008 12:44:50 +0900

> Thanks for your info.
> 
> I don't know the way to fix that problem, so I send it also as an
> attachment to be safe.

I've applied your patch, thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-05-05  5:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30  1:18 [PATCH][IP] Make use of the inline function dst_metric_locked() Satoru SATOH
2008-04-30  1:24 ` David Miller
2008-04-30  2:53   ` Satoru SATOH
2008-04-30  4:10     ` Wang Chen
2008-05-05  3:44       ` Satoru SATOH
2008-05-05  5:13         ` David Miller

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).