X-Git-Url: https://git.distorted.org.uk/~mdw/userv-utils/blobdiff_plain/caa68336fa6c005906fd0f88e444ce6a350cfa79..5edd18879555ca5e6c7017703f777fd7c9f1300b:/ipif/service.c diff --git a/ipif/service.c b/ipif/service.c index 24ea45b..97351e6 100644 --- a/ipif/service.c +++ b/ipif/service.c @@ -11,16 +11,18 @@ * ,,, * As for slattach. Supported protocols are slip, cslip, and * adaptive. Alternatively, set to `debug' to print debugging - * info. is address of the interface on chiark; - * is the address of the point-to-point peer. + * info. is address of the interface on the local + * system; is the address of the point-to-point peer. * /,/,... * List of additional routes to add for this interface. * May be the empty argument, or `-' if this is problematic. * * is either - * ,/[,] + * ,[=]/[,] * indicating that that gid may allocate addresses in * the relevant subspace ( is ignored) + * if `=' is specified then it's only allowed for the local + * endpoint address * or #... * which is a comment * or / or ./ or ../ @@ -32,7 +34,7 @@ * Should be run from userv with no-disconnect-hup. */ /* - * Copyright (C) 1999 Ian Jackson + * Copyright (C) 1999-2000 Ian Jackson * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -291,25 +293,27 @@ static int addrnet_isin(unsigned long prefix, unsigned long mask, } -static void permit(unsigned long pprefix, unsigned long pmask) { +static void permit(unsigned long pprefix, unsigned long pmask, int localonly) { int i, any; assert(!(pprefix & ~pmask)); any= 0; - if (!proto) fputs("permits",stdout); + if (!proto) fputs(localonly ? "permits-l" : "permits",stdout); if (addrnet_isin(localaddr,~0UL, pprefix,pmask)) { if (!proto) fputs(" local-addr",stdout); any= localallow= 1; } - if (addrnet_isin(peeraddr,~0UL, pprefix,pmask)) { - if (!proto) fputs(" peer-addr",stdout); - any= peerallow= 1; - } - for (i=0; i