mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Patch?: linux-2.5.45/net/ipv4/ dst.pmtu compilation fixes
@ 2002-11-01 11:16 Adam J. Richter
  2002-11-02 10:39 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Adam J. Richter @ 2002-11-01 11:16 UTC (permalink / raw)
  To: alan, slouken, kuznet; +Cc: linux-kernel

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

	linux-2.5.45 appears to have replaced dst_entry.pmtu with
dst_entry.metrics[RTAX_PMTU] and created a helper function
dst_pmtu(struct dst_entry*), presumably to simplify future changes
like this one.  Here are patches to places in three files that were
apparently missed, preventing the files from compiling.  Now the
files compile.  That is as much as I have tested.

	I am not currently familiar with this code, so I could easily
have misunderstood something in my patch.

	I would appreciate it if the appropriate maintainer(s) would
examine this patch and forward it to Linus it seems OK.  If there is
something else I should do, please let me know.

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

[-- Attachment #2: pmtu.diff --]
[-- Type: text/plain, Size: 1828 bytes --]

--- linux-2.5.45/net/ipv4/ipmr.c	2002-10-30 16:42:55.000000000 -0800
+++ linux/net/ipv4/ipmr.c	2002-10-31 02:47:37.000000000 -0800
@@ -1111,7 +1111,7 @@
 {
 	struct dst_entry *dst = skb->dst;
 
-	if (skb->len <= dst->pmtu)
+	if (skb->len <= dst_pmtu(dst))
 		return dst->output(skb);
 	else
 		return ip_fragment(skb, dst->output);
@@ -1167,7 +1167,7 @@
 
 	dev = rt->u.dst.dev;
 
-	if (skb->len+encap > rt->u.dst.pmtu && (ntohs(iph->frag_off) & IP_DF)) {
+	if (skb->len+encap > dst_pmtu(&rt->u.dst) && (ntohs(iph->frag_off) & IP_DF)) {
 		/* Do not fragment multicasts. Alas, IPv4 does not
 		   allow to send ICMP, so that packets will disappear
 		   to blackhole.
--- linux-2.5.45/net/ipv4/ip_gre.c	2002-10-30 16:43:34.000000000 -0800
+++ linux/net/ipv4/ip_gre.c	2002-11-01 03:04:16.000000000 -0800
@@ -523,11 +523,11 @@
 
 	/* change mtu on this route */
 	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
-		if (rel_info > skb2->dst->pmtu) {
+		if (rel_info > dst_pmtu(skb2->dst)) {
 			kfree_skb(skb2);
 			return;
 		}
-		skb2->dst->pmtu = rel_info;
+		skb2->dst->metrics[RTAX_PMTU] = rel_info;
 		rel_info = htonl(rel_info);
 	} else if (type == ICMP_TIME_EXCEEDED) {
 		struct ip_tunnel *t = (struct ip_tunnel*)skb2->dev->priv;
--- linux-2.5.45/net/ipv4/ipip.c	2002-10-30 16:43:48.000000000 -0800
+++ linux/net/ipv4/ipip.c	2002-11-01 03:03:45.000000000 -0800
@@ -452,11 +452,11 @@
 
 	/* change mtu on this route */
 	if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
-		if (rel_info > skb2->dst->pmtu) {
+		if (rel_info > dst_pmtu(skb2->dst)) {
 			kfree_skb(skb2);
 			return;
 		}
-		skb2->dst->pmtu = rel_info;
+		skb2->dst->metrics[RTAX_PMTU] = rel_info;
 		rel_info = htonl(rel_info);
 	} else if (type == ICMP_TIME_EXCEEDED) {
 		struct ip_tunnel *t = (struct ip_tunnel*)skb2->dev->priv;

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

* Re: Patch?: linux-2.5.45/net/ipv4/ dst.pmtu compilation fixes
  2002-11-01 11:16 Patch?: linux-2.5.45/net/ipv4/ dst.pmtu compilation fixes Adam J. Richter
@ 2002-11-02 10:39 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2002-11-02 10:39 UTC (permalink / raw)
  To: Adam J. Richter; +Cc: alan, slouken, Alexey N. Kuznetsov, linux-kernel

On Fri, 2002-11-01 at 03:16, Adam J. Richter wrote:
> 	I am not currently familiar with this code, so I could easily
> have misunderstood something in my patch.

The only mistakes is that you cannot assign to
dst->metrics[RTAX_PMTU-1], you must use
dst->ops->update_mtu() instead.

I've made this change and installed the fixes to my
tree.  Thanks.


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

end of thread, other threads:[~2002-11-02 10:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-01 11:16 Patch?: linux-2.5.45/net/ipv4/ dst.pmtu compilation fixes Adam J. Richter
2002-11-02 10:39 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®