chiark / gitweb /
Bugfixes.
authorian <ian>
Wed, 7 Jun 2000 00:59:31 +0000 (00:59 +0000)
committerian <ian>
Wed, 7 Jun 2000 00:59:31 +0000 (00:59 +0000)
ipif/Makefile
ipif/forwarder.c
ipif/mech-timestamp.c
ipif/udptunnel

index f1e63a4..e3dac05 100644 (file)
@@ -20,7 +20,8 @@
 
 OPTIMISE=      -O2
 CFLAGS=                -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \
-               -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE
+               -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE \
+               $(XCFLAGS)
 
 etcdir=                /etc
 prefix=                /usr/local
@@ -32,8 +33,9 @@ libuserv=     $(libdir)/userv
 etcuserv=      $(etcdir)/userv
 services=      $(etcuserv)/services.d
 
-PROGRAMS=      udptunnel udptunnel-forwarder
-TARGETS=       service blowfishtest $(PROGRAMS)
+PROGRAM_TARGETS=       udptunnel-forwarder
+TARGETS=               service blowfishtest $(PROGRAM_TARGETS)
+PROGRAMS=              udptunnel $(PROGRAM_TARGETS)
 
 MECHFILES=     null pkcs5 timestamp sequence blowfish
 MECHOBJS=      $(foreach m, $(MECHFILES), mech-$m.o)
@@ -56,9 +58,17 @@ udptunnel-forwarder: $(OBJS_FORWARD)
 blowfishtest:          $(OBJS_BFTEST)
                $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS_BFTEST)
 
-automech.c automech.h:         automechgen.sh Makefile
+automech.h:            automechgen.sh Makefile
                ./$< $(MECHFILES)
 
+automech.c:            automech.h
+
+clean:
+               rm -f *.o core automech.[ch] *~ ./#*#
+
+realclean:             clean
+               rm -f $(TARGETS)
+
 forwarder.o $(MECHOBJS) automech.o utils.o:    forwarder.h automech.h
 blowfish.o mech-blowfish.o blowfishtest.o:     blowfish.h
 blowfishtest.o hex.o:                          hex.h
index f901f78..6179eaa 100644 (file)
@@ -212,6 +212,8 @@ static void inbound(void) {
       if (*emsg)
        fprintf(stderr, "%s: bad packet: %s: %s\n",
                programid, mechs[i]->name, emsg);
+      else
+       cdebug(i,"silently discarded");
       return;
     }
     cdebugbuf(i, "decode", &buf_in, 3,0);
index 93d30e6..d1b83d5 100644 (file)
@@ -78,6 +78,8 @@ static const char *mdec_timestamp(struct mechdata *md, struct buffer *buf) {
   } else if (age < 0) {
     if (!md->max_skew || age >= -md->max_skew) return 0;
     sprintf(cbuf,"too much skew (%lds)",-age);
+  } else {
+    return 0;
   }
 
   if (tnow < md->next_warn) return "";
index b76a9da..720517b 100755 (executable)
@@ -20,7 +20,7 @@
 #            <public-remote-addr>,<public-remote-port>
 #            <private-local-addr>,<private-remote-addr>,<mtu>,<proto>
 #            <keepalive>,<timeout>
-#            <extra-local-nets> <extra-remote-nets>
+#            <extra-nets-for-local-cmd> <extra-nets-for-remote-cmd>
 #          [ <remote-command> [<remote-args> ...] ]
 #
 # proto may be slip or cslip
@@ -42,7 +42,7 @@
 #                     <public-local-addr'>,<public-local-port'>
 #                     <private-remote-addr>,<private-local-addr>,<mtu>,<proto>
 #                     <keepalive>,<timeout>
-#                     <extra-remote-nets> <extra-local-nets>
+#                     <extra-nets-for-remote-cmd> <extra-nets-for-local-cmd>
 #
 
 # If it was given Print for <public-remote-foo'>, this command's first
 #   <public-local-foo>   <public-local-foo'>     <public-local-foo'>
 #                        (-m not specified)      (-m specified)
 #   actual addr/port     that addr/port         `Wait'
-#   `Wait'               the chosen address     `Wait'
 #   `Print'              the chosen address     `Wait'
+#   `Any'                `Wait' for addr,       `Wait'
+#                         chosen port for port
 #
 # udptunnel will userv ipif locally, as
 #    userv root ipif <private-local-addr>,<private-remote-addr>,<mtu>,<proto>
-#                    <extra-local-nets>
+#                    <extra-nets-for-local-cmd>
 # or, if -l was given, userv root ipif is replaced with the argument(s)
 # following -l option(s) until `.'.
 #
@@ -266,7 +267,7 @@ if (@ARGV) {
     @rcmd= (@ARGV,
            @remoteopts,
            "$rad,$rpd",
-           $masq ? 'Wait,Wait' : $lapd,
+           $masq ? 'Wait,Wait' : $las eq 'Any' ? "Wait,$lpd" : $lapd,
            "$rva,$lva,$mtu,$proto",
            "$keepalive,$timeout",
            $rexn, $lexn);