Problem whith "subnet=" statement in /etc/gateways.

routed discards the first character of the network address.
Example: "subnet=10.0.0.0/24,1"
The network address is interpreted as 0.0.0.0/24,1.
PR:		4825
Reviewed by:	phk
Submitted by:	Mike E. Matsnev <mike@azog.cs.msu.su>
This commit is contained in:
Poul-Henning Kamp 1998-04-19 17:53:16 +00:00
parent f934279d20
commit 0a61a2c2ce

View File

@ -36,7 +36,7 @@ static char sccsid[] = "@(#)if.c 8.1 (Berkeley) 6/5/93";
#elif defined(__NetBSD__)
static char rcsid[] = "$NetBSD$";
#endif
#ident "$Revision: 1.12 $"
#ident "$Revision: 1.1.1.3 $"
#include "defs.h"
#include "pathnames.h"
@ -557,7 +557,7 @@ parse_parms(char *line,
/* "subnet=x.y.z.u/mask,metric" must be alone on the line */
if (!strncasecmp(line, "subnet=", sizeof("subnet=")-1)
&& *(val = &line[sizeof("subnet=")]) != '\0') {
&& *(val = &line[sizeof("subnet=")-1]) != '\0') {
intnetp = (struct intnet*)malloc(sizeof(*intnetp));
intnetp->intnet_metric = 1;
if ((p = strrchr(val,','))) {