patch-2.3.37 linux/include/net/route.h

Next file: linux/init/main.c
Previous file: linux/include/net/ip.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.36/linux/include/net/route.h linux/include/net/route.h
@@ -25,6 +25,7 @@
 
 #include <linux/config.h>
 #include <net/dst.h>
+#include <net/inetpeer.h>
 #include <linux/in_route.h>
 #include <linux/rtnetlink.h>
 #include <linux/route.h>
@@ -53,6 +54,7 @@
 	__u8			scope;
 };
 
+struct inet_peer;
 struct rtable
 {
 	union
@@ -76,6 +78,7 @@
 
 	/* Miscellaneous cached information */
 	__u32			rt_spec_dst; /* RFC1122 specific destination */
+	struct inet_peer	*peer; /* long-living peer info */
 
 #ifdef CONFIG_IP_ROUTE_NAT
 	__u32			rt_src_map;
@@ -136,6 +139,17 @@
 	ip_rt_put(*rp);
 	*rp = NULL;
 	return ip_route_output(rp, dst, src, tos, oif);
+}
+
+extern void rt_bind_peer(struct rtable *rt, int create);
+
+extern __inline__ struct inet_peer *rt_get_peer(struct rtable *rt)
+{
+	if (rt->peer)
+		return rt->peer;
+
+	rt_bind_peer(rt, 0);
+	return rt->peer;
 }
 
 #endif	/* _ROUTE_H */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)