Patch?: linux-2.5.45/net/ipv4/ dst.pmtu compilation fixes

Adam J. Richter (adam@yggdrasil.com)
Fri, 1 Nov 2002 03:16:38 -0800


--bg08WKrSYDhXBjb5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pmtu.diff"

--- 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;

--bg08WKrSYDhXBjb5-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/