summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2003-11-20 19:47:31 +0000
committerandre <andre@FreeBSD.org>2003-11-20 19:47:31 +0000
commit6dca20de0718f19b3cdc5a7d5ebb71cd54b2374e (patch)
treec25b99029c9fbe87aa9d11209da4550fbc910838 /sys/net
parent529995603c4d5d287b1446c3bde04f20544e7640 (diff)
downloadFreeBSD-src-6dca20de0718f19b3cdc5a7d5ebb71cd54b2374e.zip
FreeBSD-src-6dca20de0718f19b3cdc5a7d5ebb71cd54b2374e.tar.gz
Remove RTF_PRCLONING from routing table and adjust users of it
accordingly. The define is left intact for ABI compatibility with userland. This is a pre-step for the introduction of tcp_hostcache. The network stack remains fully useable with this change. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c27
-rw-r--r--sys/net/route.h6
2 files changed, 19 insertions, 14 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 648fa32..b625e7a 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -139,7 +139,7 @@ rtalloc1(struct sockaddr *dst, int report, u_long ignflags)
*/
newrt = rt = (struct rtentry *)rn;
nflags = rt->rt_flags & ~ignflags;
- if (report && (nflags & (RTF_CLONING | RTF_PRCLONING))) {
+ if (report && (nflags & RTF_CLONING)) {
/*
* We are apparently adding (report = 0 in delete).
* If it requires that it be cloned, do so.
@@ -584,7 +584,7 @@ rtexpunge(struct rtentry *rt)
* Now search what's left of the subtree for any cloned
* routes which might have been formed from this node.
*/
- if ((rt->rt_flags & (RTF_CLONING | RTF_PRCLONING)) && rt_mask(rt))
+ if ((rt->rt_flags & RTF_CLONING) && rt_mask(rt))
rnh->rnh_walktree_from(rnh, rt_key(rt), rt_mask(rt),
rt_fixdelete, rt);
@@ -647,7 +647,7 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt)
*/
if (flags & RTF_HOST) {
netmask = 0;
- flags &= ~(RTF_CLONING | RTF_PRCLONING);
+ flags &= ~RTF_CLONING;
}
switch (req) {
case RTM_DELETE:
@@ -669,7 +669,7 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt)
* Now search what's left of the subtree for any cloned
* routes which might have been formed from this node.
*/
- if ((rt->rt_flags & (RTF_CLONING | RTF_PRCLONING)) &&
+ if ((rt->rt_flags & RTF_CLONING) &&
rt_mask(rt)) {
rnh->rnh_walktree_from(rnh, dst, rt_mask(rt),
rt_fixdelete, rt);
@@ -716,7 +716,7 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt)
ifa = rt->rt_ifa;
/* XXX locking? */
flags = rt->rt_flags &
- ~(RTF_CLONING | RTF_PRCLONING | RTF_STATIC);
+ ~(RTF_CLONING | RTF_STATIC);
flags |= RTF_WASCLONED;
gateway = rt->rt_gateway;
if ((netmask = rt->rt_genmask) == 0)
@@ -777,11 +777,11 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt)
/*
* Uh-oh, we already have one of these in the tree.
* We do a special hack: if the route that's already
- * there was generated by the protocol-cloning
- * mechanism, then we just blow it away and retry
- * the insertion of the new one.
+ * there was generated by the cloning mechanism
+ * then we just blow it away and retry the insertion
+ * of the new one.
*/
- rt2 = rtalloc1(dst, 0, RTF_PRCLONING);
+ rt2 = rtalloc1(dst, 0, 0);
if (rt2 && rt2->rt_parent) {
rtexpunge(rt2);
RT_UNLOCK(rt2);
@@ -820,7 +820,7 @@ rtrequest1(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt)
("no route to clone from"));
rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
rt->rt_rmx.rmx_pksent = 0; /* reset packet counter */
- if ((*ret_nrt)->rt_flags & (RTF_CLONING | RTF_PRCLONING)) {
+ if ((*ret_nrt)->rt_flags & RTF_CLONING) {
/*
* NB: We do not bump the refcnt on the parent
* entry under the assumption that it will
@@ -896,7 +896,7 @@ rt_fixdelete(struct radix_node *rn, void *vp)
struct rtentry *rt0 = vp;
if (rt->rt_parent == rt0 &&
- !(rt->rt_flags & (RTF_PINNED | RTF_CLONING | RTF_PRCLONING))) {
+ !(rt->rt_flags & (RTF_PINNED | RTF_CLONING))) {
return rtrequest(RTM_DELETE, rt_key(rt),
(struct sockaddr *)0, rt_mask(rt),
rt->rt_flags, (struct rtentry **)0);
@@ -937,7 +937,7 @@ rt_fixchange(struct radix_node *rn, void *vp)
#endif
if (!rt->rt_parent ||
- (rt->rt_flags & (RTF_PINNED | RTF_CLONING | RTF_PRCLONING))) {
+ (rt->rt_flags & (RTF_PINNED | RTF_CLONING))) {
#ifdef DEBUG
if(rtfcdebug) printf("no parent, pinned or cloning\n");
#endif
@@ -1087,10 +1087,11 @@ rt_setgate(struct rtentry *rt, struct sockaddr *dst, struct sockaddr *gate)
* correct choice anyway), and avoid the resulting reference loops
* by disallowing any route to run through itself as a gateway.
* This is obviously mandatory when we get rt->rt_output().
+ * XXX: After removal of PRCLONING this is probably not needed anymore.
*/
if (rt->rt_flags & RTF_GATEWAY) {
/* XXX LOR here */
- rt->rt_gwroute = rtalloc1(gate, 1, RTF_PRCLONING);
+ rt->rt_gwroute = rtalloc1(gate, 1, 0);
if (rt->rt_gwroute == rt) {
RTFREE_LOCKED(rt->rt_gwroute);
rt->rt_gwroute = 0;
diff --git a/sys/net/route.h b/sys/net/route.h
index 54f706d..8fff560 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -151,7 +151,11 @@ struct ortentry {
#define RTF_PROTO2 0x4000 /* protocol specific routing flag */
#define RTF_PROTO1 0x8000 /* protocol specific routing flag */
-#define RTF_PRCLONING 0x10000 /* protocol requires cloning */
+/* XXX: temporary to stay API/ABI compatible with userland */
+#ifndef _KERNEL
+#define RTF_PRCLONING 0x10000 /* unused, for compatibility */
+#endif
+
#define RTF_WASCLONED 0x20000 /* route generated through cloning */
#define RTF_PROTO3 0x40000 /* protocol specific routing flag */
/* 0x80000 unused */
OpenPOWER on IntegriCloud