summaryrefslogtreecommitdiffstats
path: root/sbin/route
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-06-08 12:44:25 +0000
committerru <ru@FreeBSD.org>2001-06-08 12:44:25 +0000
commit9079964eda336913df098484d0efe6facaeb8f6f (patch)
tree2dead7ccb506506de1f729defe4ad7df81c5b4fe /sbin/route
parentf432beaf0e3087182ac0920be592ebe3016fa34b (diff)
downloadFreeBSD-src-9079964eda336913df098484d0efe6facaeb8f6f.zip
FreeBSD-src-9079964eda336913df098484d0efe6facaeb8f6f.tar.gz
When changing an indirect route, kernel routing code allocates
a route to the gateway and caches it in the route structure. It may happen (if the routing table is screwed) that the gateway route is the same route as the one being modified, in which case a kernel reports EDQUOT. Be more verbose about this: # route add -net 10 192.168.4.65 add net 10: gateway 192.168.4.65 # netstat -rn -finet Routing tables Internet: Destination Gateway Flags Refs Use Netif Expire default 192.168.4.65 UGSc 1 7 rl0 10 192.168.4.65 UGSc 0 0 rl0 127.0.0.1 127.0.0.1 UH 0 178 lo0 192.168.4 link#1 UC 2 0 rl0 => 192.168.4.65 0:d0:b7:16:9c:c6 UHLW 2 0 rl0 1123 Before: # route change -net 10 10.0.0.1 route: writing to routing socket: Disc quota exceeded change net 10: gateway 10.0.0.1: Disc quota exceeded After: # ./route change -net 10 10.0.0.1 route: writing to routing socket: Disc quota exceeded change net 10: gateway 10.0.0.1: gateway uses the same route PR: bin/1093, misc/26833
Diffstat (limited to 'sbin/route')
-rw-r--r--sbin/route/route.810
-rw-r--r--sbin/route/route.c3
2 files changed, 11 insertions, 2 deletions
diff --git a/sbin/route/route.8 b/sbin/route/route.8
index a6d8b72..13ab5ce 100644
--- a/sbin/route/route.8
+++ b/sbin/route/route.8
@@ -32,9 +32,9 @@
.\" @(#)route.8 8.3 (Berkeley) 3/19/94
.\" $FreeBSD$
.\"
-.Dd March 19, 1994
+.Dd June 8, 2001
.Dt ROUTE 8
-.Os BSD 4.4
+.Os
.Sh NAME
.Nm route
.Nd manually manipulate the routing tables
@@ -362,6 +362,12 @@ wasn't present in the tables.
An add operation was attempted, but the system was
low on resources and was unable to allocate memory
to create the new entry.
+.It "gateway uses the same route"
+A
+.Cm change
+operation resulted in a route whose gateway uses the
+same route as the one being changed.
+The next-hop gateway should be reachable through a different route.
.El
.Pp
The
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 467dbe1..2b7d246 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -741,6 +741,9 @@ newroute(argc, argv)
case ENOBUFS:
err = "routing table overflow";
break;
+ case EDQUOT: /* handle recursion avoidance in rt_setgate() */
+ err = "gateway uses the same route";
+ break;
default:
err = strerror(oerrno);
break;
OpenPOWER on IntegriCloud