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 f1e63a4b9eaeacee5d4817c7ea941dcc77ebe562..e3dac053712024bae9bba810cfbd50a7289b1ee7 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 f901f78deb4eb38d0f3840d497a07c06123f0674..6179eaa0b94fc6e53f4753f274599c676960c562 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 93d30e66183bedb1ca17475978178ee0859fe2ce..d1b83d5631968dc37a1b45566a8f42998f1d67da 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 b76a9da002393bb1cc433bfda9290144e21a7a47..720517b6179f7393aaa53b4cf4617a0e50b0751a 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);