--- /sys/man/8/timesync Mon Dec 3 00:42:28 2007 +++ /sys/man/8/timesync Mon Feb 3 22:07:46 2014 @@ -26,6 +26,8 @@ synchronizes the system clock to a time source, by default a file server. The options are: +.TF -L +.PD .TP .B -f synchronize to a file server. If @@ -108,3 +110,5 @@ log file .SH SOURCE .B /sys/src/cmd/aux/timesync.c +.SH BUGS +Only works with IPv4. --- /sys/src/9/ip/ipifc.c Thu Jun 13 23:28:35 2013 +++ /sys/src/9/ip/ipifc.c Mon Feb 3 22:19:23 2014 @@ -16,6 +16,7 @@ NHASH = 1<<6, NCACHE = 256, QMAX = 192*1024-1, + Maxv6repr = (128/(4*4))*(4+1), /* limit of xxxx:xxxx:⋯ notation */ }; Medium *media[Maxmedia] = { 0 }; @@ -1607,7 +1608,7 @@ { int plen = 64; long origint = NOW / 1000, preflt = ~0L, validlt = ~0L; - char addr[40], preflen[6]; + char addr[Maxv6repr], preflen[6]; char *params[3]; uchar autoflag = 1, onlink = 1; uchar prefix[IPaddrlen]; @@ -1635,9 +1636,17 @@ return Ebadarg; } - if (parseip(prefix, argv[1]) != 6 || validlt < preflt || plen < 0 || - plen > 64 || islinklocal(prefix)) - return Ebadarg; + if (parseip(prefix, argv[1]) != 6) + return "bad ipv6 address"; + if (validlt < preflt) + return "valid ipv6 lifetime less than preferred lifetime"; + if (plen < 0) + return "negative ipv6 prefix length"; + /* i think that this length limit is bogus - geoff */ +// if (plen > 64) +// return "ipv6 prefix length greater than 64; + if (islinklocal(prefix)) + return "ipv6 prefix is link-local"; lifc = smalloc(sizeof(Iplifc)); lifc->onlink = (onlink != 0); @@ -1648,7 +1657,7 @@ /* issue "add" ctl msg for v6 link-local addr and prefix len */ if(!ifc->m->pref2addr) - return Ebadarg; + return "no pref2addr on interface"; ifc->m->pref2addr(prefix, ifc->mac); /* mac → v6 link-local addr */ snprint(addr, sizeof addr, "%I", prefix); snprint(preflen, sizeof preflen, "/%d", plen); --- /sys/src/9/ip/ipv6.c Mon Dec 2 23:42:04 2013 +++ /sys/src/9/ip/ipv6.c Mon Feb 3 22:17:02 2014 @@ -259,7 +259,7 @@ tentative = iptentative(f, v6dst); if(tentative && h->proto != ICMPv6) { - print("ipv6 tentative addr %I, drop\n", v6dst); + print("ipv6 non-icmp tentative addr %I, drop\n", v6dst); freeblist(bp); return; } --- /sys/src/cmd/upas/smtp/smtpd.c Thu Sep 29 23:47:47 2011 +++ /sys/src/cmd/upas/smtp/smtpd.c Mon Feb 3 20:55:27 2014 @@ -51,6 +51,7 @@ String* startcmd(void); static void logmsg(char *action); +static int delaysecs(void); static int catchalarm(void *a, char *msg) @@ -199,8 +200,8 @@ dom = domainname_read(); if(dom == 0 || dom[0] == 0) dom = me; - sayhi(); parseinit(); + sayhi(); /* allow 45 minutes to parse the header */ atnotify(catchalarm, 1); @@ -287,7 +288,20 @@ void sayhi(void) { - reply("220 %s ESMTP\r\n", dom); + Dir *dp; + + reply("220-%s ESMTP\r\n", dom); + sleep(3000); + dp = dirfstat(0); + if (dp && dp->length > 0) { + syslog(0, "smtpd", "Hung up on impatient spammer %s", nci->rsys); + if(Dflag) + sleep(delaysecs()*1000); + reply("554 5.7.0 Spammer!\r\n"); + exits("spammer didn't wait for greeting to finish"); + } + free(dp); + reply("220 \r\n"); } /* @@ -1734,3 +1748,4 @@ if (s_resp2_64) s_free(s_resp2_64); } +