Skip to contentSkip to conversation

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

PATCH Adam J. Richter 2 participants 2 messages Nov 1, 2002 – Nov 2, 2002

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

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.

Signature · 4 lines
Adam J. Richter     __     ______________   575 Oroville Road
[email protected]     \ /                  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."
net/ipv4/ipmr.c +2 -2
@@ -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.
net/ipv4/ip_gre.c +2 -2
@@ -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;
net/ipv4/ipip.c +2 -2
@@ -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;
#1 lore raw
Quoted 2 lines · Adam J. Richter

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.