Skip to contentSkip to conversation

ipv4: Maintain redirect and PMTU info in struct rtable again.

PATCH In review David Miller 2 participants 2 messages Jul 10, 2012 – Jul 17, 2012

Subsystems (4)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 12/16 ipv4: Maintain redirect and PMTU info in struct rtable again.

Maintaining this in the inetpeer entries was not the right way to do this at all.

---
 include/net/inetpeer.h  |    4 -
 include/net/route.h     |    2 +-
 net/ipv4/inetpeer.c     |    3 -
 net/ipv4/route.c        |  185 ++++++++++-------------------------------------
 net/ipv4/xfrm4_policy.c |    1 +
 5 files changed, 41 insertions(+), 154 deletions(-)
include/net/inetpeer.h +0 -4
index 1119f6f..53f464d 100644
@@ -36,10 +36,6 @@ struct inet_peer {
 	u32			metrics[RTAX_MAX];
 	u32			rate_tokens;	/* rate limiting for ICMP */
 	unsigned long		rate_last;
-	unsigned long		pmtu_expires;
-	u32			pmtu_orig;
-	u32			pmtu_learned;
-	struct inetpeer_addr_base redirect_learned;
 	union {
 		struct list_head	gc_list;
 		struct rcu_head     gc_rcu;
include/net/route.h +1 -1
index 635d7a9..c274494 100644
@@ -65,7 +65,7 @@ struct rtable {
 	__be32			rt_gateway;
 
 	/* Miscellaneous cached information */
-	u32			rt_peer_genid;
+	u32			rt_pmtu;
 	unsigned long		_peer; /* long-living peer info */
 	struct fib_info		*fi; /* for client ref to shared metrics */
 };
net/ipv4/inetpeer.c +0 -3
index f457bcb..e1e0a4e 100644
@@ -511,9 +511,6 @@ relookup:
 		p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
 		p->rate_tokens = 0;
 		p->rate_last = 0;
-		p->pmtu_expires = 0;
-		p->pmtu_orig = 0;
-		memset(&p->redirect_learned, 0, sizeof(p->redirect_learned));
 		INIT_LIST_HEAD(&p->gc_list);
 
 		/* Link the node. */
net/ipv4/route.c +39 -146

344 lines not on this page · raw message

net/ipv4/xfrm4_policy.c +1 -0
index 9815ea0..951bcf3 100644
@@ -100,6 +100,7 @@ static int xfrm4_fill_dst(struct xfrm_dst *xdst, struct net_device *dev,
 	xdst->u.rt.rt_src = rt->rt_src;
 	xdst->u.rt.rt_dst = rt->rt_dst;
 	xdst->u.rt.rt_gateway = rt->rt_gateway;
+	xdst->u.rt.rt_pmtu = rt->rt_pmtu;
 
 	return 0;
 }
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 4 lines · David Miller

Maintaining this in the inetpeer entries was not the right way to do this at all.

This patch makes it possible to have the same address assigned to a tunnel interface and its lower device, whereas previously that would lead to mtu problems because both routes shared the same pmtu info in the inet_peer.

ex: gre1 192.168.1.2/32 over eth0 192.168.1.2/24

Is such a wicked configuration supported?