From ffabe2a5adaa26dfaf87b217a6866cd4408ba80f Mon Sep 17 00:00:00 2001 From: wollman Date: Tue, 11 Oct 1994 23:16:38 +0000 Subject: 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. --- sys/net/rtsock.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sys/net/rtsock.c') 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 @@ -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 */ -- cgit v1.1