From: ian Date: Wed, 7 Jun 2000 00:59:31 +0000 (+0000) Subject: Bugfixes. X-Git-Tag: userv-utils-0-1-finger-mergeup-1~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=userv-utils.git;a=commitdiff_plain;h=31dcbf98f0d9c0dde01dd20848acc6ee47c83b27 Bugfixes. --- diff --git a/ipif/Makefile b/ipif/Makefile index f1e63a4..e3dac05 100644 --- a/ipif/Makefile +++ b/ipif/Makefile @@ -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 diff --git a/ipif/forwarder.c b/ipif/forwarder.c index f901f78..6179eaa 100644 --- a/ipif/forwarder.c +++ b/ipif/forwarder.c @@ -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); diff --git a/ipif/mech-timestamp.c b/ipif/mech-timestamp.c index 93d30e6..d1b83d5 100644 --- a/ipif/mech-timestamp.c +++ b/ipif/mech-timestamp.c @@ -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 ""; diff --git a/ipif/udptunnel b/ipif/udptunnel index b76a9da..720517b 100755 --- a/ipif/udptunnel +++ b/ipif/udptunnel @@ -20,7 +20,7 @@ # , # ,,, # , -# +# # [ [ ...] ] # # proto may be slip or cslip @@ -42,7 +42,7 @@ # , # ,,, # , -# +# # # If it was given Print for , this command's first @@ -67,12 +67,13 @@ # # (-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 ,,, -# +# # 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);