2 * userv service (or standalone program) for per-user IP subranges.
4 * This is the service program, which is invoked as root from userv (or may
5 * be invoked firectly).
7 * Its arguments are supposed to be, in order, as follows:
9 * The first two arguments are usually supplied by the userv
10 * configuration. See the file `ipif/ipif' in the source tree, which
11 * is installed in /etc/userv/services.d/ipif by `make install':
15 * Specifies address ranges and gids which own them. The default
16 * configuration supplies /etc/userv/ipif-networks, which is then read
17 * for a list of entries, one per line.
20 * Serves to separate the user-supplied and therefore untrusted
21 * arguments from the trusted first argument.
23 * The remaining arguments are supplied by the (untrusted) caller:
25 * <local-addr>,<peer-addr>,<mtu>[,[<proto>][,[<ifnamepat>]]]
27 * As for slattach. The only supported protocol is slip.
28 * Alternatively, set to `debug' to print debugging info and
29 * exit. <local-addr> is address of the interface to be created
30 * on the local system; <peer-addr> is the address of the
31 * point-to-point peer. They must be actual addresses (not
34 * <prefix>/<mask>,<prefix>/<mask>,...
36 * List of additional routes to add for this interface. routes will
37 * be set up on the local system arranging for packets for those
38 * networks to be sent via the created interface. <prefix> must be an
39 * IPv4 address, and mask must be an integer (dotted-quad masks are
40 * not supported). If no additional routes are to be set up, use `-'
41 * or supply an empty argument.
43 * Each <config> item - whether a line in a file such as
44 * /etc/userv/ipif-networks, or the single trusted argument supplied
45 * on the service program command line - is one of:
48 * ./<config-file-name>
49 * ../<config-file-name>
51 * Reads a file which contains lines which are each <config>
54 * <gid>,[=][-|+]<prefix>/<len>(-|+<prefix>/<len>...)[,<junk>]
56 * Indicates that <gid> may allocate addresses in the relevant address
57 * range (<junk> is ignored). <gid> must be numeric. To specify a
58 * single host address, you must specify a mask of /32. If `=' is
59 * specified then the specific subrange is only allowed for the local
60 * endpoint address, but not for remote addresses.
62 * More than one range may be given, with each range prefixed
63 * by + or -. In this case each address range in the rule will
64 * scanned in order, and the first range in the rule that matches
65 * any desired rule will count: if that first matching range is
66 * prefixed by `+' (or nothing) then the rule applies, if it
67 * is prefixed by `-' (or nothing matches), the rule does not.
70 * Means that anything is to be permitted. This should not appear in
71 * /etc/userv/ipif-networks, as that would permit any user on the
72 * system to create any interfaces with any addresses and routes
73 * attached. It is provided so that root can usefully invoke the ipif
74 * service program directly (not via userv), without needing to set up
75 * permissions in /etc/userv/ipif-networks.
77 * Only `*' permits interface name patterns other than the default
82 * Comment. Blank lines are also ignored.
84 * NB: Permission is granted if _any_ config entry matches the request.
86 * The service program should be run from userv with no-disconnect-hup.
89 * This file is part of ipif, part of userv-utils
91 * Copyright 1996-2013 Ian Jackson <ijackson@chiark.greenend.org.uk>
92 * Copyright 1998 David Damerell <damerell@chiark.greenend.org.uk>
94 * Chancellor Masters and Scholars of the University of Cambridge
95 * Copyright 2010 Tony Finch <fanf@dotat.at>
97 * This is free software; you can redistribute it and/or modify it
98 * under the terms of the GNU General Public License as published by
99 * the Free Software Foundation; either version 3 of the License, or
100 * (at your option) any later version.
102 * This program is distributed in the hope that it will be useful, but
103 * WITHOUT ANY WARRANTY; without even the implied warranty of
104 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
105 * General Public License for more details.
107 * You should have received a copy of the GNU General Public License
108 * along with userv-utils; if not, see http://www.gnu.org/licenses/.
125 #include <sys/types.h>
126 #include <sys/wait.h>
127 #include <sys/stat.h>
129 #include <sys/types.h>
130 #include <sys/ioctl.h>
131 #include <sys/socket.h>
133 #include <sys/stat.h>
136 #include <linux/if.h>
137 #include <linux/if_tun.h>
140 #define MAXEXROUTES 50
143 static const unsigned long gidmaxval= (unsigned long)((gid_t)-2);
144 static const char *const protos_ok[]= { "slip", 0 };
145 static const char default_ifnamepat[]= "userv%d";
147 static const char *configstr, *proto;
148 static unsigned long localaddr, peeraddr, mtu;
149 static int localpming, peerpming;
150 static int localallow, peerallow, ifnameallow, allallow;
151 static char *ifnamepat;
152 static int nexroutes;
153 static struct exroute {
154 unsigned long prefix, mask;
156 char prefixtxt[ATXTLEN], masktxt[ATXTLEN];
157 } exroutes[MAXEXROUTES];
159 static char localtxt[ATXTLEN];
160 static char peertxt[ATXTLEN];
162 static struct pplace {
163 struct pplace *parent;
164 const char *filename;
173 static void terminate(int estatus) {
178 static void fatal(const char *fmt, ...)
179 __attribute__((format(printf,1,2)));
180 static void fatal(const char *fmt, ...) {
184 fputs("userv-ipif service: fatal error: ",stderr);
185 vfprintf(stderr, fmt, al);
190 static void sysfatal(const char *fmt, ...)
191 __attribute__((format(printf,1,2)));
192 static void sysfatal(const char *fmt, ...) {
199 fputs("userv-ipif service: fatal system error: ",stderr);
200 vfprintf(stderr, fmt, al);
201 fprintf(stderr,": %s\n", strerror(e));
206 static void badusage(const char *fmt, ...)
207 __attribute__((format(printf,1,2)));
208 static void badusage(const char *fmt, ...) {
214 "userv-ipif service: %s:%d: ",
215 cpplace->filename, cpplace->lineno);
217 fputs("userv-ipif service: invalid usage: ",stderr);
220 vfprintf(stderr, fmt, al);
224 for (cpp=cpplace->parent; cpp; cpp=cpp->parent) {
226 "userv-ipif service: %s:%d: ... in file included from here\n",
227 cpp->filename, cpp->lineno);
233 static char *ip2txt(unsigned long addr, char *buf) {
234 sprintf(buf, "%lu.%lu.%lu.%lu",
242 static unsigned long eat_number(const char **argp, const char *what,
243 unsigned long min, unsigned long max,
244 const char *endchars, int *endchar_r) {
245 /* If !endchars then the endchar must be a nul, otherwise it may be
246 * a nul (resulting in *argp set to 0) or something else (*argp set
247 * to point to after delim, *endchar_r set to delim).
248 * *endchar_r may be 0.
254 if (!*argp) { badusage("missing number %s",what); }
255 rv= strtoul(*argp,&ep,0);
256 if ((endchar= *ep)) {
257 if (!endchars) badusage("junk after number %s",what);
258 if (!strchr(endchars,endchar))
259 badusage("invalid character or delimiter `%c' in or after number, %s:"
260 " expected %s (or none?)", endchar,what,endchars);
265 if (endchar_r) *endchar_r= endchar;
266 if (rv < min || rv > max) badusage("number %s value %lu out of range %lu..%lu",
271 static int addrnet_overlap(unsigned long p1, unsigned long m1,
272 unsigned long p2, unsigned long m2) {
276 return (p1 & mask) == (p2 & mask);
279 static void addrnet_mustdiffer(const char *w1, unsigned long p1, unsigned long m1,
280 const char *w2, unsigned long p2, unsigned long m2) {
281 if (!addrnet_overlap(p1,m1,p2,m2)) return;
282 badusage("%s %08lx/%08lx overlaps/clashes with %s %08lx/%08lx",
286 static unsigned long eat_addr(const char **argp, const char *what,
287 const char *endchars, int *endchar_r) {
296 sprintf(whatbuf,"%s byte #%d",what,i);
297 rv |= eat_number(argp,whatbuf, 0,255, i<3 ? "." : endchars, endchar_r);
303 static void eat_prefixmask(const char **argp, const char *what,
304 const char *endchars, int *endchar_r,
305 unsigned long *prefix_r, unsigned long *mask_r, int *len_r) {
306 /* mask_r and len_r may be 0 */
309 unsigned long prefix, mask;
311 prefix= eat_addr(argp,what, "/",0);
312 sprintf(whatbuf,"%s length",what);
313 len= eat_number(argp,whatbuf, 0,32, endchars,endchar_r);
315 mask= len ? (~0UL << (32-len)) : 0UL;
316 if (prefix & ~mask) badusage("%s prefix %08lx not fully contained in mask %08lx",
319 if (mask_r) *mask_r= mask;
320 if (len_r) *len_r= len;
323 static char *eat_optionalstr(const char **argp,
327 const char *start= *argp;
331 const char *comma= strchr(start, ',');
344 char *r = malloc(len+1);
345 if (!r) sysfatal("malloc for command line string");
351 static int addrnet_isin(unsigned long prefix, unsigned long mask,
352 unsigned long mprefix, unsigned long mmask) {
353 return !(~mask & mmask) && (prefix & mmask) == mprefix;
356 /* Totally hideous algorithm for parsing the config file lines.
357 * For each config file line, we first see if its gid applies. If not
358 * we skip it. Otherwise, we do
360 * which sets <foo>pming to 1
361 * for each range. <foo>pming may be 0 if we've determined that
362 * this line does not apply to <foo>.
364 * which calls permit_range_thing for each <foo>
365 * which checks to see if <foo> is inside the relevant
366 * range (for +) or overlaps it (for -) and updates
367 * <foo>allow and <foo>pming.
370 static void permit_begin(void) {
373 localpming= peerpming= 1;
374 for (i=0; i<nexroutes; i++) exroutes[i].pming= 1;
377 static void permit_range_thing(unsigned long tprefix, unsigned long tmask,
378 const char *what, int *tallow, int *tpming,
379 unsigned long pprefix, unsigned long pmask,
380 int plus, int *any) {
382 if (!addrnet_isin(tprefix,tmask, pprefix,pmask)) return;
383 if (*tpming) *tallow= 1;
385 if (!addrnet_overlap(tprefix,tmask, pprefix,pmask)) return;
388 if (!proto) printf(" %c%s", plus?'+':'-', what);
392 static void permit_range(unsigned long prefix, unsigned long mask,
393 int plus, int localonly) {
397 assert(!(prefix & ~mask));
400 permit_range_thing(localaddr,~0UL,"local", &localallow,&localpming,
401 prefix,mask, plus,&any);
404 permit_range_thing(peeraddr,~0UL, "peer-addr", &peerallow,&peerpming,
405 prefix,mask, plus,&any);
406 for (i=0; i<nexroutes; i++) {
407 sprintf(idbuf,"route#%d",i);
408 permit_range_thing(exroutes[i].prefix,exroutes[i].mask, idbuf,
409 &exroutes[i].allow,&exroutes[i].pming,
410 prefix,mask, plus,&any);
414 if (!any) fputs(" nothing",stdout);
417 static void pconfig(const char *configstr, int truncated);
419 static void pfile(const char *filename) {
423 struct pplace npp, *cpp;
425 for (cpp=cpplace; cpp; cpp=cpp->parent) {
426 if (!strcmp(cpp->filename,filename))
427 badusage("recursive configuration file `%s'",filename);
430 file= fopen(filename,"r");
432 badusage("cannot open configuration file `%s': %s", filename, strerror(errno));
434 if (!proto) printf("config file `%s':\n",filename);
437 npp.filename= filename;
441 while (fgets(buf, sizeof(buf), file)) {
446 truncated= (buf[l-1] != '\n');
447 while (l>0 && isspace((unsigned char) buf[l-1])) l--;
452 while ((c= getc(file)) != EOF && c != '\n');
456 pconfig(buf,truncated);
459 badusage("failed while reading configuration file: %s", strerror(errno));
465 static void pconfig(const char *configstr, int truncated) {
466 unsigned long fgid, tgid, pprefix, pmask;
467 int plen, localonly, plus, rangeix, delim;
472 switch (configstr[0]) {
475 permit_range(0UL,0UL,1,0);
483 if (truncated) badusage("filename too long (`%.100s...')",configstr);
488 if (!isdigit((unsigned char)configstr[0]))
489 badusage("unknown configuration directive");
491 fgid= eat_number(&configstr,"gid", 0,gidmaxval, ",",0);
493 if (!proto) printf(" %5lu", fgid);
495 gidlist= getenv("USERV_GID");
496 if (!gidlist) fatal("USERV_GID not set");
499 if (!proto) printf(" no matching gid\n");
502 tgid= eat_number(&gidlist,"userv-gid", 0,gidmaxval, " ",0);
503 if (tgid == fgid) break;
506 if (configstr[0] == '=') {
517 switch (configstr[0]) {
518 case '-': plus= 0; /* fall through */
519 case '+': configstr++;
524 sprintf(whattxt, "%s-prefix#%d",
525 plus ? "permitted" : "notpermitted",
527 eat_prefixmask(&configstr,whattxt, ",+-",&delim,
528 &pprefix,&pmask,&plen);
529 if (!configstr && truncated)
530 badusage("gid,prefix/len,... spec too long");
533 printf(" %c%s/%d:", plus?'+':'-',ip2txt(pprefix,ptxt), plen);
535 permit_range(pprefix,pmask,plus,localonly);
536 if (delim==',') break;
538 plus= delim=='-' ? 0 : 1;
547 static void checkallow(int allow, const char *what,
548 const char *prefixtxt, const char *masktxt) {
550 fprintf(stderr,"userv-ipif service: access denied for %s, %s/%s\n",
551 what, prefixtxt, masktxt);
555 static void parseargs(int argc, const char *const *argv) {
556 unsigned long routeaddr, routemask;
558 const char *const *cprotop;
560 char erwhatbuf[100], erwhatbuf2[100];
562 if (argc < NARGS+1) { badusage("too few arguments"); }
563 if (argc > NARGS+1) { badusage("too many arguments"); }
568 if (strcmp(carg,"--")) badusage("separator argument `--' not found, got `%s'",carg);
571 localaddr= eat_addr(&carg,"local-addr", ",",0);
572 peeraddr= eat_addr(&carg,"peer-addr", ",",0);
573 mtu= eat_number(&carg,"mtu", 576,65536, ",",0);
574 localallow= peerallow= 0;
576 char *protostr= eat_optionalstr(&carg,"protocol","slip");
577 if (!strcmp(protostr,"debug")) {
580 for (cprotop= protos_ok;
581 (proto= *cprotop) && strcmp(proto,protostr);
583 if (!proto) fatal("invalid protocol");
586 ifnamepat= eat_optionalstr(&carg,"ifname pattern",default_ifnamepat);
588 addrnet_mustdiffer("local-addr",localaddr,~0UL, "peer-addr",peeraddr,~0UL);
591 if (strcmp(carg,"-")) {
595 if (nexroutes == MAXEXROUTES)
596 fatal("too many extra routes (only %d allowed)",MAXEXROUTES);
597 sprintf(erwhatbuf,"route#%d",nexroutes);
599 eat_prefixmask(&carg,erwhatbuf, ",",0, &routeaddr,&routemask,0);
600 if (routemask == ~0UL) {
601 addrnet_mustdiffer(erwhatbuf,routeaddr,routemask, "local-addr",localaddr,~0UL);
602 addrnet_mustdiffer(erwhatbuf,routeaddr,routemask, "peer-addr",peeraddr,~0UL);
604 for (i=0; i<nexroutes; i++) {
605 sprintf(erwhatbuf2,"route#%d",i);
606 addrnet_mustdiffer(erwhatbuf,routeaddr,routemask,
607 erwhatbuf2,exroutes[i].prefix,exroutes[i].mask);
609 exroutes[nexroutes].prefix= routeaddr;
610 exroutes[nexroutes].mask= routemask;
611 exroutes[nexroutes].allow= 0;
612 ip2txt(routeaddr,exroutes[nexroutes].prefixtxt);
613 ip2txt(routemask,exroutes[nexroutes].masktxt);
617 ip2txt(localaddr,localtxt);
618 ip2txt(peeraddr,peertxt);
621 static void checkpermit(void) {
626 checkallow(localallow,"local-addr", localtxt,"32");
627 checkallow(peerallow,"peer-addr", peertxt,"32");
628 for (i=0; i<nexroutes; i++) {
629 sprintf(erwhatbuf, "route#%d", i);
630 checkallow(exroutes[i].allow, erwhatbuf, exroutes[i].prefixtxt, exroutes[i].masktxt);
632 if (!strcmp(ifnamepat,default_ifnamepat))
636 "userv-ipif service: access denied for interface name %s\n",
640 if (!allallow) fatal("access denied");
643 static void dumpdebug(void) __attribute__((noreturn));
644 static void dumpdebug(void) {
648 printf("protocol: debug\n"
649 "local: %08lx == %s\n"
650 "peer: %08lx == %s\n"
657 for (i=0; i<nexroutes; i++) {
658 sprintf(erwhatbuf, "route#%d:", i);
659 printf("%-9s %08lx/%08lx == %s/%s\n",
661 exroutes[i].prefix, exroutes[i].mask,
662 exroutes[i].prefixtxt, exroutes[i].masktxt);
664 if (ferror(stdout) || fclose(stdout)) sysfatal("flush stdout");
669 static int task(const char *desc) {
674 if (pid == (pid_t)-1) sysfatal("fork for task");
678 pidr= waitpid(pid,&status,0);
679 if (pidr!=(pid_t)-1) break;
680 if (errno==EINTR) continue;
681 sysfatal("waitpid for task");
685 if (WIFEXITED(status)) {
686 if (WEXITSTATUS(status))
687 fatal("userv-ipif service: %s exited with error exit status %d\n",
688 desc, WEXITSTATUS(status));
689 } else if (WIFSIGNALED(status)) {
690 fatal("userv-ipif service: %s died due to signal %s%s\n",
691 desc, strsignal(WTERMSIG(status)),
692 WCOREDUMP(status) ? " (core dumped)" : "");
694 fatal("userv-ipif service: %s unexpectedly terminated"
695 " with unknown status code %d\n", desc, status);
701 static void createif(void) {
705 memset(&ifr,0,sizeof(ifr));
706 ifr.ifr_flags= IFF_TUN | IFF_NO_PI;
708 assert(sizeof(ifr.ifr_name) >= strlen(ifnamepat)+1);
709 strcpy(ifr.ifr_name, ifnamepat);
711 tunfd= open("/dev/net/tun", O_RDWR);
712 if (!tunfd) sysfatal("open /dev/net/tun");
714 r= fcntl(tunfd, F_GETFD);
715 if (r==-1) sysfatal("fcntl(tunfd,F_GETFD)");
716 r= fcntl(tunfd, F_SETFD, r|FD_CLOEXEC);
717 if (r==-1) sysfatal("fcntl(tunfd,F_SETFD,|FD_CLOEXEC)");
719 r= ioctl(tunfd, TUNSETIFF, (void*)&ifr);
720 if (r) sysfatal("ioctl TUNSETIFF");
722 /* ifr.ifr_name might not be null-terminated. crazy abi. */
723 ifname= malloc(sizeof(ifr.ifr_name)+1);
724 if (!ifname) sysfatal("malloc for interface name");
725 memcpy(ifname, ifr.ifr_name, sizeof(ifr.ifr_name));
726 ifname[sizeof(ifr.ifr_name)]= 0;
729 static void netconfigure(void) {
733 if (task("ifconfig")) {
734 sprintf(mtutxt,"%lu",mtu);
736 execlp("ifconfig", "ifconfig", ifname, localtxt,
737 "netmask","255.255.255.255", "pointopoint",peertxt, "-broadcast",
738 "mtu",mtutxt, "up", (char*)0);
739 sysfatal("cannot exec ifconfig");
742 for (i=0; i<nexroutes; i++) {
744 execlp("route","route", "add", "-net",exroutes[i].prefixtxt,
745 "netmask",exroutes[i].masktxt,
746 "gw",peertxt, "dev",ifname, (char*)0);
747 sysfatal("cannot exec route (for route)");
752 static void setnonblock(int fd) {
754 r= fcntl(fd,F_GETFL);
755 if (r==-1) sysfatal("fcntl F_GETFL");
756 r= fcntl(fd,F_SETFL, r|O_NONBLOCK);
757 if (r==-1) sysfatal("fcntl F_SETFL O_NONBLOCK");
760 static void rx_packet(const uint8_t *packet, int len) {
764 int r= write(tunfd, packet, len);
766 if (errno==EINTR) continue;
767 if (errno==EAGAIN || errno==ENOMEM) return; /* oh well */
768 sysfatal("error writing packet to tun (transmitting)");
775 static int output_waiting, input_waiting;
777 #define SLIP_END 0300
778 #define SLIP_ESC 0333
779 #define SLIP_ESC_END 0334
780 #define SLIP_ESC_ESC 0335
782 static void more_rx_data(uint8_t *input_buf, uint8_t *output_buf) {
783 /* we make slip_data never contain continuation of a packet */
784 /* input_buf is passed as a parameter since it's in copydata's stack frame */
786 static int output_len;
788 uint8_t *op= output_buf + output_len;
789 const uint8_t *ip= input_buf + scanned;
790 const uint8_t *ip_end= input_buf + input_waiting;
794 if (ip>=ip_end) break;
797 rx_packet(output_buf, op-output_buf);
799 eaten= ip - input_buf;
803 if (ip>=ip_end) { /* rescan this when there's more */ ip--; break; }
805 if (c==SLIP_ESC_END) c=SLIP_END;
806 else if (c==SLIP_ESC_ESC) c=SLIP_ESC;
807 else fatal("unexpected byte 0%o after SLIP_ESC",c);
809 if (op == output_buf+mtu)
810 fatal("SLIP packet exceeds mtu");
814 output_len= op - output_buf;
815 scanned= ip - input_buf;
817 input_waiting -= eaten;
818 memmove(input_buf, input_buf+eaten, input_waiting);
822 static void tx_packet(uint8_t *output_buf, const uint8_t *ip, int inlen) {
823 /* output_buf is passed as a parameter since it's in copydata's stack frame */
824 assert(!output_waiting);
825 uint8_t *op= output_buf;
830 if (c==SLIP_END) { *op++= SLIP_ESC; *op++= SLIP_ESC_END; }
831 else if (c==SLIP_ESC) { *op++= SLIP_ESC; *op++= SLIP_ESC_ESC; }
835 assert(op <= output_buf + mtu*2+2);
837 output_waiting= op - output_buf;
840 static void copydata(void) __attribute__((noreturn));
841 static void copydata(void) {
842 uint8_t output_buf[mtu*2+2];
843 uint8_t input_buf[mtu*2+2];
844 uint8_t rx_packet_buf[mtu];
848 struct pollfd polls[3];
849 memset(polls, 0, sizeof(polls));
851 polls[0].fd= 0; polls[0].events= POLLIN;
855 /* We don't do flow control on input packets; instead, we just throw
856 * away ones which the kernel doesn't accept. So we always poll for
859 * Output packets we buffer, so we poll only as appropriate for those.
862 /* Start by transmitting one END byte to say we're ready. */
863 output_buf[0]= SLIP_END;
867 if (output_waiting) {
868 r= write(1, output_buf, output_waiting);
870 if (errno==EINTR) continue;
872 sysfatal("error writing SLIP output (packets being received)");
876 memmove(output_buf, output_buf+r, output_waiting);
879 if (output_waiting) {
880 polls[1].events |= POLLOUT;
881 polls[2].events &= ~POLLIN;
883 polls[1].events &= ~POLLOUT;
884 polls[2].events |= POLLIN;
889 if (errno==EINTR) continue;
890 sysfatal("poll() failed");
892 assert(r>0); /* we used an infinite timeout */
894 for (i=0; i<sizeof(polls)/sizeof(polls[0]); i++)
895 if (polls[i].revents & ~polls[i].events)
896 fatal("unexpected revents 0x%x for fd=%d",
897 polls[i].revents, polls[i].fd);
899 if (polls[0].events & POLLIN) {
900 int want= sizeof(input_buf) - input_waiting;
901 if (want<0) fatal("incoming packet necessarily exceeds MTU");
902 r= read(0, input_buf + input_waiting, want);
905 assert(input_waiting <= sizeof(input_buf));
906 more_rx_data(input_buf, rx_packet_buf);
910 if (!(errno==EINTR || errno==EAGAIN))
911 sysfatal("error reading input SLIP data (packets to transmit)");
915 /* We handle what would be (polls[1].events & POLLOUT) above,
916 * unconditionally. That eliminates the need to poll in the usual case */
918 if (polls[2].events & POLLIN) {
919 uint8_t packet_buf[mtu];
920 r= read(tunfd, packet_buf, mtu);
922 tx_packet(output_buf, packet_buf, r);
925 if (!(errno==EAGAIN || errno==EWOULDBLOCK))
926 sysfatal("error reading packet (being transmitted) from tun");
932 int main(int argc, const char *const *argv) {
933 parseargs(argc,argv);
934 pconfig(configstr,0);
936 if (!proto) dumpdebug();