summaryrefslogtreecommitdiffstats
path: root/sys/net/rtsock.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-10-11 23:16:38 +0000
committerwollman <wollman@FreeBSD.org>1994-10-11 23:16:38 +0000
commitffabe2a5adaa26dfaf87b217a6866cd4408ba80f (patch)
tree97b87aa06a9afc8f78538511844af7ad899b7c92 /sys/net/rtsock.c
parent57cd07355619aad9842ca0ef86aabb85e8418073 (diff)
downloadFreeBSD-src-ffabe2a5adaa26dfaf87b217a6866cd4408ba80f.zip
FreeBSD-src-ffabe2a5adaa26dfaf87b217a6866cd4408ba80f.tar.gz
Fix a bug which caused panics when attempting to change just the flags of
a route. (This still doesn't work, but it doesn't panic now.) It looks like there may be a number of incipient bugs in this code. Also, get ready for the time when all IP gateway routes are cloning, which is necessary to keep proper TCP statistics.
Diffstat (limited to 'sys/net/rtsock.c')
-rw-r--r--sys/net/rtsock.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 3341a42..d482a97 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)rtsock.c 8.3 (Berkeley) 1/4/94
- * $Id: rtsock.c,v 1.5 1994/10/05 20:11:28 wollman Exp $
+ * $Id: rtsock.c,v 1.6 1994/10/08 22:38:26 phk Exp $
*/
#include <sys/param.h>
@@ -253,6 +253,17 @@ route_output(m, so)
case RTM_CHANGE:
if (gate && rt_setgate(rt, rt_key(rt), gate))
senderr(EDQUOT);
+
+ /*
+ * If they tried to change things but didn't specify
+ * the required gateway, then just use the old one.
+ * This can happen if the user tries to change the
+ * flags on the default route without changing the
+ * default gateway. Changing flags still doesn't work.
+ */
+ if ((rt->rt_flags & RTF_GATEWAY) && !gate)
+ gate = rt->rt_gateway;
+
/* new gateway could require new ifaddr, ifp;
flags may also be different; ifp may be specified
by ll sockaddr when protocol address is ambiguous */
OpenPOWER on IntegriCloud