Skip to contentSkip to conversation

Make use of the inline function dst_metric_locked()

PATCH Applied Satoru SATOH 3 participants 6 messages Apr 30, 2008 – May 5, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make use of the inline function dst_metric_locked()

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

include/net/ip.h | 2 +-
net/ipv4/route.c | 2 +-

2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip.h +0 -0
index 6d7bcd5..3b40bc2 100644
@@ -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);

net/ipv4/route.c +0 -0
index ce25a13..2fd69b5 100644
@@ -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;

maintainer
#1 lore raw

From: Satoru SATOH <[email protected]>
Date: Wed, 30 Apr 2008 10:18:45 +0900

Quoted 5 lines

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

Your patch has been massively corrupted by your email client.

Please correct this before submitting future patches, thank you.

#2 lore raw

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

 include/net/ip.h |    2 +-
 net/ipv4/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip.h +1 -1
index 6d7bcd5..3b40bc2 100644
@@ -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);
net/ipv4/route.c +1 -1
index ce25a13..2fd69b5 100644
@@ -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;
#3 lore raw

Satoru SATOH said the following on 2008-4-30 10:53:

Quoted 16 lines

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

 include/net/ip.h |    2 +-
 net/ipv4/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip.h +0 -0
index 6d7bcd5..3b40bc2 100644

include/net/ip.h int ip_dont_fragment(struct sock *sk, struct · line 212

Quoted 3 lines
include/net/ip.h +0 -0
@@ -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.

Quoted 22 lines
include/net/ip.h +1 -1
         (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);

net/ipv4/route.c +1 -1
index ce25a13..2fd69b5 100644
@@ -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;
#4 lore raw

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 <[email protected]>:

Quoted 34 lines

Satoru SATOH said the following on 2008-4-30 10:53:

Quoted 16 lines

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

 include/net/ip.h |    2 +-
 net/ipv4/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip.h +0 -0
index 6d7bcd5..3b40bc2 100644

include/net/ip.h int ip_dont_fragment(struct sock *sk, struct · line 212

Quoted 3 lines
include/net/ip.h +0 -0
@@ -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.

Quoted 5 lines
include/net/ip.h +1 -1
         (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
-         !(dst_metric(dst, RTAX_LOCK)&(1<<RTAX_MTU))));
+         !(dst_metric_locked(dst, RTAX_MTU))));
 }
 
Quoted 16 lines
Quoted 15 lines

extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst,
int more);

net/ipv4/route.c +1 -1
index ce25a13..2fd69b5 100644
@@ -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)
Quoted 1 line
                 rt->u.dst.metrics[RTAX_MTU-1] = 576;
 include/net/ip.h |    2 +-
 net/ipv4/route.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/ip.h +1 -1
index 6d7bcd5..3b40bc2 100644
@@ -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);
net/ipv4/route.c +1 -1
index 5e3685c..9084055 100644
@@ -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;
maintainer Applied
#5 lore raw

From: "Satoru SATOH" <[email protected]>
Date: Mon, 5 May 2008 12:44:50 +0900

Quoted 4 lines

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.