From: ian Date: Fri, 24 Sep 1999 16:05:10 +0000 (+0000) Subject: Allow "-" as exroutes parameter. X-Git-Tag: branchpoint-1996-06-19-retrospective-beforeuserv~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=commitdiff_plain;h=2ed30784e2e8c13fc2ef14c6c94e1e1f3899ddb7;ds=sidebyside Allow "-" as exroutes parameter. --- diff --git a/ipif/service.c b/ipif/service.c index ad55e30..0050dd2 100644 --- a/ipif/service.c +++ b/ipif/service.c @@ -15,7 +15,7 @@ * is the address of the point-to-point peer. * /,/,... * List of additional routes to add for this interface. - * May be the empty argument. + * May be the empty argument, or `-' if this is problematic. * * is either * ,/[,] @@ -431,29 +431,32 @@ static void parseargs(int argc, const char *const *argv) { addrnet_mustdiffer("local-addr",localaddr,~0UL, "peer-addr",peeraddr,~0UL); carg= *++argv; - for (nexroutes=0; - carg && *carg; - nexroutes++) { - if (nexroutes == MAXEXROUTES) - fatal("too many extra routes (only %d allowed)",MAXEXROUTES); - sprintf(erwhatbuf,"route#%d",nexroutes); + if (strcmp(carg,"-")) { + for (nexroutes=0; + carg && *carg; + nexroutes++) { + if (nexroutes == MAXEXROUTES) + fatal("too many extra routes (only %d allowed)",MAXEXROUTES); + sprintf(erwhatbuf,"route#%d",nexroutes); - eat_prefixmask(&carg,erwhatbuf, ",",0, &routeaddr,&routemask,0); - if (routemask == ~0UL) { - addrnet_mustdiffer(erwhatbuf,routeaddr,routemask, "local-addr",localaddr,~0UL); - addrnet_mustdiffer(erwhatbuf,routeaddr,routemask, "peer-addr",peeraddr,~0UL); - } - for (i=0; i